aboutsummaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorRasmus Villemoes2022-05-03 14:37:39 +0200
committerTom Rini2022-05-11 09:22:24 -0400
commitcff29636933a2ed79f01422d82b73dc6fb05f7fd (patch)
treefc646e0a9d040fe7db468a84cb6759ea4db38481 /common/console.c
parent042e87e8359a73e003d5b77e01a839859eb7d9cb (diff)
common/console.c: use CONFIG_VAL() with PRE_CON_BUF_* variables
There is currently no support for PRE_CONSOLE_BUFFER in SPL, but if and when that gets implemented, one would almost certainly want to use a different address and/or size for the buffer (e.g., U-Boot proper might specify an address in DRAM and a generous buffer, while SPL would be much more constrained). So a prerequisite for adding SPL_PRE_CONSOLE_BUFFER is to make the code use SPL_-specific values. No functional change. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/console.c b/common/console.c
index 92b1c93be1a..dc071f1ed66 100644
--- a/common/console.c
+++ b/common/console.c
@@ -593,13 +593,13 @@ int tstc(void)
#define PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL 1
#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
-#define CIRC_BUF_IDX(idx) ((idx) % (unsigned long)CONFIG_PRE_CON_BUF_SZ)
+#define CIRC_BUF_IDX(idx) ((idx) % (unsigned long)CONFIG_VAL(PRE_CON_BUF_SZ))
static void pre_console_putc(const char c)
{
char *buffer;
- buffer = map_sysmem(CONFIG_PRE_CON_BUF_ADDR, CONFIG_PRE_CON_BUF_SZ);
+ buffer = map_sysmem(CONFIG_VAL(PRE_CON_BUF_ADDR), CONFIG_VAL(PRE_CON_BUF_SZ));
buffer[CIRC_BUF_IDX(gd->precon_buf_idx++)] = c;
@@ -615,15 +615,15 @@ static void pre_console_puts(const char *s)
static void print_pre_console_buffer(int flushpoint)
{
unsigned long in = 0, out = 0;
- char buf_out[CONFIG_PRE_CON_BUF_SZ + 1];
+ char buf_out[CONFIG_VAL(PRE_CON_BUF_SZ) + 1];
char *buf_in;
if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
return;
- buf_in = map_sysmem(CONFIG_PRE_CON_BUF_ADDR, CONFIG_PRE_CON_BUF_SZ);
- if (gd->precon_buf_idx > CONFIG_PRE_CON_BUF_SZ)
- in = gd->precon_buf_idx - CONFIG_PRE_CON_BUF_SZ;
+ buf_in = map_sysmem(CONFIG_VAL(PRE_CON_BUF_ADDR), CONFIG_VAL(PRE_CON_BUF_SZ));
+ if (gd->precon_buf_idx > CONFIG_VAL(PRE_CON_BUF_SZ))
+ in = gd->precon_buf_idx - CONFIG_VAL(PRE_CON_BUF_SZ);
while (in < gd->precon_buf_idx)
buf_out[out++] = buf_in[CIRC_BUF_IDX(in++)];