summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8/zynqmp
diff options
context:
space:
mode:
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>2018-10-05 15:09:04 +0530
committerMichal Simek <michal.simek@xilinx.com>2018-10-16 16:53:24 +0200
commit12ad2994a5f01f949c3865851898bdae5ded1ddc (patch)
tree8d39096295f7ce8ba673771a8086f56780cc472f /arch/arm/cpu/armv8/zynqmp
parentddccf5ef90b6df10fe7a58fe112d2d4013e4f154 (diff)
arm64: zynqmp: Move TCM initialization to a separate routine
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>
Diffstat (limited to 'arch/arm/cpu/armv8/zynqmp')
-rw-r--r--arch/arm/cpu/armv8/zynqmp/cpu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv8/zynqmp/cpu.c b/arch/arm/cpu/armv8/zynqmp/cpu.c
index 43ba739d2f..3ed631e505 100644
--- a/arch/arm/cpu/armv8/zynqmp/cpu.c
+++ b/arch/arm/cpu/armv8/zynqmp/cpu.c
@@ -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;