Skip to content

Commit

Permalink
powerpc: Add kconfig for muxed smp ipi support
Browse files Browse the repository at this point in the history
Compile the new smp ipi mux and demux code only if a platform
will make use of it.  The new config is selected as required.

The new cause_ipi smp op is only available conditionally to point out
configs where the select is required; this makes setting the op an
immediate fail instead of a deferred unresolved symbol at link.

This also creates a new config for power surge powermac upgrade support
that can be disabled in expert mode but is default on.

I also removed the depends / default y on CONFIG_XICS since it is selected
by PSERIES.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Milton Miller authored and Benjamin Herrenschmidt committed May 19, 2011
1 parent 23d72bf commit 1ece355
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 7 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ extern void cpu_die(void);

struct smp_ops_t {
void (*message_pass)(int cpu, int msg);
#ifdef CONFIG_PPC_SMP_MUXED_IPI
void (*cause_ipi)(int cpu, unsigned long data);
#endif
int (*probe)(void);
int (*kick_cpu)(int nr);
void (*setup_cpu)(int nr);
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ int smp_request_message_ipi(int virq, int msg)
return err;
}

#ifdef CONFIG_PPC_SMP_MUXED_IPI
struct cpu_messages {
unsigned long messages; /* current messages bits */
unsigned long data; /* data for cause ipi */
Expand Down Expand Up @@ -230,6 +231,7 @@ irqreturn_t smp_ipi_demux(void)
}
return IRQ_HANDLED;
}
#endif /* CONFIG_PPC_SMP_MUXED_IPI */

void smp_send_reschedule(int cpu)
{
Expand Down
8 changes: 8 additions & 0 deletions arch/powerpc/platforms/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ config UDBG_RTAS_CONSOLE
depends on PPC_RTAS
default n

config PPC_SMP_MUXED_IPI
bool
help
Select this opton if your platform supports SMP and your
interrupt controller provides less than 4 interrupts to each
cpu. This will enable the generic code to multiplex the 4
messages on to one ipi.

config PPC_UDBG_BEAT
bool "BEAT based debug console"
depends on PPC_CELLEB
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/Kconfig.cputype
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ config PPC_BOOK3S_64
config PPC_BOOK3E_64
bool "Embedded processors"
select PPC_FPU # Make it a choice ?
select PPC_SMP_MUXED_IPI

endchoice

Expand Down Expand Up @@ -178,6 +179,7 @@ config FSL_BOOKE
config PPC_FSL_BOOK3E
bool
select FSL_EMB_PERFMON
select PPC_SMP_MUXED_IPI
default y if FSL_BOOKE

config PTE_64BIT
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/iseries/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config PPC_ISERIES
bool "IBM Legacy iSeries"
depends on PPC64 && PPC_BOOK3S
select PPC_SMP_MUXED_IPI
select PPC_INDIRECT_PIO
select PPC_INDIRECT_MMIO
select PPC_PCI_CHOICE if EXPERT
Expand Down
11 changes: 10 additions & 1 deletion arch/powerpc/platforms/powermac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@ config PPC_PMAC64
select PPC_970_NAP
default y


config PPC_PMAC32_PSURGE
bool "Support for powersurge upgrade cards" if EXPERT
depends on SMP && PPC32 && PPC_PMAC
select PPC_SMP_MUXED_IPI
default y
help
The powersurge cpu boards can be used in the generation
of powermacs that have a socket for an upgradeable cpu card,
including the 7500, 8500, 9500, 9600. Support exists for
both dual and quad socket upgrade cards.
4 changes: 2 additions & 2 deletions arch/powerpc/platforms/powermac/pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ static unsigned int pmac_pic_get_irq(void)
unsigned long bits = 0;
unsigned long flags;

#ifdef CONFIG_SMP
#ifdef CONFIG_PPC_PMAC32_PSURGE
void psurge_smp_message_recv(void);

/* IPI's are a hack on the powersurge -- Cort */
if ( smp_processor_id() != 0 ) {
psurge_smp_message_recv();
return NO_IRQ_IGNORE; /* ignore, already handled */
}
#endif /* CONFIG_SMP */
#endif /* CONFIG_PPC_PMAC32_PSURGE */
raw_spin_lock_irqsave(&pmac_pic_lock, flags);
for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
int i = irq >> 5;
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/platforms/powermac/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void (*pmac_tb_freeze)(int freeze);
static u64 timebase;
static int tb_req;

#ifdef CONFIG_PPC32
#ifdef CONFIG_PPC_PMAC32_PSURGE

/*
* Powersurge (old powermac SMP) support.
Expand Down Expand Up @@ -420,7 +420,7 @@ struct smp_ops_t psurge_smp_ops = {
.give_timebase = smp_psurge_give_timebase,
.take_timebase = smp_psurge_take_timebase,
};
#endif /* CONFIG_PPC32 - actually powersurge support */
#endif /* CONFIG_PPC_PMAC32_PSURGE */

/*
* Core 99 and later support
Expand Down Expand Up @@ -980,7 +980,7 @@ void __init pmac_setup_smp(void)
of_node_put(np);
smp_ops = &core99_smp_ops;
}
#ifdef CONFIG_PPC32
#ifdef CONFIG_PPC_PMAC32_PSURGE
else {
/* We have to set bits in cpu_possible_mask here since the
* secondary CPU(s) aren't in the device tree. Various
Expand All @@ -993,7 +993,7 @@ void __init pmac_setup_smp(void)
set_cpu_possible(cpu, true);
smp_ops = &psurge_smp_ops;
}
#endif /* CONFIG_PPC32 */
#endif /* CONFIG_PPC_PMAC32_PSURGE */

#ifdef CONFIG_HOTPLUG_CPU
ppc_md.cpu_die = pmac_cpu_die;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/sysdev/xics/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config PPC_XICS
def_bool n
select PPC_SMP_MUXED_IPI

config PPC_ICP_NATIVE
def_bool n
Expand Down

0 comments on commit 1ece355

Please sign in to comment.