2 * Copyright 2008 Freescale Semiconductor, Inc.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
29 unsigned long cpuid, val = 0;
32 printf ("Usage:\n%s\n", cmdtp->usage);
36 cpuid = simple_strtoul(argv[1], NULL, 10);
37 if (cpuid >= CONFIG_NR_CPUS) {
38 printf ("Core num: %d is out of range[0..%d]\n",
39 cpuid, CONFIG_NR_CPUS - 1);
45 if (strncmp(argv[2], "reset", 5) == 0) {
47 } else if (strncmp(argv[2], "status", 6) == 0) {
50 printf ("Usage:\n%s\n", cmdtp->usage);
56 /* 4 or greater, make sure its release */
57 if (strncmp(argv[2], "release", 7) != 0) {
58 printf ("Usage:\n%s\n", cmdtp->usage);
62 val = simple_strtoul(argv[3], NULL, 16);
64 if (cpu_release(cpuid, val, argc - 4, argv + 4)) {
65 printf ("Usage:\n%s\n", cmdtp->usage);
73 #define CPU_ARCH_HELP \
74 " [args] : <pir> <r3> <r4> <r6> <r7>\n" \
75 " pir - processor id (if writeable)\n" \
76 " r3 - value for gpr 3\n" \
77 " r4 - value for gpr 4\n" \
78 " r6 - value for gpr 6\n" \
79 " r7 - value for gpr 7\n" \
81 " Use '-' for any arg if you want the default value.\n" \
82 " Default for r3, r4, r7 is 0, r6 is 0x65504150\n" \
84 " When cpu <num> is released r5 = 0 per the ePAPR spec.\n"
88 cpu, CFG_MAXARGS, 1, cpu_cmd,
89 "cpu - Multiprocessor CPU boot manipulation and release\n",
90 "<num> reset - Reset cpu <num>\n"
91 "cpu <num> status - Status of cpu <num>\n"
92 "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]\n"