Before relocation there is generally not as much available memory and not
that much console output. At present the console-output buffer is the same
side before and after relocation. Add a separate Kconfig option to remove
this limitation.

Signed-off-by: Simon Glass <s...@chromium.org>
---

(no changes since v1)

 common/Kconfig   | 10 ++++++++++
 common/console.c |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index fdcf4536d0f..fede7e40215 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -32,6 +32,16 @@ config CONSOLE_RECORD_OUT_SIZE
          more data will be recorded until some is removed. The buffer is
          allocated immediately after the malloc() region is ready.
 
+config CONSOLE_RECORD_OUT_SIZE_F
+       hex "Output buffer size before relocation"
+       depends on CONSOLE_RECORD
+       default 0x400 if CONSOLE_RECORD
+       help
+         Set the size of the console output buffer before relocation. When
+         this fills up, no more data will be recorded until some is removed.
+         The buffer is allocated immediately after the early malloc() region is
+         ready.
+
 config CONSOLE_RECORD_IN_SIZE
        hex "Input buffer size"
        depends on CONSOLE_RECORD
diff --git a/common/console.c b/common/console.c
index 0013d183aeb..0c9099ca52a 100644
--- a/common/console.c
+++ b/common/console.c
@@ -735,7 +735,9 @@ int console_record_init(void)
        int ret;
 
        ret = membuff_new((struct membuff *)&gd->console_out,
-                         CONFIG_CONSOLE_RECORD_OUT_SIZE);
+                         gd->flags & GD_FLG_RELOC ?
+                                 CONFIG_CONSOLE_RECORD_OUT_SIZE :
+                                 CONFIG_CONSOLE_RECORD_OUT_SIZE_F);
        if (ret)
                return ret;
        ret = membuff_new((struct membuff *)&gd->console_in,
-- 
2.33.0.1079.g6e70778dc9-goog

Reply via email to