aboutsummaryrefslogtreecommitdiff
path: root/src/arch/i386/boot/tables.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-03-17 14:38:48 +0000
committerStefan Reinauer <stepan@openbios.org>2009-03-17 14:38:48 +0000
commitefab4ba3bb3e26de55a7f2e62bbc224c0a7d6e7f (patch)
tree19c9fec432896de0e0dd45c4b726843107bc4064 /src/arch/i386/boot/tables.c
parent5d6645ae4435337fd55e60f62daab2e3b372351e (diff)
This patch adds "high coreboot table support" to coreboot version 2.
Some bootloaders seem to overwrite memory starting at 0x600, thus destroying the coreboot table integrity, rendering the table useless. By moving the table to the high tables area (if it's activated), this problem is fixed. In order to move the table, a 40 bytes mini coreboot table with a single sub table is placed at 0x500/0x530 that points to the real coreboot table. This is comparable to the ACPI RSDT or the MP floating table. This patch also adds "table forward" support to flashrom and nvramtool. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4011 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/i386/boot/tables.c')
-rw-r--r--src/arch/i386/boot/tables.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/arch/i386/boot/tables.c b/src/arch/i386/boot/tables.c
index 58c5ce896a..72f2344911 100644
--- a/src/arch/i386/boot/tables.c
+++ b/src/arch/i386/boot/tables.c
@@ -75,7 +75,7 @@ struct lb_memory *write_tables(void)
unsigned long high_table_start, high_table_end=0;
if (high_tables_base) {
- printk_debug("High Tables Base is %lx.\n", high_tables_base);
+ printk_debug("High Tables Base is %llx.\n", high_tables_base);
high_table_start = high_tables_base;
high_table_end = high_tables_base;
} else {
@@ -189,26 +189,19 @@ struct lb_memory *write_tables(void)
rom_table_start, rom_table_end);
#endif
+#if HAVE_HIGH_TABLES == 1
+ if (high_tables_base) {
+ write_coreboot_table(low_table_start, low_table_end,
+ high_table_start, high_table_end);
+ } else {
+ printk_err("ERROR: No high_tables_base.\n");
+ write_coreboot_table(low_table_start, low_table_end,
+ rom_table_start, rom_table_end);
+ }
+#else
/* The coreboot table must be in 0-4K or 960K-1M */
write_coreboot_table(low_table_start, low_table_end,
rom_table_start, rom_table_end);
-
-#if 0 && HAVE_HIGH_TABLES == 1
- /* This is currently broken and should be severely refactored. Ideally
- * we only have a pointer to the coreboot table in the low memory, so
- * anyone can find the real position.
- * write_coreboot_table does a lot more than just writing the coreboot
- * table. It magically decides where the table should go, and therefore
- * it consumes two base addresses. If we call write_coreboot_table like
- * below, we get weird effects.
- */
- /* And we want another copy in high area because the low area might be
- * corrupted
- */
- if (high_tables_base) {
- write_coreboot_table(high_table_start, high_table_end,
- high_table_start, high_table_end);
- }
#endif
return get_lb_mem();