]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Fix tcminit mode param
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Thu, 8 Jun 2023 03:21:51 +0000 (08:51 +0530)
committerMichal Simek <michal.simek@amd.com>
Mon, 12 Jun 2023 11:25:02 +0000 (13:25 +0200)
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>
board/xilinx/zynqmp/cmds.c

index 930592ffb5c18b7fa3e7894fd5c357ec9bfdace8..dd1ad66f90c035a012397bf5f02df62c04a1d2cb 100644 (file)
@@ -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");