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:
parent
23b081825d
commit
fc7b41d370
|
@ -45,28 +45,28 @@ Scope(\_SB) {
|
|||
})
|
||||
|
||||
// Is battery there?
|
||||
Store(_STA(), Local0)
|
||||
And(Local0, 0x10, Local0)
|
||||
If(LNot(Local0)) {
|
||||
Local0 = _STA ()
|
||||
Local0 &= 0x10
|
||||
If (!Local0) {
|
||||
Return (PBIF)
|
||||
}
|
||||
|
||||
Store(\_SB.PCI0.LPCB.EC0.BDC0, Index(PBIF, 1))
|
||||
Store(\_SB.PCI0.LPCB.EC0.BDV0, Index(PBIF, 4))
|
||||
PBIF [1] = \_SB.PCI0.LPCB.EC0.BDC0
|
||||
PBIF [4] = \_SB.PCI0.LPCB.EC0.BDV0
|
||||
|
||||
Store(\_SB.PCI0.LPCB.EC0.BFC0, Local0)
|
||||
Store(Local0, Index(PBIF, 2))
|
||||
Local0 = \_SB.PCI0.LPCB.EC0.BFC0
|
||||
PBIF [2] = Local0
|
||||
|
||||
Divide(Local0, 10, , Local2)
|
||||
Store(Local2, Index(PBIF, 5))
|
||||
Local2 = Local0 / 10
|
||||
PBIF [5] = Local2
|
||||
|
||||
Divide(Local0, 20, , Local2)
|
||||
Store(Local2, Index(PBIF, 6))
|
||||
Local2 = Local0 / 20
|
||||
PBIF [6] = Local2
|
||||
|
||||
If (\_SB.PCI0.LPCB.EC0.BTYP) {
|
||||
Store(NIMH, Index(PBIF, 11))
|
||||
PBIF [11] = NIMH
|
||||
} Else {
|
||||
Store(LION, Index(PBIF, 11))
|
||||
PBIF [11] = LION
|
||||
}
|
||||
|
||||
Return (PBIF)
|
||||
|
@ -76,32 +76,32 @@ Scope(\_SB) {
|
|||
Method(_BST, 0)
|
||||
{
|
||||
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)
|
||||
Divide(Local3, \_SB.PCI0.LPCB.EC0.BFC0, , Local0)
|
||||
Multiply(\_SB.PCI0.LPCB.EC0.BFC0, Local0, Local3)
|
||||
Divide(Local3, 0x64, , Local0)
|
||||
Increment(Local0)
|
||||
Store(Local0, Index(PBST, 2))
|
||||
Local3 = \_SB.PCI0.LPCB.EC0.BRC0 * 100
|
||||
Local0 = Local3 / \_SB.PCI0.LPCB.EC0.BFC0
|
||||
Local3 = \_SB.PCI0.LPCB.EC0.BFC0 * Local0
|
||||
Local0 = Local3 / 100
|
||||
Local0++
|
||||
PBST [2] = Local0
|
||||
|
||||
Store (\_SB.PCI0.LPCB.EC0.BRC0, Local3)
|
||||
Store (\_SB.PCI0.LPCB.EC0.BPR0, Local0)
|
||||
And (Not (Local0), 0xFFFF, Local0)
|
||||
Store (Local0, Index(PBST,1))
|
||||
Local3 = \_SB.PCI0.LPCB.EC0.BRC0
|
||||
Local0 = \_SB.PCI0.LPCB.EC0.BPR0
|
||||
Local0 = ~Local0 & 0xFFFF
|
||||
PBST [1] = Local0
|
||||
|
||||
// AC Power connected?
|
||||
If (\_SB.PCI0.LPCB.EC0.ADP) {
|
||||
If (\_SB.PCI0.LPCB.EC0.CHRG) {
|
||||
Store(2, Index(PBST, 0))
|
||||
PBST [0] = 2
|
||||
} Else {
|
||||
Store(0, Index(PBST, 0))
|
||||
PBST [0] = 0
|
||||
}
|
||||
} Else {
|
||||
If(LLess(Local3, 25)) {
|
||||
Store(5, Index(PBST, 0))
|
||||
If (Local3 < 25) {
|
||||
PBST [0] = 5
|
||||
} Else {
|
||||
Store(1, Index(PBST, 0))
|
||||
PBST [0] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -150,28 +150,28 @@ Scope(\_SB) {
|
|||
})
|
||||
|
||||
// Is battery there?
|
||||
Store(_STA(), Local0)
|
||||
And(Local0, 0x10, Local0)
|
||||
If(LNot(Local0)) {
|
||||
Local0 = _STA ()
|
||||
Local0 &= 0x10
|
||||
If (!Local0) {
|
||||
Return (PBIF)
|
||||
}
|
||||
|
||||
Store(\_SB.PCI0.LPCB.EC0.BDC2, Index(PBIF, 1))
|
||||
Store(\_SB.PCI0.LPCB.EC0.BDV2, Index(PBIF, 4))
|
||||
PBIF [1] = \_SB.PCI0.LPCB.EC0.BDC2
|
||||
PBIF [4] = \_SB.PCI0.LPCB.EC0.BDV2
|
||||
|
||||
Store(\_SB.PCI0.LPCB.EC0.BFC2, Local0)
|
||||
Store(Local0, Index(PBIF, 2))
|
||||
Local0 = \_SB.PCI0.LPCB.EC0.BFC2
|
||||
PBIF [2] = Local0
|
||||
|
||||
Divide(Local0, 10, , Local2)
|
||||
Store(Local2, Index(PBIF, 5))
|
||||
Local2 = Local0 / 10
|
||||
PBIF [5] = Local2
|
||||
|
||||
Divide(Local0, 20, , Local2)
|
||||
Store(Local2, Index(PBIF, 6))
|
||||
Local2 = Local0 / 20
|
||||
PBIF [6] = Local2
|
||||
|
||||
If (\_SB.PCI0.LPCB.EC0.BTY2) {
|
||||
Store(NIMH, Index(PBIF, 11))
|
||||
PBIF [11] = NIMH
|
||||
} Else {
|
||||
Store(LION, Index(PBIF, 11))
|
||||
PBIF [11] = LION
|
||||
}
|
||||
|
||||
Return (PBIF)
|
||||
|
@ -181,32 +181,32 @@ Scope(\_SB) {
|
|||
Method(_BST, 0)
|
||||
{
|
||||
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)
|
||||
Divide(Local3, \_SB.PCI0.LPCB.EC0.BFC2, , Local0)
|
||||
Multiply(\_SB.PCI0.LPCB.EC0.BFC2, Local0, Local3)
|
||||
Divide(Local3, 0x64, , Local0)
|
||||
Increment(Local0)
|
||||
Store(Local0, Index(PBST, 2))
|
||||
Local3 = \_SB.PCI0.LPCB.EC0.BRC2 * 100
|
||||
Local0 = Local3 / \_SB.PCI0.LPCB.EC0.BRC2
|
||||
Local3 = \_SB.PCI0.LPCB.EC0.BFC2 * Local0
|
||||
Local0 = Local3 / 100
|
||||
Local0++
|
||||
PBST [2] = Local0
|
||||
|
||||
Store (\_SB.PCI0.LPCB.EC0.BRC2, Local3)
|
||||
Store (\_SB.PCI0.LPCB.EC0.BPR2, Local0)
|
||||
And (Not (Local0), 0xFFFF, Local0)
|
||||
Store (Local0, Index(PBST,1))
|
||||
Local3 = \_SB.PCI0.LPCB.EC0.BRC2
|
||||
Local0 = \_SB.PCI0.LPCB.EC0.BPR2
|
||||
Local0 = ~Local0 & 0xFFFF
|
||||
PBST [1] = Local0
|
||||
|
||||
// AC Power connected?
|
||||
If (\_SB.PCI0.LPCB.EC0.ADP) {
|
||||
If (\_SB.PCI0.LPCB.EC0.CRG2) {
|
||||
Store(2, Index(PBST, 0))
|
||||
PBST [0] = 2
|
||||
} Else {
|
||||
Store(0, Index(PBST, 0))
|
||||
PBST [0] = 0
|
||||
}
|
||||
} Else {
|
||||
If(LLess(Local3, 25)) {
|
||||
Store(5, Index(PBST, 0))
|
||||
If (Local3 < 25) {
|
||||
PBST [0] = 5
|
||||
} Else {
|
||||
Store(1, Index(PBST, 0))
|
||||
PBST [0] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -224,11 +224,11 @@ Scope(\_SB) {
|
|||
Method (_PSR, 0)
|
||||
{
|
||||
If (ACFG) {
|
||||
Store(ACST, Local0)
|
||||
Local0 = ACST
|
||||
} Else {
|
||||
Store(\_SB.PCI0.LPCB.EC0.ADP, Local0)
|
||||
Store(Local0, ACST)
|
||||
Store(1, ACFG)
|
||||
Local0 = \_SB.PCI0.LPCB.EC0.ADP
|
||||
ACST = Local0
|
||||
ACFG = 1
|
||||
}
|
||||
Sleep(120)
|
||||
Return (Local0)
|
||||
|
|
Loading…
Reference in New Issue