Skip to contentSkip to conversation

Fix the tcminit command

PATCH In review Venkatesh Yadav Abbarapu 2 participants 4 messages Jun 8, 2023 – Jun 12, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 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(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 arm64: zynqmp: Fix tcminit mode param

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.

---
 board/xilinx/zynqmp/cmds.c | 5 +++++
 1 file changed, 5 insertions(+)
board/xilinx/zynqmp/cmds.c +5 -0
index e20030ecda..fff3f37807 100644
@@ -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");
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 arm64: zynqmp: Fix lockstep mode cpu release functionality

In reply to Venkatesh Yadav Abbarapu

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".

---
 arch/arm/mach-zynqmp/mp.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-zynqmp/mp.c +4 -0
index 7a12f4b2b6..b06c867e57 100644
@@ -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);
Signature · 1 line
2.17.1
maintainer
#3 lore raw
In reply to Venkatesh Yadav Abbarapu
Quoted 4 lines · Venkatesh Yadav Abbarapu

Fix the tcminit mode param and cpu release lockstep functionality.

Quoted 8 lines

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