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)
{
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 */

View file

@ -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)

View file

@ -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)

View file

@ -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)
}

View file

@ -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 {

View file

@ -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)

View file

@ -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)
}
}

View file

@ -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

View file

@ -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))
{

View file

@ -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)
}

View file

@ -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)
}