From 03248033e7be6f81ad5b60ed21a60071aee32c67 Mon Sep 17 00:00:00 2001 From: Alexey Buyanov Date: Mon, 1 Jun 2020 21:41:14 -0700 Subject: soc/intel/common: Introduce ASL2.0 syntax Modify soc/intel/common .asl files to comply with ASL2.0 syntax for better code readability and clarity BUG=none BRANCH=none TEST= Deltan coreboot binary remains the same after the changes are applied Signed-off-by: Alexey Buyanov Change-Id: I8f95cf88f499d9f9bdd8c80c95af52f8fd886cdf Reviewed-on: https://review.coreboot.org/c/coreboot/+/42083 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: V Sowmya Reviewed-by: Angel Pons --- src/soc/intel/common/acpi/acpi_debug.asl | 62 +++++++++++++++--------------- src/soc/intel/common/acpi/dptf/charger.asl | 11 +++--- src/soc/intel/common/acpi/dptf/cpu.asl | 12 +++--- src/soc/intel/common/acpi/dptf/dptf.asl | 14 +++---- src/soc/intel/common/acpi/dptf/fan.asl | 6 +-- src/soc/intel/common/acpi/dptf/thermal.asl | 20 +++++----- src/soc/intel/common/acpi/pci_osc.asl | 4 +- src/soc/intel/common/acpi/pcr.asl | 10 ++--- src/soc/intel/common/acpi/platform.asl | 4 +- src/soc/intel/common/acpi/sgx.asl | 8 ++-- src/soc/intel/common/acpi/wifi.asl | 2 +- 11 files changed, 76 insertions(+), 77 deletions(-) (limited to 'src/soc/intel/common') diff --git a/src/soc/intel/common/acpi/acpi_debug.asl b/src/soc/intel/common/acpi/acpi_debug.asl index b85bed9b7d..86d207620a 100644 --- a/src/soc/intel/common/acpi/acpi_debug.asl +++ b/src/soc/intel/common/acpi/acpi_debug.asl @@ -8,14 +8,14 @@ Name (UFLG, CONFIG(CONSOLE_SERIAL)) Method (LURT, 1, Serialized) { - If (LEqual(Arg0, 0)) { /* 0 = 0x3f8 */ - Store (0x3f8, Local0) - } ElseIf (LEqual(Arg0, 1)) { /* 1 = 0x2f8 */ - Store (0x2f8, Local0) - } ElseIf (LEqual(Arg0, 2)) { /* 2 = 0x3e8 */ - Store (0x3e8, Local0) - } ElseIf (LEqual(Arg0, 3)) { /* 3 = 0x2e8 */ - Store (0x2e8, Local0) + If (Arg0 == 0) { /* 0 = 0x3f8 */ + Local0 = 0x3f8 + } ElseIf (Arg0 == 1) { /* 1 = 0x2f8 */ + Local0 = 0x2f8 + } ElseIf (Arg0 == 2) { /* 2 = 0x3e8 */ + Local0 = 0x3e8 + } ElseIf (Arg0 == 3) { /* 3 = 0x2e8 */ + Local0 = 0x2e8 } Return (Local0) } @@ -27,22 +27,22 @@ Method (APRT, 1, Serialized) Name(LENG, 0) Name(ADBG, Buffer(256) {0}) - If (LEqual(ObjectType(Arg0), 1)) { /* Integer */ + If (ObjectType(Arg0) == 1) { /* Integer */ ToHexString(Arg0, Local0) - Store(Local0, ADBG) - } ElseIf (LEqual(ObjectType(Arg0), 2)) { /* String */ - Store(Arg0, ADBG) - } ElseIf (LEqual(ObjectType(Arg0), 3)) { /* Buffer */ + ADBG = Local0 + } ElseIf (ObjectType(Arg0) == 2) { /* String */ + ADBG = Arg0 + } ElseIf (ObjectType(Arg0) == 3) { /* Buffer */ ToHexString(Arg0, ADBG) } Else { - Store("This type of object is not supported", ADBG) + ADBG = "This type of object is not supported" } - While (LNotEqual(DeRefOf(Index(ADBG, INDX)), 0)) + While (DeRefOf(ADBG[INDX]) != 0) { - Increment (INDX) + INDX++ } - Store (INDX, LENG) /* Length of the String */ + LENG = INDX /* Length of the String */ #if CONFIG(DRIVERS_UART_8250MEM_32) OperationRegion (UBAR, SystemMemory, @@ -75,33 +75,33 @@ Method (APRT, 1, Serialized) } #endif - If (LEqual(UFLG, 0)) { + If (UFLG == 0) { /* Enable Baud Rate Divisor Latch, Set Word length to 8 bit*/ - Store (0x83, LCR) - Store (0x01, IIR) - Store (0x03, MCR) + LCR = 0x83 + IIR = 0x01 + MCR = 0x03 /* Configure baud rate to 115200 */ - Store (0x01, TDR) - Store (0x00, IER) - Store (0x03, LCR) /* Disable Baud Rate Divisor Latch */ + TDR = 0x01 + IER = 0x00 + LCR = 0x03 /* Disable Baud Rate Divisor Latch */ - Increment (UFLG) + UFLG++ } - Store (0x00, INDX) - While (LLess (INDX, LENG)) + INDX = 0x00 + While (INDX < LENG) { /* Wait for the transmitter t to be ready */ While (1) { - And (LSR, 0x20, OPDT) - If (LNotEqual(OPDT, 0)) + OPDT = LSR & 0x20 + If (OPDT != 0) { Break } } - Store (DeRefOf (Index (ADBG, INDX)), TDR) - Increment(INDX) + TDR = DeRefOf (ADBG[INDX]) + INDX++ } } /* End of APRT */ diff --git a/src/soc/intel/common/acpi/dptf/charger.asl b/src/soc/intel/common/acpi/dptf/charger.asl index fca9590c37..96d314fc40 100644 --- a/src/soc/intel/common/acpi/dptf/charger.asl +++ b/src/soc/intel/common/acpi/dptf/charger.asl @@ -9,7 +9,7 @@ Device (TCHG) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == One) { Return (0xF) } Else { Return (0x0) @@ -26,11 +26,11 @@ Device (TCHG) Method (PPPC) { /* Convert size of PPSS table to index */ - Store (SizeOf (\_SB.CHPS), Local0) - Decrement (Local0) + Local0 = SizeOf (\_SB.CHPS) + Local0-- /* Check if charging is disabled (AC removed) */ - If (LEqual (\_SB.PCI0.LPCB.EC0.ACEX, Zero)) { + If (\_SB.PCI0.LPCB.EC0.ACEX == 0) { /* Return last power state */ Return (Local0) } Else { @@ -45,8 +45,7 @@ Device (TCHG) Method (SPPC, 1) { /* Retrieve Control (index 4) for specified PPSS level */ - Store (DeRefOf (Index (DeRefOf (Index - (\_SB.CHPS, ToInteger (Arg0))), 4)), Local0) + Local0 = DeRefOf (DeRefOf (\_SB.CHPS[ToInteger (Arg0)])[4]) /* Pass Control value to EC to limit charging */ \_SB.PCI0.LPCB.EC0.CHGS (Local0) diff --git a/src/soc/intel/common/acpi/dptf/cpu.asl b/src/soc/intel/common/acpi/dptf/cpu.asl index 7f21006e42..13ad9601d6 100644 --- a/src/soc/intel/common/acpi/dptf/cpu.asl +++ b/src/soc/intel/common/acpi/dptf/cpu.asl @@ -13,7 +13,7 @@ Device (DPTF_CPU_DEVICE) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == 1) { Return (0xF) } Else { Return (0x0) @@ -73,8 +73,8 @@ Device (DPTF_CPU_DEVICE) Method (_TDL) { If (CondRefOf (\_SB.CP00._TSS)) { - Store (SizeOf (\_SB.CP00._TSS), Local0) - Decrement (Local0) + Local0 = SizeOf (\_SB.CP00._TSS) + Local0-- Return (Local0) } Else { Return (0) @@ -92,7 +92,7 @@ Device (DPTF_CPU_DEVICE) Method (SPPC, 1) { - Store (Arg0, \PPCM) + \PPCM = Arg0 /* Notify OS to re-read _PPC limit on each CPU */ \PPCN () @@ -117,8 +117,8 @@ Device (DPTF_CPU_DEVICE) If (CondRefOf (\_SB.MPDL)) { Return (\_SB.MPDL) } ElseIf (CondRefOf (\_SB.CP00._PSS)) { - Store (SizeOf (\_SB.CP00._PSS), Local0) - Decrement (Local0) + Local0 = SizeOf (\_SB.CP00._PSS) + Local0-- Return (Local0) } Else { Return (0) diff --git a/src/soc/intel/common/acpi/dptf/dptf.asl b/src/soc/intel/common/acpi/dptf/dptf.asl index 4a5cb96c3d..2219c686bf 100644 --- a/src/soc/intel/common/acpi/dptf/dptf.asl +++ b/src/soc/intel/common/acpi/dptf/dptf.asl @@ -24,7 +24,7 @@ Device (DPTF) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == 1) { Return (0xF) } Else { Return (0x0) @@ -41,7 +41,7 @@ Device (DPTF) Method (_OSC, 4, Serialized) { /* Check for Passive Policy UUID */ - If (LEqual (DeRefOf (Index (IDSP, 0)), Arg0)) { + If (DeRefOf (IDSP[0]) == Arg0) { /* Initialize Thermal Devices */ ^TINI () @@ -73,25 +73,25 @@ Device (DPTF) /* Convert from Degrees C to 1/10 Kelvin for ACPI */ Method (CTOK, 1) { /* 10th of Degrees C */ - Multiply (Arg0, 10, Local0) + Local0 = Arg0 * 10 /* Convert to Kelvin */ - Add (Local0, 2732, Local0) + Local0 += 2732 Return (Local0) } /* Convert from 1/10 Kelvin to Degrees C for ACPI */ Method (KTOC, 1) { - If (LLessEqual (Arg0, 2732)) { + If (Arg0 <= 2732) { Return (0) } /* Convert to Celsius */ - Subtract (Arg0, 2732, Local0) + Local0 = Arg0 - 2732 /* Convert from 10th of degrees */ - Divide (Local0, 10,, Local0) + Local0 /= 10 Return (Local0) } diff --git a/src/soc/intel/common/acpi/dptf/fan.asl b/src/soc/intel/common/acpi/dptf/fan.asl index 6d60c63136..4b399a3a42 100644 --- a/src/soc/intel/common/acpi/dptf/fan.asl +++ b/src/soc/intel/common/acpi/dptf/fan.asl @@ -32,19 +32,19 @@ Device (TFN1) Method (_FST, 0, Serialized,,PkgObj) { /* Fill in TFST with current control. */ - Store (\_SB.PCI0.LPCB.EC0.FAND, Index (TFST, 1)) + TFST[1] = \_SB.PCI0.LPCB.EC0.FAND Return (TFST) } /* _FSL: Fan Speed Level */ Method (_FSL, 1, Serialized) { - Store (Arg0, \_SB.PCI0.LPCB.EC0.FAND) + \_SB.PCI0.LPCB.EC0.FAND = Arg0 } Method (_STA) { - If (LEqual (\DPTE, One)) + If (\DPTE == 1) { Return (0xF) } Else { diff --git a/src/soc/intel/common/acpi/dptf/thermal.asl b/src/soc/intel/common/acpi/dptf/thermal.asl index d3fccd380f..448688849f 100644 --- a/src/soc/intel/common/acpi/dptf/thermal.asl +++ b/src/soc/intel/common/acpi/dptf/thermal.asl @@ -6,25 +6,25 @@ #if CONFIG(EC_SUPPORTS_DPTF_TEVT) Method (TEVT, 1, NotSerialized) { - Store (ToInteger (Arg0), Local0) + Local0 = ToInteger (Arg0) #ifdef DPTF_TSR0_SENSOR_ID - If (LEqual (Local0, DPTF_TSR0_SENSOR_ID)) { + If (Local0 == DPTF_TSR0_SENSOR_ID) { Notify (^TSR0, 0x90) } #endif #ifdef DPTF_TSR1_SENSOR_ID - If (LEqual (Local0, DPTF_TSR1_SENSOR_ID)) { + If (Local0 == DPTF_TSR1_SENSOR_ID) { Notify (^TSR1, 0x90) } #endif #ifdef DPTF_TSR2_SENSOR_ID - If (LEqual (Local0, DPTF_TSR2_SENSOR_ID)) { + If (Local0 == DPTF_TSR2_SENSOR_ID) { Notify (^TSR2, 0x90) } #endif #ifdef DPTF_TSR3_SENSOR_ID - If (LEqual (Local0, DPTF_TSR3_SENSOR_ID)) { + If (Local0 == DPTF_TSR3_SENSOR_ID) { Notify (^TSR3, 0x90) } #endif @@ -77,7 +77,7 @@ External (\_SB.PCI0.LPCB.EC0.RCDP, MethodObj) Method (DTRP, 2, Serialized) { If (CondRefOf (\_SB.PCI0.LPCB.EC0.RCDP)) { - If (LEqual (\_SB.PCI0.LPCB.EC0.RCDP, One)) { + If (\_SB.PCI0.LPCB.EC0.RCDP == 1) { Return (CTOK (Arg0)) } } @@ -104,7 +104,7 @@ Device (TSR0) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == 1) { Return (0xF) } Else { Return (0x0) @@ -213,7 +213,7 @@ Device (TSR1) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == 1) { Return (0xF) } Else { Return (0x0) @@ -322,7 +322,7 @@ Device (TSR2) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == 1) { Return (0xF) } Else { Return (0x0) @@ -431,7 +431,7 @@ Device (TSR3) Method (_STA) { - If (LEqual (\DPTE, One)) { + If (\DPTE == 1) { Return (0xF) } Else { Return (0x0) diff --git a/src/soc/intel/common/acpi/pci_osc.asl b/src/soc/intel/common/acpi/pci_osc.asl index 653c1d5894..7b2786ebc6 100644 --- a/src/soc/intel/common/acpi/pci_osc.asl +++ b/src/soc/intel/common/acpi/pci_osc.asl @@ -5,13 +5,13 @@ Scope (\_SB.PCI0) { Method (_OSC, 4) { /* Check for proper GUID */ - If (LEqual (Arg0, ToUUID (PCI_OSC_UUID))) { + If (Arg0 == ToUUID (PCI_OSC_UUID)) { /* Let OS control everything */ Return (Arg3) } Else { /* Unrecognized UUID */ CreateDWordField (Arg3, 0, CDW1) - Or (CDW1, 4, CDW1) + CDW1 |= 4 Return (Arg3) } } diff --git a/src/soc/intel/common/acpi/pcr.asl b/src/soc/intel/common/acpi/pcr.asl index 71d679ab73..81e496185a 100644 --- a/src/soc/intel/common/acpi/pcr.asl +++ b/src/soc/intel/common/acpi/pcr.asl @@ -19,7 +19,7 @@ Method (PCRB, 1, NotSerialized) */ Method (PCRR, 2, Serialized) { - OperationRegion (PCRD, SystemMemory, Add (PCRB (Arg0), Arg1), 4) + OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4) Field (PCRD, DWordAcc, NoLock, Preserve) { DATA, 32 @@ -35,12 +35,12 @@ Method (PCRR, 2, Serialized) */ Method (PCRA, 3, Serialized) { - OperationRegion (PCRD, SystemMemory, Add (PCRB (Arg0), Arg1), 4) + OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4) Field (PCRD, DWordAcc, NoLock, Preserve) { DATA, 32 } - And (DATA, Arg2, DATA) + DATA &= Arg2 /* * After every write one needs to read an innocuous register @@ -59,12 +59,12 @@ Method (PCRA, 3, Serialized) */ Method (PCRO, 3, Serialized) { - OperationRegion (PCRD, SystemMemory, Add (PCRB (Arg0), Arg1), 4) + OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4) Field (PCRD, DWordAcc, NoLock, Preserve) { DATA, 32 } - Or (DATA, Arg2, DATA) + DATA |= Arg2 /* * After every write one needs to read an innocuous register diff --git a/src/soc/intel/common/acpi/platform.asl b/src/soc/intel/common/acpi/platform.asl index 39a7b3a9ef..a973149e6d 100644 --- a/src/soc/intel/common/acpi/platform.asl +++ b/src/soc/intel/common/acpi/platform.asl @@ -22,7 +22,7 @@ Field (POST, ByteAcc, Lock, Preserve) Method (_PTS, 1) { - Store (POST_OS_ENTER_PTS, DBG0) + DBG0 = POST_OS_ENTER_PTS If (CondRefOf (\_SB.MPTS)) { @@ -42,7 +42,7 @@ Method (_PTS, 1) Method (_WAK, 1) { - Store (POST_OS_ENTER_WAKE, DBG0) + DBG0 = POST_OS_ENTER_WAKE If (CondRefOf (\_SB.MWAK)) { diff --git a/src/soc/intel/common/acpi/sgx.asl b/src/soc/intel/common/acpi/sgx.asl index 4f47cf44e4..c0b8040729 100644 --- a/src/soc/intel/common/acpi/sgx.asl +++ b/src/soc/intel/common/acpi/sgx.asl @@ -37,15 +37,15 @@ Scope(\_SB) CreateQwordField (RBUF, ^BAR0._MIN, EMIN) CreateQwordField (RBUF, ^BAR0._MAX, EMAX) CreateQwordField (RBUF, ^BAR0._LEN, ELEN) - Store (EMNA, EMIN) - Store (ELNG, ELEN) - Subtract (Add (EMNA, ELNG), 1, EMAX) + EMIN = EMNA + ELEN = ELNG + EMAX = EMNA + ELNG - 1 Return (RBUF) } Method (_STA, 0x0, NotSerialized) { - If (LNotEqual (EPCS, 0)) + If (EPCS != 0) { Return (0xF) } diff --git a/src/soc/intel/common/acpi/wifi.asl b/src/soc/intel/common/acpi/wifi.asl index 31bf994402..23923a5c18 100644 --- a/src/soc/intel/common/acpi/wifi.asl +++ b/src/soc/intel/common/acpi/wifi.asl @@ -18,7 +18,7 @@ Device (WIFI) }) Method(WRDD,0,Serialized) { - Store(\CID1,Index (DeRefOf (Index (WRDX, 1)), 1)) // Country identifier + DeRefOf (WRDX[1])[1] = \CID1 // Country identifier Return(WRDX) } -- cgit v1.2.3