* [PATCH] powerpc/85xx: Update smp support to handle doorbells and non-mpic init
@ 2009-03-11 11:46 Kumar Gala
2009-03-11 15:52 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2009-03-11 11:46 UTC (permalink / raw)
To: linuxppc-dev
Use device tree to determine if we actually have an MPIC and use
CPU feature to decide if we should use doorbells for IPIs.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/85xx/smp.c | 43 ++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 79a0df1..cc0b0db 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -21,6 +21,7 @@
#include <asm/page.h>
#include <asm/mpic.h>
#include <asm/cacheflush.h>
+#include <asm/dbell.h>
#include <sysdev/fsl_soc.h>
@@ -80,10 +81,8 @@ smp_85xx_kick_cpu(int nr)
}
static void __init
-smp_85xx_setup_cpu(int cpu_nr)
+smp_85xx_basic_setup(int cpu_nr)
{
- mpic_setup_this_cpu();
-
/* Clear any pending timer interrupts */
mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
@@ -91,15 +90,43 @@ smp_85xx_setup_cpu(int cpu_nr)
mtspr(SPRN_TCR, TCR_DIE);
}
+static void __init
+smp_85xx_setup_cpu(int cpu_nr)
+{
+ mpic_setup_this_cpu();
+
+ smp_85xx_basic_setup(cpu_nr);
+}
+
struct smp_ops_t smp_85xx_ops = {
- .message_pass = smp_mpic_message_pass,
- .probe = smp_mpic_probe,
.kick_cpu = smp_85xx_kick_cpu,
- .setup_cpu = smp_85xx_setup_cpu,
};
-void __init
-mpc85xx_smp_init(void)
+static int __init smp_dummy_probe(void)
{
+ return NR_CPUS;
+}
+
+void __init mpc85xx_smp_init(void)
+{
+ struct device_node *np;
+
+ smp_85xx_ops.message_pass = NULL;
+
+ np = of_find_node_by_type(NULL, "open-pic");
+ if (np) {
+ smp_85xx_ops.probe = smp_mpic_probe;
+ smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu;
+ smp_85xx_ops.message_pass = smp_mpic_message_pass;
+ } else {
+ smp_85xx_ops.probe = smp_dummy_probe;
+ smp_85xx_ops.setup_cpu = smp_85xx_basic_setup;
+ }
+
+ if (cpu_has_feature(CPU_FTR_DBELL))
+ smp_85xx_ops.message_pass = smp_dbell_message_pass;
+
+ BUG_ON(!smp_85xx_ops.message_pass);
+
smp_ops = &smp_85xx_ops;
}
--
1.5.6.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc/85xx: Update smp support to handle doorbells and non-mpic init
2009-03-11 11:46 [PATCH] powerpc/85xx: Update smp support to handle doorbells and non-mpic init Kumar Gala
@ 2009-03-11 15:52 ` Scott Wood
2009-03-11 17:35 ` Kumar Gala
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2009-03-11 15:52 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
On Wed, Mar 11, 2009 at 06:46:03AM -0500, Kumar Gala wrote:
> +void __init mpc85xx_smp_init(void)
> +{
> + struct device_node *np;
> +
> + smp_85xx_ops.message_pass = NULL;
> +
> + np = of_find_node_by_type(NULL, "open-pic");
We should probably look by compatible rather than device_type. I see
only one device tree that has the latter but not the former (ksi8560),
and it's not SMP (but should still be fixed, of course).
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc/85xx: Update smp support to handle doorbells and non-mpic init
2009-03-11 15:52 ` Scott Wood
@ 2009-03-11 17:35 ` Kumar Gala
0 siblings, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2009-03-11 17:35 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
On Mar 11, 2009, at 10:52 AM, Scott Wood wrote:
> On Wed, Mar 11, 2009 at 06:46:03AM -0500, Kumar Gala wrote:
>> +void __init mpc85xx_smp_init(void)
>> +{
>> + struct device_node *np;
>> +
>> + smp_85xx_ops.message_pass = NULL;
>> +
>> + np = of_find_node_by_type(NULL, "open-pic");
>
> We should probably look by compatible rather than device_type. I see
> only one device tree that has the latter but not the former (ksi8560),
> and it's not SMP (but should still be fixed, of course).
Ever other lookup for the mpic node is done by type. I see no reason
to change this right now.
- k
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-11 17:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 11:46 [PATCH] powerpc/85xx: Update smp support to handle doorbells and non-mpic init Kumar Gala
2009-03-11 15:52 ` Scott Wood
2009-03-11 17:35 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox