bcm63xx: make smp kernels boot on older SoCs
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.9 / 102-MIPS-bmips-add-macros-for-testing-the-current-bmips-.patch
1 From 971b8b3d5101b3bb868e63f3eb96fe69b7110c61 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Thu, 27 Jun 2013 12:40:15 +0200
4 Subject: [PATCH 03/10] MIPS: bmips: add macros for testing the current bmips
5 CPU
6
7 Makes it easy to make code conditionally compiled for supported CPUs
8 without directly relying on #ifdefs.
9
10 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
11 ---
12 arch/mips/include/asm/bmips.h | 11 +++++++++++
13 1 file changed, 11 insertions(+)
14
15 --- a/arch/mips/include/asm/bmips.h
16 +++ b/arch/mips/include/asm/bmips.h
17 @@ -45,8 +45,19 @@
18 #if !defined(__ASSEMBLY__)
19
20 #include <linux/cpumask.h>
21 +#include <asm/cpu-features.h>
22 #include <asm/r4kcache.h>
23
24 +#define cpu_is_bmips32() (current_cpu_type() == CPU_BMIPS32)
25 +#define cpu_is_bmips3300() (IS_ENABLED(CONFIG_CPU_BMIPS3300) && \
26 + current_cpu_type() == CPU_BMIPS3300)
27 +#define cpu_is_bmips4350() (IS_ENABLED(CONFIG_CPU_BMIPS4350) && \
28 + current_cpu_type() == CPU_BMIPS4350)
29 +#define cpu_is_bmips4380() (IS_ENABLED(CONFIG_CPU_BMIPS4380) && \
30 + current_cpu_type() == CPU_BMIPS4380)
31 +#define cpu_is_bmips5000() (IS_ENABLED(CONFIG_CPU_BMIPS5000) && \
32 + current_cpu_type() == CPU_BMIPS5000)
33 +
34 extern struct plat_smp_ops bmips_smp_ops;
35 extern char bmips_reset_nmi_vec;
36 extern char bmips_reset_nmi_vec_end;