summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmarao Begari <[email protected]>2024-09-30 10:08:14 +0530
committerMichal Simek <[email protected]>2024-10-25 14:10:31 +0200
commit342ccba5586a1e91d4506fe46f0ee7b551d2fd54 (patch)
treeec82c32bdb62b70c9171fbe5d0e258aa8188f805
parent0ac27a62f9857837739585caa86fdd039556a31d (diff)
arm64: zynqmp: Fix tcminit mode value based on argv
The RPU pytest introduced by commit e894c10c040b ("test/py: zynqmp_rpu: Add test for loading RPU apps") expects 3rd parameter as string not a number that's why extend command to actually handle both. The issue with existing code is that when any non number string is passed hextoul returns 0. For backward compatibility zynqmp tcminit 0/1 can be still used but it is recommended to use strings instead. Signed-off-by: Padmarao Begari <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
-rw-r--r--arch/arm/mach-zynqmp/zynqmp.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/arm/mach-zynqmp/zynqmp.c b/arch/arm/mach-zynqmp/zynqmp.c
index 3b4d9c60e5c..8ee25e4c316 100644
--- a/arch/arm/mach-zynqmp/zynqmp.c
+++ b/arch/arm/mach-zynqmp/zynqmp.c
@@ -151,14 +151,12 @@ 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");
+ if (!strcmp(argv[2], "lockstep") || !strcmp(argv[2], "0")) {
+ mode = TCM_LOCK;
+ } else if (!strcmp(argv[2], "split") || !strcmp(argv[2], "1")) {
+ mode = TCM_SPLIT;
+ } else {
+ printf("Mode should be either lockstep/split\n");
return CMD_RET_FAILURE;
}
@@ -429,7 +427,7 @@ U_BOOT_LONGHELP(zynqmp,
" initialized before accessing to avoid ECC\n"
" errors. mode specifies in which mode TCM has\n"
" to be initialized. Supported modes will be\n"
- " lock(0)/split(1)\n"
+ " lockstep(0)/split(1)\n"
#endif
"zynqmp pmufw address size - load PMU FW configuration object\n"
"zynqmp pmufw node <id> - load PMU FW configuration object, <id> in dec\n"