2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #include <linux/sched.h>
20 #include <linux/smp.h>
22 #include <asm/mipsregs.h>
25 #include "cfe_error.h"
27 extern void asmlinkage smp_bootstrap(void);
29 /* Boot all other cpus in the system, initialize them, and
30 bring them into the boot fn */
31 int prom_boot_secondary(int cpu, unsigned long sp, unsigned long gp)
35 retval = cfe_cpu_start(cpu, &smp_bootstrap, sp, gp, 0);
37 printk("cfe_start_cpu(%i) returned %i\n" , cpu, retval);
44 void prom_init_secondary(void)
46 extern void load_mmu(void);
47 unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
48 STATUSF_IP1 | STATUSF_IP0;
50 /* Enable basic interrupts */
51 change_c0_status(ST0_IM, imask);
52 set_c0_status(ST0_IE);
54 /* cache and TLB setup */
59 * Set up state, return the total number of cpus in the system, including
62 void prom_setup_smp(void)
66 /* Use CFE to find out how many CPUs are available */
67 for (i=1; i<NR_CPUS; i++) {
68 if (cfe_cpu_stop(i) == 0) {
69 CPUMASK_SETB(cpu_online_map, i);
72 printk("Detected %i available CPU(s)\n", num_online_cpus());
75 void prom_smp_finish(void)
77 extern void sb1250_smp_finish(void);