lib/coreboot_table: add architecture hooks for adding tables
Add a architecture specific function, arch_write_tables(), that allows an architecture to add its required tables for booting. This callback helps write_tables() to be de-duplicated. Change-Id: I805c2f166b1e75942ad28b6e7e1982d64d2d5498 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/14435 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
d4afa938c3
commit
5481c961b2
|
@ -24,6 +24,10 @@
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
#include <lib.h>
|
#include <lib.h>
|
||||||
|
|
||||||
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void bootmem_arch_add_ranges(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
#include <lib.h>
|
#include <lib.h>
|
||||||
|
|
||||||
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void bootmem_arch_add_ranges(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
#include <lib.h>
|
#include <lib.h>
|
||||||
|
|
||||||
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void bootmem_arch_add_ranges(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
#include <lib.h>
|
#include <lib.h>
|
||||||
|
|
||||||
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void bootmem_arch_add_ranges(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
#include <lib.h>
|
#include <lib.h>
|
||||||
|
|
||||||
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void bootmem_arch_add_ranges(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,29 +181,9 @@ static unsigned long write_smbios_table(unsigned long rom_table_end)
|
||||||
return rom_table_end;
|
return rom_table_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
{
|
{
|
||||||
}
|
unsigned long rom_table_end = 0xf0000;
|
||||||
|
|
||||||
void write_tables(void)
|
|
||||||
{
|
|
||||||
unsigned long low_table_start, low_table_end;
|
|
||||||
unsigned long rom_table_end;
|
|
||||||
|
|
||||||
/* Even if high tables are configured, some tables are copied both to
|
|
||||||
* the low and the high area, so payloads and OSes don't need to know
|
|
||||||
* about the high tables.
|
|
||||||
*/
|
|
||||||
unsigned long high_table_pointer;
|
|
||||||
|
|
||||||
rom_table_end = 0xf0000;
|
|
||||||
|
|
||||||
/* Start low addr at 0x500, so we don't run into conflicts with the BDA
|
|
||||||
* in case our data structures grow beyond 0x400. Only GDT
|
|
||||||
* and the coreboot table use low_tables.
|
|
||||||
*/
|
|
||||||
low_table_start = 0;
|
|
||||||
low_table_end = 0x500;
|
|
||||||
|
|
||||||
/* This table must be between 0x0f0000 and 0x100000 */
|
/* This table must be between 0x0f0000 and 0x100000 */
|
||||||
if (IS_ENABLED(CONFIG_GENERATE_PIRQ_TABLE))
|
if (IS_ENABLED(CONFIG_GENERATE_PIRQ_TABLE))
|
||||||
|
@ -218,6 +198,28 @@ void write_tables(void)
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES))
|
if (IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES))
|
||||||
rom_table_end = write_smbios_table(rom_table_end);
|
rom_table_end = write_smbios_table(rom_table_end);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bootmem_arch_add_ranges(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_tables(void)
|
||||||
|
{
|
||||||
|
unsigned long low_table_start, low_table_end;
|
||||||
|
|
||||||
|
/* Even if high tables are configured, some tables are copied both to
|
||||||
|
* the low and the high area, so payloads and OSes don't need to know
|
||||||
|
* about the high tables.
|
||||||
|
*/
|
||||||
|
unsigned long high_table_pointer;
|
||||||
|
|
||||||
|
/* Start low addr at 0x500, so we don't run into conflicts with the BDA
|
||||||
|
* in case our data structures grow beyond 0x400. Only GDT
|
||||||
|
* and the coreboot table use low_tables.
|
||||||
|
*/
|
||||||
|
low_table_start = 0;
|
||||||
|
low_table_end = 0x500;
|
||||||
|
|
||||||
post_code(0x9e);
|
post_code(0x9e);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,18 @@
|
||||||
|
|
||||||
#include <boot/coreboot_tables.h>
|
#include <boot/coreboot_tables.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write architecture specific tables as well as the common
|
||||||
|
* coreboot table.
|
||||||
|
*/
|
||||||
void write_tables(void);
|
void write_tables(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allow per-architecture table writes called from write_tables(). The
|
||||||
|
* coreboot_table parameter provides a reference to where the coreboot
|
||||||
|
* table will be written. The parameter is to allow architectures to
|
||||||
|
* provide a forwarding table to real coreboot table.
|
||||||
|
*/
|
||||||
|
void arch_write_tables(uintptr_t coreboot_table);
|
||||||
|
|
||||||
#endif /* BOOT_TABLES_H */
|
#endif /* BOOT_TABLES_H */
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <console/uart.h>
|
#include <console/uart.h>
|
||||||
#include <ip_checksum.h>
|
#include <ip_checksum.h>
|
||||||
#include <boot/coreboot_tables.h>
|
#include <boot/coreboot_tables.h>
|
||||||
|
#include <boot/tables.h>
|
||||||
#include <boot_device.h>
|
#include <boot_device.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
@ -464,6 +465,8 @@ unsigned long write_coreboot_table(
|
||||||
{
|
{
|
||||||
struct lb_header *head;
|
struct lb_header *head;
|
||||||
|
|
||||||
|
arch_write_tables(rom_table_end);
|
||||||
|
|
||||||
if (low_table_start || low_table_end) {
|
if (low_table_start || low_table_end) {
|
||||||
printk(BIOS_DEBUG, "Writing table forward entry at 0x%08lx\n",
|
printk(BIOS_DEBUG, "Writing table forward entry at 0x%08lx\n",
|
||||||
low_table_end);
|
low_table_end);
|
||||||
|
|
Loading…
Reference in New Issue