CBMEM console: Support late init
It is not compulsory to have CBMEM console initialised in romstage, so try add the CBMEM table entry again in ramstage, if not found. Change-Id: I96ab502df7f05d6bf1d6e6fa84d395ef6306b525 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3915 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
parent
f56ff9069e
commit
52a2722389
|
@ -195,11 +195,16 @@ static void copy_console_buffer(struct cbmem_console *new_cons_p)
|
||||||
|
|
||||||
static void cbmemc_reinit_(void)
|
static void cbmemc_reinit_(void)
|
||||||
{
|
{
|
||||||
struct cbmem_console *cbm_cons_p;
|
struct cbmem_console *cbm_cons_p = NULL;
|
||||||
|
|
||||||
#ifdef __PRE_RAM__
|
#ifndef __PRE_RAM__
|
||||||
|
cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!cbm_cons_p) {
|
||||||
cbm_cons_p = cbmem_add(CBMEM_ID_CONSOLE,
|
cbm_cons_p = cbmem_add(CBMEM_ID_CONSOLE,
|
||||||
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE);
|
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE);
|
||||||
|
|
||||||
if (!cbm_cons_p) {
|
if (!cbm_cons_p) {
|
||||||
current_console_set(NULL);
|
current_console_set(NULL);
|
||||||
return;
|
return;
|
||||||
|
@ -209,13 +214,8 @@ static void cbmemc_reinit_(void)
|
||||||
sizeof(struct cbmem_console);
|
sizeof(struct cbmem_console);
|
||||||
|
|
||||||
cbm_cons_p->buffer_cursor = 0;
|
cbm_cons_p->buffer_cursor = 0;
|
||||||
#else
|
}
|
||||||
cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE);
|
|
||||||
|
|
||||||
if (!cbm_cons_p)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
copy_console_buffer(cbm_cons_p);
|
copy_console_buffer(cbm_cons_p);
|
||||||
|
|
||||||
current_console_set(cbm_cons_p);
|
current_console_set(cbm_cons_p);
|
||||||
|
|
Loading…
Reference in New Issue