kernel: fix bluetooth and zsmalloc for 3.14
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.13 / 332-MIPS-BCM63XX-detect-bcm6328-variants.patch
1 From 6c8d94aaf5e2f0a3327e4f69ccd980bd5617f925 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sat, 7 Dec 2013 14:30:59 +0100
4 Subject: [PATCH 42/53] MIPS: BCM63XX: detect bcm6328 variants
5
6 ---
7 arch/mips/bcm63xx/cpu.c | 10 ++++++++++
8 arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 8 ++++++--
9 2 files changed, 16 insertions(+), 2 deletions(-)
10
11 --- a/arch/mips/bcm63xx/cpu.c
12 +++ b/arch/mips/bcm63xx/cpu.c
13 @@ -304,6 +304,7 @@ void __init bcm63xx_cpu_init(void)
14 struct cpuinfo_mips *c = &current_cpu_data;
15 unsigned int cpu = smp_processor_id();
16 u32 chipid_reg;
17 + u8 __maybe_unused varid = 0;
18
19 /* soc registers location depends on cpu type */
20 chipid_reg = 0;
21 @@ -343,6 +344,7 @@ void __init bcm63xx_cpu_init(void)
22 bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
23 bcm63xx_cpu_variant = bcm63xx_cpu_id;
24 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
25 + varid = (tmp & REV_VARID_MASK) >> REV_VARID_SHIFT;
26
27 switch (bcm63xx_cpu_id) {
28 case BCM3368_CPU_ID:
29 @@ -352,6 +354,14 @@ void __init bcm63xx_cpu_init(void)
30 case BCM6328_CPU_ID:
31 bcm63xx_regs_base = bcm6328_regs_base;
32 bcm63xx_irqs = bcm6328_irqs;
33 +
34 + if (varid == 1)
35 + bcm63xx_cpu_variant = BCM63281_CPU_ID;
36 + else if (varid == 3)
37 + bcm63xx_cpu_variant = BCM63283_CPU_ID;
38 + else
39 + pr_warn("unknown BCM6328 variant: %x\n", varid);
40 +
41 break;
42 case BCM6338_CPU_ID:
43 bcm63xx_regs_base = bcm6338_regs_base;
44 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
45 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
46 @@ -11,6 +11,8 @@
47 */
48 #define BCM3368_CPU_ID 0x3368
49 #define BCM6328_CPU_ID 0x6328
50 +#define BCM63281_CPU_ID 0x63281
51 +#define BCM63283_CPU_ID 0x63283
52 #define BCM6338_CPU_ID 0x6338
53 #define BCM6345_CPU_ID 0x6345
54 #define BCM6348_CPU_ID 0x6348
55 @@ -85,8 +87,10 @@ static inline u16 __pure bcm63xx_get_cpu
56
57 #define BCMCPU_VARIANT_IS_3368() \
58 (bcm63xx_get_cpu_variant() == BCM3368_CPU_ID)
59 -#define BCMCPU_VARIANT_IS_6328() \
60 - (bcm63xx_get_cpu_variant() == BCM6328_CPU_ID)
61 +#define BCMCPU_VARIANT_IS_63281() \
62 + (bcm63xx_get_cpu_variant() == BCM63281_CPU_ID)
63 +#define BCMCPU_VARIANT_IS_63283() \
64 + (bcm63xx_get_cpu_variant() == BCM63283_CPU_ID)
65 #define BCMCPU_VARIANT_IS_6338() \
66 (bcm63xx_get_cpu_variant() == BCM6338_CPU_ID)
67 #define BCMCPU_VARIANT_IS_6345() \