2 * This file is part of the coreboot project.
4 * Based on src/arch/armv7/tables.c:
5 * Copyright (C) 2003 Eric Biederman
6 * Copyright (C) 2005 Steve Magnani
7 * Copyright (C) 2008-2009 coresystems GmbH
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #include <console/console.h>
21 #include <boot/tables.h>
22 #include <boot/coreboot_tables.h>
27 #define MAX_COREBOOT_TABLE_SIZE (8 * 1024)
29 void write_tables(void)
31 unsigned long table_pointer
, new_table_pointer
;
35 table_pointer
= (unsigned long)cbmem_add(CBMEM_ID_CBTABLE
,
36 MAX_COREBOOT_TABLE_SIZE
);
38 printk(BIOS_ERR
, "Could not add CBMEM for coreboot table.\n");
42 new_table_pointer
= write_coreboot_table(0UL, 0UL, table_pointer
,
45 if (new_table_pointer
> (table_pointer
+ MAX_COREBOOT_TABLE_SIZE
))
46 printk(BIOS_ERR
, "coreboot table didn't fit (%lx/%x bytes)\n",
47 new_table_pointer
- table_pointer
,
48 MAX_COREBOOT_TABLE_SIZE
);
50 printk(BIOS_DEBUG
, "coreboot table: %ld bytes.\n",
51 new_table_pointer
- table_pointer
);
55 /* Print CBMEM sections */