summaryrefslogtreecommitdiff
path: root/src/southbridge
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-03-06 19:52:36 +0000
committerStefan Reinauer <stepan@openbios.org>2009-03-06 19:52:36 +0000
commit3b387458b57f369056b0a45bf4f17e5e074c13ce (patch)
tree092d45baf4adf7d1be4a86cc7d34429c83495f15 /src/southbridge
parent43b29cf891c78a2cd01d22a2731c7da828d79e0a (diff)
downloadcoreboot-3b387458b57f369056b0a45bf4f17e5e074c13ce.tar.xz
* fix a minor power state issue in the ich7 smm handler
* move mainboard dependent code into a mainboard SMI handler. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3982 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge')
-rw-r--r--src/southbridge/intel/i82801gx/i82801gx_smi.c2
-rw-r--r--src/southbridge/intel/i82801gx/i82801gx_smihandler.c40
2 files changed, 13 insertions, 29 deletions
diff --git a/src/southbridge/intel/i82801gx/i82801gx_smi.c b/src/southbridge/intel/i82801gx/i82801gx_smi.c
index 8aae3b14d7..ccbb7334e5 100644
--- a/src/southbridge/intel/i82801gx/i82801gx_smi.c
+++ b/src/southbridge/intel/i82801gx/i82801gx_smi.c
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008 coresystems GmbH
+ * Copyright (C) 2008-2009 coresystems GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/southbridge/intel/i82801gx/i82801gx_smihandler.c b/src/southbridge/intel/i82801gx/i82801gx_smihandler.c
index 11096fecd1..d2826c6aca 100644
--- a/src/southbridge/intel/i82801gx/i82801gx_smihandler.c
+++ b/src/southbridge/intel/i82801gx/i82801gx_smihandler.c
@@ -31,9 +31,10 @@
#define DEBUG_SMI
-#define ACPI_DISABLE 0x1e
-#define ACPI_ENABLE 0xe1
-
+#define APM_CNT 0xb2
+#define APM_STS 0xb3
+#define ACPI_DISABLE 0x1e
+#define ACPI_ENABLE 0xe1
/* I945 */
#define SMRAM 0x9d
@@ -241,37 +242,18 @@ static void dump_tco_status(u32 tco_sts)
*/
#include "../../../northbridge/intel/i945/pcie_config.c"
-void southbridge_io_trap_handler(int smif)
+int southbridge_io_trap_handler(int smif)
{
- u8 reg8;
global_nvs_t *gnvs = (global_nvs_t *)0xc00;
- printk_debug("SMI function trap 0x%x: ", smif);
-
switch (smif) {
case 0x32:
printk_debug("OS Init\n");
//gnvs->smif = 0;
break;
- case 0xd5:
- printk_debug("Set Brightness\n");
- reg8 = gnvs->brtl;
- printk_debug("brtl: %x\n", reg8);
- outb(0x17, 0x66);
- outb(reg8, 0x62);
- //gnvs->smif = 0;
- break;
- case 0xd6:
- printk_debug("Get Brightness\n");
- outb(0x17, 0x66);
- reg8 = inb(0x62);
- printk_debug("brtl: %x\n", reg8);
- gnvs->brtl = reg8;
- //gnvs->smif = 0;
- break;
default:
- printk_debug("Unknown function\n");
- break;
+ /* Not handled */
+ return 0;
}
/* On success, the IO Trap Handler returns 0
@@ -281,6 +263,7 @@ void southbridge_io_trap_handler(int smif)
* see what's going on.
*/
//gnvs->smif = 0;
+ return 1; /* IO trap handled */
}
/**
@@ -423,12 +406,13 @@ void southbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_sav
*/
/* Write back to the SLP register to cause the
- * originally intended event again.
+ * originally intended event again. We need to set BIT13
+ * (SLP_EN) though to make the sleep happen.
*/
reg32 = inl(pmbase + 0x04);
- printk_debug("SMI#: SLP = 0x%08x\n");
+ printk_debug("SMI#: SLP = 0x%08x\n", reg32);
printk_debug("SMI#: Powering off.\n");
- outl(reg32, pmbase + 0x04);
+ outl(reg32 | (1 << 13), pmbase + 0x04);
}
}