]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: j7200: Add support for storing extended boot info from ROM
authorLokesh Vutla <lokeshvutla@ti.com>
Wed, 5 Aug 2020 17:14:22 +0000 (22:44 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 11 Aug 2020 15:04:46 +0000 (20:34 +0530)
Starting J7200 SoC, ROM supports for loading sysfw directly from boot
image. ROM passes this information on number of images that are loaded
to bootloader at certain location. Add support for storing this
information before it gets corrupted.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Suman Anna <s-anna@ti.com>
arch/arm/mach-k3/include/mach/hardware.h
arch/arm/mach-k3/include/mach/j721e_hardware.h
arch/arm/mach-k3/j721e_init.c

index 0ad761418bb7e04b157a4b5b421b3b025cc8a574..02b3df0e1b78d763dc78e83d8d1a5205779333b0 100644 (file)
 #define JTAG_ID_PARTNO_SHIFT   12
 #define JTAG_ID_PARTNO_MASK    (0xffff << 12)
 
+#define K3_ROM_BOOT_HEADER_MAGIC       "EXTBOOT"
+
+struct rom_extended_boot_data {
+       char header[8];
+       u32 num_components;
+};
+
 #endif /* _ASM_ARCH_HARDWARE_H_ */
index 19873d6e28c496b4839076f1fb4bda6ed79b1016..b98f0a82f19f295a03196b45ad1c6717263eea70 100644 (file)
@@ -51,6 +51,9 @@
 #define CTRLMMR_LOCK_KICK1                             0x0100c
 #define CTRLMMR_LOCK_KICK1_UNLOCK_VAL                  0xd172bc5a
 
+/* ROM HANDOFF Structure location */
+#define ROM_ENTENDED_BOOT_DATA_INFO                    0x41cffb00
+
 /* MCU SCRATCHPAD usage */
 #define TI_SRAM_SCRATCH_BOARD_EEPROM_START     CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
 
index 63a31c18ce22f3180c55abf6b04bda10b120fb5e..6246de3a2601b0cb169de407784b974615625b93 100644 (file)
@@ -126,10 +126,13 @@ void k3_mmc_restart_clock(void)
  * it to the .data section.
  */
 u32 bootindex __attribute__((section(".data")));
+static struct rom_extended_boot_data bootdata __section(.data);
 
-static void store_boot_index_from_rom(void)
+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));
 }
 
 void board_init_f(ulong dummy)
@@ -142,7 +145,7 @@ void board_init_f(ulong dummy)
         * Cannot delay this further as there is a chance that
         * K3_BOOT_PARAM_TABLE_INDEX can be over written by SPL MALLOC section.
         */
-       store_boot_index_from_rom();
+       store_boot_info_from_rom();
 
        /* Make all control module registers accessible */
        ctrl_mmr_unlock();