diff --git a/src/arch/aarch64/include/arch/early_variables.h b/src/arch/aarch64/include/arch/early_variables.h index fc472e0882..3d9fa26397 100644 --- a/src/arch/aarch64/include/arch/early_variables.h +++ b/src/arch/aarch64/include/arch/early_variables.h @@ -25,7 +25,6 @@ #endif #define CAR_GLOBAL -#define CAR_CBMEM #define CAR_MIGRATE(migrate_fn_) static inline void *car_get_var_ptr(void *var) { return var; } diff --git a/src/arch/arm/include/arch/early_variables.h b/src/arch/arm/include/arch/early_variables.h index fc472e0882..3d9fa26397 100644 --- a/src/arch/arm/include/arch/early_variables.h +++ b/src/arch/arm/include/arch/early_variables.h @@ -25,7 +25,6 @@ #endif #define CAR_GLOBAL -#define CAR_CBMEM #define CAR_MIGRATE(migrate_fn_) static inline void *car_get_var_ptr(void *var) { return var; } diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index 0ecbe8596c..9ee13124ef 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -22,10 +22,8 @@ #ifdef __PRE_RAM__ #define CAR_GLOBAL __attribute__((section(".car.global_data,\"w\",@nobits#"))) -#define CAR_CBMEM __attribute__((section(".car.cbmem_console,\"w\",@nobits#"))) #else #define CAR_GLOBAL -#define CAR_CBMEM #endif #if CONFIG_CAR_MIGRATION && defined(__PRE_RAM__) diff --git a/src/arch/x86/init/romstage.ld b/src/arch/x86/init/romstage.ld index f44185f24e..ca769a225d 100644 --- a/src/arch/x86/init/romstage.ld +++ b/src/arch/x86/init/romstage.ld @@ -54,15 +54,15 @@ SECTIONS .car.data . (NOLOAD) : { _car_data_start = .; *(.car.global_data); - /* The cbmem_console section comes last to take advantage of - * a zero-sized array to hold the memconsole contents that - * grows to a bound of CONFIG_CONSOLE_CAR_BUFFER_SIZE. However, - * collisions within the cache-as-ram region cannot be + _car_data_end = .; + /* The preram cbmem console area comes last to take advantage + * of a zero-sized array to hold the memconsole contents that + * grows to a bound of CONFIG_CONSOLE_PRERAM_BUFFER_SIZE. + * However, collisions within the cache-as-ram region cannot be * statically checked because the cache-as-ram region usage is * cpu/chipset dependent. */ - *(.car.cbmem_console); - _car_data_end = .; + preram_cbmem_console = .; } - _bogus = ASSERT((SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full"); + _bogus = ASSERT((SIZEOF(.car.data) + CONFIG_CONSOLE_PRERAM_BUFFER_SIZE <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full"); } diff --git a/src/console/Kconfig b/src/console/Kconfig index 0338045ffe..25110042b0 100644 --- a/src/console/Kconfig +++ b/src/console/Kconfig @@ -238,15 +238,15 @@ config CONSOLE_CBMEM_BUFFER_SIZE value (64K or 0x10000 bytes) is large enough to accommodate even the BIOS_SPEW level. -config CONSOLE_CAR_BUFFER_SIZE +config CONSOLE_PRERAM_BUFFER_SIZE depends on CONSOLE_CBMEM - hex "Room allocated for console output in Cache as RAM" + hex "Room allocated for console output before RAM is initialized" default 0xc00 help Console is used before RAM is initialized. This is the room reserved - in the DCACHE based RAM to keep console output before it can be - saved in a CBMEM buffer. 3K bytes should be enough even for the - BIOS_SPEW level. + in the DCACHE based RAM, SRAM, etc. to keep console output before it + can be saved in a CBMEM buffer. 3K bytes should be enough even for + the BIOS_SPEW level. choice diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 8076425088..8d6520640e 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -43,7 +43,7 @@ static struct cbmem_console *cbmem_console_p CAR_GLOBAL; * the area are defined in the config. */ -static struct cbmem_console car_cbmem_console CAR_CBMEM; +extern struct cbmem_console preram_cbmem_console; /* * Once DRAM is initialized and the cache as ram mode is disabled, while still @@ -114,7 +114,8 @@ static inline void init_console_ptr(void *storage, u32 total_space) void cbmemc_init(void) { #ifdef __PRE_RAM__ - init_console_ptr(&car_cbmem_console, CONFIG_CONSOLE_CAR_BUFFER_SIZE); + init_console_ptr(&preram_cbmem_console, + CONFIG_CONSOLE_PRERAM_BUFFER_SIZE); #else /* * Initializing before CBMEM is available, use static buffer to store