[PATCH 03/11] mvebu: Use CONFIG_SPL_STACK + 4 directly for bootparam location
Tom Rini
trini at konsulko.com
Thu May 26 15:41:59 CEST 2022
The definition of CONFIG_SPL_BOOTROM_SAVE is always a fixed
CONFIG_SPL_STACK + 4, while CONFIG_SPL_STACK is not constant. This
change will make it clear where the location is still, once
CONFIG_SPL_STACK moves to Kconfig.
Cc: Stefan Roese <sr at denx.de>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
arch/arm/mach-mvebu/lowlevel_spl.S | 8 ++++----
arch/arm/mach-mvebu/spl.c | 2 +-
include/configs/clearfog.h | 1 -
include/configs/controlcenterdc.h | 1 -
include/configs/db-88f6720.h | 1 -
include/configs/db-88f6820-amc.h | 1 -
include/configs/db-88f6820-gp.h | 1 -
include/configs/db-mv784mp-gp.h | 1 -
include/configs/ds414.h | 1 -
include/configs/helios4.h | 1 -
include/configs/maxbcm.h | 1 -
include/configs/theadorable.h | 1 -
include/configs/turris_omnia.h | 1 -
include/configs/x530.h | 1 -
14 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/arch/arm/mach-mvebu/lowlevel_spl.S b/arch/arm/mach-mvebu/lowlevel_spl.S
index 501c239e9d38..49891df9ea9e 100644
--- a/arch/arm/mach-mvebu/lowlevel_spl.S
+++ b/arch/arm/mach-mvebu/lowlevel_spl.S
@@ -8,19 +8,19 @@
* contains U-Boot SPL, optionally it can also contain additional arguments.
* The number of these arguments is in r0, pointer to the argument array in r1.
* BootROM expects executable BIN header code to return to address stored in lr.
- * Other registers (r2 - r12) must be preserved. We save all registers to
- * CONFIG_SPL_BOOTROM_SAVE address. BIN header arguments (passed via r0 and r1)
+ * Other registers (r2 - r12) must be preserved. We save all registers to the
+ * address of CONFIG_SPL_STACK + 4. BIN header arguments (passed via r0 and r1)
* are currently not used by U-Boot SPL binary.
*/
ENTRY(save_boot_params)
stmfd sp!, {r0 - r12, lr} /* @ save registers on stack */
- ldr r12, =CONFIG_SPL_BOOTROM_SAVE
+ ldr r12, =(CONFIG_SPL_STACK + 4)
str sp, [r12]
b save_boot_params_ret
ENDPROC(save_boot_params)
ENTRY(return_to_bootrom)
- ldr r12, =CONFIG_SPL_BOOTROM_SAVE
+ ldr r12, =(CONFIG_SPL_STACK + 4)
ldr sp, [r12]
ldmfd sp!, {r0 - r12, lr} /* @ restore registers from stack */
mov r0, #0x0 /* @ return value: 0x0 NO_ERR */
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index fa9a1d7ab65e..13c99913c380 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -283,7 +283,7 @@ u32 spl_boot_device(void)
int board_return_to_bootrom(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
- u32 *regs = *(u32 **)CONFIG_SPL_BOOTROM_SAVE;
+ u32 *regs = *(u32 **)(CONFIG_SPL_STACK + 4);
printf("Returning to BootROM (return address 0x%08x)...\n", regs[13]);
return_to_bootrom();
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index b67a31981b07..6cf44877601f 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -48,7 +48,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
/* SPL related MMC defines */
diff --git a/include/configs/controlcenterdc.h b/include/configs/controlcenterdc.h
index 08eb0dbbf954..78b7d4f17f29 100644
--- a/include/configs/controlcenterdc.h
+++ b/include/configs/controlcenterdc.h
@@ -40,7 +40,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((212 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
/* SPL related MMC defines */
diff --git a/include/configs/db-88f6720.h b/include/configs/db-88f6720.h
index 89786044c834..eeaae1fdabcb 100644
--- a/include/configs/db-88f6720.h
+++ b/include/configs/db-88f6720.h
@@ -38,6 +38,5 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + (128 << 10))
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#endif /* _CONFIG_DB_88F6720_H */
diff --git a/include/configs/db-88f6820-amc.h b/include/configs/db-88f6820-amc.h
index 56fd872272d9..cb2050015e00 100644
--- a/include/configs/db-88f6820-amc.h
+++ b/include/configs/db-88f6820-amc.h
@@ -45,7 +45,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
index 0c42ef415da9..e1a97daeac8b 100644
--- a/include/configs/db-88f6820-gp.h
+++ b/include/configs/db-88f6820-gp.h
@@ -45,7 +45,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
/* SPL related MMC defines */
diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index 4e0563dd5dae..2ec9afe8e843 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -57,7 +57,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + (128 << 10))
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
/* Enable DDR support in SPL (DDR3 training from Marvell bin_hdr) */
#define CONFIG_SPD_EEPROM 0x4e
diff --git a/include/configs/ds414.h b/include/configs/ds414.h
index 41f72eef4fcd..3eff94f116ea 100644
--- a/include/configs/ds414.h
+++ b/include/configs/ds414.h
@@ -49,7 +49,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + (128 << 10))
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
/* Default Environment */
diff --git a/include/configs/helios4.h b/include/configs/helios4.h
index aed4d7e8f536..e90cea374b24 100644
--- a/include/configs/helios4.h
+++ b/include/configs/helios4.h
@@ -48,7 +48,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
/* SPL related MMC defines */
diff --git a/include/configs/maxbcm.h b/include/configs/maxbcm.h
index 0eaf08e18c93..939046f6de85 100644
--- a/include/configs/maxbcm.h
+++ b/include/configs/maxbcm.h
@@ -52,7 +52,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + (128 << 10))
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
/* SPL related SPI defines */
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 8e13b47eab9c..626261d0742f 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -77,7 +77,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + (128 << 10))
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
/* Enable DDR support in SPL (DDR3 training from Marvell bin_hdr) */
#define CONFIG_SYS_SDRAM_SIZE SZ_2G
diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h
index fbdd2a4f08d2..089828fa3d18 100644
--- a/include/configs/turris_omnia.h
+++ b/include/configs/turris_omnia.h
@@ -32,7 +32,6 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
/* SPL related MMC defines */
diff --git a/include/configs/x530.h b/include/configs/x530.h
index 5065eb87a39d..601a7ee7d4f2 100644
--- a/include/configs/x530.h
+++ b/include/configs/x530.h
@@ -72,6 +72,5 @@
#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
-#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
#endif /* _CONFIG_X530_H */
--
2.25.1
More information about the U-Boot
mailing list