[M] Change in coreboot[main]: ec/google/chromeec: Derive _BIF data from _BIX
Attention is currently required from: Boris Mittelberg, Caveh Jalali. Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/95898?usp=email ) Change subject: ec/google/chromeec: Derive _BIF data from _BIX ...................................................................... ec/google/chromeec: Derive _BIF data from _BIX BBIF and BBIX read the same fields from the EC and differ only in where they place them in the returned package, with _BIX also reporting the cycle count. Implement BBIF by calling BBIX and copying the relevant elements, so the EC access logic exists only once. TEST=build 31 boards using the ChromeEC ASL. With acpiexec and EC fields seeded with non-zero capacity, voltage and battery strings, _BIF and _BIX on yaviks and poppy return identical packages before and after this change. Change-Id: I353aab123b27af61e7264a174be821f5030daa7d Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> --- M src/ec/google/chromeec/acpi/battery.asl 1 file changed, 22 insertions(+), 42 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/95898/1 diff --git a/src/ec/google/chromeec/acpi/battery.asl b/src/ec/google/chromeec/acpi/battery.asl index aef8d8f..5b39f62 100644 --- a/src/ec/google/chromeec/acpi/battery.asl +++ b/src/ec/google/chromeec/acpi/battery.asl @@ -193,46 +193,6 @@ Return (Local0) } -// _BIF implementation. -// Arg0 = battery index -// Arg1 = PBIF -Method (BBIF, 2, Serialized) -{ - If (Acquire (^BATM, 1000)) { - Return (Arg1) - } - - If (BTSW (Arg0)) { - Release (^BATM) - Return (Arg1) - } - // Last Full Charge Capacity - Arg1[2] = BTDF - - // Design Voltage - Arg1[4] = BTDV - - // Design Capacity - Local0 = BTDA - Arg1[1] = Local0 - - // Design Capacity of Warning - Local2 = Local0 * DWRN / 100 - Arg1[5] = Local2 - - // Design Capacity of Low - Local2 = Local0 * DLOW / 100 - Arg1[6] = Local2 - - // Get battery info from mainboard - Arg1[9] = BRSX (1) - Arg1[10] = BRSX (2) - Arg1[12] = BRSX (3) - - Release (^BATM) - Return (Arg1) -} - // _BIX implementation. // Arg0 = battery index // Arg1 = PBIX @@ -276,6 +236,26 @@ Return (Arg1) } +// _BIF implementation, derived from the _BIX data. +// Arg0 = battery index +// Arg1 = PBIF +// Arg2 = PBIX +Method (BBIF, 3, Serialized) +{ + Local0 = BBIX (Arg0, Arg2) + + Arg1[1] = DeRefOf (Local0[2]) // Design Capacity + Arg1[2] = DeRefOf (Local0[3]) // Last Full Charge Capacity + Arg1[4] = DeRefOf (Local0[5]) // Design Voltage + Arg1[5] = DeRefOf (Local0[6]) // Design Capacity of Warning + Arg1[6] = DeRefOf (Local0[7]) // Design Capacity of Low + Arg1[9] = DeRefOf (Local0[16]) // Model Number + Arg1[10] = DeRefOf (Local0[17]) // Serial Number + Arg1[12] = DeRefOf (Local0[19]) // OEM Information + + Return (Arg1) +} + // _BST implementation. // Arg0 = battery index // Arg1 = PBST @@ -428,7 +408,7 @@ Method (_BIF, 0, Serialized) { - Return (BBIF (0, PBIF)) + Return (BBIF (0, PBIF, PBIX)) } Method (_BIX, 0, Serialized) @@ -503,7 +483,7 @@ Method (_BIF, 0, Serialized) { - Return (BBIF (1, PBIF)) + Return (BBIF (1, PBIF, PBIX)) } Method (_BIX, 0, Serialized) -- To view, visit https://review.coreboot.org/c/coreboot/+/95898?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: coreboot Gerrit-Branch: main Gerrit-Change-Id: I353aab123b27af61e7264a174be821f5030daa7d Gerrit-Change-Number: 95898 Gerrit-PatchSet: 1 Gerrit-Owner: Matt DeVillier <matt.devillier@gmail.com> Gerrit-Reviewer: Boris Mittelberg <bmbm@google.com> Gerrit-Reviewer: Caveh Jalali <caveh@chromium.org> Gerrit-Attention: Boris Mittelberg <bmbm@google.com> Gerrit-Attention: Caveh Jalali <caveh@chromium.org>
participants (1)
-
Matt DeVillier (Code Review)