[coreboot-gerrit] Change in coreboot[master]: mb/lenovo/*/smihandler: Get rid of mainboard_io_trap_handler

Patrick Rudolph (Code Review) gerrit at coreboot.org
Fri May 19 10:21:11 CEST 2017


Patrick Rudolph has uploaded a new change for review. ( https://review.coreboot.org/19790 )

Change subject: mb/lenovo/*/smihandler: Get rid of mainboard_io_trap_handler
......................................................................

mb/lenovo/*/smihandler: Get rid of mainboard_io_trap_handler

Get rid of mainboard_io_trap_handler.

The only purpose is to enable tp-smapi, but is already done on all
boards in h8_enable, as of devicetree setting config0.

Change-Id: I33fd829a7e34aefa8f76ca6020cc8e802f7aab17
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/mainboard/lenovo/l520/smihandler.c
M src/mainboard/lenovo/t420/smihandler.c
M src/mainboard/lenovo/t420s/smihandler.c
M src/mainboard/lenovo/t430/smihandler.c
M src/mainboard/lenovo/t430s/smihandler.c
M src/mainboard/lenovo/t520/smihandler.c
M src/mainboard/lenovo/t530/smihandler.c
M src/mainboard/lenovo/x1_carbon_gen1/smihandler.c
M src/mainboard/lenovo/x220/smihandler.c
M src/mainboard/lenovo/x230/smihandler.c
10 files changed, 0 insertions(+), 218 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/19790/1

diff --git a/src/mainboard/lenovo/l520/smihandler.c b/src/mainboard/lenovo/l520/smihandler.c
index 1e463ba..d2f7cb3 100644
--- a/src/mainboard/lenovo/l520/smihandler.c
+++ b/src/mainboard/lenovo/l520/smihandler.c
@@ -26,25 +26,6 @@
 /* FIXME: check this */
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	return 0;
-}
-
 static void mainboard_smi_handle_ec_sci(void)
 {
 	u8 status = inb(EC_SC);
diff --git a/src/mainboard/lenovo/t420/smihandler.c b/src/mainboard/lenovo/t420/smihandler.c
index 23a98dd..eff0daf 100644
--- a/src/mainboard/lenovo/t420/smihandler.c
+++ b/src/mainboard/lenovo/t420/smihandler.c
@@ -25,25 +25,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	return 0;
-}
-
 static void mainboard_smi_handle_ec_sci(void)
 {
 	u8 status = inb(EC_SC);
diff --git a/src/mainboard/lenovo/t420s/smihandler.c b/src/mainboard/lenovo/t420s/smihandler.c
index 45e626b..2b6e6cd 100644
--- a/src/mainboard/lenovo/t420s/smihandler.c
+++ b/src/mainboard/lenovo/t420s/smihandler.c
@@ -31,32 +31,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	switch (smif) {
-		default:
-			return 0;
-	}
-
-	/* On success, the IO Trap Handler returns 1
-	 * On failure, the IO Trap Handler returns a value != 1 */
-	return 1;
-}
-
 static void mainboard_smi_brightness_up(void)
 {
 	u8 value;
diff --git a/src/mainboard/lenovo/t430/smihandler.c b/src/mainboard/lenovo/t430/smihandler.c
index e86c3c0..7af9e7d 100644
--- a/src/mainboard/lenovo/t430/smihandler.c
+++ b/src/mainboard/lenovo/t430/smihandler.c
@@ -26,23 +26,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	return 0;
-}
-
 static void mainboard_smi_handle_ec_sci(void)
 {
 	u8 status = inb(EC_SC);
diff --git a/src/mainboard/lenovo/t430s/smihandler.c b/src/mainboard/lenovo/t430s/smihandler.c
index 6e20500..70ecab2 100644
--- a/src/mainboard/lenovo/t430s/smihandler.c
+++ b/src/mainboard/lenovo/t430s/smihandler.c
@@ -29,32 +29,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	switch (smif) {
-		default:
-			return 0;
-	}
-
-	/* On success, the IO Trap Handler returns 1
-	 * On failure, the IO Trap Handler returns a value != 1 */
-	return 1;
-}
-
 static void mainboard_smi_brightness_up(void)
 {
 	u8 value;
diff --git a/src/mainboard/lenovo/t520/smihandler.c b/src/mainboard/lenovo/t520/smihandler.c
index 24722a0..c48cf3d 100644
--- a/src/mainboard/lenovo/t520/smihandler.c
+++ b/src/mainboard/lenovo/t520/smihandler.c
@@ -31,27 +31,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	/* On success, the IO Trap Handler returns 1
-	 * On failure, the IO Trap Handler returns a value != 1 */
-	return 0;
-}
-
 static void mainboard_smi_brightness_up(void)
 {
 	u8 value;
diff --git a/src/mainboard/lenovo/t530/smihandler.c b/src/mainboard/lenovo/t530/smihandler.c
index 08554c9..c7ca206 100644
--- a/src/mainboard/lenovo/t530/smihandler.c
+++ b/src/mainboard/lenovo/t530/smihandler.c
@@ -31,32 +31,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	switch (smif) {
-	default:
-		return 0;
-	}
-
-	/* On success, the IO Trap Handler returns 1
-	 * On failure, the IO Trap Handler returns a value != 1 */
-	return 1;
-}
-
 static void mainboard_smi_brightness_up(void)
 {
 	u8 value;
diff --git a/src/mainboard/lenovo/x1_carbon_gen1/smihandler.c b/src/mainboard/lenovo/x1_carbon_gen1/smihandler.c
index eb92556..09dcbf2 100644
--- a/src/mainboard/lenovo/x1_carbon_gen1/smihandler.c
+++ b/src/mainboard/lenovo/x1_carbon_gen1/smihandler.c
@@ -25,25 +25,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	return 0;
-}
-
 static void mainboard_smi_handle_ec_sci(void)
 {
 	u8 status = inb(EC_SC);
diff --git a/src/mainboard/lenovo/x220/smihandler.c b/src/mainboard/lenovo/x220/smihandler.c
index e1bb376..1dfd87e 100644
--- a/src/mainboard/lenovo/x220/smihandler.c
+++ b/src/mainboard/lenovo/x220/smihandler.c
@@ -31,32 +31,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	switch (smif) {
-	default:
-		return 0;
-	}
-
-	/* On success, the IO Trap Handler returns 1
-	 * On failure, the IO Trap Handler returns a value != 1 */
-	return 1;
-}
-
 static void mainboard_smi_brightness_up(void)
 {
 	u8 value;
diff --git a/src/mainboard/lenovo/x230/smihandler.c b/src/mainboard/lenovo/x230/smihandler.c
index eb92556..09dcbf2 100644
--- a/src/mainboard/lenovo/x230/smihandler.c
+++ b/src/mainboard/lenovo/x230/smihandler.c
@@ -25,25 +25,6 @@
 #define GPE_EC_SCI	1
 #define GPE_EC_WAKE	13
 
-static void mainboard_smm_init(void)
-{
-	printk(BIOS_DEBUG, "initializing SMI\n");
-	/* Enable 0x1600/0x1600 register pair */
-	ec_set_bit(0x00, 0x05);
-}
-
-int mainboard_io_trap_handler(int smif)
-{
-	static int smm_initialized;
-
-	if (!smm_initialized) {
-		mainboard_smm_init();
-		smm_initialized = 1;
-	}
-
-	return 0;
-}
-
 static void mainboard_smi_handle_ec_sci(void)
 {
 	u8 status = inb(EC_SC);

-- 
To view, visit https://review.coreboot.org/19790
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33fd829a7e34aefa8f76ca6020cc8e802f7aab17
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>



More information about the coreboot-gerrit mailing list