summaryrefslogtreecommitdiff
path: root/src/arch/armv7/boot/tables.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2013-03-20 14:08:04 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-03-22 00:17:55 +0100
commit3e4e3038584fb2055c482fd346bb821b3d6236fc (patch)
tree6de73a59507af4ce7986f68918d97a080ddb8453 /src/arch/armv7/boot/tables.c
parent93a6665e0cf29971b92550ff020b8c2f67c17202 (diff)
downloadcoreboot-3e4e3038584fb2055c482fd346bb821b3d6236fc.tar.xz
Unify coreboot table generation
coreboot tables are, unlike general system tables, a platform independent concept. Hence, use the same code for coreboot table generation on all platforms. lib/coreboot_tables.c is based on the x86 version of the file, because some important fixes were missed on the ARMv7 version lately. Change-Id: Icc38baf609f10536a320d21ac64408bef44bb77d Signed-off-by: Stefan Reinauer <reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/2863 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/arch/armv7/boot/tables.c')
-rw-r--r--src/arch/armv7/boot/tables.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/arch/armv7/boot/tables.c b/src/arch/armv7/boot/tables.c
index e9fb6abb20..0fc7399c13 100644
--- a/src/arch/armv7/boot/tables.c
+++ b/src/arch/armv7/boot/tables.c
@@ -23,11 +23,12 @@
#include <cpu/cpu.h>
#include <boot/tables.h>
#include <boot/coreboot_tables.h>
-#include <arch/coreboot_tables.h>
#include <string.h>
#include <cbmem.h>
#include <lib.h>
+#define MAX_COREBOOT_TABLE_SIZE (8 * 1024)
+
/*
* TODO: "High" tables are a convention used on x86. Maybe we can
* clean up that naming at some point.
@@ -41,12 +42,10 @@ void cbmem_arch_init(void)
struct lb_memory *write_tables(void)
{
- unsigned long table_pointer;
+ unsigned long table_pointer, new_table_pointer;
if (!high_tables_base) {
- printk(BIOS_ERR, "ERROR: coreboot_tables_base is not set.\n");
- // Are there any boards without?
- // Stepan thinks we should die() here!
+ printk(BIOS_ERR, "ERROR: high_tables_base is not set.\n");
}
printk(BIOS_DEBUG, "high_tables_base: %llx.\n", high_tables_base);
@@ -55,21 +54,25 @@ struct lb_memory *write_tables(void)
table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE,
MAX_COREBOOT_TABLE_SIZE);
- if (table_pointer) {
- unsigned long new_table_pointer;
- new_table_pointer = write_coreboot_table(table_pointer,
- high_tables_size);
- if (table_pointer > (table_pointer + MAX_COREBOOT_TABLE_SIZE)) {
- printk(BIOS_ERR, "%s: coreboot table didn't fit (%lx)\n",
- __func__, new_table_pointer - table_pointer);
- }
- printk(BIOS_DEBUG, "coreboot table: %ld bytes.\n",
- new_table_pointer - table_pointer);
+ if (!table_pointer) {
+ printk(BIOS_ERR, "Could not add CBMEM for coreboot table.\n");
+ return NULL;
}
+ new_table_pointer = write_coreboot_table(0UL, 0UL,
+ table_pointer, table_pointer);
+
+ if (new_table_pointer > (table_pointer + MAX_COREBOOT_TABLE_SIZE)) {
+ printk(BIOS_ERR, "coreboot table didn't fit (%lx/%x bytes)\n",
+ new_table_pointer - table_pointer, MAX_COREBOOT_TABLE_SIZE);
+ }
+
+ printk(BIOS_DEBUG, "coreboot table: %ld bytes.\n",
+ new_table_pointer - table_pointer);
+
post_code(0x9e);
- // Remove before sending upstream
+ /* Print CBMEM sections */
cbmem_list();
return get_lb_mem();