Sean Rhodes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56316 )
Change subject: ec/starlabs: Add model-specifc Q-events ......................................................................
ec/starlabs: Add model-specifc Q-events
Add different methods use by different models in the same EC.
Signed-off-by: Sean Rhodes sean@starlabs.systems Change-Id: Ie896788ccc1b67fa9b7f0f4e3af5f0a20f022a15 --- M src/ec/starlabs/it8987/acpi/ac.asl M src/ec/starlabs/it8987/acpi/ec.asl M src/ec/starlabs/it8987/acpi/hid.asl M src/ec/starlabs/it8987/acpi/keyboard.asl M src/ec/starlabs/it8987/acpi/lid.asl 5 files changed, 55 insertions(+), 101 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/56316/1
diff --git a/src/ec/starlabs/it8987/acpi/ac.asl b/src/ec/starlabs/it8987/acpi/ac.asl index 97ae147..d55724a 100644 --- a/src/ec/starlabs/it8987/acpi/ac.asl +++ b/src/ec/starlabs/it8987/acpi/ac.asl @@ -32,7 +32,11 @@ } }
+#if CONFIG(BOARD_STARLABS_LABTOP_KBL) +Method (_Q0A, 0, NotSerialized) // AC Power Connected +#else Method (_QA0, 0, NotSerialized) // AC Power Connected +#endif { If (ECWR & 0x01) { @@ -43,18 +47,12 @@ \PWRS = 0 }
- // 500ms delay - Not used in coreboot - // Sleep (500) Notify (BAT0, 0x81) - // Sleep (500) Notify (ADP1, 0x80) }
Method(_Q0B, 0, NotSerialized) // Battery Connected { - // 500ms delay - Not used in coreboot - // Sleep (500) Notify (BAT0, 0x81) - // Sleep (500) Notify (BAT0, 0x80) } diff --git a/src/ec/starlabs/it8987/acpi/ec.asl b/src/ec/starlabs/it8987/acpi/ec.asl index 451cdf1..cf97446 100644 --- a/src/ec/starlabs/it8987/acpi/ec.asl +++ b/src/ec/starlabs/it8987/acpi/ec.asl @@ -102,16 +102,13 @@ Return (0x00) }
- Name (ECOK, Zero) Method(_REG, 2, NotSerialized) { If ((Arg0 == 0x03) && (Arg1 == 0x01)) { - ECOS = 1 ECAV = 1
// Unconditionally fix up the Battery and Power State. - // Initialize the Number of Present Batteries. // 1 = Real Battery 1 is present // 2 = Real Battery 2 is present @@ -119,9 +116,6 @@ BNUM = 0 BNUM |= ((ECRD (RefOf (ECWR)) & 0x02) >> 1)
- // Save the current Power State for later. - // Store (PWRS, Local0) - // Initialize the Power State. // BNUM = 0 = Virtual Power State // BNUM > 0 = Real Power State @@ -142,25 +136,17 @@ // Flag that the OS supports ACPI. _SB.PCI0.LPCB.H_EC.ECOS = 1 } - - Name (S3OS, Zero) - Method (PTS, 1, Serialized) - { - Debug = Concatenate("EC: PTS: ", ToHexString(Arg0)) - If (ECOK) { - S3OS = ECOS - } + Method (PTS, 1, Serialized) + { + Debug = Concatenate("EC: PTS: ", ToHexString(Arg0)) _SB.PCI0.LPCB.H_EC.ECOS = 0 - } + }
- Method (WAK, 1, Serialized) - { - Debug = Concatenate("EC: WAK: ", ToHexString(Arg0)) - If (ECOK) { - ECOS = S3OS - } - _SB.PCI0.LPCB.H_EC.ECOS = 1 - } + Method (WAK, 1, Serialized) + { + Debug = Concatenate("EC: WAK: ", ToHexString(Arg0)) + _SB.PCI0.LPCB.H_EC.ECOS = 1 + }
OperationRegion (SIPR, SystemIO, 0xB2, 0x1) Field (SIPR, ByteAcc, Lock, Preserve) @@ -172,9 +158,9 @@ OperationRegion(ECF2, EmbeddedControl, 0, 0xFF) Field (ECF2, ByteAcc, Lock, Preserve) { - XXX0, 8, // EC Firmware main- version number. - XXX1, 8, // EC Firmware sub- version number. - XXX2, 8, // EC Firmware test- version number. + XXX0, 8, // EC Firmware main - version number. + XXX1, 8, // EC Firmware sub - version number. + XXX2, 8, // EC Firmware test - version number.
Offset(0x06), SKID, 8, // SKU ID @@ -215,7 +201,7 @@ TER4, 8, // Thermal Sensor Register 3 (skin temperature)
Offset(0x63), - TSI,4, // [0..3] 0 = SEN1 - CPU VR temperature sensor + TSI, 4, // [0..3] 0 = SEN1 - CPU VR temperature sensor // 1 = SEN2 - Heat Exchanger temperature sensor // 2 = SEN3 - Skin temperature sensor // 3 = SEN4 - Ambient temperature sensor @@ -225,14 +211,14 @@ TSHT, 8, // Thermal Sensor (N) high trip point(set default value =70) TSLT, 8, // Thermal Sensor (N) low trip point (set default value =70) TSSR, 8, // TSSR- thermal sensor status register (set bit2 =1) - // BIT0:SEN1 - CPU VR Temp Sensor Trip Flag - // BIT1:SEN2 - Fan Temp Sensor Trip Flag - // BIT2:SEN3 - Skin Temp Sensor Trip Flag - // BIT3:SEN4 - Ambient Temp Sensor Trip Flag - // BIT4:Reserved - // BIT5:Reserved - // BIT6:Reserved - // BIT7:Reserved + // BIT0: SEN1 - CPU VR Temp Sensor Trip Flag + // BIT1: SEN2 - Fan Temp Sensor Trip Flag + // BIT2: SEN3 - Skin Temp Sensor Trip Flag + // BIT3: SEN4 - Ambient Temp Sensor Trip Flag + // BIT4: Reserved + // BIT5: Reserved + // BIT6: Reserved + // BIT7: Reserved CHGR, 16, // Charge Rate
Offset(0x70), @@ -244,7 +230,7 @@ Offset(0x7F), LSTE, 1, // Lid feature // BIT0LID GPI - , 7, // Reserved + , 7, // Reserved
Offset(0x80), ECWR, 8, // AC & Battery status @@ -320,11 +306,11 @@ CTL7, 8,
Offset(0xF0), - , 3,// BIT0 .. BIT2 Reserved - TPCC, 1,// BIT3 TypeC connection bit - , 2,// BIT4 .. BIT5 Reserved - DRMD, 1,// Bit6 Dual Role Mode. 0->DFP: Host mode; 1->UFP: Device Mode. - , 1,// BIT7 Reserved + , 3, // BIT0 .. BIT2 Reserved + TPCC, 1, // BIT3 TypeC connection bit + , 2, // BIT4 .. BIT5 Reserved + DRMD, 1, // Bit6 Dual Role Mode. 0->DFP: Host mode; 1->UFP: Device Mode. + , 1, // BIT7 Reserved }
Method (ECMD, 0, Serialized) @@ -371,9 +357,11 @@ #include "ac.asl" #include "lid.asl"
- // Method(_Q45) // SMM Mode - Not used in coreboot - // { - // SMB2 = 0xC1 - // } +#if CONFIG(BOARD_STARLABS_LABTOP_CML) + Method(_Q45) // SMM Mode + { + SMB2 = 0xC1 + } +#endif } } diff --git a/src/ec/starlabs/it8987/acpi/hid.asl b/src/ec/starlabs/it8987/acpi/hid.asl index 25e3cd2..0d2dc0d 100644 --- a/src/ec/starlabs/it8987/acpi/hid.asl +++ b/src/ec/starlabs/it8987/acpi/hid.asl @@ -95,88 +95,47 @@ }
BTLD = One -// If ((AEAB == One)) -// { - BTS1 = 0x1F - _SB.PCI0.LPCB.H_EC.ECWT (BTS1, RefOf (_SB.PCI0.LPCB.H_EC.BTEN)) -// } -// Else -// { -// BTS1 = Zero -// } + BTS1 = 0x1F + _SB.PCI0.LPCB.H_EC.ECWT (BTS1, RefOf (_SB.PCI0.LPCB.H_EC.BTEN)) }
Method (BTNE, 1, Serialized) { Store ("-----> BTNE", Debug) -// If ((AEAB == One)) -// { - BTS1 = ((Arg0 & 0x1E) | One) - _SB.PCI0.LPCB.H_EC.ECWT (BTS1, RefOf (_SB.PCI0.LPCB.H_EC.BTEN)) -// } + BTS1 = ((Arg0 & 0x1E) | One) + _SB.PCI0.LPCB.H_EC.ECWT (BTS1, RefOf (_SB.PCI0.LPCB.H_EC.BTEN)) }
Method (BTNS, 0, Serialized) { Store ("-----> BTNS", Debug) -// If ((AEAB == One)) -// { - BTS1 = _SB.PCI0.LPCB.H_EC.ECRD (RefOf (_SB.PCI0.LPCB.H_EC.BTEN)) -// } + BTS1 = _SB.PCI0.LPCB.H_EC.ECRD (RefOf (_SB.PCI0.LPCB.H_EC.BTEN)) Return (BTS1) }
Method (BTNC, 0, Serialized) { Store ("-----> BTNC", Debug) -// If ((AEAB == One)) -// { - Return (0x1F) -// } -// Else -// { -// Return (Zero) -// } + Return (0x1F) }
Name (HEB2, Zero) Method (HEBC, 0, Serialized) { Store ("-----> HEBC", Debug) -// If ((AHDB == One)) -// { -// Return (\HEB1) -// } -// Else -// { - Return (Zero) -// } + Return (Zero) }
Method (H2BC, 0, Serialized) { Store ("-----> H2BC", Debug) -// If ((AHDB == One)) -// { -// Return (\HEB1) -// } -// Else -// { - Return (Zero) -// } + Return (Zero) }
Method (HEEC, 0, Serialized) { Store ("-----> HEEC", Debug) -// If ((AHDB == One)) -// { - Return (HEB2) /* _SB_.HIDD.HEB2 */ -// } -// Else -// { -// Return (Zero) -// } + Return (HEB2) /* _SB_.HIDD.HEB2 */ }
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method diff --git a/src/ec/starlabs/it8987/acpi/keyboard.asl b/src/ec/starlabs/it8987/acpi/keyboard.asl index f5b1d52..c39bfcf 100644 --- a/src/ec/starlabs/it8987/acpi/keyboard.asl +++ b/src/ec/starlabs/it8987/acpi/keyboard.asl @@ -33,6 +33,11 @@ _SB.PCI0.GFX0.INCB() }
+Method (_Q0E) +{ + FNLC = FNST +} + Method(_Q08) // FN lock QEvent { FNLC = FNST diff --git a/src/ec/starlabs/it8987/acpi/lid.asl b/src/ec/starlabs/it8987/acpi/lid.asl index 22e8eeb..ad02f3c 100644 --- a/src/ec/starlabs/it8987/acpi/lid.asl +++ b/src/ec/starlabs/it8987/acpi/lid.asl @@ -4,6 +4,10 @@ { Name (_HID, EisaId ("PNP0C0D"))
+#if CONFIG(BOARD_STARLABS_LABTOP_KBL) + Name (_PRW, Package() { EC_GPE_SWI, 3 }) +#endif + Method (_STA, 0, NotSerialized) { DEBUG = "---> IT8987 LID: _STA"