mb/getac/p470/acpi: Convert 'battery.asl' to ASL 2.0 syntax

IASL optimizes the code differently, which changes the binary.
However, the generated `build/dsdt.dsl` remains identical.

Change-Id: Ifcc8bf4022838056bf1fff853eb2027af684064e
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45554
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes HAOUAS 2020-09-20 09:30:58 +02:00 committed by Patrick Georgi
parent 23b081825d
commit fc7b41d370
1 changed files with 81 additions and 81 deletions

View File

@ -18,10 +18,10 @@ Scope(\_SB) {
Method(_STA, 0) Method(_STA, 0)
{ {
Sleep(120) Sleep(120)
If(\_SB.PCI0.LPCB.EC0.BAT) { If (\_SB.PCI0.LPCB.EC0.BAT) {
Return(0x1f) Return (0x1f)
} Else { } Else {
Return(0x0f) Return (0x0f)
} }
} }
@ -45,67 +45,67 @@ Scope(\_SB) {
}) })
// Is battery there? // Is battery there?
Store(_STA(), Local0) Local0 = _STA ()
And(Local0, 0x10, Local0) Local0 &= 0x10
If(LNot(Local0)) { If (!Local0) {
Return (PBIF) Return (PBIF)
} }
Store(\_SB.PCI0.LPCB.EC0.BDC0, Index(PBIF, 1)) PBIF [1] = \_SB.PCI0.LPCB.EC0.BDC0
Store(\_SB.PCI0.LPCB.EC0.BDV0, Index(PBIF, 4)) PBIF [4] = \_SB.PCI0.LPCB.EC0.BDV0
Store(\_SB.PCI0.LPCB.EC0.BFC0, Local0) Local0 = \_SB.PCI0.LPCB.EC0.BFC0
Store(Local0, Index(PBIF, 2)) PBIF [2] = Local0
Divide(Local0, 10, , Local2) Local2 = Local0 / 10
Store(Local2, Index(PBIF, 5)) PBIF [5] = Local2
Divide(Local0, 20, , Local2) Local2 = Local0 / 20
Store(Local2, Index(PBIF, 6)) PBIF [6] = Local2
If(\_SB.PCI0.LPCB.EC0.BTYP) { If (\_SB.PCI0.LPCB.EC0.BTYP) {
Store(NIMH, Index(PBIF, 11)) PBIF [11] = NIMH
} Else { } Else {
Store(LION, Index(PBIF, 11)) PBIF [11] = LION
} }
Return(PBIF) Return (PBIF)
} }
/* Battery Status */ /* Battery Status */
Method(_BST, 0) Method(_BST, 0)
{ {
If(\_SB.PCI0.LPCB.EC0.BAT) { If (\_SB.PCI0.LPCB.EC0.BAT) {
Store(\_SB.PCI0.LPCB.EC0.BPV0, Index(PBST, 3)) PBST [3] = \_SB.PCI0.LPCB.EC0.BPV0
Multiply(\_SB.PCI0.LPCB.EC0.BRC0, 100, Local3) Local3 = \_SB.PCI0.LPCB.EC0.BRC0 * 100
Divide(Local3, \_SB.PCI0.LPCB.EC0.BFC0, , Local0) Local0 = Local3 / \_SB.PCI0.LPCB.EC0.BFC0
Multiply(\_SB.PCI0.LPCB.EC0.BFC0, Local0, Local3) Local3 = \_SB.PCI0.LPCB.EC0.BFC0 * Local0
Divide(Local3, 0x64, , Local0) Local0 = Local3 / 100
Increment(Local0) Local0++
Store(Local0, Index(PBST, 2)) PBST [2] = Local0
Store (\_SB.PCI0.LPCB.EC0.BRC0, Local3) Local3 = \_SB.PCI0.LPCB.EC0.BRC0
Store (\_SB.PCI0.LPCB.EC0.BPR0, Local0) Local0 = \_SB.PCI0.LPCB.EC0.BPR0
And (Not (Local0), 0xFFFF, Local0) Local0 = ~Local0 & 0xFFFF
Store (Local0, Index(PBST,1)) PBST [1] = Local0
// AC Power connected? // AC Power connected?
If(\_SB.PCI0.LPCB.EC0.ADP) { If (\_SB.PCI0.LPCB.EC0.ADP) {
If(\_SB.PCI0.LPCB.EC0.CHRG) { If (\_SB.PCI0.LPCB.EC0.CHRG) {
Store(2, Index(PBST, 0)) PBST [0] = 2
} Else { } Else {
Store(0, Index(PBST, 0)) PBST [0] = 0
} }
} Else { } Else {
If(LLess(Local3, 25)) { If (Local3 < 25) {
Store(5, Index(PBST, 0)) PBST [0] = 5
} Else { } Else {
Store(1, Index(PBST, 0)) PBST [0] = 1
} }
} }
} }
Return(PBST) Return (PBST)
} }
} }
@ -123,10 +123,10 @@ Scope(\_SB) {
Method(_STA, 0) Method(_STA, 0)
{ {
Sleep(120) Sleep(120)
If(\_SB.PCI0.LPCB.EC0.BAT2) { If (\_SB.PCI0.LPCB.EC0.BAT2) {
Return(0x1f) Return (0x1f)
} Else { } Else {
Return(0x0f) Return (0x0f)
} }
} }
@ -150,67 +150,67 @@ Scope(\_SB) {
}) })
// Is battery there? // Is battery there?
Store(_STA(), Local0) Local0 = _STA ()
And(Local0, 0x10, Local0) Local0 &= 0x10
If(LNot(Local0)) { If (!Local0) {
Return (PBIF) Return (PBIF)
} }
Store(\_SB.PCI0.LPCB.EC0.BDC2, Index(PBIF, 1)) PBIF [1] = \_SB.PCI0.LPCB.EC0.BDC2
Store(\_SB.PCI0.LPCB.EC0.BDV2, Index(PBIF, 4)) PBIF [4] = \_SB.PCI0.LPCB.EC0.BDV2
Store(\_SB.PCI0.LPCB.EC0.BFC2, Local0) Local0 = \_SB.PCI0.LPCB.EC0.BFC2
Store(Local0, Index(PBIF, 2)) PBIF [2] = Local0
Divide(Local0, 10, , Local2) Local2 = Local0 / 10
Store(Local2, Index(PBIF, 5)) PBIF [5] = Local2
Divide(Local0, 20, , Local2) Local2 = Local0 / 20
Store(Local2, Index(PBIF, 6)) PBIF [6] = Local2
If(\_SB.PCI0.LPCB.EC0.BTY2) { If (\_SB.PCI0.LPCB.EC0.BTY2) {
Store(NIMH, Index(PBIF, 11)) PBIF [11] = NIMH
} Else { } Else {
Store(LION, Index(PBIF, 11)) PBIF [11] = LION
} }
Return(PBIF) Return (PBIF)
} }
/* Battery Status */ /* Battery Status */
Method(_BST, 0) Method(_BST, 0)
{ {
If(\_SB.PCI0.LPCB.EC0.BAT2) { If (\_SB.PCI0.LPCB.EC0.BAT2) {
Store(\_SB.PCI0.LPCB.EC0.BPV2, Index(PBST, 3)) PBST [3] = \_SB.PCI0.LPCB.EC0.BPV2
Multiply(\_SB.PCI0.LPCB.EC0.BRC2, 100, Local3) Local3 = \_SB.PCI0.LPCB.EC0.BRC2 * 100
Divide(Local3, \_SB.PCI0.LPCB.EC0.BFC2, , Local0) Local0 = Local3 / \_SB.PCI0.LPCB.EC0.BRC2
Multiply(\_SB.PCI0.LPCB.EC0.BFC2, Local0, Local3) Local3 = \_SB.PCI0.LPCB.EC0.BFC2 * Local0
Divide(Local3, 0x64, , Local0) Local0 = Local3 / 100
Increment(Local0) Local0++
Store(Local0, Index(PBST, 2)) PBST [2] = Local0
Store (\_SB.PCI0.LPCB.EC0.BRC2, Local3) Local3 = \_SB.PCI0.LPCB.EC0.BRC2
Store (\_SB.PCI0.LPCB.EC0.BPR2, Local0) Local0 = \_SB.PCI0.LPCB.EC0.BPR2
And (Not (Local0), 0xFFFF, Local0) Local0 = ~Local0 & 0xFFFF
Store (Local0, Index(PBST,1)) PBST [1] = Local0
// AC Power connected? // AC Power connected?
If(\_SB.PCI0.LPCB.EC0.ADP) { If (\_SB.PCI0.LPCB.EC0.ADP) {
If(\_SB.PCI0.LPCB.EC0.CRG2) { If (\_SB.PCI0.LPCB.EC0.CRG2) {
Store(2, Index(PBST, 0)) PBST [0] = 2
} Else { } Else {
Store(0, Index(PBST, 0)) PBST [0] = 0
} }
} Else { } Else {
If(LLess(Local3, 25)) { If (Local3 < 25) {
Store(5, Index(PBST, 0)) PBST [0] = 5
} Else { } Else {
Store(1, Index(PBST, 0)) PBST [0] = 1
} }
} }
} }
Return(PBST) Return (PBST)
} }
} }
@ -223,12 +223,12 @@ Scope(\_SB) {
Name (ACST, 0x00) Name (ACST, 0x00)
Method (_PSR, 0) Method (_PSR, 0)
{ {
If(ACFG) { If (ACFG) {
Store(ACST, Local0) Local0 = ACST
} Else { } Else {
Store(\_SB.PCI0.LPCB.EC0.ADP, Local0) Local0 = \_SB.PCI0.LPCB.EC0.ADP
Store(Local0, ACST) ACST = Local0
Store(1, ACFG) ACFG = 1
} }
Sleep(120) Sleep(120)
Return (Local0) Return (Local0)