HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
ec/purism/librem: Convert to ASL 2.0 syntax
Change-Id: I36cb7a2ebde1161f87e78eeab739b15e3cf88860 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/purism/librem/acpi/battery.asl M src/ec/purism/librem/acpi/ec.asl 2 files changed, 53 insertions(+), 54 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46102/1
diff --git a/src/ec/purism/librem/acpi/battery.asl b/src/ec/purism/librem/acpi/battery.asl index ca682a8..028a1de 100644 --- a/src/ec/purism/librem/acpi/battery.asl +++ b/src/ec/purism/librem/acpi/battery.asl @@ -65,13 +65,13 @@ /* Method to enable full battery workaround */ Method (BFWE) { - Store (One, BFWK) + BFWK = 1 }
/* Method to disable full battery workaround */ Method (BFWD) { - Store (Zero, BFWK) + BFWK = 0 }
Method (_STA, 0, Serialized) @@ -86,22 +86,22 @@ Method (_BIF, 0, Serialized) { /* Last Full Charge Capacity */ - Store (BTDF, Index (PBIF, 2)) + PBIF [2] = BTDF
/* Design Voltage */ - Store (BTDV, Index (PBIF, 4)) + PBIF [4] = BTDV
/* Design Capacity */ - Store (BTDA, Local0) - Store (Local0, Index (PBIF, 1)) + Local0 = BTDA + PBIF [1] = Local0
/* Design Capacity of Warning */ - Divide (Multiply (Local0, DWRN), 100, , Local2) - Store (Local2, Index (PBIF, 5)) + Local2 = (Local0 * DWRN) / 100 + PBIF [5] = Local2
/* Design Capacity of Low */ - Divide (Multiply (Local0, DLOW), 100, , Local2) - Store (Local2, Index (PBIF, 6)) + Local2 = (Local0 * DLOW) / 100 + PBIF [6] = Local2
Return (PBIF) } @@ -109,22 +109,22 @@ Method (_BIX, 0, Serialized) { /* Last Full Charge Capacity */ - Store (BTDF, Index (PBIX, 3)) + PBIX [3] = BTDF
/* Design Voltage */ - Store (BTDV, Index (PBIX, 5)) + PBIX [5] = BTDV
/* Design Capacity */ - Store (BTDA, Local0) - Store (Local0, Index (PBIX, 2)) + Local0 = BTDA + PBIX [2] = Local0
/* Design Capacity of Warning */ - Divide (Multiply (Local0, DWRN), 100, , Local2) - Store (Local2, Index (PBIX, 6)) + Local2 = (Local0 * DWRN) / 100 + PBIX [6] = Local2
/* Design Capacity of Low */ - Divide (Multiply (Local0, DLOW), 100, , Local2) - Store (Local2, Index (PBIX, 7)) + Local2 = (Local0 * DLOW) / 100 + PBIX [7] = Local2
Return (PBIX) } @@ -142,61 +142,60 @@ /* Check if AC is present */ If (ACEX) { /* Read battery status from EC */ - Store (BSTS, Local0) + Local0 = BSTS } Else { /* Always discharging when on battery power */ - Store (0x01, Local0) + Local0 = 0x01 }
/* Check for critical battery level */ If (BFCR) { - Or (Local0, 0x04, Local0) + Local0 |= 0x04 } - Store (Local0, Index (PBST, 0)) + PBST [0] = Local0
/* Notify if battery state has changed since last time */ - If (LNotEqual (Local0, BSTP)) { - Store (Local0, BSTP) + If (Local0 != BSTP) { + BSTP = Local0 Notify (BAT, 0x80) }
/* * 1: BATTERY PRESENT RATE */ - Store (BTPR, Local1) - If (And (Local1, 0x8000)) { - And (Not (Local1), 0x7FFF, Local0) - Increment (Local0) + Local1 = BTPR + If (Local1 & 0x8000) { + Local0 = ~Local1 & 0x7FFF + Local0++ } Else { - And (Local1, 0x7FFF, Local0) + Local0 = Local1 & 0x7FFF } - If(LLess(Local0, 0x0352)) + If(Local0 < 0x0352) { - Store(0x0352, Local0) + Local0 = 0x0352 } - Store (Local0, Index (PBST, 1)) + PBST [1] = Local0
/* * 2: BATTERY REMAINING CAPACITY */ - Store (BTRA, Local0) - If (LAnd (BFWK, LAnd (ACEX, LNot (BSTS)))) { - Store (BTDF, Local1) + Local0 = BTRA + If (BFWK && ACEX && !BSTS)) { + Local1 = BTDF
/* See if within ~6% of full */ - ShiftRight (Local1, 4, Local2) - If (LAnd (LGreater (Local0, Subtract (Local1, Local2)), - LLess (Local0, Add (Local1, Local2)))) + Local2 = Local1 >> 4 + If (Local0 > (Local1 - Local2)) && (Local0 < (Local1 + Local2)) { - Store (Local1, Local0) + Local0 = Local1 } } - Store (Local0, Index (PBST, 2)) + PBST [2] = Local0
/* * 3: BATTERY PRESENT VOLTAGE */ - Store (BTVO, Index (PBST, 3)) + PBST [3] = BTVO
Return (PBST) } diff --git a/src/ec/purism/librem/acpi/ec.asl b/src/ec/purism/librem/acpi/ec.asl index 668b7d1..bf855af 100644 --- a/src/ec/purism/librem/acpi/ec.asl +++ b/src/ec/purism/librem/acpi/ec.asl @@ -15,12 +15,12 @@
Method (FNCX, 1, NotSerialized) { - If (LEqual (Arg0, 0x86)) { + If (Arg0 == 0x86) { /* Enable topstar-laptop kernel driver handling */ - Store (One, ^^EC.TPSE) - } ElseIf (LEqual (Arg0, 0x87)) { + ^^EC.TPSE = 1 + } ElseIf (Arg0 == 0x87) { /* Disable topstar-laptop kernel driver handling */ - Store (Zero, ^^EC.TPSE) + ^^EC.TPSE = 0 } } } @@ -80,10 +80,10 @@ Method (_REG, 2, NotSerialized) { /* Initialize AC power state */ - Store (ACEX, \PWRS) + \PWRS = ACEX
/* Initialize LID switch state */ - Store (LIDS, \LIDS) + \LIDS = LIDS }
/* Notify topstar-laptop kernel driver */ @@ -115,7 +115,7 @@ /* AC Status Changed */ Method (_Q20) { - Store (ACEX, \PWRS) + \PWRS = ACEX Notify (AC, 0x80) Notify (BAT, 0x80) PNOT () @@ -124,7 +124,7 @@ /* Lid Event */ Method (_Q21) { - Store (LIDS, \LIDS) + \LIDS = LIDS Notify (LID0, 0x80) }
@@ -193,7 +193,7 @@ /* KEY_BLUETOOTH */ Method (_Q37) { - XOr (^BTLE, One, ^BTLE) + ^BTLE ^= 1 }
/* Turbo Enable/Disable */ @@ -208,13 +208,13 @@ * when the system is charging. */ If (TURB) { - Store (PPCM_TURBO, PPCM) + PPCM = PPCM_TURBO PPCN () - Store (One, EDTB) + EDTB = 1 } Else { - Store (PPCM_NOTURBO, PPCM) + PPCM = PPCM_NOTURBO PPCN () - Store (Zero, EDTB) + EDTB = 0 } }
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46102
to look at the new patch set (#3).
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
ec/purism/librem: Convert to ASL 2.0 syntax
Change-Id: I36cb7a2ebde1161f87e78eeab739b15e3cf88860 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/purism/librem/acpi/battery.asl M src/ec/purism/librem/acpi/ec.asl 2 files changed, 53 insertions(+), 54 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46102/3
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46102
to look at the new patch set (#4).
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
ec/purism/librem: Convert to ASL 2.0 syntax
Change-Id: I36cb7a2ebde1161f87e78eeab739b15e3cf88860 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/purism/librem/acpi/battery.asl M src/ec/purism/librem/acpi/ec.asl 2 files changed, 53 insertions(+), 54 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46102/4
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46102
to look at the new patch set (#5).
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
ec/purism/librem: Convert to ASL 2.0 syntax
Generated build/dsdt.dsl are same for purism Librem 15 v4.
Change-Id: I36cb7a2ebde1161f87e78eeab739b15e3cf88860 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/ec/purism/librem/acpi/battery.asl M src/ec/purism/librem/acpi/ec.asl 2 files changed, 53 insertions(+), 54 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46102/5
Benjamin Doron has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... File src/ec/purism/librem/acpi/ec.asl:
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... PS5, Line 179: /* KEY_F13 (Touchpad Enable/Disable) End comment?
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
Patch Set 5: Code-Review+2
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... File src/ec/purism/librem/acpi/ec.asl:
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... PS5, Line 179: /* KEY_F13 (Touchpad Enable/Disable)
End comment?
Interesting. Does this comment out the rest of the file?
Benjamin Doron has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... File src/ec/purism/librem/acpi/ec.asl:
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... PS5, Line 179: /* KEY_F13 (Touchpad Enable/Disable)
Interesting. […]
No, just until `/* KEY_WLAN */` below. It's this one query only that is affected.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... File src/ec/purism/librem/acpi/ec.asl:
https://review.coreboot.org/c/coreboot/+/46102/5/src/ec/purism/librem/acpi/e... PS5, Line 179: /* KEY_F13 (Touchpad Enable/Disable)
No, just until `/* KEY_WLAN */` below. It's this one query only that is affected.
No in scope for this commit. Feel free to suggest a follow up.
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46102 )
Change subject: ec/purism/librem: Convert to ASL 2.0 syntax ......................................................................
ec/purism/librem: Convert to ASL 2.0 syntax
Generated build/dsdt.dsl are same for purism Librem 15 v4.
Change-Id: I36cb7a2ebde1161f87e78eeab739b15e3cf88860 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/46102 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M src/ec/purism/librem/acpi/battery.asl M src/ec/purism/librem/acpi/ec.asl 2 files changed, 53 insertions(+), 54 deletions(-)
Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved
diff --git a/src/ec/purism/librem/acpi/battery.asl b/src/ec/purism/librem/acpi/battery.asl index ca682a8..742dd25 100644 --- a/src/ec/purism/librem/acpi/battery.asl +++ b/src/ec/purism/librem/acpi/battery.asl @@ -65,13 +65,13 @@ /* Method to enable full battery workaround */ Method (BFWE) { - Store (One, BFWK) + BFWK = 1 }
/* Method to disable full battery workaround */ Method (BFWD) { - Store (Zero, BFWK) + BFWK = 0 }
Method (_STA, 0, Serialized) @@ -86,22 +86,22 @@ Method (_BIF, 0, Serialized) { /* Last Full Charge Capacity */ - Store (BTDF, Index (PBIF, 2)) + PBIF [2] = BTDF
/* Design Voltage */ - Store (BTDV, Index (PBIF, 4)) + PBIF [4] = BTDV
/* Design Capacity */ - Store (BTDA, Local0) - Store (Local0, Index (PBIF, 1)) + Local0 = BTDA + PBIF [1] = Local0
/* Design Capacity of Warning */ - Divide (Multiply (Local0, DWRN), 100, , Local2) - Store (Local2, Index (PBIF, 5)) + Local2 = (Local0 * DWRN) / 100 + PBIF [5] = Local2
/* Design Capacity of Low */ - Divide (Multiply (Local0, DLOW), 100, , Local2) - Store (Local2, Index (PBIF, 6)) + Local2 = (Local0 * DLOW) / 100 + PBIF [6] = Local2
Return (PBIF) } @@ -109,22 +109,22 @@ Method (_BIX, 0, Serialized) { /* Last Full Charge Capacity */ - Store (BTDF, Index (PBIX, 3)) + PBIX [3] = BTDF
/* Design Voltage */ - Store (BTDV, Index (PBIX, 5)) + PBIX [5] = BTDV
/* Design Capacity */ - Store (BTDA, Local0) - Store (Local0, Index (PBIX, 2)) + Local0 = BTDA + PBIX [2] = Local0
/* Design Capacity of Warning */ - Divide (Multiply (Local0, DWRN), 100, , Local2) - Store (Local2, Index (PBIX, 6)) + Local2 = (Local0 * DWRN) / 100 + PBIX [6] = Local2
/* Design Capacity of Low */ - Divide (Multiply (Local0, DLOW), 100, , Local2) - Store (Local2, Index (PBIX, 7)) + Local2 = (Local0 * DLOW) / 100 + PBIX [7] = Local2
Return (PBIX) } @@ -142,61 +142,60 @@ /* Check if AC is present */ If (ACEX) { /* Read battery status from EC */ - Store (BSTS, Local0) + Local0 = BSTS } Else { /* Always discharging when on battery power */ - Store (0x01, Local0) + Local0 = 0x01 }
/* Check for critical battery level */ If (BFCR) { - Or (Local0, 0x04, Local0) + Local0 |= 0x04 } - Store (Local0, Index (PBST, 0)) + PBST [0] = Local0
/* Notify if battery state has changed since last time */ - If (LNotEqual (Local0, BSTP)) { - Store (Local0, BSTP) + If (Local0 != BSTP) { + BSTP = Local0 Notify (BAT, 0x80) }
/* * 1: BATTERY PRESENT RATE */ - Store (BTPR, Local1) - If (And (Local1, 0x8000)) { - And (Not (Local1), 0x7FFF, Local0) - Increment (Local0) + Local1 = BTPR + If (Local1 & 0x8000) { + Local0 = ~Local1 & 0x7FFF + Local0++ } Else { - And (Local1, 0x7FFF, Local0) + Local0 = Local1 & 0x7FFF } - If(LLess(Local0, 0x0352)) + If(Local0 < 0x0352) { - Store(0x0352, Local0) + Local0 = 0x0352 } - Store (Local0, Index (PBST, 1)) + PBST [1] = Local0
/* * 2: BATTERY REMAINING CAPACITY */ - Store (BTRA, Local0) - If (LAnd (BFWK, LAnd (ACEX, LNot (BSTS)))) { - Store (BTDF, Local1) + Local0 = BTRA + If (BFWK && ACEX && !BSTS) { + Local1 = BTDF
/* See if within ~6% of full */ - ShiftRight (Local1, 4, Local2) - If (LAnd (LGreater (Local0, Subtract (Local1, Local2)), - LLess (Local0, Add (Local1, Local2)))) + Local2 = Local1 >> 4 + If ((Local0 > (Local1 - Local2)) && (Local0 < (Local1 + Local2))) { - Store (Local1, Local0) + Local0 = Local1 } } - Store (Local0, Index (PBST, 2)) + PBST [2] = Local0
/* * 3: BATTERY PRESENT VOLTAGE */ - Store (BTVO, Index (PBST, 3)) + PBST [3] = BTVO
Return (PBST) } diff --git a/src/ec/purism/librem/acpi/ec.asl b/src/ec/purism/librem/acpi/ec.asl index 668b7d1..bf855af 100644 --- a/src/ec/purism/librem/acpi/ec.asl +++ b/src/ec/purism/librem/acpi/ec.asl @@ -15,12 +15,12 @@
Method (FNCX, 1, NotSerialized) { - If (LEqual (Arg0, 0x86)) { + If (Arg0 == 0x86) { /* Enable topstar-laptop kernel driver handling */ - Store (One, ^^EC.TPSE) - } ElseIf (LEqual (Arg0, 0x87)) { + ^^EC.TPSE = 1 + } ElseIf (Arg0 == 0x87) { /* Disable topstar-laptop kernel driver handling */ - Store (Zero, ^^EC.TPSE) + ^^EC.TPSE = 0 } } } @@ -80,10 +80,10 @@ Method (_REG, 2, NotSerialized) { /* Initialize AC power state */ - Store (ACEX, \PWRS) + \PWRS = ACEX
/* Initialize LID switch state */ - Store (LIDS, \LIDS) + \LIDS = LIDS }
/* Notify topstar-laptop kernel driver */ @@ -115,7 +115,7 @@ /* AC Status Changed */ Method (_Q20) { - Store (ACEX, \PWRS) + \PWRS = ACEX Notify (AC, 0x80) Notify (BAT, 0x80) PNOT () @@ -124,7 +124,7 @@ /* Lid Event */ Method (_Q21) { - Store (LIDS, \LIDS) + \LIDS = LIDS Notify (LID0, 0x80) }
@@ -193,7 +193,7 @@ /* KEY_BLUETOOTH */ Method (_Q37) { - XOr (^BTLE, One, ^BTLE) + ^BTLE ^= 1 }
/* Turbo Enable/Disable */ @@ -208,13 +208,13 @@ * when the system is charging. */ If (TURB) { - Store (PPCM_TURBO, PPCM) + PPCM = PPCM_TURBO PPCN () - Store (One, EDTB) + EDTB = 1 } Else { - Store (PPCM_NOTURBO, PPCM) + PPCM = PPCM_NOTURBO PPCN () - Store (Zero, EDTB) + EDTB = 0 } }