1 From 0b135a3e8f344061ed0aa66e2514627dd7aa946f Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sun, 23 Jun 2013 14:04:51 +0200
4 Subject: [PATCH V2 08/13] MIPS: BMIPS: add a smp ops registration helper
6 Add a helper similar to the generic register_XXX_smp_ops() for bmips.
7 Register SMP UP ops in case of BMIPS32/3300.
9 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
12 * use SMP_UP (ops) in case of BMIPS32_3300
14 arch/mips/Kconfig | 1 +
15 arch/mips/bcm63xx/prom.c | 2 +-
16 arch/mips/include/asm/bmips.h | 26 ++++++++++++++++++++++++++
17 3 files changed, 28 insertions(+), 1 deletion(-)
19 --- a/arch/mips/Kconfig
20 +++ b/arch/mips/Kconfig
21 @@ -1551,6 +1551,7 @@ config CPU_LOONGSON1
22 select CPU_SUPPORTS_HIGHMEM
24 config CPU_BMIPS32_3300
25 + select SMP_UP if SMP
29 --- a/arch/mips/bcm63xx/prom.c
30 +++ b/arch/mips/bcm63xx/prom.c
31 @@ -61,7 +61,7 @@ void __init prom_init(void)
33 if (IS_ENABLED(CONFIG_CPU_BMIPS4350) && IS_ENABLED(CONFIG_SMP)) {
35 - register_smp_ops(&bmips43xx_smp_ops);
36 + register_bmips_smp_ops();
39 * BCM6328 might not have its second CPU enabled, while BCM3368
40 --- a/arch/mips/include/asm/bmips.h
41 +++ b/arch/mips/include/asm/bmips.h
44 #include <linux/cpumask.h>
45 #include <asm/r4kcache.h>
46 +#include <asm/smp-ops.h>
48 extern struct plat_smp_ops bmips43xx_smp_ops;
49 extern struct plat_smp_ops bmips5000_smp_ops;
51 +static inline int register_bmips_smp_ops(void)
53 +#if IS_ENABLED(CONFIG_CPU_BMIPS) && IS_ENABLED(CONFIG_SMP)
54 + switch (current_cpu_type()) {
57 + return register_up_smp_ops();
60 + register_smp_ops(&bmips43xx_smp_ops);
63 + register_smp_ops(&bmips5000_smp_ops);
75 extern char bmips_reset_nmi_vec;
76 extern char bmips_reset_nmi_vec_end;
77 extern char bmips_smp_movevec;