diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-02-11 23:50:42 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-03-11 07:44:56 -0400 |
commit | 563fdd4a0af509d8cb78901750f7d00db345d864 (patch) | |
tree | bf27b2e7284b4e818c5daba0761565ab5d087f55 /arch/powerpc/platforms/85xx | |
parent | 1a3d1fc2273c6736ad2d19058e0413bc830c5e4d (diff) |
powerpc/85xx: Update smp support to handle doorbells and non-mpic init
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>
Diffstat (limited to 'arch/powerpc/platforms/85xx')
-rw-r--r-- | 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 79a0df17078b..cc0b0db8a6f3 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/page.h> | 21 | #include <asm/page.h> |
22 | #include <asm/mpic.h> | 22 | #include <asm/mpic.h> |
23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
24 | #include <asm/dbell.h> | ||
24 | 25 | ||
25 | #include <sysdev/fsl_soc.h> | 26 | #include <sysdev/fsl_soc.h> |
26 | 27 | ||
@@ -80,10 +81,8 @@ smp_85xx_kick_cpu(int nr) | |||
80 | } | 81 | } |
81 | 82 | ||
82 | static void __init | 83 | static void __init |
83 | smp_85xx_setup_cpu(int cpu_nr) | 84 | smp_85xx_basic_setup(int cpu_nr) |
84 | { | 85 | { |
85 | mpic_setup_this_cpu(); | ||
86 | |||
87 | /* Clear any pending timer interrupts */ | 86 | /* Clear any pending timer interrupts */ |
88 | mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); | 87 | mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); |
89 | 88 | ||
@@ -91,15 +90,43 @@ smp_85xx_setup_cpu(int cpu_nr) | |||
91 | mtspr(SPRN_TCR, TCR_DIE); | 90 | mtspr(SPRN_TCR, TCR_DIE); |
92 | } | 91 | } |
93 | 92 | ||
93 | static void __init | ||
94 | smp_85xx_setup_cpu(int cpu_nr) | ||
95 | { | ||
96 | mpic_setup_this_cpu(); | ||
97 | |||
98 | smp_85xx_basic_setup(cpu_nr); | ||
99 | } | ||
100 | |||
94 | struct smp_ops_t smp_85xx_ops = { | 101 | struct smp_ops_t smp_85xx_ops = { |
95 | .message_pass = smp_mpic_message_pass, | ||
96 | .probe = smp_mpic_probe, | ||
97 | .kick_cpu = smp_85xx_kick_cpu, | 102 | .kick_cpu = smp_85xx_kick_cpu, |
98 | .setup_cpu = smp_85xx_setup_cpu, | ||
99 | }; | 103 | }; |
100 | 104 | ||
101 | void __init | 105 | static int __init smp_dummy_probe(void) |
102 | mpc85xx_smp_init(void) | ||
103 | { | 106 | { |
107 | return NR_CPUS; | ||
108 | } | ||
109 | |||
110 | void __init mpc85xx_smp_init(void) | ||
111 | { | ||
112 | struct device_node *np; | ||
113 | |||
114 | smp_85xx_ops.message_pass = NULL; | ||
115 | |||
116 | np = of_find_node_by_type(NULL, "open-pic"); | ||
117 | if (np) { | ||
118 | smp_85xx_ops.probe = smp_mpic_probe; | ||
119 | smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; | ||
120 | smp_85xx_ops.message_pass = smp_mpic_message_pass; | ||
121 | } else { | ||
122 | smp_85xx_ops.probe = smp_dummy_probe; | ||
123 | smp_85xx_ops.setup_cpu = smp_85xx_basic_setup; | ||
124 | } | ||
125 | |||
126 | if (cpu_has_feature(CPU_FTR_DBELL)) | ||
127 | smp_85xx_ops.message_pass = smp_dbell_message_pass; | ||
128 | |||
129 | BUG_ON(!smp_85xx_ops.message_pass); | ||
130 | |||
104 | smp_ops = &smp_85xx_ops; | 131 | smp_ops = &smp_85xx_ops; |
105 | } | 132 | } |