]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootstash: Do not provide a default address for all
authorTom Rini <trini@konsulko.com>
Mon, 15 Jul 2024 11:42:00 +0000 (12:42 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 19 Jul 2024 22:48:07 +0000 (16:48 -0600)
A valid memory location to stash bootstage information at will be
architecture dependent. Move the existing defaults to the main Kconfig
file for this option and set 0x0 as the default only for sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-rockchip/tpl.c
arch/arm/mach-stm32mp/Kconfig.13x
arch/arm/mach-stm32mp/Kconfig.15x
arch/arm/mach-stm32mp/Kconfig.25x
arch/x86/cpu/cpu.c
boot/Kconfig
cmd/bootstage.c
common/board_f.c
common/bootstage.c

index 50f04f9474a0d16da36c88a57ab7a39299ddfd5a..597a5caa84bb9106662894010547eb1f283b83a4 100644 (file)
@@ -92,15 +92,13 @@ void board_init_f(ulong dummy)
 int board_return_to_bootrom(struct spl_image_info *spl_image,
                            struct spl_boot_device *bootdev)
 {
-#ifdef CONFIG_BOOTSTAGE_STASH
        int ret;
 
        bootstage_mark_name(BOOTSTAGE_ID_END_TPL, "end tpl");
-       ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
-                             CONFIG_BOOTSTAGE_STASH_SIZE);
+       ret = bootstage_stash_default();
        if (ret)
                debug("Failed to stash bootstage: err=%d\n", ret);
-#endif
+
        back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 
        return 0;
index 4d74b35055b865473a4a2c5a50b8288176e95aa1..bc8b3f8cf77f9042e2bc4ce0df19674fd2579773 100644 (file)
@@ -28,9 +28,6 @@ config PRE_CON_BUF_ADDR
 config PRE_CON_BUF_SZ
        default 4096
 
-config BOOTSTAGE_STASH_ADDR
-       default 0xC3000000
-
 if BOOTCOUNT_GENERIC
 config SYS_BOOTCOUNT_SINGLEWORD
        default y
index d99aa9fd694a6ab5fe1bbaa19a8b9550e0d09a86..42da36a73e85656c89722d94fd8bea7abfa8a592 100644 (file)
@@ -86,9 +86,6 @@ config PRE_CON_BUF_ADDR
 config PRE_CON_BUF_SZ
        default 4096
 
-config BOOTSTAGE_STASH_ADDR
-       default 0xC3000000
-
 if BOOTCOUNT_GENERIC
 config SYS_BOOTCOUNT_SINGLEWORD
        default y
index 2c0f691f8b54e5c79f4006430c29c9f215d341d5..7d2d8171845bc933d473c855b48652014c3aea76 100644 (file)
@@ -24,9 +24,6 @@ config PRE_CON_BUF_ADDR
 config PRE_CON_BUF_SZ
        default 4096
 
-config BOOTSTAGE_STASH_ADDR
-       default 0x87000000
-
 if DEBUG_UART
 
 config DEBUG_UART_BOARD_INIT
index c8433360f28e9c54dd9928b7b64521cf0c3121f9..ad21fdb457a3c41fae7c4a657f696bbddcc0430b 100644 (file)
@@ -75,8 +75,7 @@ int __weak x86_cleanup_before_linux(void)
        ret = mp_park_aps();
        if (ret)
                return log_msg_ret("park", ret);
-       bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
-                       CONFIG_BOOTSTAGE_STASH_SIZE);
+       bootstage_stash_default();
 
        return 0;
 }
index def483a41f156c0df9446f50f8ed20439f6d075f..30d10cb59c21a6f658e5d4400acfc04b9e3da76e 100644 (file)
@@ -1019,13 +1019,17 @@ config BOOTSTAGE_STASH
 
 config BOOTSTAGE_STASH_ADDR
        hex "Address to stash boot timing information"
-       default 0x0
+       depends on BOOTSTAGE_STASH
+       default 0xC3000000 if STM32MP13X || STM32MP15X
+       default 0x87000000 if STM32MP25X
+       default 0x0 if SANDBOX
        help
          Provide an address which will not be overwritten by the OS when it
          starts, so that it can read this information when ready.
 
 config BOOTSTAGE_STASH_SIZE
        hex "Size of boot timing stash region"
+       depends on BOOTSTAGE_STASH
        default 0x1000
        help
          This should be large enough to hold the bootstage stash. A value of
index c47679d69d67a834473fcad6e93ca720736fefd4..8248c41ca8262e1d11196a89472474f5894bd5d7 100644 (file)
@@ -15,6 +15,7 @@ static int do_bootstage_report(struct cmd_tbl *cmdtp, int flag, int argc,
        return 0;
 }
 
+#if IS_ENABLED(CONFIG_BOOTSTAGE_STASH)
 static int get_base_size(int argc, char *const argv[], ulong *basep,
                         ulong *sizep)
 {
@@ -58,11 +59,14 @@ static int do_bootstage_stash(struct cmd_tbl *cmdtp, int flag, int argc,
 
        return 0;
 }
+#endif
 
 static struct cmd_tbl cmd_bootstage_sub[] = {
        U_BOOT_CMD_MKENT(report, 2, 1, do_bootstage_report, "", ""),
+#if IS_ENABLED(CONFIG_BOOTSTAGE_STASH)
        U_BOOT_CMD_MKENT(stash, 4, 0, do_bootstage_stash, "", ""),
        U_BOOT_CMD_MKENT(unstash, 4, 0, do_bootstage_stash, "", ""),
+#endif
 };
 
 /*
@@ -90,6 +94,8 @@ U_BOOT_CMD(bootstage, 4, 1, do_boostage,
        "Boot stage command",
        " - check boot progress and timing\n"
        "report                      - Print a report\n"
+#if IS_ENABLED(CONFIG_BOOTSTAGE_STASH)
        "stash [<start> [<size>]]    - Stash data into memory\n"
-       "unstash [<start> [<size>]]  - Unstash data from memory"
+       "unstash [<start> [<size>]]  - Unstash data from memory\n"
+#endif
 );
index 22c180b21877c390f1892924a41a037bfcfe50d2..29e185137adc0b0948c129dcfb18e104899ea3fc 100644 (file)
@@ -810,10 +810,7 @@ static int initf_bootstage(void)
        if (ret)
                return ret;
        if (from_spl) {
-               const void *stash = map_sysmem(CONFIG_BOOTSTAGE_STASH_ADDR,
-                                              CONFIG_BOOTSTAGE_STASH_SIZE);
-
-               ret = bootstage_unstash(stash, CONFIG_BOOTSTAGE_STASH_SIZE);
+               ret = bootstage_stash_default();
                if (ret && ret != -ENOENT) {
                        debug("Failed to unstash bootstage: err=%d\n", ret);
                        return ret;
index df83eb684c09c567f54f99adb83c4e4f02f57199..b6c268d9f4782ec2dd283ea22230c7786f9df987 100644 (file)
@@ -500,6 +500,7 @@ int bootstage_unstash(const void *base, int size)
        return 0;
 }
 
+#if IS_ENABLED(CONFIG_BOOTSTAGE_STASH)
 int _bootstage_stash_default(void)
 {
        return bootstage_stash(map_sysmem(CONFIG_BOOTSTAGE_STASH_ADDR, 0),
@@ -513,6 +514,7 @@ int _bootstage_unstash_default(void)
 
        return bootstage_unstash(stash, CONFIG_BOOTSTAGE_STASH_SIZE);
 }
+#endif
 
 int bootstage_get_size(void)
 {