chromeec: Add support for reading second battery info

Hardware / Coreboot - Nicolas Boichat [chromium.org] - 7 February 2018 16:38 EST

We share the same shared memory fields for both batteries. When the host wants to switch battery to read out, it will:- Set BTID (EC_ACPI_MEM_BATTERY_INDEX) to the required index- Wait for BITX (EC_MEMMAP_BATT_INDEX) to have the required value- Then fetch the data

BRANCH=none BUG=b:65697620 TEST=Boot lux, both /sys/class/power_supply/BAT0 and BAT1 are present, data is valid.

Change-Id: Ib06176e6ab4c45a899259f0917e6292121865ed6

07fe6184bc chromeec: Add support for reading second battery info
src/ec/google/chromeec/acpi/battery.asl | 417 +++++++++++++++++++++++---------
src/ec/google/chromeec/acpi/ec.asl | 14 +-
src/ec/google/chromeec/acpi/emem.asl | 5 +
3 files changed, 324 insertions(+), 112 deletions(-)

Upstream: review.coreboot.org


  • Share