aboutsummaryrefslogtreecommitdiff
path: root/src/arch/i386/boot
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-04-22 08:17:38 +0000
committerStefan Reinauer <stepan@openbios.org>2009-04-22 08:17:38 +0000
commit7e9771cc1a02f4154cd655386219ea69578e01f0 (patch)
tree1137513767496e7661fa51cda7c46084c7362fc3 /src/arch/i386/boot
parent18d7320d17622e3fb87caae3eea645d8b06f942f (diff)
* move i386 / ACPI dependent code out of hardwaremain.c and into the i386
acpi code. * add some defines for FADT flags Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4167 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/i386/boot')
-rw-r--r--src/arch/i386/boot/acpi.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/arch/i386/boot/acpi.c b/src/arch/i386/boot/acpi.c
index c7046e1b31..b6aa19ff1b 100644
--- a/src/arch/i386/boot/acpi.c
+++ b/src/arch/i386/boot/acpi.c
@@ -1,8 +1,8 @@
/*
* coreboot ACPI Table support
* written by Stefan Reinauer <stepan@openbios.org>
- * (C) 2004 SUSE LINUX AG
- * (C) 2005 Stefan Reinauer
+ * Copyright (C) 2004 SUSE LINUX AG
+ * Copyright (C) 2005-2009 coresystems GmbH
*
* ACPI FADT, FACS, and DSDT table support added by
* Nick Barker <nick.barker9@btinternet.com>, and those portions
@@ -27,11 +27,6 @@
#include <arch/acpigen.h>
#include <device/pci.h>
-#if HAVE_ACPI_RESUME == 1
-/* this is to be filled by SB code - startup value what was found */
-u8 acpi_slp_type;
-#endif
-
u8 acpi_checksum(u8 *table, u32 length)
{
u8 ret=0;
@@ -81,7 +76,6 @@ int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base, u16 seg_
return (sizeof(acpi_mcfg_mmconfig_t));
}
-
int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic)
{
lapic->type=0;
@@ -378,6 +372,29 @@ void acpi_write_rsdp(acpi_rsdp_t *rsdp, acpi_rsdt_t *rsdt)
}
#if HAVE_ACPI_RESUME == 1
+void suspend_resume(void)
+{
+ void *wake_vec;
+
+#if 0
+#if MEM_TRAIN_SEQ != 0
+ #error "So far it works on AMD and MEM_TRAIN_SEQ == 0"
+#endif
+
+#if _RAMBASE < 0x1F00000
+ #error "For ACPI RESUME you need to have _RAMBASE at least 31MB"
+ #error "Chipset support (S3_NVRAM_EARLY and ACPI_IS_WAKEUP_EARLY functions and memory ctrl)"
+ #error "And coreboot memory reserved in mainboard.c"
+#endif
+#endif
+ /* if we happen to be resuming find wakeup vector and jump to OS */
+ wake_vec = acpi_find_wakeup_vector();
+ if (wake_vec)
+ acpi_jump_to_wakeup(wake_vec);
+}
+
+/* this is to be filled by SB code - startup value what was found */
+u8 acpi_slp_type = 0;
int acpi_get_sleep_type(void)
{
@@ -461,8 +478,10 @@ void *acpi_find_wakeup_vector(void)
printk_debug("FADT found at %p\n", fadt);
facs = fadt->firmware_ctrl;
- if (facs == NULL)
+ if (facs == NULL) {
+ printk_debug("No FACS found, wake up from S3 not possible.\n");
return NULL;
+ }
printk_debug("FACS found at %p\n", facs);
wake_vec = (void *) facs->firmware_waking_vector;