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