]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: j7200: Detect if ROM has already loaded sysfw
authorLokesh Vutla <lokeshvutla@ti.com>
Wed, 5 Aug 2020 17:14:23 +0000 (22:44 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 11 Aug 2020 15:04:46 +0000 (20:34 +0530)
Detect if sysfw is already loaded by ROM and pass this information to
sysfw loader. Based on this information sysfw loader either loads the
sysfw image from boot media or just receives the boot notification
message form sysfw.

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

index f4d7c3d71e6d2ac943293d8baefc07cb7eba6d51..8c903f14ff879fb57a5e0359c509be2c734f39c2 100644 (file)
@@ -72,6 +72,14 @@ void mmr_unlock(phys_addr_t base, u32 partition)
        writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
 }
 
+bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data)
+{
+       if (strncmp(data->header, K3_ROM_BOOT_HEADER_MAGIC, 7))
+               return false;
+
+       return data->num_components > 1;
+}
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_K3_EARLY_CONS
index 32d07340bfd1796b0300518d8c5927e93f4559ea..a6dbc7808b851fc838b6c602fab1331ce87acd89 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <asm/armv7_mpu.h>
+#include <asm/hardware.h>
 
 #define J721E  0xbb64
 #define J7200  0xbb6d
@@ -26,3 +27,4 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
 void k3_sysfw_print_ver(void);
 void spl_enable_dcache(void);
 void mmr_unlock(phys_addr_t base, u32 partition);
+bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
index 6246de3a2601b0cb169de407784b974615625b93..a36e4ed603b1af17566384416c75d3120336f2ab 100644 (file)
@@ -177,7 +177,8 @@ void board_init_f(ulong dummy)
         * callback hook, effectively switching on (or over) the console
         * output.
         */
-       k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);
+       k3_sysfw_loader(is_rom_loaded_sysfw(&bootdata),
+                       k3_mmc_stop_clock, k3_mmc_restart_clock);
 
        /* Prepare console output */
        preloader_console_init();