arch: use Kconfig variable for coreboot table size

Instead of hard coding a #define in each architecture's
tables.c for the coreboot table size in cbmem use a Kconfig
varible. This aids in aligning on a common write_tables()
implementation instead of duplicating the code for each
architecture.

Change-Id: I09c0f56133606ea62e9a9c4c6b9828bc24dcc668
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14429
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Aaron Durbin 2016-04-19 15:17:08 -05:00
parent 0eb1f1cba9
commit a0546da57a
7 changed files with 16 additions and 6 deletions

View File

@ -658,6 +658,15 @@ config ACPI_NHLT
help help
Build support for NHLT (non HD Audio) ACPI table generation. Build support for NHLT (non HD Audio) ACPI table generation.
config COREBOOT_TABLE_SIZE
hex
default 0x8000 if ARCH_X86
default 0x2000 if !ARCH_X86
help
The amount of memory to reserve for the coreboot tables in
cbmem.
#These Options are here to avoid "undefined" warnings. #These Options are here to avoid "undefined" warnings.
#The actual selection and help texts are in the following menu. #The actual selection and help texts are in the following menu.

View File

@ -23,7 +23,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <lib.h> #include <lib.h>
#define MAX_COREBOOT_TABLE_SIZE (8 * 1024) #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
void write_tables(void) void write_tables(void)
{ {

View File

@ -23,7 +23,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <lib.h> #include <lib.h>
#define MAX_COREBOOT_TABLE_SIZE (8 * 1024) #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
void write_tables(void) void write_tables(void)
{ {

View File

@ -24,7 +24,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <lib.h> #include <lib.h>
#define MAX_COREBOOT_TABLE_SIZE (8 * 1024) #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
void write_tables(void) void write_tables(void)
{ {

View File

@ -23,7 +23,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <lib.h> #include <lib.h>
#define MAX_COREBOOT_TABLE_SIZE (8 * 1024) #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
void write_tables(void) void write_tables(void)
{ {

View File

@ -23,7 +23,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <lib.h> #include <lib.h>
#define MAX_COREBOOT_TABLE_SIZE (8 * 1024) #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
void write_tables(void) void write_tables(void)
{ {

View File

@ -26,6 +26,8 @@
#include <cbmem.h> #include <cbmem.h>
#include <smbios.h> #include <smbios.h>
#define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
void write_tables(void) void write_tables(void)
{ {
unsigned long low_table_start, low_table_end; unsigned long low_table_start, low_table_end;
@ -181,7 +183,6 @@ void write_tables(void)
post_code(0x9e); post_code(0x9e);
#define MAX_COREBOOT_TABLE_SIZE (32 * 1024)
post_code(0x9d); post_code(0x9d);
high_table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE, MAX_COREBOOT_TABLE_SIZE); high_table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE, MAX_COREBOOT_TABLE_SIZE);