summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2022-08-30 16:40:37 -0400
committerTom Rini <trini@konsulko.com>2022-09-15 09:55:30 -0400
commit069f0d7506f6e256f9e2ade82e315ef976dfb9ba (patch)
treec331ee5014fe5c7dcbd925cccb6379a9ed43afe5
parentf6f681642f0d730887bfe944b029cb6f76a35fb6 (diff)
downloadu-boot-069f0d7506f6e256f9e2ade82e315ef976dfb9ba.tar.gz
u-boot-069f0d7506f6e256f9e2ade82e315ef976dfb9ba.tar.bz2
u-boot-069f0d7506f6e256f9e2ade82e315ef976dfb9ba.zip
cli: Reduce size of readline buffers in SPL
Normally, readline is not used int SPL. However, it may be useful to enable the Freescale DDR interactive mode in SPL, while U-Boot is still executing from SRAM. The default settings for readline result in a large buffer being allocated. Reduce the size of the maximum input line, and the number of lines of scrollback when building for SPL. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--common/cli_readline.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/cli_readline.c b/common/cli_readline.c
index e86ee73faf..f883b7ffac 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -72,8 +72,13 @@ static char *delete_char (char *buffer, char *p, int *colp, int *np, int plen)
#define getcmd_getch() getchar()
#define getcmd_cbeep() getcmd_putch('\a')
+#ifdef CONFIG_SPL_BUILD
+#define HIST_MAX 3
+#define HIST_SIZE 32
+#else
#define HIST_MAX 20
#define HIST_SIZE CONFIG_SYS_CBSIZE
+#endif
static int hist_max;
static int hist_add_idx;