[coreboot-gerrit] New patch to review for coreboot: b5a761b macbook21 lenovo/xx: Fix inw() in SMI handlers

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Thu Jan 8 11:12:07 CET 2015


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8169

-gerrit

commit b5a761ba4d018e0c10e6b79ef8525d9b57cc77b9
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Thu Jan 8 12:06:35 2015 +0200

    macbook21 lenovo/xx: Fix inw() in SMI handlers
    
    Missing base may have enabled SMI for all GPI inputs.
    
    Change-Id: I1157afaccccb17d325a4efdb1f270a27f9a299ab
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/mainboard/apple/macbook21/smihandler.c | 2 +-
 src/mainboard/lenovo/t420s/smihandler.c    | 2 +-
 src/mainboard/lenovo/t520/smihandler.c     | 2 +-
 src/mainboard/lenovo/t530/smihandler.c     | 2 +-
 src/mainboard/lenovo/t60/smihandler.c      | 2 +-
 src/mainboard/lenovo/x201/smihandler.c     | 2 +-
 src/mainboard/lenovo/x220/smihandler.c     | 2 +-
 src/mainboard/lenovo/x230/smihandler.c     | 2 +-
 src/mainboard/lenovo/x60/smihandler.c      | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mainboard/apple/macbook21/smihandler.c b/src/mainboard/apple/macbook21/smihandler.c
index ab039dd..449e367 100644
--- a/src/mainboard/apple/macbook21/smihandler.c
+++ b/src/mainboard/apple/macbook21/smihandler.c
@@ -69,7 +69,7 @@ int mainboard_smi_apmc(u8 data)
 	switch(data) {
 		case APM_CNT_ACPI_ENABLE:
 			/* route H8SCI to SCI */
-			outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+			outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 			tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 			tmp &= ~0x03;
 			tmp |= 0x02;
diff --git a/src/mainboard/lenovo/t420s/smihandler.c b/src/mainboard/lenovo/t420s/smihandler.c
index dd8878f..6c80573 100644
--- a/src/mainboard/lenovo/t420s/smihandler.c
+++ b/src/mainboard/lenovo/t420s/smihandler.c
@@ -130,7 +130,7 @@ int mainboard_smi_apmc(u8 data)
 			/* use 0x1600/0x1604 to prevent races with userspace */
 			ec_set_ports(0x1604, 0x1600);
 			/* route H8SCI to SCI */
-			outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+			outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 			tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 			tmp &= ~0x03;
 			tmp |= 0x02;
diff --git a/src/mainboard/lenovo/t520/smihandler.c b/src/mainboard/lenovo/t520/smihandler.c
index c81825e..bb3ad78 100644
--- a/src/mainboard/lenovo/t520/smihandler.c
+++ b/src/mainboard/lenovo/t520/smihandler.c
@@ -125,7 +125,7 @@ int mainboard_smi_apmc(u8 data)
 		/* use 0x1600/0x1604 to prevent races with userspace */
 		ec_set_ports(0x1604, 0x1600);
 		/* route H8SCI to SCI */
-		outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+		outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 		tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 		tmp &= ~0x03;
 		tmp |= 0x02;
diff --git a/src/mainboard/lenovo/t530/smihandler.c b/src/mainboard/lenovo/t530/smihandler.c
index 5bcde1c..6f6cca1 100644
--- a/src/mainboard/lenovo/t530/smihandler.c
+++ b/src/mainboard/lenovo/t530/smihandler.c
@@ -130,7 +130,7 @@ int mainboard_smi_apmc(u8 data)
 		/* use 0x1600/0x1604 to prevent races with userspace */
 		ec_set_ports(0x1604, 0x1600);
 		/* route H8SCI to SCI */
-		outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+		outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 		tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 		tmp &= ~0x03;
 		tmp |= 0x02;
diff --git a/src/mainboard/lenovo/t60/smihandler.c b/src/mainboard/lenovo/t60/smihandler.c
index 130ad96..36495dc 100644
--- a/src/mainboard/lenovo/t60/smihandler.c
+++ b/src/mainboard/lenovo/t60/smihandler.c
@@ -173,7 +173,7 @@ int mainboard_smi_apmc(u8 data)
 			/* use 0x1600/0x1604 to prevent races with userspace */
 			ec_set_ports(0x1604, 0x1600);
 			/* route H8SCI to SCI */
-			outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+			outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 			tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 			tmp &= ~0x03;
 			tmp |= 0x02;
diff --git a/src/mainboard/lenovo/x201/smihandler.c b/src/mainboard/lenovo/x201/smihandler.c
index ad3911c..7af613b 100644
--- a/src/mainboard/lenovo/x201/smihandler.c
+++ b/src/mainboard/lenovo/x201/smihandler.c
@@ -173,7 +173,7 @@ int mainboard_smi_apmc(u8 data)
 		/* use 0x1600/0x1604 to prevent races with userspace */
 		ec_set_ports(0x1604, 0x1600);
 		/* route H8SCI to SCI */
-		outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+		outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 		tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 		tmp &= ~0x03;
 		tmp |= 0x02;
diff --git a/src/mainboard/lenovo/x220/smihandler.c b/src/mainboard/lenovo/x220/smihandler.c
index 5bcde1c..6f6cca1 100644
--- a/src/mainboard/lenovo/x220/smihandler.c
+++ b/src/mainboard/lenovo/x220/smihandler.c
@@ -130,7 +130,7 @@ int mainboard_smi_apmc(u8 data)
 		/* use 0x1600/0x1604 to prevent races with userspace */
 		ec_set_ports(0x1604, 0x1600);
 		/* route H8SCI to SCI */
-		outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+		outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 		tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 		tmp &= ~0x03;
 		tmp |= 0x02;
diff --git a/src/mainboard/lenovo/x230/smihandler.c b/src/mainboard/lenovo/x230/smihandler.c
index 5bcde1c..6f6cca1 100644
--- a/src/mainboard/lenovo/x230/smihandler.c
+++ b/src/mainboard/lenovo/x230/smihandler.c
@@ -130,7 +130,7 @@ int mainboard_smi_apmc(u8 data)
 		/* use 0x1600/0x1604 to prevent races with userspace */
 		ec_set_ports(0x1604, 0x1600);
 		/* route H8SCI to SCI */
-		outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+		outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 		tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 		tmp &= ~0x03;
 		tmp |= 0x02;
diff --git a/src/mainboard/lenovo/x60/smihandler.c b/src/mainboard/lenovo/x60/smihandler.c
index 090f037..ccc328e 100644
--- a/src/mainboard/lenovo/x60/smihandler.c
+++ b/src/mainboard/lenovo/x60/smihandler.c
@@ -179,7 +179,7 @@ int mainboard_smi_apmc(u8 data)
 			/* use 0x1600/0x1604 to prevent races with userspace */
 			ec_set_ports(0x1604, 0x1600);
 			/* route H8SCI to SCI */
-			outw(inw(ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
+			outw(inw(pmbase + ALT_GP_SMI_EN) & ~0x1000, pmbase + ALT_GP_SMI_EN);
 			tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb);
 			tmp &= ~0x03;
 			tmp |= 0x02;



More information about the coreboot-gerrit mailing list