1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2008-2009 Freescale Semiconductor, Inc.
9 static int cpu_status_all(void)
13 for (cpuid = 0; ; cpuid++) {
14 if (!is_core_valid(cpuid)) {
16 printf("Core num: %lu is not valid\n", cpuid);
28 cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
32 if (argc == 2 && strncmp(argv[1], "status", 6) == 0)
33 return cpu_status_all();
38 cpuid = simple_strtoul(argv[1], NULL, 10);
39 if (!is_core_valid(cpuid)) {
40 printf ("Core num: %lu is not valid\n", cpuid);
46 if (strncmp(argv[2], "reset", 5) == 0)
48 else if (strncmp(argv[2], "status", 6) == 0)
50 else if (strncmp(argv[2], "disable", 7) == 0)
51 return cpu_disable(cpuid);
58 /* 4 or greater, make sure its release */
59 if (strncmp(argv[2], "release", 7) != 0)
62 if (cpu_release(cpuid, argc - 3, argv + 3))
68 #ifdef CONFIG_SYS_LONGHELP
69 static char cpu_help_text[] =
70 "<num> reset - Reset cpu <num>\n"
71 "cpu status - Status of all cpus\n"
72 "cpu <num> status - Status of cpu <num>\n"
73 "cpu <num> disable - Disable cpu <num>\n"
74 "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
77 " [args] : <pir> <r3> <r6>\n" \
78 " pir - processor id (if writeable)\n" \
79 " r3 - value for gpr 3\n" \
80 " r6 - value for gpr 6\n" \
82 " Use '-' for any arg if you want the default value.\n" \
83 " Default for r3 is <num> and r6 is 0\n" \
85 " When cpu <num> is released r4 and r5 = 0.\n" \
86 " r7 will contain the size of the initial mapped area"
92 cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd,
93 "Multiprocessor CPU boot manipulation and release", cpu_help_text