Patrick Georgi submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved
mb/google/beltino: Convert to ASL 2.0 syntax

Built google/beltino (Monroe) provides identical 'dsdt.dsl'.

Change-Id: I12b6a8264e53ece30ae79da2d79c6f1d302fb357
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46170
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
---
M src/mainboard/google/beltino/acpi/mainboard.asl
M src/mainboard/google/beltino/acpi/thermal.asl
2 files changed, 57 insertions(+), 67 deletions(-)

diff --git a/src/mainboard/google/beltino/acpi/mainboard.asl b/src/mainboard/google/beltino/acpi/mainboard.asl
index 3049dbe..10696ff 100644
--- a/src/mainboard/google/beltino/acpi/mainboard.asl
+++ b/src/mainboard/google/beltino/acpi/mainboard.asl
@@ -14,9 +14,9 @@

Method (_DSW, 3, NotSerialized)
{
- Store (NIC_WAKE_GPIO, Local0)
+ Local0 = NIC_WAKE_GPIO

- If (LEqual (Arg0, 1)) {
+ If (Arg0 == 1) {
// Enable GPIO as wake source
\_SB.PCI0.LPCB.GWAK (Local0)
}
@@ -36,9 +36,9 @@

Method (_DSW, 3, NotSerialized)
{
- Store (WLAN_WAKE_GPIO, Local0)
+ Local0 = WLAN_WAKE_GPIO

- If (LEqual (Arg0, 1)) {
+ If (Arg0 == 1) {
// Enable GPIO as wake source
\_SB.PCI0.LPCB.GWAK (Local0)
}
diff --git a/src/mainboard/google/beltino/acpi/thermal.asl b/src/mainboard/google/beltino/acpi/thermal.asl
index 1292af4..96acaeb 100644
--- a/src/mainboard/google/beltino/acpi/thermal.asl
+++ b/src/mainboard/google/beltino/acpi/thermal.asl
@@ -23,10 +23,10 @@
// 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)
}
@@ -52,66 +52,66 @@
// Start fan at state 4 = lowest temp state
Method (_INI)
{
- Store (4, \FLVL)
- Store (FAN4_PWM, \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ \FLVL = 4
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
Notify (\_TZ.THRM, 0x81)
}

Method (TCHK, 0, Serialized)
{
// Get CPU Temperature from PECI via SuperIO TMPIN3
- Store (\_SB.PCI0.LPCB.SIO.ENVC.TIN3, Local0)
+ Local0 = \_SB.PCI0.LPCB.SIO.ENVC.TIN3

// Check for "no reading available"
- If (LEqual (Local0, 0x80)) {
+ If (Local0 == 0x80) {
Return (CTOK (FAN0_THRESHOLD_ON))
}

// Check for invalid readings
- If (LOr (LEqual (Local0, 255), LEqual (Local0, 0))) {
+ If ((Local0 == 255) || (Local0 == 0)) {
Return (CTOK (FAN0_THRESHOLD_ON))
}

// PECI raw value is an offset from Tj_max
- Subtract (255, Local0, Local1)
+ Local1 = 255 - Local0

// Handle values greater than Tj_max
- If (LGreaterEqual (Local1, \TMAX)) {
+ If (Local1 >= \TMAX) {
Return (CTOK (\TMAX))
}

// Subtract from Tj_max to get temperature
- Subtract (\TMAX, Local1, Local0)
+ Local0 = \TMAX - Local1
Return (CTOK (Local0))
}

Method (_TMP, 0, Serialized)
{
// Get temperature from SuperIO in deci-kelvin
- Store (TCHK (), Local0)
+ Local0 = TCHK ()

// Critical temperature in deci-kelvin
- Store (CTOK (\TMAX), Local1)
+ Local1 = CTOK (\TMAX)

- If (LGreaterEqual (Local0, Local1)) {
- Store ("CRITICAL TEMPERATURE", Debug)
- Store (Local0, Debug)
+ If (Local0 >= Local1) {
+ Debug = "CRITICAL TEMPERATURE"
+ Debug = Local0

// Wait 1 second for SuperIO to re-poll
Sleep (1000)

// Re-read temperature from SuperIO
- Store (TCHK (), Local0)
+ Local0 = TCHK ()

- Store ("RE-READ TEMPERATURE", Debug)
- Store (Local0, Debug)
+ Debug = "RE-READ TEMPERATURE"
+ Debug = Local0
}

Return (Local0)
}

Method (_AC0) {
- If (LLessEqual (\FLVL, 0)) {
+ If (\FLVL <= 0) {
Return (CTOK (FAN0_THRESHOLD_OFF))
} Else {
Return (CTOK (FAN0_THRESHOLD_ON))
@@ -119,7 +119,7 @@
}

Method (_AC1) {
- If (LLessEqual (\FLVL, 1)) {
+ If (\FLVL <= 1) {
Return (CTOK (FAN1_THRESHOLD_OFF))
} Else {
Return (CTOK (FAN1_THRESHOLD_ON))
@@ -127,7 +127,7 @@
}

Method (_AC2) {
- If (LLessEqual (\FLVL, 2)) {
+ If (\FLVL <= 2) {
Return (CTOK (FAN2_THRESHOLD_OFF))
} Else {
Return (CTOK (FAN2_THRESHOLD_ON))
@@ -135,7 +135,7 @@
}

Method (_AC3) {
- If (LLessEqual (\FLVL, 3)) {
+ If (\FLVL <= 3) {
Return (CTOK (FAN3_THRESHOLD_OFF))
} Else {
Return (CTOK (FAN3_THRESHOLD_ON))
@@ -143,7 +143,7 @@
}

Method (_AC4) {
- If (LLessEqual (\FLVL, 4)) {
+ If (\FLVL <= 4) {
Return (CTOK (FAN4_THRESHOLD_OFF))
} Else {
Return (CTOK (FAN4_THRESHOLD_ON))
@@ -159,25 +159,23 @@
PowerResource (FNP0, 0, 0)
{
Method (_STA) {
- If (LLessEqual (\FLVL, 0)) {
+ If (\FLVL <= 0) {
Return (One)
} Else {
Return (Zero)
}
}
Method (_ON) {
- If (LNot (_STA ())) {
- Store (0, \FLVL)
- Store (FAN0_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ If (!_STA ()) {
+ \FLVL = 0
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN0_PWM
Notify (\_TZ.THRM, 0x81)
}
}
Method (_OFF) {
If (_STA ()) {
- Store (1, \FLVL)
- Store (FAN1_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ \FLVL = 1
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN1_PWM
Notify (\_TZ.THRM, 0x81)
}
}
@@ -186,25 +184,23 @@
PowerResource (FNP1, 0, 0)
{
Method (_STA) {
- If (LLessEqual (\FLVL, 1)) {
+ If (\FLVL <= 1) {
Return (One)
} Else {
Return (Zero)
}
}
Method (_ON) {
- If (LNot (_STA ())) {
- Store (1, \FLVL)
- Store (FAN1_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ If (!_STA ()) {
+ \FLVL = 1
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN1_PWM
Notify (\_TZ.THRM, 0x81)
}
}
Method (_OFF) {
If (_STA ()) {
- Store (2, \FLVL)
- Store (FAN2_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ \FLVL = 2
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN2_PWM
Notify (\_TZ.THRM, 0x81)
}
}
@@ -213,25 +209,23 @@
PowerResource (FNP2, 0, 0)
{
Method (_STA) {
- If (LLessEqual (\FLVL, 2)) {
+ If (\FLVL <= 2) {
Return (One)
} Else {
Return (Zero)
}
}
Method (_ON) {
- If (LNot (_STA ())) {
- Store (2, \FLVL)
- Store (FAN2_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ If (!_STA ()) {
+ \FLVL = 2
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN2_PWM
Notify (\_TZ.THRM, 0x81)
}
}
Method (_OFF) {
If (_STA ()) {
- Store (3, \FLVL)
- Store (FAN3_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ \FLVL = 3
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN3_PWM
Notify (\_TZ.THRM, 0x81)
}
}
@@ -240,25 +234,23 @@
PowerResource (FNP3, 0, 0)
{
Method (_STA) {
- If (LLessEqual (\FLVL, 3)) {
+ If (\FLVL <= 3) {
Return (One)
} Else {
Return (Zero)
}
}
Method (_ON) {
- If (LNot (_STA ())) {
- Store (3, \FLVL)
- Store (FAN3_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ If (!_STA ()) {
+ \FLVL = 3
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN3_PWM
Notify (\_TZ.THRM, 0x81)
}
}
Method (_OFF) {
If (_STA ()) {
- Store (4, \FLVL)
- Store (FAN4_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ \FLVL = 4
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
Notify (\_TZ.THRM, 0x81)
}
}
@@ -267,25 +259,23 @@
PowerResource (FNP4, 0, 0)
{
Method (_STA) {
- If (LLessEqual (\FLVL, 4)) {
+ If (\FLVL <= 4) {
Return (One)
} Else {
Return (Zero)
}
}
Method (_ON) {
- If (LNot (_STA ())) {
- Store (4, \FLVL)
- Store (FAN4_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ If (!_STA ()) {
+ \FLVL = 4
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
Notify (\_TZ.THRM, 0x81)
}
}
Method (_OFF) {
If (_STA ()) {
- Store (4, \FLVL)
- Store (FAN4_PWM,
- \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
+ \FLVL = 4
+ \_SB.PCI0.LPCB.SIO.ENVC.F2PS = FAN4_PWM
Notify (\_TZ.THRM, 0x81)
}
}

To view, visit change 46170. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I12b6a8264e53ece30ae79da2d79c6f1d302fb357
Gerrit-Change-Number: 46170
Gerrit-PatchSet: 3
Gerrit-Owner: HAOUAS Elyes <ehaouas@noos.fr>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged