Skip to content

Commit

Permalink
ARC: smp: Introduce smp hook @init_irq_cpu called for all cores
Browse files Browse the repository at this point in the history
Note this is not part of platform owned static machine_desc,
but more of device owned plat_smp_ops (rather misnamed) which a IPI
provider or some such typically defines.

This will help us seperate out the IPI registration from platform
specific init_cpu_smp() into device specific init_irq_cpu()

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Oct 28, 2015
1 parent 8721a7f commit 286130e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions arch/arc/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ extern int smp_ipi_irq_setup(int cpu, int irq);
* @init_early_smp: A SMP specific h/w block can init itself
* Could be common across platforms so not covered by
* mach_desc->init_early()
* @init_irq_cpu: Called for each core so SMP h/w block driver can do
* any needed setup per cpu (e.g. IPI request)
* @cpu_kick: For Master to kickstart a cpu (optionally at a PC)
* @ipi_send: To send IPI to a @cpu
* @ips_clear: To clear IPI received at @irq
*/
struct plat_smp_ops {
const char *info;
void (*init_early_smp)(void);
void (*init_irq_cpu)(int cpu);
void (*cpu_kick)(int cpu, unsigned long pc);
void (*ipi_send)(int cpu);
void (*ipi_clear)(int irq);
Expand Down
6 changes: 5 additions & 1 deletion arch/arc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/interrupt.h>
#include <linux/irqchip.h>
#include <asm/mach_desc.h>
#include <asm/smp.h>

/*
* Late Interrupt system init called from start_kernel for Boot CPU only
Expand All @@ -27,7 +28,10 @@ void __init init_IRQ(void)
irqchip_init();

#ifdef CONFIG_SMP
/* Master CPU can initialize it's side of IPI */
/* a SMP H/w block could do IPI IRQ request here */
if (plat_smp_ops.init_irq_cpu)
plat_smp_ops.init_irq_cpu(smp_processor_id());

if (machine_desc->init_cpu_smp)
machine_desc->init_cpu_smp(smp_processor_id());
#endif
Expand Down
4 changes: 4 additions & 0 deletions arch/arc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ void start_kernel_secondary(void)

pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu);

/* Some SMP H/w setup - for each cpu */
if (plat_smp_ops.init_irq_cpu)
plat_smp_ops.init_irq_cpu(cpu);

if (machine_desc->init_cpu_smp)
machine_desc->init_cpu_smp(cpu);

Expand Down

0 comments on commit 286130e

Please sign in to comment.