aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-12-02 15:38:18 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2022-12-07 11:23:15 +0000
commit2c3ebd8b9d56c01d8e4adadf6f4e4d5b56cdb4e1 (patch)
treebc2c00b2dfb95cd5358a04f51cfdcbc6ac56649b /src/mainboard
parent3c528f283079261aae50c3760a1e048aaeb54890 (diff)
mb,sb,soc/intel: Drop useless IO trap handlers
There are four requirements for the SMI to hit a printk() this commit now removes. Build must have DEBUG_SMI=y, otherwise any printk() is a no-op inside SMM. ASL must have a TRAP() with argument 0x99 or 0x32 for SMIF value. Platform needs to have IO Trap #3 enabled at IO 0x800. The SMI monitor must call io_trap_handler for IO Trap #3. At the moment, only getac/p470 would meet the above criteria with TRAP(0x32) in its DSDT _INI method. The ASL ignores any return value of TRAP() calls made. A mainboard IO trap handler should have precedence over a southbridge IO trap handler. At the moment we seem to have no cases of the latter to support, so remove the latter. Change-Id: I3a3298c8d9814db8464fbf7444c6e0e6ac6ac008 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70365 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/cyan/smihandler.c22
-rw-r--r--src/mainboard/google/glados/smihandler.c21
-rw-r--r--src/mainboard/google/jecht/smihandler.c21
-rw-r--r--src/mainboard/intel/kblrvp/smihandler.c21
-rw-r--r--src/mainboard/intel/kunimitsu/smihandler.c21
-rw-r--r--src/mainboard/intel/strago/smihandler.c22
6 files changed, 0 insertions, 128 deletions
diff --git a/src/mainboard/google/cyan/smihandler.c b/src/mainboard/google/cyan/smihandler.c
index 9083a8773b..7394b78b68 100644
--- a/src/mainboard/google/cyan/smihandler.c
+++ b/src/mainboard/google/cyan/smihandler.c
@@ -19,28 +19,6 @@
#define GPIO_SUS7_WAKE_MASK (1 << 12)
#define GPIO_SUS1_WAKE_MASK (1 << 13)
-int mainboard_io_trap_handler(int smif)
-{
- switch (smif) {
- case 0x99:
- printk(BIOS_DEBUG, "Sample\n");
- gnvs->smif = 0;
- break;
- default:
- return 0;
- }
-
- /*
- * On success, the IO Trap Handler returns 0
- * On failure, the IO Trap Handler returns a value != 0
- *
- * For now, we force the return value to 0 and log all traps to
- * see what's going on.
- */
- //gnvs->smif = 0;
- return 1;
-}
-
static uint8_t mainboard_smi_ec(void)
{
uint8_t cmd = google_chromeec_get_event();
diff --git a/src/mainboard/google/glados/smihandler.c b/src/mainboard/google/glados/smihandler.c
index 882aff6da9..b1adb866d9 100644
--- a/src/mainboard/google/glados/smihandler.c
+++ b/src/mainboard/google/glados/smihandler.c
@@ -6,32 +6,11 @@
#include <ec/google/chromeec/smm.h>
#include <gpio.h>
#include <soc/iomap.h>
-#include <soc/nvs.h>
#include <soc/pm.h>
#include <intelblocks/smihandler.h>
#include "ec.h"
#include <variant/gpio.h>
-int mainboard_io_trap_handler(int smif)
-{
- switch (smif) {
- case 0x99:
- printk(BIOS_DEBUG, "Sample\n");
- gnvs->smif = 0;
- break;
- default:
- return 0;
- }
-
- /* On success, the IO Trap Handler returns 0
- * On failure, the IO Trap Handler returns a value != 0
- *
- * For now, we force the return value to 0 and log all traps to
- * see what's going on.
- */
- return 1;
-}
-
void mainboard_smi_gpi_handler(const struct gpi_status *sts)
{
if (gpi_status_get(sts, EC_SMI_GPI))
diff --git a/src/mainboard/google/jecht/smihandler.c b/src/mainboard/google/jecht/smihandler.c
index 1adc5d5438..a4feeb496a 100644
--- a/src/mainboard/google/jecht/smihandler.c
+++ b/src/mainboard/google/jecht/smihandler.c
@@ -7,29 +7,8 @@
#include <ec/google/chromeec/ec.h>
#include <southbridge/intel/lynxpoint/lp_gpio.h>
#include <soc/iomap.h>
-#include <soc/nvs.h>
#include "onboard.h"
-int mainboard_io_trap_handler(int smif)
-{
- switch (smif) {
- case 0x99:
- printk(BIOS_DEBUG, "Sample\n");
- gnvs->smif = 0;
- break;
- default:
- return 0;
- }
-
- /* On success, the IO Trap Handler returns 0
- * On failure, the IO Trap Handler returns a value != 0
- *
- * For now, we force the return value to 0 and log all traps to
- * see what's going on.
- */
- return 1;
-}
-
/* gpi_sts is GPIO 47:32 */
void mainboard_smi_gpi(u32 gpi_sts)
{
diff --git a/src/mainboard/intel/kblrvp/smihandler.c b/src/mainboard/intel/kblrvp/smihandler.c
index 4c9531ce01..c6f4239e53 100644
--- a/src/mainboard/intel/kblrvp/smihandler.c
+++ b/src/mainboard/intel/kblrvp/smihandler.c
@@ -4,32 +4,11 @@
#include <cpu/x86/smm.h>
#include <ec/google/chromeec/smm.h>
#include <soc/iomap.h>
-#include <soc/nvs.h>
#include <soc/pm.h>
#include <intelblocks/smihandler.h>
#include "ec.h"
#include <variant/gpio.h>
-int mainboard_io_trap_handler(int smif)
-{
- switch (smif) {
- case 0x99:
- printk(BIOS_DEBUG, "Sample\n");
- gnvs->smif = 0;
- break;
- default:
- return 0;
- }
-
- /* On success, the IO Trap Handler returns 0
- * On failure, the IO Trap Handler returns a value != 0
- *
- * For now, we force the return value to 0 and log all traps to
- * see what's going on.
- */
- return 1;
-}
-
void mainboard_smi_gpi_handler(const struct gpi_status *sts)
{
if (CONFIG(BOARD_INTEL_KBLRVP8))
diff --git a/src/mainboard/intel/kunimitsu/smihandler.c b/src/mainboard/intel/kunimitsu/smihandler.c
index 14a3f8f9ca..58c7dfb044 100644
--- a/src/mainboard/intel/kunimitsu/smihandler.c
+++ b/src/mainboard/intel/kunimitsu/smihandler.c
@@ -4,32 +4,11 @@
#include <cpu/x86/smm.h>
#include <ec/google/chromeec/smm.h>
#include <soc/iomap.h>
-#include <soc/nvs.h>
#include <soc/pm.h>
#include <intelblocks/smihandler.h>
#include "ec.h"
#include "gpio.h"
-int mainboard_io_trap_handler(int smif)
-{
- switch (smif) {
- case 0x99:
- printk(BIOS_DEBUG, "Sample\n");
- gnvs->smif = 0;
- break;
- default:
- return 0;
- }
-
- /* On success, the IO Trap Handler returns 0
- * On failure, the IO Trap Handler returns a value != 0
- *
- * For now, we force the return value to 0 and log all traps to
- * see what's going on.
- */
- return 1;
-}
-
void mainboard_smi_gpi_handler(const struct gpi_status *sts)
{
if (gpi_status_get(sts, EC_SMI_GPI))
diff --git a/src/mainboard/intel/strago/smihandler.c b/src/mainboard/intel/strago/smihandler.c
index e953ccd531..c660e5a24c 100644
--- a/src/mainboard/intel/strago/smihandler.c
+++ b/src/mainboard/intel/strago/smihandler.c
@@ -18,28 +18,6 @@
/* The wake gpio is SUS_GPIO[0]. */
#define WAKE_GPIO_EN SUS_GPIO_EN0
-int mainboard_io_trap_handler(int smif)
-{
- switch (smif) {
- case 0x99:
- printk(BIOS_DEBUG, "Sample\n");
- gnvs->smif = 0;
- break;
- default:
- return 0;
- }
-
- /*
- * On success, the IO Trap Handler returns 0
- * On failure, the IO Trap Handler returns a value != 0
- *
- * For now, we force the return value to 0 and log all traps to
- * see what's going on.
- */
- //gnvs->smif = 0;
- return 1;
-}
-
static uint8_t mainboard_smi_ec(void)
{
uint8_t cmd = google_chromeec_get_event();