[coreboot-gerrit] New patch to review for coreboot: be9c580 lenovo/t520: Enable wake on LID and Fn key

Nicolas Reinecke (nr@das-labor.org) gerrit at coreboot.org
Fri Oct 17 15:39:47 CEST 2014


Nicolas Reinecke (nr at das-labor.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7101

-gerrit

commit be9c580f425b5e5ddb369ea3fe4b25eee528660e
Author: Nicolas Reinecke <nr at das-labor.org>
Date:   Fri Oct 17 15:06:29 2014 +0200

    lenovo/t520: Enable wake on LID and Fn key
    
    Change-Id: Ieb23728ba171733820830e86e77a4c6d8e1cc57d
    Signed-off-by: Nicolas Reinecke <nr at das-labor.org>
---
 src/mainboard/lenovo/t520/smihandler.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/mainboard/lenovo/t520/smihandler.c b/src/mainboard/lenovo/t520/smihandler.c
index f4ed367..c81825e 100644
--- a/src/mainboard/lenovo/t520/smihandler.c
+++ b/src/mainboard/lenovo/t520/smihandler.c
@@ -167,3 +167,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);
+		}
+	}
+}



More information about the coreboot-gerrit mailing list