]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: fix tcm initialization for mini u-boot
authorPadmarao Begari <padmarao.begari@amd.com>
Fri, 11 Oct 2024 11:34:35 +0000 (17:04 +0530)
committerMichal Simek <michal.simek@amd.com>
Fri, 25 Oct 2024 12:10:31 +0000 (14:10 +0200)
Fix the issue introduced by commit fed064477c2c
("arm64: zynqmp: Print an error for split to lock mode switch").
The mini u-boot is hanging, because of the tcm is not initialized.
The mini u-boot is using the tcm to reserve the mmu table and
currently it is not initialized, so allowing u-boot to initialize
the tcm.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20241011113435.1966604-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
arch/arm/mach-zynqmp/cpu.c
arch/arm/mach-zynqmp/include/mach/sys_proto.h

index 5db99e2a73a1201a7b4fae0eaa41edd98e3c56a3..960ffac2105c96f79b4437a6ab506ad1448c652e 100644 (file)
@@ -112,7 +112,7 @@ u64 get_page_table_size(void)
        return 0x14000;
 }
 
-#if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP)
+#if defined(CONFIG_DEFINE_TCM_OCM_MMAP)
 void tcm_init(u8 mode)
 {
        int ret;
@@ -134,7 +134,10 @@ void tcm_init(u8 mode)
 #ifdef CONFIG_SYS_MEM_RSVD_FOR_MMU
 int arm_reserve_mmu(void)
 {
-       tcm_init(TCM_LOCK);
+       puts("WARNING: Initializing TCM overwrites TCM content\n");
+       initialize_tcm(TCM_LOCK);
+       memset((void *)ZYNQMP_TCM_BASE_ADDR, 0, ZYNQMP_TCM_SIZE);
+
        gd->arch.tlb_size = PGTABLE_SIZE;
        gd->arch.tlb_addr = ZYNQMP_TCM_BASE_ADDR;
 
index b3396db28f0b9d4bb1fcf11bd3287401bcf12b1e..9af3ab5d6b665049f910d727c6cbddff600c62f5 100644 (file)
@@ -51,7 +51,7 @@ unsigned int zynqmp_get_silicon_version(void);
 int check_tcm_mode(bool mode);
 void initialize_tcm(bool mode);
 void mem_map_fill(void);
-#if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP)
+#if defined(CONFIG_DEFINE_TCM_OCM_MMAP)
 void tcm_init(u8 mode);
 #endif