summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-09-12 04:01:31 +1000
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-09-12 22:01:27 +0200
commit07e6bd2a5576aea1479a96b12824a794035e5d0f (patch)
tree6625748ca29865605f106896527e8a40d65c1ada /src/mainboard
parent3a677dbd86716ef27ad02daea09f249cd184f293 (diff)
lenovo/t530: Enable wake on LID and Fn key
Change-Id: I09a8fe94b33c3cc1da62f7a5a527944638bd6f0c Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/6877 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/lenovo/t530/smihandler.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mainboard/lenovo/t530/smihandler.c b/src/mainboard/lenovo/t530/smihandler.c
index da6d863b8e..5bcde1cbb6 100644
--- a/src/mainboard/lenovo/t530/smihandler.c
+++ b/src/mainboard/lenovo/t530/smihandler.c
@@ -172,3 +172,23 @@ int mainboard_smi_apmc(u8 data)
}
return 0;
}
+
+void mainboard_smi_sleep(u8 slp_typ)
+{
+ if (slp_typ == 3) {
+ u8 ec_wake = ec_read(0x32);
+ /* If EC wake events are enabled, enable wake on EC WAKE GPE. */
+ if (ec_wake & 0x14) {
+ u32 gpe_rout;
+ u16 pmbase = pci_read_config16(PCI_DEV(0, 0x1f, 0), 0x40) & 0xfffc;
+
+ /* Enable EC WAKE GPE. */
+ outl(inl(pmbase + GPE0_EN) | (1 << 29), pmbase + GPE0_EN);
+ gpe_rout = pci_read_config32(PCI_DEV(0, 0x1f, 0), GPIO_ROUT);
+ /* Redirect EC WAKE GPE to SCI. */
+ gpe_rout &= ~(3 << 26);
+ gpe_rout |= (2 << 26);
+ pci_write_config32(PCI_DEV(0, 0x1f, 0), GPIO_ROUT, gpe_rout);
+ }
+ }
+}