]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Move TCM initialization to a separate routine
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Fri, 5 Oct 2018 09:39:04 +0000 (15:09 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 16 Oct 2018 14:53:24 +0000 (16:53 +0200)
This patch moves TCM initialization to a separate routine to
make it modular and can be reused if required. It also prints
warning message now as it writes to TCM.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv8/zynqmp/cpu.c

index 43ba739d2f7c0a305b0e961d79ab65c362671b78..3ed631e505afc6b3e942692a45ad091ee9811277 100644 (file)
@@ -105,10 +105,16 @@ u64 get_page_table_size(void)
 }
 
 #ifdef CONFIG_SYS_MEM_RSVD_FOR_MMU
-int reserve_mmu(void)
+static void tcm_init(u8 mode)
 {
-       initialize_tcm(TCM_LOCK);
+       puts("WARNING: Initializing TCM overwrites TCM content\n");
+       initialize_tcm(mode);
        memset((void *)ZYNQMP_TCM_BASE_ADDR, 0, ZYNQMP_TCM_SIZE);
+}
+
+int reserve_mmu(void)
+{
+       tcm_init(TCM_LOCK);
        gd->arch.tlb_size = PGTABLE_SIZE;
        gd->arch.tlb_addr = ZYNQMP_TCM_BASE_ADDR;