ARM: stm32: Auto-detect ROM API table on STM32MP15xx
Subsystems (3)
PATCH 1/1 ARM: stm32: Auto-detect ROM API table on STM32MP15xx
The ROM API table location is passed to the SPL by BootROM in register r0, make use of this, store the content of r0 and later use it to access the ROM API table to determine current boot device.
---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- arch/arm/mach-stm32mp/stm32mp1/cpu.c | 3 +-- arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/mach-stm32mp/stm32mp1/cpu.c +1 -2
@@ -330,8 +330,7 @@ static uintptr_t nt_fw_dtb __section(".data");void save_boot_params (unsigned long r0,unsigned long r1,unsigned long r2,unsigned long r3) { -if (IS_ENABLED (CONFIG_STM32_ECDSA_VERIFY )) - rom_api_table = r0; + rom_api_table = r0;if (IS_ENABLED (CONFIG_TFABOOT )) nt_fw_dtb = r2;
arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c +1 -2
@@ -64,7 +64,6 @@* - boot instance = bit 31:16 * - boot device = bit 15:0 */ -#define BOOTROM_PARAM_ADDR 0x2FFC0078#define BOOTROM_MODE_MASK GENMASK(15, 0)#define BOOTROM_MODE_SHIFT 0#define BOOTROM_INSTANCE_MASK GENMASK(31, 16)
@@ -189,7 +188,7 @@ void spl_board_init(void)static void update_bootmode (void ) {u32 boot_mode; -u32 bootrom_itf =readl (BOOTROM_PARAM_ADDR ); +u32 bootrom_itf =readl (get_stm32mp_rom_api_table ());u32 bootrom_device, bootrom_instance;/* enable TAMP clock = RTCAPBEN */
Signature · 1 line
2.47.2
Quoted 45 lines · Marek Vasut
The ROM API table location is passed to the SPL by BootROM in register r0, make use of this, store the content of r0 and later use it to access the ROM API table to determine current boot device.
Signed-off-by Marek Vasut <[email protected]>---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]--- arch/arm/mach-stm32mp/stm32mp1/cpu.c | 3 +-- arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)arch/arm/mach-stm32mp/stm32mp1/cpu.c +1
-2@@ -330,8 +330,7 @@ static uintptr_t nt_fw_dtb __section(".data");void save_boot_params (unsigned long r0,unsigned long r1,unsigned long r2,unsigned long r3) { -if (IS_ENABLED (CONFIG_STM32_ECDSA_VERIFY )) - rom_api_table = r0; + rom_api_table = r0;if (IS_ENABLED (CONFIG_TFABOOT )) nt_fw_dtb = r2;arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c +0
-1@@ -64,7 +64,6 @@* - boot instance = bit 31:16 * - boot device = bit 15:0 */ -#define BOOTROM_PARAM_ADDR 0x2FFC0078#define BOOTROM_MODE_MASK GENMASK(15, 0)#define BOOTROM_MODE_SHIFT 0#define BOOTROM_INSTANCE_MASK GENMASK(31, 16)
arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c void spl_board_init(void) · line 194
Quoted 8 lines
arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c +1
-1@@ -189,7 +188,7 @@ void spl_board_init(void)static void update_bootmode (void ) {u32 boot_mode; -u32 bootrom_itf =readl (BOOTROM_PARAM_ADDR ); +u32 bootrom_itf =readl (get_stm32mp_rom_api_table ());u32 bootrom_device, bootrom_instance;/* enable TAMP clock = RTCAPBEN */
Thanks
Patrice
Quoted 55 lines · Patrice CHOTARD
Quoted 52 lines · Marek Vasut
The ROM API table location is passed to the SPL by BootROM in register r0, make use of this, store the content of r0 and later use it to access the ROM API table to determine current boot device.
Signed-off-by Marek Vasut <[email protected]>---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]--- arch/arm/mach-stm32mp/stm32mp1/cpu.c | 3 +-- arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)arch/arm/mach-stm32mp/stm32mp1/cpu.c +1
-2@@ -330,8 +330,7 @@ static uintptr_t nt_fw_dtb __section(".data");void save_boot_params (unsigned long r0,unsigned long r1,unsigned long r2,unsigned long r3) { -if (IS_ENABLED (CONFIG_STM32_ECDSA_VERIFY )) - rom_api_table = r0; + rom_api_table = r0;if (IS_ENABLED (CONFIG_TFABOOT )) nt_fw_dtb = r2;arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c +1
-2@@ -64,7 +64,6 @@* - boot instance = bit 31:16 * - boot device = bit 15:0 */ -#define BOOTROM_PARAM_ADDR 0x2FFC0078#define BOOTROM_MODE_MASK GENMASK(15, 0)#define BOOTROM_MODE_SHIFT 0#define BOOTROM_INSTANCE_MASK GENMASK(31, 16)@@ -189,7 +188,7 @@ void spl_board_init(void)static void update_bootmode (void ) {u32 boot_mode; -u32 bootrom_itf =readl (BOOTROM_PARAM_ADDR ); +u32 bootrom_itf =readl (get_stm32mp_rom_api_table ());u32 bootrom_device, bootrom_instance;
Quoted 6 lines
arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c void spl_board_init(void) · line 194
Quoted 1 line
arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c +0
-0/* enable TAMP clock = RTCAPBEN */ Reviewed-by Patrice Chotard <[email protected]>Thanks
Patrice
Applied to u-boot-stm32/next
Thanks
Patrice