Skip to content
Snippets Groups Projects
Commit 711e5e26 authored by Michal Simek's avatar Michal Simek
Browse files

cmd_mp: Add support for showing all CPU status by one command


Use one command for showing overall CPU status than several without
knowing how many cpus is available in the system.

Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
parent 80fd9792
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,32 @@ ...@@ -7,11 +7,32 @@
#include <common.h> #include <common.h>
#include <command.h> #include <command.h>
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 static int
cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{ {
unsigned long cpuid; unsigned long cpuid;
if (argc == 2 && strncmp(argv[1], "status", 6) == 0)
return cpu_status_all();
if (argc < 3) if (argc < 3)
return CMD_RET_USAGE; return CMD_RET_USAGE;
...@@ -48,6 +69,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -48,6 +69,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#ifdef CONFIG_SYS_LONGHELP #ifdef CONFIG_SYS_LONGHELP
static char cpu_help_text[] = static char cpu_help_text[] =
"<num> reset - Reset cpu <num>\n" "<num> reset - Reset cpu <num>\n"
"cpu status - Status of all cpus\n"
"cpu <num> status - Status of cpu <num>\n" "cpu <num> status - Status of cpu <num>\n"
"cpu <num> disable - Disable cpu <num>\n" "cpu <num> disable - Disable cpu <num>\n"
"cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]" "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment