09afd52ae9c9579aa43752532df78896edee945a
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-2.6.25 / 001-bcm963xx.patch
1 From 2b2b8e163d28646cbbfde81c900fbb57d6572a11 Mon Sep 17 00:00:00 2001
2 From: Axel Gembe <ago@bastart.eu.org>
3 Date: Thu, 15 May 2008 11:00:43 +0200
4 Subject: [PATCH] bcm963xx: board support
5
6
7 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
8 ---
9 arch/mips/Kconfig | 11 +++++++++++
10 arch/mips/Makefile | 4 ++++
11 arch/mips/kernel/cpu-probe.c | 16 ++++++++++++++++
12 arch/mips/mm/c-r4k.c | 7 +++++++
13 arch/mips/mm/tlbex.c | 4 ++++
14 arch/mips/pci/Makefile | 1 +
15 include/asm-mips/bootinfo.h | 12 ++++++++++++
16 include/asm-mips/cpu.h | 7 ++++++-
17 8 files changed, 61 insertions(+), 1 deletions(-)
18
19 Index: linux-2.6.25.4/arch/mips/Kconfig
20 ===================================================================
21 --- linux-2.6.25.4.orig/arch/mips/Kconfig
22 +++ linux-2.6.25.4/arch/mips/Kconfig
23 @@ -59,6 +59,17 @@ config BCM47XX
24 help
25 Support for BCM47XX based boards
26
27 +config BCM963XX
28 + bool "Support for Broadcom BCM963xx SoC"
29 + select SYS_SUPPORTS_32BIT_KERNEL
30 + select SYS_SUPPORTS_BIG_ENDIAN
31 + select SYS_HAS_CPU_MIPS32_R1
32 + select HW_HAS_PCI
33 + select DMA_NONCOHERENT
34 + select IRQ_CPU
35 + help
36 + This is a fmaily of boards based on the Broadcom MIPS32
37 +
38 config MIPS_COBALT
39 bool "Cobalt Server"
40 select CEVT_R4K
41 Index: linux-2.6.25.4/arch/mips/Makefile
42 ===================================================================
43 --- linux-2.6.25.4.orig/arch/mips/Makefile
44 +++ linux-2.6.25.4/arch/mips/Makefile
45 @@ -560,6 +560,10 @@ core-$(CONFIG_BCM47XX) += arch/mips/bcm
46 cflags-$(CONFIG_BCM47XX) += -Iinclude/asm-mips/mach-bcm47xx
47 load-$(CONFIG_BCM47XX) := 0xffffffff80001000
48
49 +core-$(CONFIG_BCM963XX) += arch/mips/bcm963xx/
50 +cflags-$(CONFIG_BCM963XX) += -Iinclude/asm-mips/mach-bcm963xx
51 +load-$(CONFIG_BCM963XX) := 0xffffffff8001000
52 +
53 #
54 # SNI RM
55 #
56 Index: linux-2.6.25.4/arch/mips/kernel/cpu-probe.c
57 ===================================================================
58 --- linux-2.6.25.4.orig/arch/mips/kernel/cpu-probe.c
59 +++ linux-2.6.25.4/arch/mips/kernel/cpu-probe.c
60 @@ -803,6 +803,21 @@ static inline void cpu_probe_broadcom(st
61 case PRID_IMP_BCM4710:
62 c->cputype = CPU_BCM4710;
63 break;
64 +// case PRID_IMP_BCM6338:
65 +// c->cputype = CPU_BCM6338;
66 +// break;
67 + case PRID_IMP_BCM6345:
68 + c->cputype = CPU_BCM6345;
69 + break;
70 + case PRID_IMP_BCM6348:
71 + c->cputype = CPU_BCM6348;
72 + break;
73 + case PRID_IMP_BCM6358:
74 + c->cputype = CPU_BCM6358;
75 + break;
76 + case PRID_IMP_BCM3350:
77 + c->cputype = CPU_BCM3350;
78 + break;
79 default:
80 c->cputype = CPU_UNKNOWN;
81 break;
82 @@ -887,6 +899,11 @@ static __cpuinit const char *cpu_to_name
83 case CPU_SR71000: name = "Sandcraft SR71000"; break;
84 case CPU_BCM3302: name = "Broadcom BCM3302"; break;
85 case CPU_BCM4710: name = "Broadcom BCM4710"; break;
86 + case CPU_BCM6338: name = "Broadcom BCM6338"; break;
87 + case CPU_BCM6345: name = "Broadcom BCM6345"; break;
88 + case CPU_BCM6348: name = "Broadcom BCM6348"; break;
89 + case CPU_BCM6358: name = "Broadcom BCM6358"; break;
90 + case CPU_BCM3350: name = "Broadcom BCM3350"; break;
91 case CPU_PR4450: name = "Philips PR4450"; break;
92 case CPU_LOONGSON2: name = "ICT Loongson-2"; break;
93 default:
94 Index: linux-2.6.25.4/arch/mips/mm/c-r4k.c
95 ===================================================================
96 --- linux-2.6.25.4.orig/arch/mips/mm/c-r4k.c
97 +++ linux-2.6.25.4/arch/mips/mm/c-r4k.c
98 @@ -882,6 +882,13 @@ static void __cpuinit probe_pcache(void)
99 if (!(config & MIPS_CONF_M))
100 panic("Don't know how to probe P-caches on this cpu.");
101
102 + if (c->cputype == CPU_BCM6338 || c->cputype == CPU_BCM6345 || c->cputype == CPU_BCM6348 || c->cputype == CPU_BCM6358 || c->cputype == CPU_BCM3350)
103 + {
104 + printk("bcm963xx: enabling icache and dcache...\n");
105 + /* Enable caches */
106 + write_c0_diag(read_c0_diag() | 0xC0000000);
107 + }
108 +
109 /*
110 * So we seem to be a MIPS32 or MIPS64 CPU
111 * So let's probe the I-cache ...
112 Index: linux-2.6.25.4/arch/mips/mm/tlbex.c
113 ===================================================================
114 --- linux-2.6.25.4.orig/arch/mips/mm/tlbex.c
115 +++ linux-2.6.25.4/arch/mips/mm/tlbex.c
116 @@ -315,6 +315,11 @@ static void __cpuinit build_tlb_write_en
117 case CPU_25KF:
118 case CPU_BCM3302:
119 case CPU_BCM4710:
120 +// case CPU_BCM6338:
121 + case CPU_BCM6345:
122 + case CPU_BCM6348:
123 + case CPU_BCM6358:
124 + case CPU_BCM3350:
125 case CPU_LOONGSON2:
126 if (m4kc_tlbp_war())
127 uasm_i_nop(p);
128 Index: linux-2.6.25.4/arch/mips/pci/Makefile
129 ===================================================================
130 --- linux-2.6.25.4.orig/arch/mips/pci/Makefile
131 +++ linux-2.6.25.4/arch/mips/pci/Makefile
132 @@ -48,3 +48,4 @@ obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-
133 obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
134 obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
135 obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o
136 +obj-$(CONFIG_BCM963XX) += fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
137 Index: linux-2.6.25.4/include/asm-mips/bootinfo.h
138 ===================================================================
139 --- linux-2.6.25.4.orig/include/asm-mips/bootinfo.h
140 +++ linux-2.6.25.4/include/asm-mips/bootinfo.h
141 @@ -94,6 +94,19 @@
142 #define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */
143 #define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */
144
145 +#define MACH_WRPPMC 1
146 +
147 +/*
148 + * Valid machtype for group Broadcom
149 + */
150 +#define MACH_GROUP_BRCM 23 /* Broadcom */
151 +#define MACH_BCM47XX 1 /* Broadcom BCM47XX */
152 +#define MACH_BCM96338 2
153 +#define MACH_BCM96345 3
154 +#define MACH_BCM96348 4
155 +#define MACH_BCM96358 5
156 +#define MACH_BCM3350 6
157 +
158 #define CL_SIZE COMMAND_LINE_SIZE
159
160 extern char *system_type;
161 Index: linux-2.6.25.4/include/asm-mips/cpu.h
162 ===================================================================
163 --- linux-2.6.25.4.orig/include/asm-mips/cpu.h
164 +++ linux-2.6.25.4/include/asm-mips/cpu.h
165 @@ -111,6 +111,11 @@
166
167 #define PRID_IMP_BCM4710 0x4000
168 #define PRID_IMP_BCM3302 0x9000
169 +//#define PRID_IMP_BCM6338 0x9000
170 +#define PRID_IMP_BCM6345 0x8000
171 +#define PRID_IMP_BCM6348 0x9100
172 +#define PRID_IMP_BCM6358 0xA000
173 +#define PRID_IMP_BCM3350 0x28000
174
175 /*
176 * Definitions for 7:0 on legacy processors
177 @@ -196,7 +200,8 @@ enum cpu_type_enum {
178 */
179 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_74K, CPU_AU1000,
180 CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500, CPU_AU1550,
181 - CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
182 + CPU_PR4450, CPU_BCM3302, CPU_BCM4710, CPU_BCM6338, CPU_BCM6345, CPU_BCM6348,
183 + CPU_BCM6358, CPU_BCM3350,
184
185 /*
186 * MIPS64 class processors