]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Convert CFG_SYS_UBOOT_START to Kconfig
authorJesse Taube <mr.bossman075@gmail.com>
Fri, 25 Aug 2023 01:59:48 +0000 (21:59 -0400)
committerTom Rini <trini@konsulko.com>
Sat, 30 Sep 2023 19:24:43 +0000 (15:24 -0400)
Commit 65cc0e2a65d2 ("global: Move remaining CONFIG_SYS_* to CFG_SYS_*")
renamed CONFIG_SYS_UBOOT_START to CFG_SYS_UBOOT_START. Unfortunately,
this meant that the value was no longer available to the Makefile. This
caused imxrt to fail to boot. All the other boards that used this
variable were unaffected because they were using the default value
which is CONFIG_TEXT_BASE.

This commit converts CFG_SYS_UBOOT_START to Kconfig and sets the default
value to CONFIG_TEXT_BASE.

Suggested-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
19 files changed:
Kconfig
Makefile
arch/arm/mach-k3/config_secure.mk
arch/arm/mach-omap2/config_secure.mk
common/spl/spl.c
common/spl/spl_fit.c
configs/imxrt1020-evk_defconfig
configs/imxrt1050-evk_defconfig
configs/imxrt1170-evk_defconfig
include/configs/gardena-smart-gateway-mt7688.h
include/configs/imxrt1020-evk.h
include/configs/imxrt1050-evk.h
include/configs/imxrt1170-evk.h
include/configs/linkit-smart-7688.h
include/configs/mt7620.h
include/configs/mt7628.h
include/configs/mt8512.h
include/configs/vocore2.h
include/spl.h

diff --git a/Kconfig b/Kconfig
index 2d4b821498605167593b0907681d1760eceb71e4..109379a1498a3c4b3ea697a27a80e745a791a8e7 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -601,7 +601,27 @@ config TEXT_BASE
        default 0x42e00000 if SUNXI_MINIMUM_DRAM_MB >= 64
        hex "Text Base"
        help
-         The address in memory that U-Boot will be running from, initially.
+         The address in memory that U-Boot will be copied and executed from
+         initially.
+
+config HAVE_SYS_UBOOT_START
+       bool "Use custom U-Boot Start"
+       depends on HAVE_TEXT_BASE
+       help
+         By default, the address in memory that U-Boot will be copied from
+         (TEXT_BASE) and the entry point are the same. Select this to start the
+         execution of U-Boot from a different address.
+         This may be required if a header or vector table needs to be copied
+         but not executed.
+
+config SYS_UBOOT_START
+       hex
+       depends on HAVE_TEXT_BASE
+       default TEXT_BASE
+       prompt "U-Boot entry" if HAVE_SYS_UBOOT_START
+       help
+         If TEXT_BASE differs from the start of execution, this sets the
+         address in memory that U-Boot will start execution from initially.
 
 config HAVE_SYS_MONITOR_BASE
        bool
index efbaf434df48d2641d5538d7d6fbd07a14b511dd..b62f0a66142e93d0b58ee12d323a61267ec9c9bc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1367,14 +1367,6 @@ OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
 u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE
        $(call if_changed,objcopy)
 
-#
-# U-Boot entry point, needed for booting of full-blown U-Boot
-# from the SPL U-Boot version.
-#
-ifndef CFG_SYS_UBOOT_START
-CFG_SYS_UBOOT_START := $(CONFIG_TEXT_BASE)
-endif
-
 # Boards with more complex image requirements can provide an .its source file
 # or a generator script
 # NOTE: Please do not use this. We are migrating away from Makefile rules to use
@@ -1394,7 +1386,7 @@ endif
 
 ifdef CONFIG_SPL_LOAD_FIT
 MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-       -a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+       -a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -p $(CONFIG_FIT_EXTERNAL_OFFSET) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(DEVICE_TREE))) \
@@ -1402,10 +1394,10 @@ MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 else
 MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
-       -a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+       -a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 MKIMAGEFLAGS_u-boot-ivt.img = -A $(ARCH) -T firmware_ivt -C none -O u-boot \
-       -a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+       -a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 u-boot-ivt.img: MKIMAGEOUTPUT = u-boot-ivt.img.log
 endif
@@ -1436,7 +1428,7 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
 UBOOT_BIN := u-boot.bin
 
 MKIMAGEFLAGS_u-boot-lzma.img = -A $(ARCH) -T standalone -C lzma -O u-boot \
-       -a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+       -a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 
 u-boot.bin.lzma: u-boot.bin FORCE
index 7bc8af813a6b9146d06f038714f469b9e16f9484..9cc1f9eb24fa777aabb2aa7a74cd60510303ceee 100644 (file)
@@ -30,7 +30,7 @@ tispl.bin_HS: $(obj)/u-boot-spl-nodtb.bin_HS $(patsubst %,$(obj)/dts/%.dtb_HS,$(
        $(call if_changed,mkfitimage)
 
 MKIMAGEFLAGS_u-boot.img_HS = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-       -a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+       -a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtb_HS,$(subst ",,$(CONFIG_OF_LIST)))
 
index 24ddcdb9614eccde4886f93841a1c7050ad1eed0..f76262bb0ce8ff1ff6db019c1628612a1c2c8263 100644 (file)
@@ -102,7 +102,7 @@ u-boot_HS_XIP_X-LOADER: $(obj)/u-boot.bin FORCE
 ifdef CONFIG_SPL_LOAD_FIT
 
 MKIMAGEFLAGS_u-boot_HS.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-       -a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+       -a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
        -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtb_HS,$(subst ",,$(CONFIG_OF_LIST)))
 
index 045a5e89625da28622b7feb6bf9038c5c0d77109..cd294e81b2a115102492b23f02995e298540b12d 100644 (file)
 DECLARE_GLOBAL_DATA_PTR;
 DECLARE_BINMAN_MAGIC_SYM;
 
-#ifndef CFG_SYS_UBOOT_START
-#define CFG_SYS_UBOOT_START    CONFIG_TEXT_BASE
-#endif
-
 u32 *boot_params_ptr = NULL;
 
 #if CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS)
@@ -252,7 +248,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
                spl_image->entry_point = u_boot_pos;
                spl_image->load_addr = u_boot_pos;
        } else {
-               spl_image->entry_point = CFG_SYS_UBOOT_START;
+               spl_image->entry_point = CONFIG_SYS_UBOOT_START;
                spl_image->load_addr = CONFIG_TEXT_BASE;
        }
        spl_image->os = IH_OS_U_BOOT;
index cd73b25656580e808399f414926fe7b5e1339876..b1668c0396cdd5fccadd58ee7b1415831ce76281 100644 (file)
@@ -817,7 +817,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
        }
 
        /*
-        * If a platform does not provide CFG_SYS_UBOOT_START, U-Boot's
+        * If a platform does not provide CONFIG_SYS_UBOOT_START, U-Boot's
         * Makefile will set it to 0 and it will end up as the entry point
         * here. What it actually means is: use the load address.
         */
index 40210a5f0b001700d4559410a06784fdab1df3d7..6b63b808958bb7d56c2629b12a3783c29b6cb8ca 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_SPL_SERIAL=y
 CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_SYS_LOAD_ADDR=0x20209000
+CONFIG_HAVE_SYS_UBOOT_START=y
+CONFIG_SYS_UBOOT_START=0x800023FD
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SD_BOOT=y
 # CONFIG_USE_BOOTCOMMAND is not set
index 8f7a36fea7593089381787991a8e29a85d0bf5d5..cbf9469b248b24542703b78ff05a9483e23fce4f 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_SPL_SERIAL=y
 CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_SYS_LOAD_ADDR=0x20209000
+CONFIG_HAVE_SYS_UBOOT_START=y
+CONFIG_SYS_UBOOT_START=0x800023FD
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SD_BOOT=y
 # CONFIG_USE_BOOTCOMMAND is not set
index 8320c091d21764a9352a7f33b107537c03635bfd..83825da6de927753aad77916703205b75a64f16a 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_SPL_SERIAL=y
 CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_SYS_LOAD_ADDR=0x202C0000
+CONFIG_HAVE_SYS_UBOOT_START=y
+CONFIG_SYS_UBOOT_START=0x202403FD
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SD_BOOT=y
 # CONFIG_USE_BOOTCOMMAND is not set
index 0ba4efe67ac34b9d1e3a71149363487199174033..1b97ae22fc611306c5c54ac4af40772e8400ab59 100644 (file)
 
 #define CFG_SYS_INIT_SP_OFFSET 0x400000
 
-/* SPL */
-
-#define CFG_SYS_UBOOT_START            CONFIG_TEXT_BASE
-
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE             0
 
index e180387c687ad48ff256c8ae0c156487a4f71f7f..cd6af93454b68a1d110979056a88edecbad5fa76 100644 (file)
 #define DMAMEM_BASE                    (PHYS_SDRAM + PHYS_SDRAM_SIZE - \
                                         DMAMEM_SZ_ALL)
 
-/*
- * Configuration of the external SDRAM memory
- */
-
-#define CFG_SYS_UBOOT_START            0x800023FD
-
 #endif /* __IMXRT1020_EVK_H */
index 7688464841ebb572d0127e8f2ff6cb6a55a9881c..2af2dde2aea17e95210218c7cd9576ed1b566517 100644 (file)
                "stderr=serial,vidconsole\0"
 #endif
 
-/*
- * Configuration of the external SDRAM memory
- */
-
-#define CFG_SYS_UBOOT_START            0x800023FD
-
 #endif /* __IMXRT1050_EVK_H */
index f83429082ac70819b347ec7912ca5d679ad4a4e9..1ccaa15bc112dbf9908580f49ebdcd33c7690c7d 100644 (file)
@@ -22,8 +22,5 @@
 #define DMAMEM_SZ_ALL                  (1 * 1024 * 1024)
 #define DMAMEM_BASE                    (PHYS_SDRAM + PHYS_SDRAM_SIZE - \
                                         DMAMEM_SZ_ALL)
-/* For SPL */
-#define CFG_SYS_UBOOT_START            0x202403FD
-/* For SPL ends */
 
 #endif /* __IMXRT1170_EVK_H */
index f16c7e912217000775b91bd13218d60530948368..e8f7a59c4019e912b40318a70ca02142900cc0bf 100644 (file)
 
 #define CFG_SYS_INIT_SP_OFFSET 0x400000
 
-/* SPL */
-
-#define CFG_SYS_UBOOT_START            CONFIG_TEXT_BASE
-
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE             0
 
index d69d35fa96c169fe851e58e4c237a2cd7c9505f5..3bc0c18a1e51cfe39e7be9047272715460a2b6be 100644 (file)
@@ -12,9 +12,6 @@
 
 #define CFG_SYS_INIT_SP_OFFSET         0x400000
 
-/* SPL */
-#define CFG_SYS_UBOOT_START            CONFIG_TEXT_BASE
-
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE             0
 
index 0ac376d33ca5d4c1395df30e24d156786c032235..1df06811d65a961d93b962cf6a16000152dff2cc 100644 (file)
@@ -22,9 +22,6 @@
 #define CFG_SYS_BAUDRATE_TABLE         { 9600, 19200, 38400, 57600, 115200, \
                                          230400, 460800, 921600 }
 
-/* SPL */
-#define CFG_SYS_UBOOT_START            CONFIG_TEXT_BASE
-
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE             0
 
index c0fc8688ca6714506b1921d7359e906328eb102d..4e70291e943be6dc597b84e7081f157791d522ab 100644 (file)
@@ -10,8 +10,6 @@
 #define __MT8512_H
 
 /* Uboot definition */
-#define CFG_SYS_UBOOT_START                    CONFIG_TEXT_BASE
-
 #define ENV_BOOT_READ_IMAGE \
        "boot_rd_img=mmc dev 0" \
        ";mmc read ${loadaddr} 0x27000 0x8000" \
index 43050d61c37eed83940403f3a6839e9d24a79ad8..eb87633661672b371d2e65c6661f0b0a434700f3 100644 (file)
 
 #define CFG_SYS_INIT_SP_OFFSET 0x400000
 
-/* SPL */
-
-#define CFG_SYS_UBOOT_START            CONFIG_TEXT_BASE
-
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE             0
 
index 92bcaa90a4afe4b3d51217d27b7173feeef74b03..57da1484f0dd70f5a556c9ddd95559e3e24c7658 100644 (file)
@@ -484,7 +484,7 @@ unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
  * spl_set_header_raw_uboot() - Set up a standard SPL image structure
  *
  * This sets up the given spl_image which the standard values obtained from
- * config options: CONFIG_SYS_MONITOR_LEN, CFG_SYS_UBOOT_START,
+ * config options: CONFIG_SYS_MONITOR_LEN, CONFIG_SYS_UBOOT_START,
  * CONFIG_TEXT_BASE.
  *
  * @spl_image: Image description to set up