mb/apple/macbook21/acpi: Convert *.asl to ASL 2.0 syntax

It changes the binary for apple/macbook21 because of optimization of "Store" instruction.
Generated build/dsdt.dsl files are same.

Change-Id: I16b5180f8a8c44e6bc3ef353a99ef92a381b3295
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45282
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Elyes HAOUAS
2020-09-11 07:50:32 +02:00
committed by Patrick Georgi
parent 18582237ac
commit aca5d18efd
2 changed files with 37 additions and 37 deletions

View File

@ -32,27 +32,27 @@ Device(EC)
Method(SBPC, 0, NotSerialized) Method(SBPC, 0, NotSerialized)
{ {
Store(1000, Local0) Local0 = 1000
While(Local0) While(Local0)
{ {
If(LEqual(SPTR, 0x00)) If(SPTR == 0)
{ {
Return() Return()
} }
Sleep(1) Sleep(1)
Decrement(Local0) Local0--
} }
} }
Method(SBRW, 2, NotSerialized) Method(SBRW, 2, NotSerialized)
{ {
Acquire(ECLK, 0xFFFF) Acquire(ECLK, 0xFFFF)
Store(ShiftLeft(Arg0, 0x01), SADR) SADR = (Arg0 << 1)
Store(Arg1, SCMD) SCMD = Arg1
Store(0x09, SPTR) SPTR = 0x09
SBPC() SBPC()
Store(SBDW, Local0) Local0 = SBDW
Release(ECLK) Release(ECLK)
Return(Local0) Return(Local0)
} }
@ -60,11 +60,11 @@ Device(EC)
Method(SBRB, 2, NotSerialized) Method(SBRB, 2, NotSerialized)
{ {
Acquire(ECLK, 0xFFFF) Acquire(ECLK, 0xFFFF)
Store(ShiftLeft(Arg0, 0x01), SADR) SADR = (Arg0 << 1)
Store(Arg1, SCMD) SCMD = Arg1
Store(0x0B, SPTR) SPTR = 0x0B
SBPC() SBPC()
Store(SBFR, Local0) Local0 = SBFR
Release(ECLK) Release(ECLK)
Return(Local0) Return(Local0)
} }
@ -112,9 +112,9 @@ Device(EC)
Method(_PSW, 1, NotSerialized) Method(_PSW, 1, NotSerialized)
{ {
if (Arg0) { if (Arg0) {
Store(1, WKLD) WKLD = 1
} else { } else {
Store(0, WKLD) WKLD = 0
} }
} }
} }
@ -172,19 +172,19 @@ Device(EC)
Method(_BIF, 0, NotSerialized) Method(_BIF, 0, NotSerialized)
{ {
Multiply(^^SBRW(0x0B, 0x18), 10, Index(BATS, 0x01)) BATS [0x01] = (SBRW (0x0B, 0x18) * 10)
Multiply(^^SBRW(0x0B, 0x10), 10, Index(BATS, 0x02)) BATS [0x02] = (SBRW (0x0B, 0x10) * 10)
Store(^^SBRW(0x0B, 0x19), Index(BATS, 0x04)) BATS [0x04] = SBRW (0x0B, 0x19)
Store(^^SBRB(0x0B, 0x21), Index(BATS, 0x09)) BATS [0x09] = SBRB (0x0B, 0x21)
Store(^^SBRB(0x0B, 0x22), Index(BATS, 0x0B)) BATS [0x0B] = SBRB (0x0B, 0x22)
Store(^^SBRB(0x0B, 0x20), Index(BATS, 0x0C)) BATS [0x0C] = SBRB (0x0B, 0x20)
Return(BATS) Return(BATS)
} }
Method(_STA, 0, NotSerialized) Method(_STA, 0, NotSerialized)
{ {
If(And(^^SBRW(0x0A, 0x01), 0x01)) { If (SBRW(0x0A, 1) & 1) {
Return(0x1f) Return(0x1f)
} else { } else {
Return(0x0f) Return(0x0f)
@ -194,7 +194,7 @@ Device(EC)
Method(_BST, 0, NotSerialized) Method(_BST, 0, NotSerialized)
{ {
/* Check for battery presence. */ /* Check for battery presence. */
If(LNot(And(^^SBRW(0x0A, 0x01), 0x01))) { If (!(SBRW (0x0A, 1) & 1)) {
Return(Package(4) { Return(Package(4) {
0, 0,
0xFFFFFFFF, 0xFFFFFFFF,
@ -202,30 +202,30 @@ Device(EC)
0xFFFFFFFF 0xFFFFFFFF
}) })
} }
Store(^^SBRW(0x0B, 0x09), Local1) Local1 = SBRW(0x0B, 0x09)
Store(Local1, Index(BATI, 0x03)) BATI [3] = Local1
Store(^^SBRW(0x0B, 0x0A), Local0) Local0 = SBRW (0x0B, 0x0A)
/* Sign-extend Local0. */ /* Sign-extend Local0. */
If(And(Local0, 0x8000)) If(Local0 & 0x8000)
{ {
Not(Local0, Local0) Local0 = ~Local0
And(Increment(Local0), 0xFFFF, Local0) Local0 = (Local0++ & 0xFFFF)
} }
Multiply(Local0, Local1, Local0) Local0 *= Local1
Divide(Local0, 1000, , Index(BATI, 1)) BATI [1] = (Local0 / 1000)
Multiply(^^SBRW(0x0B, 0x0F), 10, Index(BATI, 2)) BATI [2] = (SBRW (0x0B, 0x0F) * 10)
If(HPAC) If(HPAC)
{ {
If(LNot(And(^^SBRW(0x0B, 0x16), 0x40))) { If (!(SBRW (0x0B, 0x16) & 0x40)) {
Store(2, Index(BATI, 0)) BATI [0] = 2
} Else { } Else {
Store(0, Index(BATI, 0)) BATI [0] = 0
} }
} }
Else Else
{ {
Store(0x01, Index(BATI, 0)) BATI [0] = 1
} }
Return(BATI) Return(BATI)

View File

@ -10,12 +10,12 @@ Method(_WAK,1)
// was inserted while a sleep state was active. // was inserted while a sleep state was active.
// Are we going to S3? // Are we going to S3?
If (LEqual(Arg0, 3)) { If (Arg0 == 3) {
// .. // ..
} }
// Are we going to S4? // Are we going to S4?
If (LEqual(Arg0, 4)) { If (Arg0 == 4) {
// .. // ..
} }
@ -46,7 +46,7 @@ Scope(\_SB)
* running: Windows XP SP1 needs to have C-State coordination * running: Windows XP SP1 needs to have C-State coordination
* enabled in SMM. * enabled in SMM.
*/ */
If (LAnd(LEqual(OSYS, 2001), MPEN)) { If ((OSYS == 2001) && MPEN) {
// TRAP(61) // TODO // TRAP(61) // TODO
} }