mb/google/cyan/var/terra: Convert to ASL 2.0

Change-Id: Ice6158943c61b3e2156a2ebbf96aa73e7cf87a7e
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50320
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes HAOUAS 2021-02-05 19:57:01 +01:00 committed by Patrick Georgi
parent a24efbcb96
commit e7fc29740b
2 changed files with 19 additions and 21 deletions

View File

@ -9,7 +9,7 @@ Device (TCHG)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@ -19,7 +19,7 @@ Device (TCHG)
/* Return charger performance states defined by Terra2 or Terra3 mainboard */ /* Return charger performance states defined by Terra2 or Terra3 mainboard */
Method (PPSS) Method (PPSS)
{ {
If (LEqual (\_SB.GPID, TERRA2_PROJECT_ID)) If (\_SB.GPID == TERRA2_PROJECT_ID)
{ {
Return (\_SB.CPT2) Return (\_SB.CPT2)
} Else { } Else {
@ -31,17 +31,17 @@ Device (TCHG)
Method (PPPC) Method (PPPC)
{ {
/* Convert size of PPSS table to index */ /* Convert size of PPSS table to index */
If (LEqual (\_SB.GPID, TERRA2_PROJECT_ID)) If (\_SB.GPID == TERRA2_PROJECT_ID)
{ {
Store (SizeOf (\_SB.CPT2), Local0) Local0 = SizeOf (\_SB.CPT2)
} Else { } Else {
Store (SizeOf (\_SB.CPT3), Local0) Local0 = SizeOf (\_SB.CPT3)
} }
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 {
@ -57,13 +57,11 @@ Device (TCHG)
{ {
/* Retrieve Control (index 4) for specified PPSS level */ /* Retrieve Control (index 4) for specified PPSS level */
/* Convert size of PPSS table to index */ /* Convert size of PPSS table to index */
If (LEqual (\_SB.GPID, TERRA2_PROJECT_ID)) If (\_SB.GPID == TERRA2_PROJECT_ID)
{ {
Store (DeRefOf (Index (DeRefOf (Index Local0 = DeRefOf (DeRefOf (\_SB.CPT2 [ToInteger (Arg0)])[4])
(\_SB.CPT2, ToInteger (Arg0))), 4)), Local0)
} Else { } Else {
Store (DeRefOf (Index (DeRefOf (Index Local0 = DeRefOf (DeRefOf (\_SB.CPT3 [ToInteger (Arg0)])[4])
(\_SB.CPT3, ToInteger (Arg0))), 4)), Local0)
} }
/* Pass Control value to EC to limit charging */ /* Pass Control value to EC to limit charging */

View File

@ -40,7 +40,7 @@ Device (B0DB)
Method (_STA) Method (_STA)
{ {
If (LEqual (\DPTE, One)) { If (\DPTE == 1) {
Return (0xF) Return (0xF)
} Else { } Else {
Return (0x0) Return (0x0)
@ -100,8 +100,8 @@ Device (B0DB)
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)
@ -119,7 +119,7 @@ Device (B0DB)
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 ()
@ -143,8 +143,8 @@ Device (B0DB)
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)
@ -154,7 +154,7 @@ Device (B0DB)
/* Return PPCC table defined by Terra2 or Terra3 mainboard */ /* Return PPCC table defined by Terra2 or Terra3 mainboard */
Method (PPCC) Method (PPCC)
{ {
If (LEqual (\_SB.GPID, TERRA2_PROJECT_ID)) If (\_SB.GPID == TERRA2_PROJECT_ID)
{ {
Return (\_SB.PPT2) Return (\_SB.PPT2)
} Else { } Else {
@ -165,7 +165,7 @@ Device (B0DB)
/* Return critical thermal point defined by Terra2 or Terra3 mainboard */ /* Return critical thermal point defined by Terra2 or Terra3 mainboard */
Method (_CRT) Method (_CRT)
{ {
If (Lequal(\_SB.GPID, TERRA2_PROJECT_ID)) If (\_SB.GPID == TERRA2_PROJECT_ID)
{ {
Return (\_SB.DPTF.CTOK(DPTF_TERRA2_CPU_CRITICAL)) Return (\_SB.DPTF.CTOK(DPTF_TERRA2_CPU_CRITICAL))
} Else { } Else {
@ -176,7 +176,7 @@ Device (B0DB)
/* Return passive thermal point defined by Terra2 or Terra3 mainboard */ /* Return passive thermal point defined by Terra2 or Terra3 mainboard */
Method (_PSV) Method (_PSV)
{ {
If (Lequal(\_SB.GPID, TERRA2_PROJECT_ID)) If (\_SB.GPID == TERRA2_PROJECT_ID)
{ {
Return (\_SB.DPTF.CTOK(DPTF_TERRA2_CPU_PASSIVE)) Return (\_SB.DPTF.CTOK(DPTF_TERRA2_CPU_PASSIVE))
} Else { } Else {