summaryrefslogtreecommitdiff
path: root/src/mainboard/google/parrot
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-12-29 11:32:27 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-04-28 07:59:13 +0200
commitb85a87b7d6f9f12d5c71c32741c8af731ed6be7e (patch)
tree67553a9c683557ead346dc1c7b155d3eac475090 /src/mainboard/google/parrot
parent189f3ba974df8f1b305cfa421a151fe069fc1a6f (diff)
downloadcoreboot-b85a87b7d6f9f12d5c71c32741c8af731ed6be7e.tar.xz
intel SMI handlers: Refactor GPI SMI/SCI routing
Move the GPI interrupt routing selection between SMI/SCI from mainboards to southbridge. There is speculation if this is all just legacy APM stuff that could be removed with a followup. Change-Id: Iab14cf347584513793f417febc47f0559e17f5a5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Signed-off-by: Nicolas Reinecke <nr@das-labor.org> Reviewed-on: http://review.coreboot.org/7967 Tested-by: build bot (Jenkins) Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'src/mainboard/google/parrot')
-rw-r--r--src/mainboard/google/parrot/smihandler.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/src/mainboard/google/parrot/smihandler.c b/src/mainboard/google/parrot/smihandler.c
index 4a189f8695..1d1b23c02d 100644
--- a/src/mainboard/google/parrot/smihandler.c
+++ b/src/mainboard/google/parrot/smihandler.c
@@ -29,44 +29,6 @@
#include <ec/compal/ene932/ec.h>
#include "ec.h"
-/* Power Management PCI Configuration Registers
- * Bus 0, Device 31, Function 0, Offset 0xB8
- * 00 = No Effect
- * 01 = SMI#
- * 10 = SCI
- * 11 = NMI
- */
-#define GPI_ROUT 0x8000F8B8
-#define GPI_IS_SMI 0x01
-#define GPI_IS_SCI 0x02
-
-static void set_lid_gpi_mode(u32 mode)
-{
- u32 reg32 = 0;
- u16 reg16 = 0;
-
- /* read the GPI register, clear the lid GPI's mode, write the new mode
- * and write out the register.
- */
- outl(GPI_ROUT, 0xcf8);
- reg32 = inl(0xcfc);
- reg32 &= ~(0x03 << (EC_LID_GPI * 2));
- reg32 |= (mode << (EC_LID_GPI * 2));
- outl(GPI_ROUT, 0xcf8);
- outl(reg32, 0xcfc);
-
- /* Set or Disable Lid GPE as SMI source in the ALT_GPI_SMI_EN register. */
- reg16 = inw(smm_get_pmbase() + ALT_GP_SMI_EN);
- if (mode == GPI_IS_SCI) {
- reg16 &= ~(1 << EC_LID_GPI);
- } else {
- reg16 |= (1 << EC_LID_GPI);
- }
- outw(reg16, smm_get_pmbase() + ALT_GP_SMI_EN);
-
- return;
-}
-
int mainboard_io_trap_handler(int smif)
{
printk(BIOS_DEBUG, "mainboard_io_trap_handler: %x\n", smif);
@@ -200,8 +162,7 @@ int mainboard_smi_apmc(u8 apmc)
ec_kbc_write_ib(0xE8);
/* Set LID GPI to generate SCIs */
- set_lid_gpi_mode(GPI_IS_SCI);
-
+ gpi_route_interrupt(EC_LID_GPI, GPI_IS_SCI);
break;
case APMC_ACPI_DIS:
printk(BIOS_DEBUG, "APMC: ACPI_DIS\n");
@@ -211,7 +172,7 @@ int mainboard_smi_apmc(u8 apmc)
ec_kbc_write_ib(0xE9);
/* Set LID GPI to generate SMIs */
- set_lid_gpi_mode(GPI_IS_SMI);
+ gpi_route_interrupt(EC_LID_GPI, GPI_IS_SMI);
break;
}
return 0;