Lines Matching +full:single +full:- +full:cpu

1 // SPDX-License-Identifier: GPL-2.0
2 /* leon_smp.c: Sparc-Leon SMP support.
27 #include <linux/cpu.h>
81 * go-ahead by setting the smp_commenced_mask and will wait without in leon_cpu_pre_online()
87 local_ops->cache_all(); in leon_cpu_pre_online()
88 local_ops->tlb_all(); in leon_cpu_pre_online()
96 current->active_mm = &init_mm; in leon_cpu_pre_online()
114 …printk(KERN_INFO "Note: SMP with snooping only works on 4k cache, found %dk(0x%x) on cpu %d, disab… in leon_configure_cache_smp()
122 … printk(KERN_INFO "Note: You have to enable snooping in the vhdl model cpu %d, disabling caches\n", in leon_configure_cache_smp()
128 local_ops->cache_all(); in leon_configure_cache_smp()
129 local_ops->tlb_all(); in leon_configure_cache_smp()
135 ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >> in leon_smp_setbroadcast()
138 …prom_printf("######## !!!! The irqmp-ctrl must have broadcast enabled, smp wont work !!!!! #######… in leon_smp_setbroadcast()
147 LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask); in leon_smp_setbroadcast()
153 ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >> in leon_smp_nrcpus()
168 (unsigned int)&(leon3_irqctrl_regs->mpstatus)); in leon_boot_cpus()
177 local_ops->cache_all(); in leon_boot_cpus()
190 * we need to re-initialize it for each cpu in leon_boot_one_cpu()
197 printk(KERN_INFO "Starting CPU %d : (irqmp: 0x%x)\n", (unsigned int)i, in leon_boot_one_cpu()
198 (unsigned int)&leon3_irqctrl_regs->mpstatus); in leon_boot_one_cpu()
199 local_ops->cache_all(); in leon_boot_one_cpu()
201 /* Make sure all IRQs are of from the start for this new CPU */ in leon_boot_one_cpu()
202 LEON_BYPASS_STORE_PA(&leon3_irqctrl_regs->mask[i], 0); in leon_boot_one_cpu()
204 /* Wake one CPU */ in leon_boot_one_cpu()
205 LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpstatus), 1 << i); in leon_boot_one_cpu()
213 printk(KERN_INFO "Started CPU %d\n", (unsigned int)i); in leon_boot_one_cpu()
217 return -ENODEV; in leon_boot_one_cpu()
224 local_ops->cache_all(); in leon_boot_one_cpu()
234 /* setup cpu list for irq rotation */ in leon_smp_done()
244 local_ops->cache_all(); in leon_smp_done()
262 int single; member
274 int cpu, len; in leon_ipi_init() local
285 if (pp && (*(int *)pp->value)) in leon_ipi_init()
286 leon_ipi_irq = *(int *)pp->value; in leon_ipi_init()
292 trap_table = &sparc_ttable[SP_TRAP_IRQ1 + (leon_ipi_irq - 1)]; in leon_ipi_init()
293 trap_table->inst_three += smpleon_ipi - real_irq_entry; in leon_ipi_init()
294 local_ops->cache_all(); in leon_ipi_init()
297 for_each_possible_cpu(cpu) { in leon_ipi_init()
298 work = &per_cpu(leon_ipi_work, cpu); in leon_ipi_init()
299 work->single = work->msk = work->resched = 0; in leon_ipi_init()
303 static void leon_send_ipi(int cpu, int level) in leon_send_ipi() argument
307 LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->force[cpu], mask); in leon_send_ipi()
310 static void leon_ipi_single(int cpu) in leon_ipi_single() argument
312 struct leon_ipi_work *work = &per_cpu(leon_ipi_work, cpu); in leon_ipi_single()
315 work->single = 1; in leon_ipi_single()
317 /* Generate IRQ on the CPU */ in leon_ipi_single()
318 leon_send_ipi(cpu, leon_ipi_irq); in leon_ipi_single()
321 static void leon_ipi_mask_one(int cpu) in leon_ipi_mask_one() argument
323 struct leon_ipi_work *work = &per_cpu(leon_ipi_work, cpu); in leon_ipi_mask_one()
326 work->msk = 1; in leon_ipi_mask_one()
328 /* Generate IRQ on the CPU */ in leon_ipi_mask_one()
329 leon_send_ipi(cpu, leon_ipi_irq); in leon_ipi_mask_one()
332 static void leon_ipi_resched(int cpu) in leon_ipi_resched() argument
334 struct leon_ipi_work *work = &per_cpu(leon_ipi_work, cpu); in leon_ipi_resched()
337 work->resched = 1; in leon_ipi_resched()
339 /* Generate IRQ on the CPU (any IRQ will cause resched) */ in leon_ipi_resched()
340 leon_send_ipi(cpu, leon_ipi_irq); in leon_ipi_resched()
347 if (work->single) { in leonsmp_ipi_interrupt()
348 work->single = 0; in leonsmp_ipi_interrupt()
351 if (work->msk) { in leonsmp_ipi_interrupt()
352 work->msk = 0; in leonsmp_ipi_interrupt()
355 if (work->resched) { in leonsmp_ipi_interrupt()
356 work->resched = 0; in leonsmp_ipi_interrupt()
380 register int high = NR_CPUS - 1; in leon_cross_call()
460 .single = leon_ipi_single,
467 t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_leon - linux_trap_ipi15_sun4m); in leon_init_smp()