diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-04-19 20:37:51 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2016-04-21 20:48:14 +0200 |
commit | 5481c961b265ef5128ab67b24d0416df22d1f693 (patch) | |
tree | 1be924448edad0662da489319fa2405c14a3b03d /src/arch | |
parent | d4afa938c3f8b72e2d3572dc74d60b731f4ddeb0 (diff) |
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>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/tables.c | 4 | ||||
-rw-r--r-- | src/arch/arm64/tables.c | 4 | ||||
-rw-r--r-- | src/arch/mips/tables.c | 4 | ||||
-rw-r--r-- | src/arch/power8/tables.c | 4 | ||||
-rw-r--r-- | src/arch/riscv/tables.c | 4 | ||||
-rw-r--r-- | src/arch/x86/tables.c | 36 |
6 files changed, 39 insertions, 17 deletions
diff --git a/src/arch/arm/tables.c b/src/arch/arm/tables.c index 20891e8d67..92213c5b9c 100644 --- a/src/arch/arm/tables.c +++ b/src/arch/arm/tables.c @@ -24,6 +24,10 @@ #include <cbmem.h> #include <lib.h> +void arch_write_tables(uintptr_t coreboot_table) +{ +} + void bootmem_arch_add_ranges(void) { } diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c index 20891e8d67..92213c5b9c 100644 --- a/src/arch/arm64/tables.c +++ b/src/arch/arm64/tables.c @@ -24,6 +24,10 @@ #include <cbmem.h> #include <lib.h> +void arch_write_tables(uintptr_t coreboot_table) +{ +} + void bootmem_arch_add_ranges(void) { } diff --git a/src/arch/mips/tables.c b/src/arch/mips/tables.c index d54b8d6e20..32e73bc1e2 100644 --- a/src/arch/mips/tables.c +++ b/src/arch/mips/tables.c @@ -25,6 +25,10 @@ #include <cbmem.h> #include <lib.h> +void arch_write_tables(uintptr_t coreboot_table) +{ +} + void bootmem_arch_add_ranges(void) { } diff --git a/src/arch/power8/tables.c b/src/arch/power8/tables.c index 17e678a999..ff07c31066 100644 --- a/src/arch/power8/tables.c +++ b/src/arch/power8/tables.c @@ -24,6 +24,10 @@ #include <cbmem.h> #include <lib.h> +void arch_write_tables(uintptr_t coreboot_table) +{ +} + void bootmem_arch_add_ranges(void) { } diff --git a/src/arch/riscv/tables.c b/src/arch/riscv/tables.c index 20891e8d67..92213c5b9c 100644 --- a/src/arch/riscv/tables.c +++ b/src/arch/riscv/tables.c @@ -24,6 +24,10 @@ #include <cbmem.h> #include <lib.h> +void arch_write_tables(uintptr_t coreboot_table) +{ +} + void bootmem_arch_add_ranges(void) { } diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c index 4fba509a96..94fe691bcb 100644 --- a/src/arch/x86/tables.c +++ b/src/arch/x86/tables.c @@ -181,6 +181,25 @@ static unsigned long write_smbios_table(unsigned long rom_table_end) return rom_table_end; } +void arch_write_tables(uintptr_t coreboot_table) +{ + unsigned long rom_table_end = 0xf0000; + + /* This table must be between 0x0f0000 and 0x100000 */ + if (IS_ENABLED(CONFIG_GENERATE_PIRQ_TABLE)) + rom_table_end = write_pirq_table(rom_table_end); + + /* The smp table must be in 0-1K, 639K-640K, or 960K-1M */ + if (IS_ENABLED(CONFIG_GENERATE_MP_TABLE)) + rom_table_end = write_mptable(rom_table_end); + + if (IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)) + rom_table_end = write_acpi_table(rom_table_end); + + if (IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)) + rom_table_end = write_smbios_table(rom_table_end); +} + void bootmem_arch_add_ranges(void) { } @@ -188,7 +207,6 @@ void bootmem_arch_add_ranges(void) 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 @@ -196,8 +214,6 @@ void write_tables(void) */ 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. @@ -205,20 +221,6 @@ void write_tables(void) low_table_start = 0; low_table_end = 0x500; - /* This table must be between 0x0f0000 and 0x100000 */ - if (IS_ENABLED(CONFIG_GENERATE_PIRQ_TABLE)) - rom_table_end = write_pirq_table(rom_table_end); - - /* The smp table must be in 0-1K, 639K-640K, or 960K-1M */ - if (IS_ENABLED(CONFIG_GENERATE_MP_TABLE)) - rom_table_end = write_mptable(rom_table_end); - - if (IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)) - rom_table_end = write_acpi_table(rom_table_end); - - if (IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)) - rom_table_end = write_smbios_table(rom_table_end); - post_code(0x9e); post_code(0x9d); |