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

View File

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