From 782ac36cfac8be208f0d1221f6586375e1b8c574 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 8 Aug 2014 00:00:20 +0200 Subject: lenovo/x230: Enable wake on LID and Fn key. Change-Id: Ifc7208400b0bdfa2b9b70773bd24e9f9df7f8048 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/6526 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan --- src/mainboard/lenovo/x230/smihandler.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/mainboard/lenovo/x230/smihandler.c') diff --git a/src/mainboard/lenovo/x230/smihandler.c b/src/mainboard/lenovo/x230/smihandler.c index bbe08e2620..063209dd54 100644 --- a/src/mainboard/lenovo/x230/smihandler.c +++ b/src/mainboard/lenovo/x230/smihandler.c @@ -173,3 +173,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); + } + } +} -- cgit v1.2.3