summaryrefslogtreecommitdiff
path: root/target/linux/aruba-2.6/patches/000-aruba.patch
blob: 2867bc4c3a6e41cacb3491f920f7a4d6be334066 (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
211
212
213
214
215
diff -Nur linux-2.6.21.1/arch/mips/Kconfig linux-2.6.21.1-owrt/arch/mips/Kconfig
--- linux-2.6.21.1/arch/mips/Kconfig	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/mips/Kconfig	2007-05-23 23:34:01.000000000 +0200
@@ -220,6 +220,17 @@
 	  <http://www.marvell.com/>.  Say Y here if you wish to build a
 	  kernel for this platform.
 
+config MACH_ARUBA
+	bool "Support for the ARUBA product line"
+	select DMA_NONCOHERENT
+	select CPU_HAS_PREFETCH
+	select HW_HAS_PCI
+	select SWAP_IO_SPACE
+	select SYS_SUPPORTS_32BIT_KERNEL
+	select SYS_HAS_CPU_MIPS32_R1
+	select SYS_SUPPORTS_BIG_ENDIAN
+
+
 config MACH_JAZZ
 	bool "Jazz family of machines"
 	select ARC
diff -Nur linux-2.6.21.1/arch/mips/Makefile linux-2.6.21.1-owrt/arch/mips/Makefile
--- linux-2.6.21.1/arch/mips/Makefile	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/mips/Makefile	2007-05-23 23:34:01.000000000 +0200
@@ -158,6 +158,14 @@
 #
 
 #
+# Aruba
+#
+
+core-$(CONFIG_MACH_ARUBA)	+= arch/mips/aruba/
+cflags-$(CONFIG_MACH_ARUBA)	+= -Iinclude/asm-mips/aruba
+load-$(CONFIG_MACH_ARUBA)	+= 0x80100000
+
+#
 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
 #
 core-$(CONFIG_MACH_JAZZ)	+= arch/mips/jazz/
diff -Nur linux-2.6.21.1/drivers/net/Kconfig linux-2.6.21.1-owrt/drivers/net/Kconfig
--- linux-2.6.21.1/drivers/net/Kconfig	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/drivers/net/Kconfig	2007-05-24 10:45:57.000000000 +0200
@@ -201,6 +201,13 @@
 
 source "drivers/net/arm/Kconfig"
 
+config IDT_RC32434_ETH
+        tristate "IDT RC32434 Local Ethernet support"
+        depends on NET_ETHERNET
+        help
+        IDT RC32434 has one local ethernet port. Say Y here to enable it.
+        To compile this driver as a module, choose M here.
+
 config MACE
 	tristate "MACE (Power Mac ethernet) support"
 	depends on NET_ETHERNET && PPC_PMAC && PPC32
diff -Nur linux-2.6.21.1/drivers/net/Makefile linux-2.6.21.1-owrt/drivers/net/Makefile
--- linux-2.6.21.1/drivers/net/Makefile	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/drivers/net/Makefile	2007-05-24 10:45:57.000000000 +0200
@@ -38,6 +38,7 @@
 obj-$(CONFIG_MACE) += mace.o
 obj-$(CONFIG_BMAC) += bmac.o
 
+obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
 obj-$(CONFIG_DGRS) += dgrs.o
 obj-$(CONFIG_VORTEX) += 3c59x.o
 obj-$(CONFIG_TYPHOON) += typhoon.o
diff -Nur linux-2.6.21.1/drivers/net/natsemi.c linux-2.6.21.1-owrt/drivers/net/natsemi.c
--- linux-2.6.21.1/drivers/net/natsemi.c	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/drivers/net/natsemi.c	2007-05-23 23:34:01.000000000 +0200
@@ -656,6 +656,49 @@
 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
 static const struct ethtool_ops ethtool_ops;
 
+#ifdef CONFIG_MACH_ARUBA
+
+#include <linux/ctype.h>
+
+#ifndef ERR
+#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
+#endif
+
+static int parse_mac_addr(struct net_device *dev, char* macstr)
+{
+        int i, j;
+        unsigned char result, value;
+
+        for (i=0; i<6; i++) {
+                result = 0;
+                if (i != 5 && *(macstr+2) != ':') {
+                        ERR("invalid mac address format: %d %c\n",
+                            i, *(macstr+2));
+                        return -EINVAL;
+                }
+                for (j=0; j<2; j++) {
+                        if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
+                                                  toupper(*macstr)-'A'+10) < 16) {
+                                result = result*16 + value;
+                                macstr++;
+                        }
+                        else {
+                                ERR("invalid mac address "
+                                    "character: %c\n", *macstr);
+                                return -EINVAL;
+                        }
+                }
+
+                macstr++;
+                dev->dev_addr[i] = result;
+        }
+
+	dev->dev_addr[5]++;
+        return 0;
+}
+
+#endif
+
 static inline void __iomem *ns_ioaddr(struct net_device *dev)
 {
 	return (void __iomem *) dev->base_addr;
@@ -794,6 +837,7 @@
 		goto err_ioremap;
 	}
 
+#ifndef CONFIG_MACH_ARUBA
 	/* Work around the dropped serial bit. */
 	prev_eedata = eeprom_read(ioaddr, 6);
 	for (i = 0; i < 3; i++) {
@@ -802,6 +846,19 @@
 		dev->dev_addr[i*2+1] = eedata >> 7;
 		prev_eedata = eedata;
 	}
+#else
+	{
+		char mac[32];
+		unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
+		extern char *getenv(char *e);
+		memset(mac, 0, 32);
+		memcpy(mac, getenv("ethaddr"), 17);
+		if (parse_mac_addr(dev, mac)){
+			printk("%s: MAC address not found\n", __func__);
+			memcpy(dev->dev_addr, def_mac, 6);
+		}
+	}
+#endif
 
 	dev->base_addr = (unsigned long __force) ioaddr;
 	dev->irq = irq;
diff -Nur linux-2.6.21.1/include/asm-mips/bootinfo.h linux-2.6.21.1-owrt/include/asm-mips/bootinfo.h
--- linux-2.6.21.1/include/asm-mips/bootinfo.h	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-mips/bootinfo.h	2007-05-23 23:34:01.000000000 +0200
@@ -213,6 +213,17 @@
 #define MACH_GROUP_NEC_EMMA2RH 25	/* NEC EMMA2RH (was 23)		*/
 #define  MACH_NEC_MARKEINS	0	/* NEC EMMA2RH Mark-eins	*/
 
+
+/*
+ * Valid machtype for group ARUBA
+ */
+#define MACH_GROUP_ARUBA	23
+#define  MACH_ARUBA_UNKNOWN	0
+#define  MACH_ARUBA_AP60	1
+#define  MACH_ARUBA_AP65	2
+#define  MACH_ARUBA_AP70	3
+#define  MACH_ARUBA_AP40	4
+
 #define CL_SIZE			COMMAND_LINE_SIZE
 
 const char *get_system_type(void);
diff -Nur linux-2.6.21.1/include/asm-mips/cpu.h linux-2.6.21.1-owrt/include/asm-mips/cpu.h
--- linux-2.6.21.1/include/asm-mips/cpu.h	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-mips/cpu.h	2007-05-23 23:34:01.000000000 +0200
@@ -54,6 +54,9 @@
 #define PRID_IMP_R14000		0x0f00
 #define PRID_IMP_R8000		0x1000
 #define PRID_IMP_PR4450		0x1200
+#define PRID_IMP_RC32334	0x1800
+#define PRID_IMP_RC32355	0x1900
+#define PRID_IMP_RC32365	0x1900
 #define PRID_IMP_R4600		0x2000
 #define PRID_IMP_R4700		0x2100
 #define PRID_IMP_TX39		0x2200
@@ -200,7 +203,8 @@
 #define CPU_SB1A		62
 #define CPU_74K			63
 #define CPU_R14000		64
-#define CPU_LAST		64
+#define CPU_RC32300		65
+#define CPU_LAST		65
 
 /*
  * ISA Level encodings
diff -Nur linux-2.6.21.1/include/asm-mips/mach-generic/irq.h linux-2.6.21.1-owrt/include/asm-mips/mach-generic/irq.h
--- linux-2.6.21.1/include/asm-mips/mach-generic/irq.h	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-mips/mach-generic/irq.h	2007-05-23 23:35:55.000000000 +0200
@@ -9,7 +9,7 @@
 #define __ASM_MACH_GENERIC_IRQ_H
 
 #ifndef NR_IRQS
-#define NR_IRQS	128
+#define NR_IRQS	256
 #endif
 
 #ifdef CONFIG_I8259
diff -Nur linux-2.6.21.1/include/linux/kernel.h linux-2.6.21.1-owrt/include/linux/kernel.h
--- linux-2.6.21.1/include/linux/kernel.h	2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/linux/kernel.h	2007-05-23 23:34:01.000000000 +0200
@@ -334,6 +334,7 @@
 };
 
 /* Force a compilation error if condition is true */
+extern void BUILD_BUG(void);
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
 
 /* Force a compilation error if condition is true, but also produce a