]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Define a way to intialize TCM
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 13 Jul 2017 13:31:09 +0000 (19:01 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 2 Aug 2017 07:11:52 +0000 (09:11 +0200)
TCM on ZynqMP needs to be intialized in a sequence
and this patch provides a global routine to perform
this as per requirement.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv8/zynqmp/mp.c
arch/arm/include/asm/arch-zynqmp/sys_proto.h

index e10fc3136c85b3958ecfbccbce9a6ed0a20407ec..76f889ba7d9eb082830c5888560c8ffc6d306461 100644 (file)
@@ -206,6 +206,21 @@ static void write_tcm_boot_trampoline(u32 boot_addr)
        }
 }
 
+void initialize_tcm(bool mode)
+{
+       if (!mode) {
+               set_r5_tcm_mode(LOCK);
+               set_r5_halt_mode(HALT, LOCK);
+               enable_clock_r5();
+               release_r5_reset(LOCK);
+       } else {
+               set_r5_tcm_mode(SPLIT);
+               set_r5_halt_mode(HALT, SPLIT);
+               enable_clock_r5();
+               release_r5_reset(SPLIT);
+       }
+}
+
 int cpu_release(int nr, int argc, char * const argv[])
 {
        if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) {
index d91d98a1196c16643761e615b2ad5f7ef647886d..3d7fad7731151e718bc19aee85c9c2b3cb202f30 100644 (file)
 
 #define PAYLOAD_ARG_CNT                5
 
+enum {
+       TCM_LOCK,
+       TCM_SPLIT,
+};
+
 int zynq_slcr_get_mio_pin_status(const char *periph);
 
 unsigned int zynqmp_get_silicon_version(void);
@@ -24,4 +29,6 @@ int zynqmp_mmio_read(const u32 address, u32 *value);
 int invoke_smc(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3,
               u32 *ret_payload);
 
+void initialize_tcm(bool mode);
+
 #endif /* _ASM_ARCH_SYS_PROTO_H */