diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Makefile.inc | 1 | ||||
-rw-r--r-- | src/lib/cbmem_console.c | 3 | ||||
-rw-r--r-- | src/lib/imd_cbmem.c | 3 | ||||
-rw-r--r-- | src/lib/program.ld | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index dec608fa41..394491c769 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -142,6 +142,7 @@ ramstage-y += imd_cbmem.c ramstage-y += imd.c postcar-y += cbmem_common.c +postcar-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c postcar-y += imd_cbmem.c postcar-y += imd.c diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 49c11eb65b..06f34af990 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -228,7 +228,7 @@ static void cbmemc_reinit(int is_recovery) /* No appending when no preram console available and adding for * the first time. */ - if (!ENV_RAMSTAGE && _preram_cbmem_console_size == 0) + if (!ENV_RAMSTAGE && !ENV_POSTCAR && _preram_cbmem_console_size == 0) flags = CBMEMC_RESET; /* Need to reset the newly added cbmem console in romstage. */ @@ -247,6 +247,7 @@ static void cbmemc_reinit(int is_recovery) } ROMSTAGE_CBMEM_INIT_HOOK(cbmemc_reinit) RAMSTAGE_CBMEM_INIT_HOOK(cbmemc_reinit) +POSTCAR_CBMEM_INIT_HOOK(cbmemc_reinit) #if IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART) void cbmem_dump_console(void) diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index d72f0b034a..b0273f4d56 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -38,7 +38,8 @@ * burden on board or chipset code to tell us by returning NULL from cbmem_top() * before that point. */ -#define CAN_USE_GLOBALS (!IS_ENABLED(CONFIG_ARCH_X86) || ENV_RAMSTAGE) +#define CAN_USE_GLOBALS \ + (!IS_ENABLED(CONFIG_ARCH_X86) || ENV_RAMSTAGE || ENV_POSTCAR) static inline struct imd *cbmem_get_imd(void) { diff --git a/src/lib/program.ld b/src/lib/program.ld index 77adb3ced8..4668aea2c6 100644 --- a/src/lib/program.ld +++ b/src/lib/program.ld @@ -38,7 +38,7 @@ *(.text); *(.text.*); -#if ENV_RAMSTAGE || ENV_ROMSTAGE +#if ENV_RAMSTAGE || ENV_ROMSTAGE || ENV_POSTCAR . = ALIGN(ARCH_POINTER_ALIGN_SIZE); _cbmem_init_hooks = .; KEEP(*(.rodata.cbmem_init_hooks)); |