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 <alexey.buyanov@intel.com>
Change-Id: I8f95cf88f499d9f9bdd8c80c95af52f8fd886cdf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42083
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: V Sowmya <v.sowmya@intel.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Alexey Buyanov
2020-06-01 21:41:14 -07:00
committed by Subrata Banik
parent e334fea94b
commit 03248033e7
11 changed files with 76 additions and 77 deletions

View File

@@ -8,14 +8,14 @@ Name (UFLG, CONFIG(CONSOLE_SERIAL))
Method (LURT, 1, Serialized) Method (LURT, 1, Serialized)
{ {
If (LEqual(Arg0, 0)) { /* 0 = 0x3f8 */ If (Arg0 == 0) { /* 0 = 0x3f8 */
Store (0x3f8, Local0) Local0 = 0x3f8
} ElseIf (LEqual(Arg0, 1)) { /* 1 = 0x2f8 */ } ElseIf (Arg0 == 1) { /* 1 = 0x2f8 */
Store (0x2f8, Local0) Local0 = 0x2f8
} ElseIf (LEqual(Arg0, 2)) { /* 2 = 0x3e8 */ } ElseIf (Arg0 == 2) { /* 2 = 0x3e8 */
Store (0x3e8, Local0) Local0 = 0x3e8
} ElseIf (LEqual(Arg0, 3)) { /* 3 = 0x2e8 */ } ElseIf (Arg0 == 3) { /* 3 = 0x2e8 */
Store (0x2e8, Local0) Local0 = 0x2e8
} }
Return (Local0) Return (Local0)
} }
@@ -27,22 +27,22 @@ Method (APRT, 1, Serialized)
Name(LENG, 0) Name(LENG, 0)
Name(ADBG, Buffer(256) {0}) Name(ADBG, Buffer(256) {0})
If (LEqual(ObjectType(Arg0), 1)) { /* Integer */ If (ObjectType(Arg0) == 1) { /* Integer */
ToHexString(Arg0, Local0) ToHexString(Arg0, Local0)
Store(Local0, ADBG) ADBG = Local0
} ElseIf (LEqual(ObjectType(Arg0), 2)) { /* String */ } ElseIf (ObjectType(Arg0) == 2) { /* String */
Store(Arg0, ADBG) ADBG = Arg0
} ElseIf (LEqual(ObjectType(Arg0), 3)) { /* Buffer */ } ElseIf (ObjectType(Arg0) == 3) { /* Buffer */
ToHexString(Arg0, ADBG) ToHexString(Arg0, ADBG)
} Else { } 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) #if CONFIG(DRIVERS_UART_8250MEM_32)
OperationRegion (UBAR, SystemMemory, OperationRegion (UBAR, SystemMemory,
@@ -75,33 +75,33 @@ Method (APRT, 1, Serialized)
} }
#endif #endif
If (LEqual(UFLG, 0)) { If (UFLG == 0) {
/* Enable Baud Rate Divisor Latch, Set Word length to 8 bit*/ /* Enable Baud Rate Divisor Latch, Set Word length to 8 bit*/
Store (0x83, LCR) LCR = 0x83
Store (0x01, IIR) IIR = 0x01
Store (0x03, MCR) MCR = 0x03
/* Configure baud rate to 115200 */ /* Configure baud rate to 115200 */
Store (0x01, TDR) TDR = 0x01
Store (0x00, IER) IER = 0x00
Store (0x03, LCR) /* Disable Baud Rate Divisor Latch */ LCR = 0x03 /* Disable Baud Rate Divisor Latch */
Increment (UFLG) UFLG++
} }
Store (0x00, INDX) INDX = 0x00
While (LLess (INDX, LENG)) While (INDX < LENG)
{ {
/* Wait for the transmitter t to be ready */ /* Wait for the transmitter t to be ready */
While (1) While (1)
{ {
And (LSR, 0x20, OPDT) OPDT = LSR & 0x20
If (LNotEqual(OPDT, 0)) If (OPDT != 0)
{ {
Break Break
} }
} }
Store (DeRefOf (Index (ADBG, INDX)), TDR) TDR = DeRefOf (ADBG[INDX])
Increment(INDX) INDX++
} }
} /* End of APRT */ } /* End of APRT */

View File

@@ -9,7 +9,7 @@ Device (TCHG)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == One) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@@ -26,11 +26,11 @@ Device (TCHG)
Method (PPPC) Method (PPPC)
{ {
/* Convert size of PPSS table to index */ /* Convert size of PPSS table to index */
Store (SizeOf (\_SB.CHPS), Local0) Local0 = SizeOf (\_SB.CHPS)
Decrement (Local0) Local0--
/* Check if charging is disabled (AC removed) */ /* 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 last power state */
Return (Local0) Return (Local0)
} Else { } Else {
@@ -45,8 +45,7 @@ Device (TCHG)
Method (SPPC, 1) Method (SPPC, 1)
{ {
/* Retrieve Control (index 4) for specified PPSS level */ /* Retrieve Control (index 4) for specified PPSS level */
Store (DeRefOf (Index (DeRefOf (Index Local0 = DeRefOf (DeRefOf (\_SB.CHPS[ToInteger (Arg0)])[4])
(\_SB.CHPS, ToInteger (Arg0))), 4)), Local0)
/* Pass Control value to EC to limit charging */ /* Pass Control value to EC to limit charging */
\_SB.PCI0.LPCB.EC0.CHGS (Local0) \_SB.PCI0.LPCB.EC0.CHGS (Local0)

View File

@@ -13,7 +13,7 @@ Device (DPTF_CPU_DEVICE)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@@ -73,8 +73,8 @@ Device (DPTF_CPU_DEVICE)
Method (_TDL) Method (_TDL)
{ {
If (CondRefOf (\_SB.CP00._TSS)) { If (CondRefOf (\_SB.CP00._TSS)) {
Store (SizeOf (\_SB.CP00._TSS), Local0) Local0 = SizeOf (\_SB.CP00._TSS)
Decrement (Local0) Local0--
Return (Local0) Return (Local0)
} Else { } Else {
Return (0) Return (0)
@@ -92,7 +92,7 @@ Device (DPTF_CPU_DEVICE)
Method (SPPC, 1) Method (SPPC, 1)
{ {
Store (Arg0, \PPCM) \PPCM = Arg0
/* Notify OS to re-read _PPC limit on each CPU */ /* Notify OS to re-read _PPC limit on each CPU */
\PPCN () \PPCN ()
@@ -117,8 +117,8 @@ Device (DPTF_CPU_DEVICE)
If (CondRefOf (\_SB.MPDL)) { If (CondRefOf (\_SB.MPDL)) {
Return (\_SB.MPDL) Return (\_SB.MPDL)
} ElseIf (CondRefOf (\_SB.CP00._PSS)) { } ElseIf (CondRefOf (\_SB.CP00._PSS)) {
Store (SizeOf (\_SB.CP00._PSS), Local0) Local0 = SizeOf (\_SB.CP00._PSS)
Decrement (Local0) Local0--
Return (Local0) Return (Local0)
} Else { } Else {
Return (0) Return (0)

View File

@@ -24,7 +24,7 @@ Device (DPTF)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@@ -41,7 +41,7 @@ Device (DPTF)
Method (_OSC, 4, Serialized) Method (_OSC, 4, Serialized)
{ {
/* Check for Passive Policy UUID */ /* Check for Passive Policy UUID */
If (LEqual (DeRefOf (Index (IDSP, 0)), Arg0)) { If (DeRefOf (IDSP[0]) == Arg0) {
/* Initialize Thermal Devices */ /* Initialize Thermal Devices */
^TINI () ^TINI ()
@@ -73,25 +73,25 @@ Device (DPTF)
/* Convert from Degrees C to 1/10 Kelvin for ACPI */ /* Convert from Degrees C to 1/10 Kelvin for ACPI */
Method (CTOK, 1) { Method (CTOK, 1) {
/* 10th of Degrees C */ /* 10th of Degrees C */
Multiply (Arg0, 10, Local0) Local0 = Arg0 * 10
/* Convert to Kelvin */ /* Convert to Kelvin */
Add (Local0, 2732, Local0) Local0 += 2732
Return (Local0) Return (Local0)
} }
/* Convert from 1/10 Kelvin to Degrees C for ACPI */ /* Convert from 1/10 Kelvin to Degrees C for ACPI */
Method (KTOC, 1) { Method (KTOC, 1) {
If (LLessEqual (Arg0, 2732)) { If (Arg0 <= 2732) {
Return (0) Return (0)
} }
/* Convert to Celsius */ /* Convert to Celsius */
Subtract (Arg0, 2732, Local0) Local0 = Arg0 - 2732
/* Convert from 10th of degrees */ /* Convert from 10th of degrees */
Divide (Local0, 10,, Local0) Local0 /= 10
Return (Local0) Return (Local0)
} }

View File

@@ -32,19 +32,19 @@ Device (TFN1)
Method (_FST, 0, Serialized,,PkgObj) Method (_FST, 0, Serialized,,PkgObj)
{ {
/* Fill in TFST with current control. */ /* Fill in TFST with current control. */
Store (\_SB.PCI0.LPCB.EC0.FAND, Index (TFST, 1)) TFST[1] = \_SB.PCI0.LPCB.EC0.FAND
Return (TFST) Return (TFST)
} }
/* _FSL: Fan Speed Level */ /* _FSL: Fan Speed Level */
Method (_FSL, 1, Serialized) Method (_FSL, 1, Serialized)
{ {
Store (Arg0, \_SB.PCI0.LPCB.EC0.FAND) \_SB.PCI0.LPCB.EC0.FAND = Arg0
} }
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) If (\DPTE == 1)
{ {
Return (0xF) Return (0xF)
} Else { } Else {

View File

@@ -6,25 +6,25 @@
#if CONFIG(EC_SUPPORTS_DPTF_TEVT) #if CONFIG(EC_SUPPORTS_DPTF_TEVT)
Method (TEVT, 1, NotSerialized) Method (TEVT, 1, NotSerialized)
{ {
Store (ToInteger (Arg0), Local0) Local0 = ToInteger (Arg0)
#ifdef DPTF_TSR0_SENSOR_ID #ifdef DPTF_TSR0_SENSOR_ID
If (LEqual (Local0, DPTF_TSR0_SENSOR_ID)) { If (Local0 == DPTF_TSR0_SENSOR_ID) {
Notify (^TSR0, 0x90) Notify (^TSR0, 0x90)
} }
#endif #endif
#ifdef DPTF_TSR1_SENSOR_ID #ifdef DPTF_TSR1_SENSOR_ID
If (LEqual (Local0, DPTF_TSR1_SENSOR_ID)) { If (Local0 == DPTF_TSR1_SENSOR_ID) {
Notify (^TSR1, 0x90) Notify (^TSR1, 0x90)
} }
#endif #endif
#ifdef DPTF_TSR2_SENSOR_ID #ifdef DPTF_TSR2_SENSOR_ID
If (LEqual (Local0, DPTF_TSR2_SENSOR_ID)) { If (Local0 == DPTF_TSR2_SENSOR_ID) {
Notify (^TSR2, 0x90) Notify (^TSR2, 0x90)
} }
#endif #endif
#ifdef DPTF_TSR3_SENSOR_ID #ifdef DPTF_TSR3_SENSOR_ID
If (LEqual (Local0, DPTF_TSR3_SENSOR_ID)) { If (Local0 == DPTF_TSR3_SENSOR_ID) {
Notify (^TSR3, 0x90) Notify (^TSR3, 0x90)
} }
#endif #endif
@@ -77,7 +77,7 @@ External (\_SB.PCI0.LPCB.EC0.RCDP, MethodObj)
Method (DTRP, 2, Serialized) Method (DTRP, 2, Serialized)
{ {
If (CondRefOf (\_SB.PCI0.LPCB.EC0.RCDP)) { 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)) Return (CTOK (Arg0))
} }
} }
@@ -104,7 +104,7 @@ Device (TSR0)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@@ -213,7 +213,7 @@ Device (TSR1)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@@ -322,7 +322,7 @@ Device (TSR2)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@@ -431,7 +431,7 @@ Device (TSR3)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)

View File

@@ -5,13 +5,13 @@
Scope (\_SB.PCI0) { Scope (\_SB.PCI0) {
Method (_OSC, 4) { Method (_OSC, 4) {
/* Check for proper GUID */ /* Check for proper GUID */
If (LEqual (Arg0, ToUUID (PCI_OSC_UUID))) { If (Arg0 == ToUUID (PCI_OSC_UUID)) {
/* Let OS control everything */ /* Let OS control everything */
Return (Arg3) Return (Arg3)
} Else { } Else {
/* Unrecognized UUID */ /* Unrecognized UUID */
CreateDWordField (Arg3, 0, CDW1) CreateDWordField (Arg3, 0, CDW1)
Or (CDW1, 4, CDW1) CDW1 |= 4
Return (Arg3) Return (Arg3)
} }
} }

View File

@@ -19,7 +19,7 @@ Method (PCRB, 1, NotSerialized)
*/ */
Method (PCRR, 2, Serialized) Method (PCRR, 2, Serialized)
{ {
OperationRegion (PCRD, SystemMemory, Add (PCRB (Arg0), Arg1), 4) OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4)
Field (PCRD, DWordAcc, NoLock, Preserve) Field (PCRD, DWordAcc, NoLock, Preserve)
{ {
DATA, 32 DATA, 32
@@ -35,12 +35,12 @@ Method (PCRR, 2, Serialized)
*/ */
Method (PCRA, 3, 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) Field (PCRD, DWordAcc, NoLock, Preserve)
{ {
DATA, 32 DATA, 32
} }
And (DATA, Arg2, DATA) DATA &= Arg2
/* /*
* After every write one needs to read an innocuous register * After every write one needs to read an innocuous register
@@ -59,12 +59,12 @@ Method (PCRA, 3, Serialized)
*/ */
Method (PCRO, 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) Field (PCRD, DWordAcc, NoLock, Preserve)
{ {
DATA, 32 DATA, 32
} }
Or (DATA, Arg2, DATA) DATA |= Arg2
/* /*
* After every write one needs to read an innocuous register * After every write one needs to read an innocuous register

View File

@@ -22,7 +22,7 @@ Field (POST, ByteAcc, Lock, Preserve)
Method (_PTS, 1) Method (_PTS, 1)
{ {
Store (POST_OS_ENTER_PTS, DBG0) DBG0 = POST_OS_ENTER_PTS
If (CondRefOf (\_SB.MPTS)) If (CondRefOf (\_SB.MPTS))
{ {
@@ -42,7 +42,7 @@ Method (_PTS, 1)
Method (_WAK, 1) Method (_WAK, 1)
{ {
Store (POST_OS_ENTER_WAKE, DBG0) DBG0 = POST_OS_ENTER_WAKE
If (CondRefOf (\_SB.MWAK)) If (CondRefOf (\_SB.MWAK))
{ {

View File

@@ -37,15 +37,15 @@ Scope(\_SB)
CreateQwordField (RBUF, ^BAR0._MIN, EMIN) CreateQwordField (RBUF, ^BAR0._MIN, EMIN)
CreateQwordField (RBUF, ^BAR0._MAX, EMAX) CreateQwordField (RBUF, ^BAR0._MAX, EMAX)
CreateQwordField (RBUF, ^BAR0._LEN, ELEN) CreateQwordField (RBUF, ^BAR0._LEN, ELEN)
Store (EMNA, EMIN) EMIN = EMNA
Store (ELNG, ELEN) ELEN = ELNG
Subtract (Add (EMNA, ELNG), 1, EMAX) EMAX = EMNA + ELNG - 1
Return (RBUF) Return (RBUF)
} }
Method (_STA, 0x0, NotSerialized) Method (_STA, 0x0, NotSerialized)
{ {
If (LNotEqual (EPCS, 0)) If (EPCS != 0)
{ {
Return (0xF) Return (0xF)
} }

View File

@@ -18,7 +18,7 @@ Device (WIFI)
}) })
Method(WRDD,0,Serialized) Method(WRDD,0,Serialized)
{ {
Store(\CID1,Index (DeRefOf (Index (WRDX, 1)), 1)) // Country identifier DeRefOf (WRDX[1])[1] = \CID1 // Country identifier
Return(WRDX) Return(WRDX)
} }