[coreboot-gerrit] New patch to review for coreboot: 1b9390d lenovo/x201: Enable wake on LID.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Fri Aug 8 00:10:54 CEST 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6528

-gerrit

commit 1b9390de4de34ba2eb5a8fbf1aebedcdba62a0b5
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Aug 8 00:10:28 2014 +0200

    lenovo/x201: Enable wake on LID.
    
    Change-Id: I485da5b8e9084c73f16b5df1c42879697fc0ac3d
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/mainboard/lenovo/x201/smihandler.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/mainboard/lenovo/x201/smihandler.c b/src/mainboard/lenovo/x201/smihandler.c
index 0529818..754c981 100644
--- a/src/mainboard/lenovo/x201/smihandler.c
+++ b/src/mainboard/lenovo/x201/smihandler.c
@@ -200,3 +200,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 & 4) {
+			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);
+		}
+	}
+}



More information about the coreboot-gerrit mailing list