]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Fix r5 mode for cpu release command
authorPadmarao Begari <padmarao.begari@amd.com>
Mon, 4 Nov 2024 12:27:50 +0000 (17:57 +0530)
committerMichal Simek <michal.simek@amd.com>
Fri, 15 Nov 2024 13:32:47 +0000 (14:32 +0100)
The cpu release command for r5 mode (lockstep/split) argument
accepts only string. But the zynqmp tcminit command accepts
string or number for r5 mode (lockstep/split or 0/1) argument.
To fix the r5 mode argument, the common argument (lockstep/split
or 0/1) is used across different u-boot commands. Use the strcmp()
instead of strncmp() to make uniform the r5 mode (lockstep/split
or 0/1) for the zynqmp tcminit and cpu release command.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20241104122750.96251-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
arch/arm/mach-zynqmp/mp.c

index 6e6da8008f402c28cb646980429892e31026b898..448bc5328673d1083e6717e3beed454502b46900 100644 (file)
@@ -352,7 +352,7 @@ int cpu_release(u32 nr, int argc, char *const argv[])
                 */
                flush_dcache_all();
 
-               if (!strncmp(argv[1], "lockstep", 8)) {
+               if (!strcmp(argv[1], "lockstep") || !strcmp(argv[1], "0")) {
                        if (nr != ZYNQMP_CORE_RPU0) {
                                printf("Lockstep mode should run on ZYNQMP_CORE_RPU0\n");
                                return 1;
@@ -369,7 +369,7 @@ int cpu_release(u32 nr, int argc, char *const argv[])
                        dcache_enable();
                        set_r5_halt_mode(nr, RELEASE, LOCK);
                        mark_r5_used(nr, LOCK);
-               } else if (!strncmp(argv[1], "split", 5)) {
+               } else if (!strcmp(argv[1], "split") || !strcmp(argv[1], "1")) {
                        printf("R5 split mode\n");
                        set_r5_reset(nr, SPLIT);
                        set_r5_tcm_mode(SPLIT);