[MIPS] SMP: Scatter __cpuinit over the code as needed.
[linux-2.6/verdex.git] / arch / mips / mips-boards / malta / malta_smtc.c
blob40d782d7d37ff95a7c8b8662f737dcd939936dc2
1 /*
2 * Malta Platform-specific hooks for SMP operation
3 */
4 #include <linux/init.h>
6 #include <asm/mipsregs.h>
7 #include <asm/mipsmtregs.h>
8 #include <asm/smtc.h>
9 #include <asm/smtc_ipi.h>
11 /* VPE/SMP Prototype implements platform interfaces directly */
14 * Cause the specified action to be performed on a targeted "CPU"
17 void core_send_ipi(int cpu, unsigned int action)
19 /* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */
20 smtc_send_ipi(cpu, LINUX_SMP_IPI, action);
24 * Platform "CPU" startup hook
27 void __cpuinit prom_boot_secondary(int cpu, struct task_struct *idle)
29 smtc_boot_secondary(cpu, idle);
33 * Post-config but pre-boot cleanup entry point
36 void __cpuinit prom_init_secondary(void)
38 void smtc_init_secondary(void);
39 int myvpe;
41 /* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */
42 myvpe = read_c0_tcbind() & TCBIND_CURVPE;
43 if (myvpe != 0) {
44 /* Ideally, this should be done only once per VPE, but... */
45 clear_c0_status(ST0_IM);
46 set_c0_status((0x100 << cp0_compare_irq)
47 | (0x100 << MIPS_CPU_IPI_IRQ));
48 if (cp0_perfcount_irq >= 0)
49 set_c0_status(0x100 << cp0_perfcount_irq);
52 smtc_init_secondary();
56 * Platform SMP pre-initialization
58 * As noted above, we can assume a single CPU for now
59 * but it may be multithreaded.
62 void __cpuinit plat_smp_setup(void)
64 if (read_c0_config3() & (1<<2))
65 mipsmt_build_cpu_map(0);
68 void __init plat_prepare_cpus(unsigned int max_cpus)
70 if (read_c0_config3() & (1<<2))
71 mipsmt_prepare_cpus();
75 * SMP initialization finalization entry point
78 void __cpuinit prom_smp_finish(void)
80 smtc_smp_finish();
84 * Hook for after all CPUs are online
87 void prom_cpus_done(void)