Relocate booindex to OCRAM region after it gets opened by TIFS so
the main domain bootloaders can have access to this data.

Signed-off-by: Wadim Egorov <w.ego...@phytec.de>
---
v2:
  - Relocate bootindex to OCRAM, drop misleading comments and remove not needed 
changes
---
 arch/arm/mach-k3/am625_init.c                 | 8 ++++++++
 arch/arm/mach-k3/include/mach/am62_hardware.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 6c96e881146..c9c97b6ce19 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -175,6 +175,14 @@ void board_init_f(ulong dummy)
                k3_sysfw_loader(true, NULL, NULL);
        }
 
+       /*
+        * Relocate boot information to OCRAM (after TIFS has opend this
+        * region for us) so the next bootloader stages can keep access to
+        * primary vs backup bootmodes.
+        */
+       if (IS_ENABLED(CONFIG_CPU_V7R))
+               writel(bootindex, K3_BOOT_PARAM_TABLE_INDEX_OCRAM);
+
        /*
         * Force probe of clk_k3 driver here to ensure basic default clock
         * configuration is always done.
diff --git a/arch/arm/mach-k3/include/mach/am62_hardware.h 
b/arch/arm/mach-k3/include/mach/am62_hardware.h
index 54380f36e16..30c2f11062c 100644
--- a/arch/arm/mach-k3/include/mach/am62_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am62_hardware.h
@@ -76,6 +76,7 @@
 #define CTRLMMR_MCU_RST_CTRL                   (MCU_CTRL_MMR0_BASE + 0x18170)
 
 #define ROM_EXTENDED_BOOT_DATA_INFO            0x43c3f1e0
+#define K3_BOOT_PARAM_TABLE_INDEX_OCRAM                0x7000F290
 
 #define TI_SRAM_SCRATCH_BOARD_EEPROM_START     0x43c30000
 
-- 
2.34.1

Reply via email to