sb/amd/cimx/sb800/acpi: Convert to ASL 2.0 syntax
Also, fix typo on "success".
Built gizmosphere/gizmo generate identical 'build/dsdt.dsl'.
Change-Id: I6fd7056d8053f0097b5c9de6b4e2e6db38910a2e
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45875
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/src/southbridge/amd/cimx/sb800/acpi/smbus.asl b/src/southbridge/amd/cimx/sb800/acpi/smbus.asl
index a676893..b81c5b1 100644
--- a/src/southbridge/amd/cimx/sb800/acpi/smbus.asl
+++ b/src/southbridge/amd/cimx/sb800/acpi/smbus.asl
@@ -19,37 +19,37 @@
}
Method (WCLR, 0, NotSerialized) { /* clear SMBUS status register */
- Store (0x1E, HSTS)
- Store (0xFA, Local0)
- While (LAnd (LNotEqual (And (HSTS, 0x1E), Zero), LGreater (Local0, Zero))) {
+ HSTS = 0x1e
+ Local0 = 0xfa
+ While ((HSTS & 0x1e) != 0) && (Local0 > 0)) {
Stall (0x64)
- Decrement (Local0)
+ Local0--
}
Return (Local0)
}
Method (SWTC, 1, NotSerialized) {
- Store (Arg0, Local0)
- Store (0x07, Local2)
- Store (One, Local1)
- While (LEqual (Local1, One)) {
- Store (And (HSTS, 0x1E), Local3)
- If (LNotEqual (Local3, Zero)) { /* read sucess */
- If (LEqual (Local3, 0x02)) {
- Store (Zero, Local2)
+ Local0 = Arg0
+ Local2 = 0x07
+ Local1 = 1
+ While (Local1 == 1) {
+ Local3 = HSTS & 0x1e
+ If (Local3 != 0) { /* read success */
+ If (Local3 != 0x02) {
+ Local2 = 0
}
- Store (Zero, Local1)
+ Local1 = 0
}
Else {
- If (LLess (Local0, 0x0A)) { /* read failure */
- Store (0x10, Local2)
- Store (Zero, Local1)
+ If (Local0 < 0x0A) { /* read failure */
+ Local2 = 0x10
+ Local1 = 0
}
Else {
Sleep (0x0A) /* 10 ms, try again */
- Subtract (Local0, 0x0A, Local0)
+ Local0 -= 0x0a
}
}
}
@@ -58,29 +58,29 @@
}
Method (SMBR, 3, NotSerialized) {
- Store (0x07, Local0)
- If (LEqual (Acquire (SBX0, 0xFFFF), Zero)) {
- Store (WCLR (), Local0) /* clear SMBUS status register before read data */
- If (LEqual (Local0, Zero)) {
+ Local0 = 0x07
+ If (Acquire (SBX0, 0xFFFF) == 0) {
+ Local0 = WCLR () /* clear SMBUS status register before read data */
+ If (Local0 == 0) {
Release (SBX0)
Return (0x0)
}
- Store (0x1F, HSTS)
- Store (Or (ShiftLeft (Arg1, One), One), HADD)
- Store (Arg2, HCMD)
- If (LEqual (Arg0, 0x07)) {
- Store (0x48, HCNT) /* read byte */
+ HSTS = 0x1f
+ HADD = (Arg1 << 1) | 1
+ HCMD = Arg2
+ If (Arg0 == 0x07) {
+ HCNT = 0x48 /* read byte */
}
- Store (SWTC (0x03E8), Local1) /* 1000 ms */
- If (LEqual (Local1, Zero)) {
- If (LEqual (Arg0, 0x07)) {
- Store (DAT0, Local0)
+ Local1 = SWTC (0x03E8) /* 1000 ms */
+ If (Local1 == 0) {
+ If (Arg0 == 0x07) {
+ Local0 = DAT0
}
}
Else {
- Store (Local1, Local0)
+ Local0 = Local1
}
Release (SBX0)