summaryrefslogtreecommitdiffstats
path: root/target/device/jp/q5/kernel-patches-2.4.29/001-q5
blob: 5f1af425ae8aea3688e440560285cceec5a058ea (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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/arch/mips/au1000/common/Makefile linux-2.4.25-rc2_q/arch/mips/au1000/common/Makefile
--- linux-2.4.25-rc2_org/arch/mips/au1000/common/Makefile	2004-02-13 01:03:35.000000000 +0100
+++ linux-2.4.25-rc2_q/arch/mips/au1000/common/Makefile	2004-02-13 10:04:07.000000000 +0100
@@ -16,7 +16,7 @@ all: au1000.o
 
 O_TARGET := au1000.o
 
-export-objs		= prom.o clocks.o power.o usbdev.o
+export-objs		= prom.o clocks.o power.o usbdev.o setup.o
 
 obj-y := prom.o int-handler.o dma.o irq.o puts.o time.o reset.o \
 	clocks.o power.o setup.o sleeper.o
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/arch/mips/au1000/common/prom.c linux-2.4.25-rc2_q/arch/mips/au1000/common/prom.c
--- linux-2.4.25-rc2_org/arch/mips/au1000/common/prom.c	2004-02-13 01:03:32.000000000 +0100
+++ linux-2.4.25-rc2_q/arch/mips/au1000/common/prom.c	2004-02-13 10:07:12.000000000 +0100
@@ -81,7 +81,7 @@ void  prom_init_cmdline(void)
 }
 
 
-char *prom_getenv(char *envname)
+char *prom_getenv_n(char *envname, int n)
 {
 	/*
 	 * Return a pointer to the given environment variable.
@@ -89,19 +89,24 @@ char *prom_getenv(char *envname)
 	 */
 
 	t_env_var *env = (t_env_var *)prom_envp;
-	int i;
+	int i, j=0;
 
 	i = strlen(envname);
 
 	while(env->name) {
 		if(strncmp(envname, env->name, i) == 0) {
-			return(env->name + strlen(envname) + 1);
+			if(j++ == n) return(env->name + strlen(envname) + 1);
 		}
 		env++;
 	}
 	return(NULL);
 }
 
+char *prom_getenv(char *envname)
+{
+      return prom_getenv_n(envname, 0);
+}
+
 inline unsigned char str2hexnum(unsigned char c)
 {
 	if(c >= '0' && c <= '9')
@@ -128,18 +133,18 @@ inline void str2eaddr(unsigned char *ea,
 	}
 }
 
-int get_ethernet_addr(char *ethernet_addr)
+int get_ethernet_addr_n(char *ethernet_addr, int n)
 {
         char *ethaddr_str;
 
-        ethaddr_str = prom_getenv("ethaddr");
+        ethaddr_str = prom_getenv_n("ethaddr", n);
 	if (!ethaddr_str) {
 	        printk("ethaddr not set in boot prom\n");
 		return -1;
 	}
 	str2eaddr(ethernet_addr, ethaddr_str);
 
-#if 0
+#if 1
 	{
 		int i;
 
@@ -153,7 +158,13 @@ int get_ethernet_addr(char *ethernet_add
 	return 0;
 }
 
+int get_ethernet_addr(char *ethernet_addr)
+{
+      return get_ethernet_addr_n(ethernet_addr, 0);
+}
+
 void prom_free_prom_memory (void) {}
+EXPORT_SYMBOL(get_ethernet_addr_n);
 EXPORT_SYMBOL(prom_getcmdline);
 EXPORT_SYMBOL(get_ethernet_addr);
 EXPORT_SYMBOL(str2eaddr);
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/arch/mips/au1000/common/setup.c linux-2.4.25-rc2_q/arch/mips/au1000/common/setup.c
--- linux-2.4.25-rc2_org/arch/mips/au1000/common/setup.c	2004-02-13 01:03:31.000000000 +0100
+++ linux-2.4.25-rc2_q/arch/mips/au1000/common/setup.c	2004-02-13 10:04:07.000000000 +0100
@@ -57,6 +57,7 @@ extern struct ide_ops *ide_ops;
 #endif
 
 extern struct rtc_ops no_rtc_ops;
+void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void __init board_setup(void);
 extern void au1000_restart(char *);
@@ -71,6 +72,11 @@ static phys_t au1500_fixup_bigphys_addr(
 extern void au1xxx_time_init(void);
 extern void au1xxx_timer_setup(void);
 
+void au1500_wbflush(void)
+{
+        __asm__ volatile ("sync");
+}
+
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -89,6 +95,8 @@ void __init au1x00_setup(void)
 	}
 #endif	  
 
+	__wbflush = au1500_wbflush;
+
 #ifdef CONFIG_FB_AU1100
     if ((argptr = strstr(argptr, "video=")) == NULL) {
         argptr = prom_getcmdline();
@@ -215,3 +223,6 @@ static phys_t au1500_fixup_bigphys_addr(
 		return phys_addr;
 }
 #endif
+
+EXPORT_SYMBOL(__wbflush);
+
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/arch/mips/kernel/head.S linux-2.4.25-rc2_q/arch/mips/kernel/head.S
--- linux-2.4.25-rc2_org/arch/mips/kernel/head.S	2004-02-13 01:02:42.000000000 +0100
+++ linux-2.4.25-rc2_q/arch/mips/kernel/head.S	2004-02-13 10:07:43.000000000 +0100
@@ -33,7 +33,9 @@
 		 * Reserved space for exception handlers.
 		 * Necessary for machines which link their kernels at KSEG0.
 		 */
-		.fill	0x400
+		j kernel_entry
+		nop
+		.org 0x400
 
 		/* The following two symbols are used for kernel profiling. */
 		EXPORT(stext)
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/arch/mips/Makefile linux-2.4.25-rc2_q/arch/mips/Makefile
--- linux-2.4.25-rc2_org/arch/mips/Makefile	2004-02-13 01:01:00.000000000 +0100
+++ linux-2.4.25-rc2_q/arch/mips/Makefile	2004-04-09 10:40:09.000000000 +0200
@@ -69,13 +69,13 @@ endif
 set_gccflags = $(shell \
 while :; do \
 	cpu=$(1); isa=-$(2); \
-	for gcc_opt in -march= -mcpu=; do \
+	for gcc_opt in -march=; do \
 		$(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
 			-xc /dev/null > /dev/null 2>&1 && \
 			break 2; \
 	done; \
 	cpu=$(3); isa=-$(4); \
-	for gcc_opt in -march= -mcpu=; do \
+	for gcc_opt in -march=; do \
 		$(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
 			-xc /dev/null > /dev/null 2>&1 && \
 			break 2; \
@@ -90,7 +90,7 @@ else \
 fi; \
 gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
 while :; do \
-	for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
+	for gas_opt in -Wa,-march=; do \
 		$(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
 			-o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
 			break 2; \
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/drivers/char/dummy_keyb.c linux-2.4.25-rc2_q/drivers/char/dummy_keyb.c
--- linux-2.4.25-rc2_org/drivers/char/dummy_keyb.c	2004-02-12 23:51:10.000000000 +0100
+++ linux-2.4.25-rc2_q/drivers/char/dummy_keyb.c	2004-02-13 10:11:06.000000000 +0100
@@ -29,6 +29,7 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/input.h>
+#include <linux/pm.h>
 
 void kbd_leds(unsigned char leds)
 {
@@ -140,3 +141,46 @@ void __init kbd_init_hw(void)
 {
 	printk("Dummy keyboard driver installed.\n");
 }
+
+
+void panic_blink(void)
+ {
+ }
+
+
+ int pckbd_translate(unsigned char scancode, unsigned char *keycode,
+                   char raw_mode)
+ {
+   return 0;
+ }
+
+ char pckbd_unexpected_up(unsigned char keycode)
+ {
+   return 0;
+ }
+
+
+ void pckbd_leds(unsigned char leds)
+ {
+ }
+
+
+ int pckbd_setkeycode(unsigned int scancode, unsigned int keycode)
+ {
+   return 0;
+ }
+
+ int pckbd_getkeycode(unsigned int scancode)
+ {
+   return 0;
+ }
+
+ void __init pckbd_init_hw(void)
+ {
+ }
+
+ int pckbd_pm_resume(struct pm_dev *dev, pm_request_t rqst, void *data)
+ {
+   return 0;
+ }
+
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/drivers/char/Makefile linux-2.4.25-rc2_q/drivers/char/Makefile
--- linux-2.4.25-rc2_org/drivers/char/Makefile	2004-02-12 23:50:40.000000000 +0100
+++ linux-2.4.25-rc2_q/drivers/char/Makefile	2004-02-13 10:11:06.000000000 +0100
@@ -32,7 +32,7 @@ mod-subdirs	:=	joystick ftape drm drm-4.
 list-multi	:=	
 
 KEYMAP   =defkeymap.o
-KEYBD    =pc_keyb.o
+KEYBD    =dummy_keyb.o
 CONSOLE  =console.o
 SERIAL   =serial.o
 
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.4.25-rc2_q/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.4.25-rc2_org/drivers/mtd/chips/cfi_cmdset_0002.c	2004-02-13 00:49:45.000000000 +0100
+++ linux-2.4.25-rc2_q/drivers/mtd/chips/cfi_cmdset_0002.c	2004-03-16 10:04:18.000000000 +0100
@@ -511,7 +511,7 @@ static int do_write_oneword(struct map_i
 	   or tells us why it failed. */        
 	dq6 = CMD(1<<6);
 	dq5 = CMD(1<<5);
-	timeo = jiffies + (HZ/1000); /* setting timeout to 1ms for now */
+	timeo = jiffies + HZ; /* setting timeout to 1ms for now */
 		
 	oldstatus = cfi_read(map, adr);
 	status = cfi_read(map, adr);
@@ -540,9 +540,7 @@ static int do_write_oneword(struct map_i
 			oldstatus = cfi_read(map, adr);
 			status = cfi_read(map, adr);
 		    
-			if ( (oldstatus & 0x00FF) == (status & 0x00FF) ) {
-				printk(KERN_WARNING "Warning: DQ5 raised while program operation was in progress, however operation completed OK\n" );
-			} else { 
+			if ( (oldstatus & 0x00FF) != (status & 0x00FF) ) {
 				/* DQ5 is active so we can do a reset and stop the erase */
 				cfi_write(map, CMD(0xF0), chip->start);
 				printk(KERN_WARNING "Internal flash device timeout occurred or write operation was performed while flash was programming.\n" );
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/drivers/mtd/maps/physmap.c linux-2.4.25-rc2_q/drivers/mtd/maps/physmap.c
--- linux-2.4.25-rc2_org/drivers/mtd/maps/physmap.c	2004-02-13 00:50:09.000000000 +0100
+++ linux-2.4.25-rc2_q/drivers/mtd/maps/physmap.c	2004-02-13 10:11:40.000000000 +0100
@@ -86,28 +86,24 @@ static int                   mtd_parts_n
 #else
 static struct mtd_partition physmap_partitions[] = {
 /* Put your own partition definitions here */
-#if 0
 	{
-		name:		"bootROM",
-		size:		0x80000,
+		name:		"fs1",
+		size:		28*1024*1024,
 		offset:		0,
-		mask_flags:	MTD_WRITEABLE,  /* force read-only */
 	}, {
-		name:		"zImage",
-		size:		0x100000,
+		name:		"bootldr",
+		size:		128*1024,
 		offset:		MTDPART_OFS_APPEND,
 		mask_flags:	MTD_WRITEABLE,  /* force read-only */
 	}, {
-		name:		"ramdisk.gz",
-		size:		0x300000,
+		name:		"kernel",
+		size:		1*1024*1024,
 		offset:		MTDPART_OFS_APPEND,
-		mask_flags:	MTD_WRITEABLE,  /* force read-only */
 	}, {
-		name:		"User FS",
+		name:		"fs2",
 		size:		MTDPART_SIZ_FULL,
 		offset:		MTDPART_OFS_APPEND,
 	}
-#endif
 };
 
 #define NUM_PARTITIONS	(sizeof(physmap_partitions)/sizeof(struct mtd_partition))
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/drivers/net/natsemi.c linux-2.4.25-rc2_q/drivers/net/natsemi.c
--- linux-2.4.25-rc2_org/drivers/net/natsemi.c	2004-02-12 23:29:19.000000000 +0100
+++ linux-2.4.25-rc2_q/drivers/net/natsemi.c	2004-04-22 09:28:51.000000000 +0200
@@ -773,7 +773,11 @@ static int __devinit natsemi_probe1 (str
 		goto err_ioremap;
 	}
 
-	/* Work around the dropped serial bit. */
+#ifdef __mips__
+	if (get_ethernet_addr_n(dev->dev_addr, 2)) {
+		printk(KERN_INFO "%s: No mac address found\n", dev->name);
+	}
+#else
 	prev_eedata = eeprom_read(ioaddr, 6);
 	for (i = 0; i < 3; i++) {
 		int eedata = eeprom_read(ioaddr, i + 7);
@@ -781,6 +785,7 @@ static int __devinit natsemi_probe1 (str
 		dev->dev_addr[i*2+1] = eedata >> 7;
 		prev_eedata = eedata;
 	}
+#endif
 
 	dev->base_addr = ioaddr;
 	dev->irq = irq;
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/drivers/net/wireless/hermes.h linux-2.4.25-rc2_q/drivers/net/wireless/hermes.h
--- linux-2.4.25-rc2_org/drivers/net/wireless/hermes.h	2004-02-12 23:47:43.000000000 +0100
+++ linux-2.4.25-rc2_q/drivers/net/wireless/hermes.h	2004-02-13 10:13:40.000000000 +0100
@@ -302,9 +302,9 @@ typedef struct hermes_response {
 #define hermes_read_reg(hw, off) ((hw)->io_space ? \
 	inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
 	readw((hw)->iobase + ( (off) << (hw)->reg_spacing )))
-#define hermes_write_reg(hw, off, val) ((hw)->io_space ? \
-	outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
-	writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )))
+#define hermes_write_reg(hw, off, val) { if((hw)->io_space) \
+	outw_p((val), (hw)->iobase + ( (off) << (hw)->reg_spacing )); else \
+	writew((val), (hw)->iobase + ( (off) << (hw)->reg_spacing ));}
 
 #define hermes_read_regn(hw, name) (hermes_read_reg((hw), HERMES_##name))
 #define hermes_write_regn(hw, name, val) (hermes_write_reg((hw), HERMES_##name, (val)))
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/include/asm-mips/page.h linux-2.4.25-rc2_q/include/asm-mips/page.h
--- linux-2.4.25-rc2_org/include/asm-mips/page.h	2004-02-12 23:06:14.000000000 +0100
+++ linux-2.4.25-rc2_q/include/asm-mips/page.h	2004-03-23 14:18:38.000000000 +0100
@@ -13,7 +13,6 @@
 #include <linux/config.h>
 #include <asm/break.h>
 
-#ifdef __KERNEL__
 
 /*
  * PAGE_SHIFT determines the page size
@@ -30,6 +29,7 @@
 #define PAGE_SIZE	(1L << PAGE_SHIFT)
 #define PAGE_MASK	(~(PAGE_SIZE-1))
 
+#ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
 #include <asm/cacheflush.h>
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/include/asm-mips/wbflush.h linux-2.4.25-rc2_q/include/asm-mips/wbflush.h
--- linux-2.4.25-rc2_org/include/asm-mips/wbflush.h	2004-02-12 23:06:33.000000000 +0100
+++ linux-2.4.25-rc2_q/include/asm-mips/wbflush.h	2004-02-13 20:42:57.000000000 +0100
@@ -15,8 +15,11 @@
 
 #ifdef CONFIG_CPU_HAS_WB
 
-extern void (*__wbflush)(void);
-extern void wbflush_setup(void);
+//extern void (*__wbflush)(void);
+//extern void wbflush_setup(void);
+
+
+#define __wbflush() { __asm__ volatile ("sync"); }
 
 #define wbflush()			\
 	do {				\
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/include/pcmcia/cs_types.h linux-2.4.25-rc2_q/include/pcmcia/cs_types.h
--- linux-2.4.25-rc2_org/include/pcmcia/cs_types.h	2004-02-12 23:13:05.000000000 +0100
+++ linux-2.4.25-rc2_q/include/pcmcia/cs_types.h	2004-02-13 10:15:10.000000000 +0100
@@ -37,6 +37,7 @@
 #endif
 
 #if defined(__arm__) || defined(__mips__)
+//obs jp: on mips, "typedef unsigned long long ioaddr_t;" may be needed to support cardbus
 typedef u_int   ioaddr_t;
 #else
 typedef u_short	ioaddr_t;
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/include/pcmcia/ss.h linux-2.4.25-rc2_q/include/pcmcia/ss.h
--- linux-2.4.25-rc2_org/include/pcmcia/ss.h	2004-02-12 23:13:02.000000000 +0100
+++ linux-2.4.25-rc2_q/include/pcmcia/ss.h	2004-02-13 10:15:32.000000000 +0100
@@ -112,7 +112,7 @@ typedef struct pccard_mem_map {
     u_char	map;
     u_char	flags;
     u_short	speed;
-    u_long	sys_start, sys_stop;
+    ioaddr_t	sys_start, sys_stop;
     u_int	card_start;
 } pccard_mem_map;
 
diff -Naur -p -X do_not_diff -I '\$Id' -I '@(#)' linux-2.4.25-rc2_org/init/do_mounts.c linux-2.4.25-rc2_q/init/do_mounts.c
--- linux-2.4.25-rc2_org/init/do_mounts.c	2004-02-12 22:59:08.000000000 +0100
+++ linux-2.4.25-rc2_q/init/do_mounts.c	2004-02-13 10:16:02.000000000 +0100
@@ -760,8 +760,6 @@ static void __init devfs_make_root(char 
 static void __init mount_root(void)
 {
 #ifdef CONFIG_ROOT_NFS
-       if (MAJOR(ROOT_DEV) == NFS_MAJOR
-           && MINOR(ROOT_DEV) == NFS_MINOR) {
 		if (mount_nfs_root()) {
 			sys_chdir("/root");
 			ROOT_DEV = current->fs->pwdmnt->mnt_sb->s_dev;
@@ -770,7 +768,6 @@ static void __init mount_root(void)
 		}
 		printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying floppy.\n");
 		ROOT_DEV = MKDEV(FLOPPY_MAJOR, 0);
-	}
 #endif
 	devfs_make_root(root_device_name);
 	create_dev("/dev/root", ROOT_DEV, root_device_name);