aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches/001-bcm963xx.patch
blob: 728d5ba5466bfdd2c3fe90654777ea9331b94e85 (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
diff -urN linux-2.6.24/arch/mips/Kconfig linux-2.6.24.new/arch/mips/Kconfig
--- linux-2.6.24/arch/mips/Kconfig	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/arch/mips/Kconfig	2008-02-13 16:20:49.000000000 +0100
@@ -67,6 +67,17 @@
 	help
 	 Support for BCM47XX based boards
 
+config BCM963XX
+       bool "Support for Broadcom BCM963xx SoC"
+       select SYS_SUPPORTS_32BIT_KERNEL
+       select SYS_SUPPORTS_BIG_ENDIAN
+       select SYS_HAS_CPU_MIPS32_R1
+       select HW_HAS_PCI
+       select DMA_NONCOHERENT
+       select IRQ_CPU
+       help
+         This is a fmaily of boards based on the Broadcom MIPS32
+
 config MIPS_COBALT
 	bool "Cobalt Server"
 	select CEVT_R4K
diff -urN linux-2.6.24/arch/mips/kernel/cpu-probe.c linux-2.6.24.new/arch/mips/kernel/cpu-probe.c
--- linux-2.6.24/arch/mips/kernel/cpu-probe.c	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/arch/mips/kernel/cpu-probe.c	2008-02-13 16:23:21.000000000 +0100
@@ -796,6 +796,18 @@
 	case PRID_IMP_BCM4710:
 		c->cputype = CPU_BCM4710;
 		break;
+//	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;
+	case PRID_IMP_BCM6358:
+		c->cputype = CPU_BCM6358;
+		break;
 	default:
 		c->cputype = CPU_UNKNOWN;
 		break;
@@ -878,6 +890,10 @@
 	case CPU_SR71000:	name = "Sandcraft SR71000"; break;
 	case CPU_BCM3302:	name = "Broadcom BCM3302"; break;
 	case CPU_BCM4710:	name = "Broadcom BCM4710"; break;
+	case CPU_BCM6338:	name = "Broadcom BCM6338"; break;
+	case CPU_BCM6345:	name = "Broadcom BCM6345"; break;
+	case CPU_BCM6348:	name = "Broadcom BCM6348"; break;
+	case CPU_BCM6358:	name = "Broadcom BCM6358"; break;
 	case CPU_PR4450:	name = "Philips PR4450"; break;
 	case CPU_LOONGSON2:	name = "ICT Loongson-2"; break;
 	default:
diff -urN linux-2.6.24/arch/mips/Makefile linux-2.6.24.new/arch/mips/Makefile
--- linux-2.6.24/arch/mips/Makefile	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/arch/mips/Makefile	2008-02-13 16:21:21.000000000 +0100
@@ -543,6 +543,10 @@
 cflags-$(CONFIG_BCM47XX)	+= -Iinclude/asm-mips/mach-bcm47xx
 load-$(CONFIG_BCM47XX)		:= 0xffffffff80001000
 
+core-$(CONFIG_BCM963XX)		+= arch/mips/bcm963xx/
+cflags-$(CONFIG_BCM963XX)	+= -Iinclude/asm-mips/mach-bcm963xx
+load-$(CONFIG_BCM963XX)		:= 0xffffffff8001000
+
 #
 # SNI RM
 #
diff -urN linux-2.6.24/arch/mips/mm/c-r4k.c linux-2.6.24.new/arch/mips/mm/c-r4k.c
--- linux-2.6.24/arch/mips/mm/c-r4k.c	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/arch/mips/mm/c-r4k.c	2008-02-13 16:24:29.000000000 +0100
@@ -878,6 +878,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 || c->cputype == CPU_BCM6358)
+		{
+			printk("bcm963xx: 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.24/arch/mips/mm/tlbex.c linux-2.6.24.new/arch/mips/mm/tlbex.c
--- linux-2.6.24/arch/mips/mm/tlbex.c	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/arch/mips/mm/tlbex.c	2008-02-13 16:25:08.000000000 +0100
@@ -910,6 +910,10 @@
 	case CPU_25KF:
 	case CPU_BCM3302:
 	case CPU_BCM4710:
+//	case CPU_BCM6338:
+	case CPU_BCM6345:
+	case CPU_BCM6348:
+	case CPU_BCM6358:
 	case CPU_LOONGSON2:
 		if (m4kc_tlbp_war())
 			i_nop(p);
diff -urN linux-2.6.24/arch/mips/pci/Makefile linux-2.6.24.new/arch/mips/pci/Makefile
--- linux-2.6.24/arch/mips/pci/Makefile	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/arch/mips/pci/Makefile	2008-02-13 16:27:33.000000000 +0100
@@ -48,3 +48,4 @@
 obj-$(CONFIG_VICTOR_MPC30X)	+= fixup-mpc30x.o
 obj-$(CONFIG_ZAO_CAPCELLA)	+= fixup-capcella.o
 obj-$(CONFIG_WR_PPMC)		+= fixup-wrppmc.o
+obj-$(CONFIG_BCM963XX)		+= fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
diff -urN linux-2.6.24/include/asm-mips/bootinfo.h linux-2.6.24.new/include/asm-mips/bootinfo.h
--- linux-2.6.24/include/asm-mips/bootinfo.h	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/include/asm-mips/bootinfo.h	2008-02-13 16:26:05.000000000 +0100
@@ -197,6 +197,10 @@
  */
 #define MACH_GROUP_BRCM		23	/* Broadcom			*/
 #define  MACH_BCM47XX		1	/* Broadcom BCM47XX		*/
+#define  MACH_BCM96338          2
+#define  MACH_BCM96345          3
+#define  MACH_BCM96348          4
+#define  MACH_BCM96358          5
 
 #define CL_SIZE			COMMAND_LINE_SIZE
 
diff -urN linux-2.6.24/include/asm-mips/cpu.h linux-2.6.24.new/include/asm-mips/cpu.h
--- linux-2.6.24/include/asm-mips/cpu.h	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.new/include/asm-mips/cpu.h	2008-02-13 16:27:13.000000000 +0100
@@ -111,6 +111,10 @@
 
 #define PRID_IMP_BCM4710	0x4000
 #define PRID_IMP_BCM3302	0x9000
+//#define PRID_IMP_BCM6338        0x9000
+#define PRID_IMP_BCM6345        0x8000
+#define PRID_IMP_BCM6348        0x9100
+#define PRID_IMP_BCM6358        0xA000
 
 /*
  * Definitions for 7:0 on legacy processors
@@ -196,7 +200,8 @@
 	 */
 	CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_74K, CPU_AU1000,
 	CPU_AU1100, CPU_AU1200, CPU_AU1500, CPU_AU1550, CPU_PR4450,
-	CPU_BCM3302, CPU_BCM4710,
+	CPU_BCM3302, CPU_BCM4710, CPU_BCM6338, CPU_BCM6345, CPU_BCM6348,
+	CPU_BCM6358,
 
 	/*
 	 * MIPS64 class processors