[PATCH 0/2] Fix the tcminit command

Fix the tcminit mode param and cpu release lockstep functionality.
Venkatesh Yadav Abbarapu (2): arm64: zynqmp: Fix tcminit mode param arm64: zynqmp: Fix lockstep mode cpu release functionality
arch/arm/mach-zynqmp/mp.c | 4 ++++ board/xilinx/zynqmp/cmds.c | 5 +++++ 2 files changed, 9 insertions(+)

While invoking "zynqmp tcminit mode" command (which is invalid command) on U-Boot, it just works. Check the mode param, if it is valid then only initialize the TCM.
Signed-off-by: Venkatesh Yadav Abbarapu venkatesh.abbarapu@amd.com --- board/xilinx/zynqmp/cmds.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index e20030ecda..fff3f37807 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -187,6 +187,11 @@ static int do_zynqmp_tcm_init(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != cmdtp->maxargs) return CMD_RET_USAGE;
+ if (strcmp(argv[2], "lockstep") && strcmp(argv[2], "split")) { + printf("mode param should be lockstep or split\n"); + return CMD_RET_FAILURE; + } + mode = hextoul(argv[2], NULL); if (mode != TCM_LOCK && mode != TCM_SPLIT) { printf("Mode should be either 0(lock)/1(split)\n");

For lockstep mode, cpu_release function is expecting to execute on R5 core 0, if there is attempt to pass other than R5 core 0, through an error saying "Lockstep mode should run on R5 core 0 only".
Signed-off-by: Venkatesh Yadav Abbarapu venkatesh.abbarapu@amd.com --- arch/arm/mach-zynqmp/mp.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/mach-zynqmp/mp.c b/arch/arm/mach-zynqmp/mp.c index 7a12f4b2b6..b06c867e57 100644 --- a/arch/arm/mach-zynqmp/mp.c +++ b/arch/arm/mach-zynqmp/mp.c @@ -326,6 +326,10 @@ int cpu_release(u32 nr, int argc, char *const argv[]) flush_dcache_all();
if (!strncmp(argv[1], "lockstep", 8)) { + if (nr != ZYNQMP_CORE_RPU0) { + printf("Lockstep mode should run on ZYNQMP_CORE_RPU0\n"); + return 1; + } printf("R5 lockstep mode\n"); set_r5_reset(nr, LOCK); set_r5_tcm_mode(LOCK);

On 6/8/23 05:21, Venkatesh Yadav Abbarapu wrote:
Fix the tcminit mode param and cpu release lockstep functionality.
Venkatesh Yadav Abbarapu (2): arm64: zynqmp: Fix tcminit mode param arm64: zynqmp: Fix lockstep mode cpu release functionality
arch/arm/mach-zynqmp/mp.c | 4 ++++ board/xilinx/zynqmp/cmds.c | 5 +++++ 2 files changed, 9 insertions(+)
Applied but can you please also update command documentation to use lockstep instead of lock?
439 "zynqmp tcminit mode - Initialize the TCM with zeros. TCM needs to be\n" 440 " initialized before accessing to avoid ECC\n" 441 " errors. mode specifies in which mode TCM has\n" 442 " to be initialized. Supported modes will be\n" 443 " lock(0)/split(1)\n"
Thanks, Michal
participants (2)
-
Michal Simek
-
Venkatesh Yadav Abbarapu