]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Check 0 node ID
authorMichal Simek <michal.simek@amd.com>
Thu, 1 Jun 2023 10:32:36 +0000 (12:32 +0200)
committerMichal Simek <michal.simek@amd.com>
Mon, 12 Jun 2023 11:25:01 +0000 (13:25 +0200)
ID is decimal not hexadecimal that's why passing hex number all the time
end's up as 0 that's why check it. Node ID 0 is not valid anyway.
Also properly say it in help.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/68c5cd5eade216f3c5aa6eb703ee9f69f14acad1.1685615549.git.michal.simek@amd.com
board/xilinx/zynqmp/cmds.c

index e20030ecda790297f05184db7ae80918c0f24eb8..c1224bdf821fa81478f1b8c6779f277873305bd4 100644 (file)
@@ -216,6 +216,10 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc,
                        return zynqmp_pmufw_config_close();
 
                id = dectoul(argv[3], NULL);
+               if (!id) {
+                       printf("Incorrect ID passed\n");
+                       return CMD_RET_USAGE;
+               }
 
                printf("Enable permission for node ID %d\n", id);
 
@@ -429,7 +433,7 @@ static char zynqmp_help_text[] =
        "                      lock(0)/split(1)\n"
 #endif
        "zynqmp pmufw address size - load PMU FW configuration object\n"
-       "zynqmp pmufw node <id> - load PMU FW configuration object\n"
+       "zynqmp pmufw node <id> - load PMU FW configuration object, <id> in dec\n"
        "zynqmp pmufw node close - disable config object loading\n"
        "       node: keyword, id: NODE_ID in decimal format\n"
        "zynqmp rsa srcaddr srclen mod exp rsaop -\n"