aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkatesh Yadav Abbarapu2023-06-08 08:51:51 +0530
committerMichal Simek2023-06-12 13:25:02 +0200
commit2eed42c2f18c739303b098370019e366aeb64ae6 (patch)
tree3c75c984322d86fff983a572e176f70daf11967d
parent2f5ad77cfead72b0e5156a7cc527b2f9eabde63e (diff)
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. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20230608032152.980-2-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
-rw-r--r--board/xilinx/zynqmp/cmds.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c
index 930592ffb5c..dd1ad66f90c 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");