diff options
author | Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> | 2018-10-05 15:09:05 +0530 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-10-16 16:53:24 +0200 |
commit | 5860bc16b918bb5456a4a77930eafd7c858f70db (patch) | |
tree | e76cec5af6ccc6548bf7b7059c6217bc328ac460 /arch | |
parent | 12ad2994a5f01f949c3865851898bdae5ded1ddc (diff) | |
download | u-boot-5860bc16b918bb5456a4a77930eafd7c858f70db.tar.gz u-boot-5860bc16b918bb5456a4a77930eafd7c858f70db.tar.xz u-boot-5860bc16b918bb5456a4a77930eafd7c858f70db.zip |
arm64: zynqmp: Add new command for TCM initialization
This patch adds new zynqmp command "zynqmp tcminit mode" to
initialize TCM. TCM needs to be initialized before accessing
to avoid ECC errors. This new command helps to perform
the same. It also makes tcm_init() as global and uses it for
doing the TCM initialization.
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')
-rw-r--r-- | arch/arm/cpu/armv8/zynqmp/cpu.c | 6 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-zynqmp/sys_proto.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv8/zynqmp/cpu.c b/arch/arm/cpu/armv8/zynqmp/cpu.c index 3ed631e505..4ee8e3f627 100644 --- a/arch/arm/cpu/armv8/zynqmp/cpu.c +++ b/arch/arm/cpu/armv8/zynqmp/cpu.c @@ -104,14 +104,16 @@ u64 get_page_table_size(void) return 0x14000; } -#ifdef CONFIG_SYS_MEM_RSVD_FOR_MMU -static void tcm_init(u8 mode) +#if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP) +void tcm_init(u8 mode) { puts("WARNING: Initializing TCM overwrites TCM content\n"); initialize_tcm(mode); memset((void *)ZYNQMP_TCM_BASE_ADDR, 0, ZYNQMP_TCM_SIZE); } +#endif +#ifdef CONFIG_SYS_MEM_RSVD_FOR_MMU int reserve_mmu(void) { tcm_init(TCM_LOCK); diff --git a/arch/arm/include/asm/arch-zynqmp/sys_proto.h b/arch/arm/include/asm/arch-zynqmp/sys_proto.h index 9fa44d084c..385c8825f2 100644 --- a/arch/arm/include/asm/arch-zynqmp/sys_proto.h +++ b/arch/arm/include/asm/arch-zynqmp/sys_proto.h @@ -68,5 +68,8 @@ int invoke_smc(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, void initialize_tcm(bool mode); void mem_map_fill(void); int chip_id(unsigned char id); +#if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP) +void tcm_init(u8 mode); +#endif #endif /* _ASM_ARCH_SYS_PROTO_H */ |