CBMEM console: Fix boards with BROKEN_CAR_MIGRATE
There is no need to call cbmemc_reinit() exclusively in romstage, that is done as part of the CAR migration of cbmem_recovery(). CBMEM console for romstage remains disabled for boards flagged with BROKEN_CAR_MIGRATE, but with this change it is possible to have it for ramstage. Change-Id: I48c4afcd847d0d5f8864d23c0786935341e3f752 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/7592 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <gaumless@gmail.com>
This commit is contained in:
parent
13a845acb3
commit
71b214553c
|
@ -32,7 +32,7 @@ static inline void cbmemc_reinit(void) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define __CBMEM_CONSOLE_ENABLE__ CONFIG_CONSOLE_CBMEM && \
|
#define __CBMEM_CONSOLE_ENABLE__ CONFIG_CONSOLE_CBMEM && \
|
||||||
((ENV_ROMSTAGE && CONFIG_EARLY_CBMEM_INIT) || ENV_RAMSTAGE)
|
((ENV_ROMSTAGE && !CONFIG_BROKEN_CAR_MIGRATE) || ENV_RAMSTAGE)
|
||||||
|
|
||||||
#if __CBMEM_CONSOLE_ENABLE__
|
#if __CBMEM_CONSOLE_ENABLE__
|
||||||
static inline void __cbmemc_init(void) { cbmemc_init(); }
|
static inline void __cbmemc_init(void) { cbmemc_init(); }
|
||||||
|
|
|
@ -256,9 +256,7 @@ static void init_cbmem_post_device(void *unused)
|
||||||
#else
|
#else
|
||||||
cbmem_recovery(0);
|
cbmem_recovery(0);
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CONSOLE_CBMEM
|
|
||||||
cbmemc_reinit();
|
cbmemc_reinit();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = {
|
BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = {
|
||||||
|
|
|
@ -188,6 +188,11 @@ void cbmemc_reinit(void)
|
||||||
{
|
{
|
||||||
struct cbmem_console *cbm_cons_p = NULL;
|
struct cbmem_console *cbm_cons_p = NULL;
|
||||||
|
|
||||||
|
#ifdef __PRE_RAM__
|
||||||
|
if (IS_ENABLED(CONFIG_BROKEN_CAR_MIGRATE))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __PRE_RAM__
|
#ifndef __PRE_RAM__
|
||||||
cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE);
|
cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -426,9 +426,7 @@ void *cbmem_entry_start(const struct cbmem_entry *entry)
|
||||||
static void init_cbmem_pre_device(void *unused)
|
static void init_cbmem_pre_device(void *unused)
|
||||||
{
|
{
|
||||||
cbmem_initialize();
|
cbmem_initialize();
|
||||||
#if CONFIG_CONSOLE_CBMEM
|
|
||||||
cbmemc_reinit();
|
cbmemc_reinit();
|
||||||
#endif /* CONFIG_CONSOLE_CBMEM */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = {
|
BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = {
|
||||||
|
|
|
@ -342,10 +342,6 @@ void romstage_main_continue(EFI_STATUS status, VOID *HobListPtr) {
|
||||||
timestamp_add(TS_AFTER_INITRAM, after_initram_time);
|
timestamp_add(TS_AFTER_INITRAM, after_initram_time);
|
||||||
timestamp_add_now(TS_END_ROMSTAGE);
|
timestamp_add_now(TS_END_ROMSTAGE);
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CONSOLE_CBMEM
|
|
||||||
/* Keep this the last thing this function does. */
|
|
||||||
cbmemc_reinit();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Load the ramstage. */
|
/* Load the ramstage. */
|
||||||
copy_and_run();
|
copy_and_run();
|
||||||
|
|
|
@ -279,10 +279,6 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr) {
|
||||||
timestamp_add_now(TS_END_ROMSTAGE);
|
timestamp_add_now(TS_END_ROMSTAGE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_CONSOLE_CBMEM)
|
|
||||||
printk(BIOS_DEBUG, "cbmemc_reinit\n");
|
|
||||||
cbmemc_reinit();
|
|
||||||
#endif
|
|
||||||
post_code(0x4f);
|
post_code(0x4f);
|
||||||
|
|
||||||
/* Load the ramstage. */
|
/* Load the ramstage. */
|
||||||
|
|
|
@ -136,10 +136,6 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr) {
|
||||||
timestamp_add_now(TS_END_ROMSTAGE);
|
timestamp_add_now(TS_END_ROMSTAGE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_CONSOLE_CBMEM)
|
|
||||||
printk(BIOS_DEBUG, "cbmemc_reinit\n");
|
|
||||||
cbmemc_reinit();
|
|
||||||
#endif
|
|
||||||
post_code(0x4f);
|
post_code(0x4f);
|
||||||
|
|
||||||
/* Load the ramstage. */
|
/* Load the ramstage. */
|
||||||
|
|
Loading…
Reference in New Issue