common: Add CONFIG_SKIP_RELOCATE
authorJesse Taube <mr.bossman075@gmail.com>
Wed, 9 Apr 2025 18:08:33 +0000 (14:08 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 15 Apr 2025 17:21:30 +0000 (11:21 -0600)
Add a check for CONFIG_SKIP_RELOCATE in reserve_uboot to skip the
relocation of the U-Boot image.
CONFIG_SKIP_RELOCATE skips relocation of U-Boot to the end of RAM
allowing for systems that have extremely limited RAM to run U-Boot.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Kconfig
common/board_f.c

diff --git a/Kconfig b/Kconfig
index a508c54..5135863 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -454,6 +454,12 @@ config TOOLS_DEBUG
          it is possible to set breakpoints on particular lines, single-step
          debug through the source code, etc.
 
+config SKIP_RELOCATE
+       bool "Skips relocation of U-Boot to end of RAM"
+       help
+         Skips relocation of U-Boot allowing for systems that have extremely
+         limited RAM to run U-Boot.
+
 endif # EXPERT
 
 config PHYS_64BIT
index e4e17dd..bff465d 100644 (file)
@@ -477,6 +477,13 @@ static int reserve_trace(void)
 
 static int reserve_uboot(void)
 {
+       /*
+        * This should be the first place GD_FLG_SKIP_RELOC is read from.
+        * Set GD_FLG_SKIP_RELOC flag if CONFIG_SKIP_RELOCATE is enabled.
+        */
+       if (CONFIG_IS_ENABLED(SKIP_RELOCATE))
+               gd->flags |= GD_FLG_SKIP_RELOC;
+
        if (!(gd->flags & GD_FLG_SKIP_RELOC)) {
                /*
                 * reserve memory for U-Boot code, data & bss