aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/acpi/dptf
diff options
context:
space:
mode:
authorAlexey Buyanov <alexey.buyanov@intel.com>2020-06-01 21:41:14 -0700
committerSubrata Banik <subrata.banik@intel.com>2020-06-13 09:03:32 +0000
commit03248033e7be6f81ad5b60ed21a60071aee32c67 (patch)
treeed158e24bf2808c7ed1546418f23754f5857fbfb /src/soc/intel/common/acpi/dptf
parente334fea94b126760cf34f93131a884886a6de3a7 (diff)
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>
Diffstat (limited to 'src/soc/intel/common/acpi/dptf')
-rw-r--r--src/soc/intel/common/acpi/dptf/charger.asl11
-rw-r--r--src/soc/intel/common/acpi/dptf/cpu.asl12
-rw-r--r--src/soc/intel/common/acpi/dptf/dptf.asl14
-rw-r--r--src/soc/intel/common/acpi/dptf/fan.asl6
-rw-r--r--src/soc/intel/common/acpi/dptf/thermal.asl20
5 files changed, 31 insertions, 32 deletions
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)