add generic GPIO to MIPS boards, use it for au1000 and for the MTX-1 led driver as...
[openwrt.git] / target / linux / brcm63xx-2.6 / patches / 001-bcm963xx.patch
1 diff -urN linux-2.6.19/arch/mips/Kconfig linux-2.6.19.new/arch/mips/Kconfig
2 --- linux-2.6.19/arch/mips/Kconfig 2006-11-29 22:57:37.000000000 +0100
3 +++ linux-2.6.19.new/arch/mips/Kconfig 2006-12-16 18:46:31.000000000 +0100
4 @@ -4,6 +4,10 @@
5 # Horrible source of confusion. Die, die, die ...
6 select EMBEDDED
7
8 +config CFE
9 + bool
10 + # Common Firmware Environment
11 +
12 mainmenu "Linux/MIPS Kernel Configuration"
13
14 menu "Machine selection"
15 @@ -12,6 +12,18 @@
16 prompt "System type"
17 default SGI_IP22
18
19 +config BCM963XX
20 + bool "Support for Broadcom BCM963xx SoC"
21 + select SYS_SUPPORTS_32BIT_KERNEL
22 + select SYS_SUPPORTS_BIG_ENDIAN
23 + select SYS_HAS_CPU_MIPS32_R1
24 + select HW_HAS_PCI
25 + select DMA_NONCOHERENT
26 + select IRQ_CPU
27 + select CFE
28 + help
29 + This is a fmaily of boards based on the Broadcom MIPS32
30 +
31 config MIPS_MTX1
32 bool "4G Systems MTX-1 board"
33 select DMA_NONCOHERENT
34 diff -urN linux-2.6.19/arch/mips/Makefile linux-2.6.19.new/arch/mips/Makefile
35 --- linux-2.6.19/arch/mips/Makefile 2006-12-16 17:36:29.000000000 +0100
36 +++ linux-2.6.19.new/arch/mips/Makefile 2006-12-16 18:46:31.000000000 +0100
37 @@ -158,6 +158,19 @@
38 #
39
40 #
41 +# Broadcom BCM963xx SoC
42 +#
43 +core-$(CONFIG_BCM963XX) += arch/mips/bcm963xx/
44 +cflags-$(CONFIG_BCM963XX) += -Iinclude/asm-mips/mach-bcm963xx
45 +load-$(CONFIG_BCM963XX) += 0xffffffff80010000
46 +
47 +
48 +#
49 +# Common Firmware Environment
50 +#
51 +core-$(CONFIG_CFE) += arch/mips/cfe/
52 +
53 +#
54 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
55 #
56 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
57 diff -urN linux-2.6.19/arch/mips/kernel/cpu-probe.c linux-2.6.19.new/arch/mips/kernel/cpu-probe.c
58 --- linux-2.6.19/arch/mips/kernel/cpu-probe.c 2006-11-29 22:57:37.000000000 +0100
59 +++ linux-2.6.19.new/arch/mips/kernel/cpu-probe.c 2006-12-16 18:46:31.000000000 +0100
60 @@ -602,6 +602,25 @@
61 return;
62 }
63
64 +static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
65 +{
66 + decode_configs(c);
67 + switch (c->processor_id & 0xff00) {
68 + case PRID_IMP_BCM6338:
69 + c->cputype = CPU_BCM6338;
70 + break;
71 + case PRID_IMP_BCM6345:
72 + c->cputype = CPU_BCM6345;
73 + break;
74 + case PRID_IMP_BCM6348:
75 + c->cputype = CPU_BCM6348;
76 + break;
77 + default:
78 + c->cputype = CPU_UNKNOWN;
79 + break;
80 + }
81 +}
82 +
83 static inline void cpu_probe_mips(struct cpuinfo_mips *c)
84 {
85 decode_configs(c);
86 @@ -736,6 +755,9 @@
87 case PRID_COMP_LEGACY:
88 cpu_probe_legacy(c);
89 break;
90 + case PRID_COMP_BROADCOM:
91 + cpu_probe_broadcom(c);
92 + break;
93 case PRID_COMP_MIPS:
94 cpu_probe_mips(c);
95 break;
96 diff -urN linux-2.6.19/arch/mips/kernel/proc.c linux-2.6.19.new/arch/mips/kernel/proc.c
97 --- linux-2.6.19/arch/mips/kernel/proc.c 2006-11-29 22:57:37.000000000 +0100
98 +++ linux-2.6.19.new/arch/mips/kernel/proc.c 2006-12-16 18:46:31.000000000 +0100
99 @@ -84,6 +84,9 @@
100 [CPU_VR4181A] = "NEC VR4181A",
101 [CPU_SR71000] = "Sandcraft SR71000",
102 [CPU_PR4450] = "Philips PR4450",
103 + [CPU_BCM6338] = "BCM6338",
104 + [CPU_BCM6345] = "BCM6345",
105 + [CPU_BCM6348] = "BCM6348",
106 };
107
108
109 diff -urN linux-2.6.19/arch/mips/mm/c-r4k.c linux-2.6.19.new/arch/mips/mm/c-r4k.c
110 --- linux-2.6.19/arch/mips/mm/c-r4k.c 2006-11-29 22:57:37.000000000 +0100
111 +++ linux-2.6.19.new/arch/mips/mm/c-r4k.c 2006-12-16 18:46:31.000000000 +0100
112 @@ -852,6 +852,13 @@
113 if (!(config & MIPS_CONF_M))
114 panic("Don't know how to probe P-caches on this cpu.");
115
116 + if (c->cputype == CPU_BCM6338 || c->cputype == CPU_BCM6345 || c->cputype == CPU_BCM6348)
117 + {
118 + printk("bcm963xx: enabling icache and dcache...\n");
119 + /* Enable caches */
120 + write_c0_diag(read_c0_diag() | 0xC0000000);
121 + }
122 +
123 /*
124 * So we seem to be a MIPS32 or MIPS64 CPU
125 * So let's probe the I-cache ...
126 diff -urN linux-2.6.19/arch/mips/mm/tlbex.c linux-2.6.19.new/arch/mips/mm/tlbex.c
127 --- linux-2.6.19/arch/mips/mm/tlbex.c 2006-11-29 22:57:37.000000000 +0100
128 +++ linux-2.6.19.new/arch/mips/mm/tlbex.c 2006-12-16 18:46:31.000000000 +0100
129 @@ -880,6 +880,9 @@
130 case CPU_4KSC:
131 case CPU_20KC:
132 case CPU_25KF:
133 + case CPU_BCM6338:
134 + case CPU_BCM6345:
135 + case CPU_BCM6348:
136 tlbw(p);
137 break;
138
139 diff -urN linux-2.6.19/arch/mips/pci/Makefile linux-2.6.19.new/arch/mips/pci/Makefile
140 --- linux-2.6.19/arch/mips/pci/Makefile 2006-11-29 22:57:37.000000000 +0100
141 +++ linux-2.6.19.new/arch/mips/pci/Makefile 2006-12-16 18:48:18.000000000 +0100
142 @@ -17,6 +17,7 @@
143 obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
144 obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o
145 obj-$(CONFIG_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
146 +obj-$(CONFIG_BCM963XX) += fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
147
148 #
149 # These are still pretty much in the old state, watch, go blind.
150 diff -urN linux-2.6.19/drivers/serial/Makefile linux-2.6.19.new/drivers/serial/Makefile
151 --- linux-2.6.19/drivers/serial/Makefile 2006-11-29 22:57:37.000000000 +0100
152 +++ linux-2.6.19.new/drivers/serial/Makefile 2006-12-16 18:49:17.000000000 +0100
153 @@ -56,3 +56,4 @@
154 obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
155 obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
156 obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
157 +obj-$(CONFIG_BCM963XX) += bcm63xx_cons.o
158 diff -urN linux-2.6.19/include/asm-mips/bootinfo.h linux-2.6.19.new/include/asm-mips/bootinfo.h
159 --- linux-2.6.19/include/asm-mips/bootinfo.h 2006-11-29 22:57:37.000000000 +0100
160 +++ linux-2.6.19.new/include/asm-mips/bootinfo.h 2006-12-16 18:46:31.000000000 +0100
161 @@ -212,6 +212,14 @@
162 #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
163 #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
164
165 +/*
166 + * Valid machtype for group BRCM
167 + */
168 +#define MACH_GROUP_BRCM 23 /* Broadcom boards */
169 +#define MACH_BCM96338 0
170 +#define MACH_BCM96345 1
171 +#define MACH_BCM96348 2
172 +
173 #define CL_SIZE COMMAND_LINE_SIZE
174
175 const char *get_system_type(void);
176 diff -urN linux-2.6.19/include/asm-mips/cpu.h linux-2.6.19.new/include/asm-mips/cpu.h
177 --- linux-2.6.19/include/asm-mips/cpu.h 2006-11-29 22:57:37.000000000 +0100
178 +++ linux-2.6.19.new/include/asm-mips/cpu.h 2006-12-16 18:46:31.000000000 +0100
179 @@ -103,6 +103,13 @@
180
181 #define PRID_IMP_SR71000 0x0400
182
183 +/* These are the PRID's for when 23:16 == PRID_COMP_BROADCOM
184 + */
185 +
186 +#define PRID_IMP_BCM6338 0x9000
187 +#define PRID_IMP_BCM6345 0x8000
188 +#define PRID_IMP_BCM6348 0x9100
189 +
190 /*
191 * Definitions for 7:0 on legacy processors
192 */
193 @@ -200,7 +207,10 @@
194 #define CPU_SB1A 62
195 #define CPU_74K 63
196 #define CPU_R14000 64
197 -#define CPU_LAST 64
198 +#define CPU_BCM6338 65
199 +#define CPU_BCM6345 66
200 +#define CPU_BCM6348 67
201 +#define CPU_LAST 67
202
203 /*
204 * ISA Level encodings
205 diff -urN linux-2.6.19/include/asm-mips/module.h linux-2.6.19.new/include/asm-mips/module.h
206 --- linux-2.6.19/include/asm-mips/module.h 2006-11-29 22:57:37.000000000 +0100
207 +++ linux-2.6.19.new/include/asm-mips/module.h 2006-12-16 19:03:22.000000000 +0100
208 @@ -112,6 +112,12 @@
209 #define MODULE_PROC_FAMILY "RM9000 "
210 #elif defined CONFIG_CPU_SB1
211 #define MODULE_PROC_FAMILY "SB1 "
212 +#elif defined CONFIG_CPU_BCM6338
213 +#define MODULE_PROC_FAMILY "BCM6338 "
214 +#elif defined CONFIG_CPU_BCM6345
215 +#define MODULE_PROC_FAMILY "BCM6345 "
216 +#elif defined CONFIG_CPU_BCM6348
217 +#define MODULE_PROC_FAMILY "BCM6348 "
218 #else
219 #error MODULE_PROC_FAMILY undefined for your processor configuration
220 #endif
This page took 0.048497 seconds and 5 git commands to generate.