X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_mp.c;h=a80c6421575ea3ade21165b2102f2af9af526a39;hb=52cd47c9a5b467dd865e872647e9820d85e4292b;hp=328b338068b812f613bbe3c8998ef221e8e90897;hpb=3be2bdf5dc69b3142c1162a59bc67191c9077567;p=u-boot diff --git a/common/cmd_mp.c b/common/cmd_mp.c index 328b338068..a80c642157 100644 --- a/common/cmd_mp.c +++ b/common/cmd_mp.c @@ -7,11 +7,32 @@ #include #include +static int cpu_status_all(void) +{ + unsigned long cpuid; + + for (cpuid = 0; ; cpuid++) { + if (!is_core_valid(cpuid)) { + if (cpuid == 0) { + printf("Core num: %lu is not valid\n", cpuid); + return 1; + } + break; + } + cpu_status(cpuid); + } + + return 0; +} + static int cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long cpuid; + if (argc == 2 && strncmp(argv[1], "status", 6) == 0) + return cpu_status_all(); + if (argc < 3) return CMD_RET_USAGE; @@ -48,6 +69,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #ifdef CONFIG_SYS_LONGHELP static char cpu_help_text[] = " reset - Reset cpu \n" + "cpu status - Status of all cpus\n" "cpu status - Status of cpu \n" "cpu disable - Disable cpu \n" "cpu release [args] - Release cpu at with [args]"