Add infrastructure for global data in the CAR phase of boot
The cbmem console structure and car global data are put in their own section, with the cbmem console coming after the global data. These areas are linked to be where CAR is available and at the very bottom of the stack. There is one shortcoming of this change: The section created by this change needs to be stripped out by the Makefile since leaving it in confuses cbfstool when it installs the stage in the image. I would like to make the tools link those symbols at the right location but leave allocation of that space out of the ELF. Change-Id: Iccfb99b128d59c5b7d6164796d21ba46d2a674e0 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/727 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
committed by
Stefan Reinauer
parent
4d04a71547
commit
19e7e7d2e7
@ -19,6 +19,7 @@
|
||||
|
||||
#include <console/console.h>
|
||||
#include <cbmem.h>
|
||||
#include <cpu/x86/car.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
@ -39,7 +40,9 @@ struct cbmem_console {
|
||||
* ram space is used for the console buffer storage. The size and location of
|
||||
* the area are defined in the config.
|
||||
*/
|
||||
#define cbmem_console_p ((struct cbmem_console *)CONFIG_DCACHE_RAM_BASE)
|
||||
|
||||
static struct cbmem_console car_cbmem_console CAR_CBMEM;
|
||||
#define cbmem_console_p (&car_cbmem_console)
|
||||
|
||||
/*
|
||||
* Once DRAM is initialized and the cache as ram mode is disabled, while still
|
||||
@ -92,7 +95,7 @@ void cbmemc_tx_byte(unsigned char data)
|
||||
* DCACHE_RAM_BASE), use the redirect pointer to find out where the
|
||||
* actual console buffer is.
|
||||
*/
|
||||
if ((u32)&cursor < (u32)CONFIG_DCACHE_RAM_BASE)
|
||||
if ((uintptr_t)&cursor < (uintptr_t)&car_cbmem_console)
|
||||
cbm_cons_p = CBMEM_CONSOLE_REDIRECT;
|
||||
#endif
|
||||
if (!cbm_cons_p)
|
||||
|
Reference in New Issue
Block a user