summaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3/j721e_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-k3/j721e_init.c')
-rw-r--r--arch/arm/mach-k3/j721e_init.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index f9454e3273e..a36e4ed603b 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -64,16 +64,6 @@ struct fwl_data cbass_hc_cfg0_fwls[] = {
#endif
#endif
-static void mmr_unlock(u32 base, u32 partition)
-{
- /* Translate the base address */
- phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
- /* Unlock the requested partition if locked using two-step sequence */
- writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
- writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
static void ctrl_mmr_unlock(void)
{
/* Unlock all WKUP_CTRL_MMR0 module registers */
@@ -97,9 +87,9 @@ static void ctrl_mmr_unlock(void)
mmr_unlock(CTRL_MMR0_BASE, 1);
mmr_unlock(CTRL_MMR0_BASE, 2);
mmr_unlock(CTRL_MMR0_BASE, 3);
- mmr_unlock(CTRL_MMR0_BASE, 4);
mmr_unlock(CTRL_MMR0_BASE, 5);
- mmr_unlock(CTRL_MMR0_BASE, 6);
+ if (soc_is_j721e())
+ mmr_unlock(CTRL_MMR0_BASE, 6);
mmr_unlock(CTRL_MMR0_BASE, 7);
}
@@ -136,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)
@@ -152,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();
@@ -184,7 +177,8 @@ void board_init_f(ulong dummy)
* callback hook, effectively switching on (or over) the console
* output.
*/
- k3_sysfw_loader(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();
@@ -208,7 +202,8 @@ void board_init_f(ulong dummy)
k3_sysfw_print_ver();
/* Perform EEPROM-based board detection */
- do_board_detect();
+ if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+ do_board_detect();
#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
@@ -370,6 +365,9 @@ void start_non_linux_remote_cores(void)
int size = 0, ret;
u32 loadaddr = 0;
+ if (!soc_is_j721e())
+ return;
+
size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load",
&loadaddr);
if (size <= 0)