ec/lenovo/h8: Apply ME workaround on X230 on S3 resume.

This makes S3 work.

Change-Id: Ife14372f5f9bb151d7e6e98c6069eb99d5369baf
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/6392
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
Vladimir Serbinenko 2014-07-29 00:51:31 +02:00
parent 5aa28f5c1b
commit e0ceac3856
4 changed files with 19 additions and 5 deletions

View File

@ -1,7 +1,8 @@
Scope(\_TZ) Scope(\_TZ)
{ {
#if defined (CONFIG_BOARD_LENOVO_X201) && CONFIG_BOARD_LENOVO_X201 #if defined (EC_LENOVO_H8_ME_WORKAROUND)
Name (MEBT, 0) Name (MEB1, 0)
Name (MEB2, 0)
#endif #endif
Method(C2K, 1, NotSerialized) Method(C2K, 1, NotSerialized)
@ -24,12 +25,12 @@ Scope(\_TZ)
Return (C2K(127)) Return (C2K(127))
} }
Method(_TMP) { Method(_TMP) {
#if defined (CONFIG_BOARD_LENOVO_X201) && CONFIG_BOARD_LENOVO_X201 #if defined (EC_LENOVO_H8_ME_WORKAROUND)
/* Avoid tripping alarm if ME isn't booted at all yet */ /* Avoid tripping alarm if ME isn't booted at all yet */
If (LAnd (LNot (MEBT), LEqual (\_SB.PCI0.LPCB.EC.TMP0, 128))) { If (LAnd (LNot (MEB1), LEqual (\_SB.PCI0.LPCB.EC.TMP0, 128))) {
Return (C2K(40)) Return (C2K(40))
} }
Store (1, MEBT) Store (1, MEB1)
#endif #endif
Return (C2K(\_SB.PCI0.LPCB.EC.TMP0)) Return (C2K(\_SB.PCI0.LPCB.EC.TMP0))
} }
@ -46,6 +47,13 @@ Scope(\_TZ)
} }
Method(_TMP) { Method(_TMP) {
#if defined (EC_LENOVO_H8_ME_WORKAROUND)
/* Avoid tripping alarm if ME isn't booted at all yet */
If (LAnd (LNot (MEB2), LEqual (\_SB.PCI0.LPCB.EC.TMP1, 128))) {
Return (C2K(40))
}
Store (1, MEB2)
#endif
Return (C2K(\_SB.PCI0.LPCB.EC.TMP1)) Return (C2K(\_SB.PCI0.LPCB.EC.TMP1))
} }
} }

View File

@ -24,6 +24,7 @@
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.LCD0.DECB #define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.LCD0.DECB
#define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0 #define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
#define RP04_IS_EXPRESSCARD 1 #define RP04_IS_EXPRESSCARD 1
#define EC_LENOVO_H8_ME_WORKAROUND 1
DefinitionBlock( DefinitionBlock(
"dsdt.aml", "dsdt.aml",

View File

@ -68,6 +68,10 @@ Method(_PTS,1)
Method(_WAK,1) Method(_WAK,1)
{ {
/* ME may not be up yet. */
Store (0, \_TZ.MEB1)
Store (0, \_TZ.MEB2)
/* Not implemented. */ /* Not implemented. */
Return(Package(){0,0}) Return(Package(){0,0})
} }

View File

@ -24,6 +24,7 @@
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.LCD0.DECB #define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.LCD0.DECB
#define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0 #define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
#define RP03_IS_EXPRESSCARD 1 #define RP03_IS_EXPRESSCARD 1
#define EC_LENOVO_H8_ME_WORKAROUND 1
DefinitionBlock( DefinitionBlock(
"dsdt.aml", "dsdt.aml",