|
@@ -54,6 +54,10 @@ static struct table_info table_list[] = {
|
|
|
#ifdef CONFIG_GENERATE_MP_TABLE
|
|
|
{ "mp", write_mp_table, },
|
|
|
#endif
|
|
|
+ /*
|
|
|
+ * tables which can go in the bloblist must be last in this list, so
|
|
|
+ * that the calculation of gd->table_end works properly
|
|
|
+ */
|
|
|
#ifdef CONFIG_GENERATE_ACPI_TABLE
|
|
|
{ "acpi", write_acpi_tables, BLOBLISTT_ACPI_TABLES, 0x10000, 0x1000},
|
|
|
#endif
|
|
@@ -80,10 +84,12 @@ int write_tables(void)
|
|
|
{
|
|
|
u32 high_table, table_size;
|
|
|
struct memory_area cfg_tables[ARRAY_SIZE(table_list) + 1];
|
|
|
+ bool use_high = false;
|
|
|
u32 rom_addr;
|
|
|
int i;
|
|
|
|
|
|
- rom_addr = ROM_TABLE_ADDR;
|
|
|
+ gd->arch.table_start = ROM_TABLE_ADDR;
|
|
|
+ rom_addr = gd->arch.table_start;
|
|
|
|
|
|
debug("Writing tables to %x:\n", rom_addr);
|
|
|
for (i = 0; i < ARRAY_SIZE(table_list); i++) {
|
|
@@ -92,10 +98,17 @@ int write_tables(void)
|
|
|
u32 rom_table_end;
|
|
|
|
|
|
if (IS_ENABLED(CONFIG_BLOBLIST_TABLES) && table->tag) {
|
|
|
+ if (!gd->arch.table_end)
|
|
|
+ gd->arch.table_end = rom_addr;
|
|
|
rom_addr = (ulong)bloblist_add(table->tag, size,
|
|
|
table->align);
|
|
|
if (!rom_addr)
|
|
|
return log_msg_ret("bloblist", -ENOBUFS);
|
|
|
+
|
|
|
+ /* the bloblist is always in high memory */
|
|
|
+ use_high = true;
|
|
|
+ if (!gd->arch.table_start_high)
|
|
|
+ gd->arch.table_start_high = rom_addr;
|
|
|
}
|
|
|
rom_table_end = table->write(rom_addr);
|
|
|
if (!rom_table_end) {
|
|
@@ -132,6 +145,11 @@ int write_tables(void)
|
|
|
rom_addr = rom_table_end;
|
|
|
}
|
|
|
|
|
|
+ if (use_high)
|
|
|
+ gd->arch.table_end_high = rom_addr;
|
|
|
+ else
|
|
|
+ gd->arch.table_end = rom_addr;
|
|
|
+
|
|
|
if (IS_ENABLED(CONFIG_SEABIOS)) {
|
|
|
/* make sure the last item is zero */
|
|
|
cfg_tables[i].size = 0;
|