diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-11-19 07:23:51 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-01-29 05:14:57 -0500 |
commit | 87353d8ac39c52784da605ecbe965ecdfad609ad (patch) | |
tree | c95ce7cbe9b099c21cab71a195621801b04bc05a /arch/mips/mips-boards | |
parent | 19388fb092d89e179575bd0b44f51b57e175edf5 (diff) |
[MIPS] SMP: Call platform methods via ops structure.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards')
-rw-r--r-- | arch/mips/mips-boards/generic/init.c | 8 | ||||
-rw-r--r-- | arch/mips/mips-boards/malta/malta_smtc.c | 66 |
2 files changed, 48 insertions, 26 deletions
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c index 30f1f54cb68b..1695dca5506b 100644 --- a/arch/mips/mips-boards/generic/init.c +++ b/arch/mips/mips-boards/generic/init.c | |||
@@ -250,6 +250,8 @@ void __init mips_ejtag_setup(void) | |||
250 | flush_icache_range((unsigned long)base, (unsigned long)base + 0x80); | 250 | flush_icache_range((unsigned long)base, (unsigned long)base + 0x80); |
251 | } | 251 | } |
252 | 252 | ||
253 | extern struct plat_smp_ops msmtc_smp_ops; | ||
254 | |||
253 | void __init prom_init(void) | 255 | void __init prom_init(void) |
254 | { | 256 | { |
255 | prom_argc = fw_arg0; | 257 | prom_argc = fw_arg0; |
@@ -416,4 +418,10 @@ void __init prom_init(void) | |||
416 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 418 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
417 | console_config(); | 419 | console_config(); |
418 | #endif | 420 | #endif |
421 | #ifdef CONFIG_MIPS_MT_SMP | ||
422 | register_smp_ops(&vsmp_smp_ops); | ||
423 | #endif | ||
424 | #ifdef CONFIG_MIPS_MT_SMTC | ||
425 | register_smp_ops(&msmtc_smp_ops); | ||
426 | #endif | ||
419 | } | 427 | } |
diff --git a/arch/mips/mips-boards/malta/malta_smtc.c b/arch/mips/mips-boards/malta/malta_smtc.c index 5c980f4a48fe..6f051ca243fa 100644 --- a/arch/mips/mips-boards/malta/malta_smtc.c +++ b/arch/mips/mips-boards/malta/malta_smtc.c | |||
@@ -15,26 +15,24 @@ | |||
15 | * Cause the specified action to be performed on a targeted "CPU" | 15 | * Cause the specified action to be performed on a targeted "CPU" |
16 | */ | 16 | */ |
17 | 17 | ||
18 | void core_send_ipi(int cpu, unsigned int action) | 18 | static void msmtc_send_ipi_single(int cpu, unsigned int action) |
19 | { | 19 | { |
20 | /* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */ | 20 | /* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */ |
21 | smtc_send_ipi(cpu, LINUX_SMP_IPI, action); | 21 | smtc_send_ipi(cpu, LINUX_SMP_IPI, action); |
22 | } | 22 | } |
23 | 23 | ||
24 | /* | 24 | static void msmtc_send_ipi_mask(cpumask_t mask, unsigned int action) |
25 | * Platform "CPU" startup hook | ||
26 | */ | ||
27 | |||
28 | void __cpuinit prom_boot_secondary(int cpu, struct task_struct *idle) | ||
29 | { | 25 | { |
30 | smtc_boot_secondary(cpu, idle); | 26 | unsigned int i; |
27 | |||
28 | for_each_cpu_mask(i, mask) | ||
29 | msmtc_send_ipi_single(i, action); | ||
31 | } | 30 | } |
32 | 31 | ||
33 | /* | 32 | /* |
34 | * Post-config but pre-boot cleanup entry point | 33 | * Post-config but pre-boot cleanup entry point |
35 | */ | 34 | */ |
36 | 35 | static void __cpuinit msmtc_init_secondary(void) | |
37 | void __cpuinit prom_init_secondary(void) | ||
38 | { | 36 | { |
39 | void smtc_init_secondary(void); | 37 | void smtc_init_secondary(void); |
40 | int myvpe; | 38 | int myvpe; |
@@ -50,45 +48,61 @@ void __cpuinit prom_init_secondary(void) | |||
50 | set_c0_status(0x100 << cp0_perfcount_irq); | 48 | set_c0_status(0x100 << cp0_perfcount_irq); |
51 | } | 49 | } |
52 | 50 | ||
53 | smtc_init_secondary(); | 51 | smtc_init_secondary(); |
54 | } | 52 | } |
55 | 53 | ||
56 | /* | 54 | /* |
57 | * Platform SMP pre-initialization | 55 | * Platform "CPU" startup hook |
58 | * | ||
59 | * As noted above, we can assume a single CPU for now | ||
60 | * but it may be multithreaded. | ||
61 | */ | 56 | */ |
62 | 57 | static void __cpuinit msmtc_boot_secondary(int cpu, struct task_struct *idle) | |
63 | void __cpuinit plat_smp_setup(void) | ||
64 | { | 58 | { |
65 | if (read_c0_config3() & (1<<2)) | 59 | smtc_boot_secondary(cpu, idle); |
66 | mipsmt_build_cpu_map(0); | ||
67 | } | 60 | } |
68 | 61 | ||
69 | void __init plat_prepare_cpus(unsigned int max_cpus) | 62 | /* |
63 | * SMP initialization finalization entry point | ||
64 | */ | ||
65 | static void __cpuinit msmtc_smp_finish(void) | ||
70 | { | 66 | { |
71 | if (read_c0_config3() & (1<<2)) | 67 | smtc_smp_finish(); |
72 | mipsmt_prepare_cpus(); | ||
73 | } | 68 | } |
74 | 69 | ||
75 | /* | 70 | /* |
76 | * SMP initialization finalization entry point | 71 | * Hook for after all CPUs are online |
77 | */ | 72 | */ |
78 | 73 | ||
79 | void __cpuinit prom_smp_finish(void) | 74 | static void msmtc_cpus_done(void) |
80 | { | 75 | { |
81 | smtc_smp_finish(); | ||
82 | } | 76 | } |
83 | 77 | ||
84 | /* | 78 | /* |
85 | * Hook for after all CPUs are online | 79 | * Platform SMP pre-initialization |
80 | * | ||
81 | * As noted above, we can assume a single CPU for now | ||
82 | * but it may be multithreaded. | ||
86 | */ | 83 | */ |
87 | 84 | ||
88 | void prom_cpus_done(void) | 85 | static void __init msmtc_smp_setup(void) |
89 | { | 86 | { |
87 | mipsmt_build_cpu_map(0); | ||
90 | } | 88 | } |
91 | 89 | ||
90 | static void __init msmtc_prepare_cpus(unsigned int max_cpus) | ||
91 | { | ||
92 | mipsmt_prepare_cpus(); | ||
93 | } | ||
94 | |||
95 | struct plat_smp_ops msmtc_smp_ops = { | ||
96 | .send_ipi_single = msmtc_send_ipi_single, | ||
97 | .send_ipi_mask = msmtc_send_ipi_mask, | ||
98 | .init_secondary = msmtc_init_secondary, | ||
99 | .smp_finish = msmtc_smp_finish, | ||
100 | .cpus_done = msmtc_cpus_done, | ||
101 | .boot_secondary = msmtc_boot_secondary, | ||
102 | .smp_setup = msmtc_smp_setup, | ||
103 | .prepare_cpus = msmtc_prepare_cpus, | ||
104 | }; | ||
105 | |||
92 | #ifdef CONFIG_MIPS_MT_SMTC_IRQAFF | 106 | #ifdef CONFIG_MIPS_MT_SMTC_IRQAFF |
93 | /* | 107 | /* |
94 | * IRQ affinity hook | 108 | * IRQ affinity hook |