cli: Reduce size of readline buffers in SPL
authorSean Anderson <sean.anderson@seco.com>
Tue, 30 Aug 2022 20:40:37 +0000 (16:40 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 15 Sep 2022 13:55:30 +0000 (09:55 -0400)
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>
common/cli_readline.c

index e86ee73..f883b7f 100644 (file)
@@ -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;