Attention is currently required from: Michael Niewöhner, Alexander Couzens, HAOUAS Elyes. Hello build bot (Jenkins), Michael Niewöhner, Alexander Couzens, HAOUAS Elyes,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/51986
to review the following change.
Change subject: Revert "src/ec/lenovo/h8/acpi/battery.asl: Convert to ASL 2.0" ......................................................................
Revert "src/ec/lenovo/h8/acpi/battery.asl: Convert to ASL 2.0"
This reverts commit 81d55cf6d62ac710df030fc02dd3ca00f3d80405.
Reason for revert: No reason given, not known to be tested, and has a mistake that most likely introduced a recent regression, as reported in mailing list thread `problem after "convert to ASL 2.0"`.
Change-Id: Ifffe0730fb6f204abf8b5fe99f4e37015bb8d5b7 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/ec/lenovo/h8/acpi/battery.asl 1 file changed, 41 insertions(+), 43 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/51986/1
diff --git a/src/ec/lenovo/h8/acpi/battery.asl b/src/ec/lenovo/h8/acpi/battery.asl index d5e8c12..42b91b9 100644 --- a/src/ec/lenovo/h8/acpi/battery.asl +++ b/src/ec/lenovo/h8/acpi/battery.asl @@ -80,7 +80,7 @@ */ Method(BPAG, 1, NotSerialized) { - PAGE = Arg0 + Store(Arg0, PAGE) #ifdef BATTERY_PAGE_DELAY_MS Sleep(BATTERY_PAGE_DELAY_MS) #endif @@ -94,32 +94,32 @@ Method(BSTA, 4, NotSerialized) { Acquire(ECLK, 0xffff) - Local0 = 0 - ^BPAG(Arg0 | 1) - Local1 = BAMA + Store(0, Local0) + ^BPAG(Or(1, Arg0)) + Store(BAMA, Local1) ^BPAG(Arg0) /* Battery dynamic information */
/* * Present rate is a 16bit signed int, positive while charging * and negative while discharging. */ - Local2 = BAPR + Store(BAPR, Local2)
If (Arg2) // Charging { - Local0 |= 2 + Or(2, Local0, Local0) } Else { If (Arg3) // Discharging { - Local0 |= 1 + Or(1, Local0, Local0) // Negate present rate - Local2 -= 0x10000 + Subtract(0x10000, Local2, Local2) } Else // Full battery, force to 0 { - Local2 = 0 + Store(0, Local2) } }
@@ -127,21 +127,21 @@ * The present rate value must be positive now, if it is not we have an * EC bug or inconsistency and force the value to 0. */ - If (Local2 >= 0x8000) { - Local2 = 0 + If (LGreaterEqual (Local2, 0x8000)) { + Store(0, Local2) }
- Arg1 [0] = Local0 + Store(Local0, Index(Arg1, 0x00))
if (Local1) { - Arg1 [2] = BARC * 10 - Local2 *= BAVO - Arg1 [1] = Local2 / 1000 + Multiply (BARC, 10, Index(Arg1, 2)) + Multiply (Local2, BAVO, Local2) + Divide (Local2, 1000, , Index(Arg1, 1)) } else { - Arg1 [2] = BARC - Arg1 [1] = Local2 + Store(BARC, Index(Arg1, 2)) + Store(Local2, Index(Arg1, 1)) } - Arg1 [3] = BAVO + Store(BAVO, Index(Arg1, 3)) Release(ECLK) Return (Arg1) } @@ -150,45 +150,43 @@ { Acquire(ECLK, 0xffff) ^BPAG(Or(1, Arg1)) /* Battery 0 static information */ - Arg0 [0] = BAMA ^ 1 - Local0 = BAMA + Xor(BAMA, 1, Index(Arg0, 0)) + Store(BAMA, Local0) ^BPAG(Arg1) - Local2 = BAFC - ^BPAG(Arg1 | 2) - Local1 = BADC + Store(BAFC, Local2) + ^BPAG(Or(2, Arg1)) + Store(BADC, Local1)
if (Local0) { - Local1 *= 10 - Local2 *= 10 + Multiply (Local1, 10, Local1) + Multiply (Local2, 10, Local2) }
- Arg0 [1] = Local1 // Design Capacity - Arg0 [2] = Local2 // Last full charge capacity - Arg0 [4] = BADV // Design Voltage - Local0 = Local2 % 20 // FIXME: Local0 not used - Arg0 [5] = Local2 / 20 // Warning capacity + Store(Local1, Index(Arg0, 1)) // Design Capacity + Store(Local2, Index(Arg0, 2)) // Last full charge capacity + Store(BADV, Index(Arg0, 4)) // Design Voltage + Divide (Local2, 20, Local0, Index(Arg0, 5)) // Warning capacity
- Local0 = BASN + Store (BASN, Local0) Name (SERN, Buffer (0x06) { " " }) - Local1 = 4 + Store (4, Local1) While (Local0) { - Local2 = Local0 % 10 - Local0 /= 10 - SERN [Local1] = Local2 + 48 - Local1-- + Divide (Local0, 0x0A, Local2, Local0) + Add (Local2, 48, Index (SERN, Local1)) + Decrement (Local1) } - Arg0 [10] = SERN // Serial Number + Store (SERN, Index (Arg0, 10)) // Serial Number
^BPAG(Or(4, Arg1)) Name (TYPE, Buffer() { 0, 0, 0, 0, 0 }) - TYPE = BATY - Arg0 [11] = TYPE // Battery type - ^BPAG(Arg1 | 5) - Arg0 [12] = BAOE // OEM information - ^BPAG(Arg1 | 6) - Arg0 [9] = BANA // Model number + Store(BATY, TYPE) + Store(TYPE, Index (Arg0, 11)) // Battery type + ^BPAG(Or(5, Arg1)) + Store(BAOE, Index (Arg0, 12)) // OEM information + ^BPAG(Or(6, Arg1)) + Store(BANA, Index (Arg0, 9)) // Model number Release(ECLK) Return (Arg0) }