summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-11-20 20:06:41 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-30 09:51:02 +0000
commitc0a4e2088720d65cd073440f14305090c8b7d6fb (patch)
tree2c123ae7650dd2f1a5cfb4b51d6faf6479511f4c /src/lib
parent3802563bdcaa850b9db9afe48469af80ce24e652 (diff)
downloadcoreboot-c0a4e2088720d65cd073440f14305090c8b7d6fb.tar.xz
lib/cbmem_console.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I5c970a07c7114bff81f0048cac8eafaec35a2386 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37035 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbmem_console.c43
1 files changed, 16 insertions, 27 deletions
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c
index 7876ff510a..7bd247d55b 100644
--- a/src/lib/cbmem_console.c
+++ b/src/lib/cbmem_console.c
@@ -16,7 +16,6 @@
#include <console/cbmem_console.h>
#include <console/uart.h>
#include <cbmem.h>
-#include <arch/early_variables.h>
#include <symbols.h>
/*
@@ -49,7 +48,7 @@ struct cbmem_console {
_Static_assert(CONFIG_CONSOLE_CBMEM_BUFFER_SIZE <= MAX_SIZE,
"cbmem_console format cannot support buffers larger than 256MB!");
-static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
+static struct cbmem_console *cbmem_console_p;
/*
* While running from ROM, before DRAM is initialized, some area in cache as
@@ -65,14 +64,9 @@ static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
#define STATIC_CONSOLE_SIZE 1024
static u8 static_console[STATIC_CONSOLE_SIZE];
-static struct cbmem_console *current_console(void)
-{
- return car_get_ptr(cbmem_console_p);
-}
-
static void current_console_set(struct cbmem_console *new_console_p)
{
- car_set_ptr(cbmem_console_p, new_console_p);
+ cbmem_console_p = new_console_p;
}
static int buffer_valid(struct cbmem_console *cbm_cons_p, u32 total_space)
@@ -112,21 +106,19 @@ void cbmemc_init(void)
void cbmemc_tx_byte(unsigned char data)
{
- struct cbmem_console *cbm_cons_p = current_console();
-
- if (!cbm_cons_p || !cbm_cons_p->size)
+ if (!cbmem_console_p || !cbmem_console_p->size)
return;
- u32 flags = cbm_cons_p->cursor & ~CURSOR_MASK;
- u32 cursor = cbm_cons_p->cursor & CURSOR_MASK;
+ u32 flags = cbmem_console_p->cursor & ~CURSOR_MASK;
+ u32 cursor = cbmem_console_p->cursor & CURSOR_MASK;
- cbm_cons_p->body[cursor++] = data;
- if (cursor >= cbm_cons_p->size) {
+ cbmem_console_p->body[cursor++] = data;
+ if (cursor >= cbmem_console_p->size) {
cursor = 0;
flags |= OVERFLOW;
}
- cbm_cons_p->cursor = flags | cursor;
+ cbmem_console_p->cursor = flags | cursor;
}
/*
@@ -166,7 +158,7 @@ static void cbmemc_reinit(int is_recovery)
const size_t size = CONFIG_CONSOLE_CBMEM_BUFFER_SIZE;
/* If CBMEM entry already existed, old contents are not altered. */
struct cbmem_console *cbmem_cons_p = cbmem_add(CBMEM_ID_CONSOLE, size);
- struct cbmem_console *previous_cons_p = current_console();
+ struct cbmem_console *previous_cons_p = cbmem_console_p;
init_console_ptr(cbmem_cons_p, size);
copy_console_buffer(previous_cons_p);
@@ -178,19 +170,16 @@ POSTCAR_CBMEM_INIT_HOOK(cbmemc_reinit)
#if CONFIG(CONSOLE_CBMEM_DUMP_TO_UART)
void cbmem_dump_console(void)
{
- struct cbmem_console *cbm_cons_p;
u32 cursor;
-
- cbm_cons_p = current_console();
- if (!cbm_cons_p)
+ if (!cbmem_console_p)
return;
uart_init(0);
- if (cbm_cons_p->cursor & OVERFLOW)
- for (cursor = cbm_cons_p->cursor & CURSOR_MASK;
- cursor < cbm_cons_p->size; cursor++)
- uart_tx_byte(0, cbm_cons_p->body[cursor]);
- for (cursor = 0; cursor < (cbm_cons_p->cursor & CURSOR_MASK); cursor++)
- uart_tx_byte(0, cbm_cons_p->body[cursor]);
+ if (cbmem_console_p->cursor & OVERFLOW)
+ for (cursor = cbmem_console_p->cursor & CURSOR_MASK;
+ cursor < cbmem_console_p->size; cursor++)
+ uart_tx_byte(0, cbmem_console_p->body[cursor]);
+ for (cursor = 0; cursor < (cbmem_console_p->cursor & CURSOR_MASK); cursor++)
+ uart_tx_byte(0, cbmem_console_p->body[cursor]);
}
#endif