summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Brattlof <bb@ti.com>2022-12-01 18:54:00 -0600
committerPraneeth Bajjuri <praneeth@ti.com>2022-12-01 18:58:20 -0600
commit3983bffabc137c885ab557ac3d1923e29d252fac (patch)
tree488f44cf185ac14f441dba048e506d45991b221f
parente2d39d6ffef39f37ffb0dfc1a317b2c03da409af (diff)
mach-k3: am62a7_init: Avoid HSM SRAM access from A53 SPL/U-Boot
Starting with v08.05.01 TIFS, HSM SRAM access is restricted to only the DM firmware and SMS cores meaning the A53 SPL and U-Boot will no longer be able to access these parts of SRAM. Unfortunately there are two data structures located in the HSM SRAM the A53's boot-loaders will need and now must be relocated by the R5 SPL. 1. The boot index from ROM, indicating whether ROM booted from the primary vs backup boot media. 2. And the Board EEPROM data scratch pad. The EXTENDED BOOT INFO, indicating which images ROM loaded is not needed by the A53 SPL and is now limited to the R5 SPL. Signed-off-by: Bryan Brattlof <bb@ti.com>
-rw-r--r--arch/arm/mach-k3/Kconfig3
-rw-r--r--arch/arm/mach-k3/am62a7_init.c20
-rw-r--r--arch/arm/mach-k3/include/mach/am62a_hardware.h6
3 files changed, 24 insertions, 5 deletions
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index 7888ff11cde..9c0572597f8 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -84,7 +84,8 @@ config SYS_K3_BOOT_PARAM_TABLE_INDEX
default 0x701bebfc if SOC_K3_AM642
default 0x43c3f290 if SOC_K3_AM625 && CPU_V7R
default 0x7000f290 if SOC_K3_AM625 && ARM64
- default 0x43c3f290 if SOC_K3_AM62A7
+ default 0x43c3f290 if SOC_K3_AM62A7 && CPU_V7R
+ default 0x7000f290 if SOC_K3_AM62A7 && ARM64
help
Address at which ROM stores the value which determines if SPL
is booted up by primary boot media or secondary boot media.
diff --git a/arch/arm/mach-k3/am62a7_init.c b/arch/arm/mach-k3/am62a7_init.c
index f4f87aa5064..75796ed166b 100644
--- a/arch/arm/mach-k3/am62a7_init.c
+++ b/arch/arm/mach-k3/am62a7_init.c
@@ -29,10 +29,20 @@ static struct rom_extended_boot_data bootdata __section(".data");
static void store_boot_info_from_rom(void)
{
bootindex = *(u32 *)(CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX);
- memcpy(&bootdata, (uintptr_t *)ROM_ENTENDED_BOOT_DATA_INFO,
- sizeof(struct rom_extended_boot_data));
+
+ if (IS_ENABLED(CONFIG_CPU_V7R)) {
+ memcpy(&bootdata, (uintptr_t *)ROM_ENTENDED_BOOT_DATA_INFO,
+ sizeof(struct rom_extended_boot_data));
+ }
}
+#if defined(CONFIG_K3_LOAD_SYSFW)
+static void store_boot_info_to_ocram(void)
+{
+ writel(bootindex, K3_BOOT_PARAM_TABLE_INDEX_OCRAM);
+}
+#endif /* CONFIG_K3_LOAD_SYSFW */
+
static void ctrl_mmr_unlock(void)
{
/* Unlock all WKUP_CTRL_MMR0 module registers */
@@ -125,6 +135,12 @@ void board_init_f(ulong dummy)
panic("ROM has not loaded TIFS firmware\n");
k3_sysfw_loader(true, NULL, NULL);
+
+ /*
+ * Relocate boot information to OCRAM to allow the next stages to
+ * know about primary vs backup bootmodes
+ */
+ store_boot_info_to_ocram();
#endif
/*
diff --git a/arch/arm/mach-k3/include/mach/am62a_hardware.h b/arch/arm/mach-k3/include/mach/am62a_hardware.h
index 52b0d9b3cb9..35cc1cacd47 100644
--- a/arch/arm/mach-k3/include/mach/am62a_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am62a_hardware.h
@@ -68,7 +68,9 @@
#define ROM_ENTENDED_BOOT_DATA_INFO 0x43c3f1e0
-/* Use Last 2K as Scratch pad */
-#define TI_SRAM_SCRATCH_BOARD_EEPROM_START 0x70000001
+#define K3_BOOT_PARAM_TABLE_INDEX_OCRAM 0x7000F290
+
+/* Use OCRAM s scratch pad */
+#define TI_SRAM_SCRATCH_BOARD_EEPROM_START 0x70000000
#endif /* __ASM_ARCH_AM62A_HARDWARE_H */