Path: blob/master/arch/mips/pmc-sierra/msp71xx/msp_smtc.c
15118 views
/*1* MSP71xx Platform-specific hooks for SMP operation2*/3#include <linux/irq.h>4#include <linux/init.h>56#include <asm/mipsmtregs.h>7#include <asm/mipsregs.h>8#include <asm/smtc.h>9#include <asm/smtc_ipi.h>1011/* VPE/SMP Prototype implements platform interfaces directly */1213/*14* Cause the specified action to be performed on a targeted "CPU"15*/1617static void msp_smtc_send_ipi_single(int cpu, unsigned int action)18{19/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */20smtc_send_ipi(cpu, LINUX_SMP_IPI, action);21}2223static void msp_smtc_send_ipi_mask(const struct cpumask *mask,24unsigned int action)25{26unsigned int i;2728for_each_cpu(i, mask)29msp_smtc_send_ipi_single(i, action);30}3132/*33* Post-config but pre-boot cleanup entry point34*/35static void __cpuinit msp_smtc_init_secondary(void)36{37int myvpe;3839/* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */40myvpe = read_c0_tcbind() & TCBIND_CURVPE;41if (myvpe > 0)42change_c0_status(ST0_IM, STATUSF_IP0 | STATUSF_IP1 |43STATUSF_IP6 | STATUSF_IP7);44smtc_init_secondary();45}4647/*48* Platform "CPU" startup hook49*/50static void __cpuinit msp_smtc_boot_secondary(int cpu,51struct task_struct *idle)52{53smtc_boot_secondary(cpu, idle);54}5556/*57* SMP initialization finalization entry point58*/59static void __cpuinit msp_smtc_smp_finish(void)60{61smtc_smp_finish();62}6364/*65* Hook for after all CPUs are online66*/6768static void msp_smtc_cpus_done(void)69{70}7172/*73* Platform SMP pre-initialization74*75* As noted above, we can assume a single CPU for now76* but it may be multithreaded.77*/7879static void __init msp_smtc_smp_setup(void)80{81/*82* we won't get the definitive value until83* we've run smtc_prepare_cpus later, but84*/8586if (read_c0_config3() & (1 << 2))87smp_num_siblings = smtc_build_cpu_map(0);88}8990static void __init msp_smtc_prepare_cpus(unsigned int max_cpus)91{92smtc_prepare_cpus(max_cpus);93}9495struct plat_smp_ops msp_smtc_smp_ops = {96.send_ipi_single = msp_smtc_send_ipi_single,97.send_ipi_mask = msp_smtc_send_ipi_mask,98.init_secondary = msp_smtc_init_secondary,99.smp_finish = msp_smtc_smp_finish,100.cpus_done = msp_smtc_cpus_done,101.boot_secondary = msp_smtc_boot_secondary,102.smp_setup = msp_smtc_smp_setup,103.prepare_cpus = msp_smtc_prepare_cpus,104};105106107