1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

Upgrade to Linux 2.6.19

- Includes large parts of the patch from #1021 by dpalffy
- Includes RB532 NAND driver changes by n0-1



git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5789 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd
2006-12-14 16:41:33 +00:00
parent a8131d4638
commit c92885c466
93 changed files with 33484 additions and 19072 deletions

View File

@@ -1,7 +1,7 @@
diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
--- linux.old/arch/mips/Kconfig 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/arch/mips/Kconfig 2006-10-11 21:56:38.000000000 +0200
@@ -742,6 +742,19 @@
--- linux.old/arch/mips/Kconfig 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/arch/mips/Kconfig 2006-12-14 04:09:50.000000000 +0100
@@ -728,6 +728,19 @@
select SYS_SUPPORTS_BIG_ENDIAN
select TOSHIBA_BOARDS
@@ -21,7 +21,7 @@ diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
config TOSHIBA_RBTX4927
bool "Toshiba TBTX49[23]7 board"
select DMA_NONCOHERENT
@@ -1028,7 +1041,7 @@
@@ -1015,7 +1028,7 @@
config MIPS_L1_CACHE_SHIFT
int
@@ -31,9 +31,9 @@ diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
default "5"
diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
--- linux.old/arch/mips/Makefile 2006-10-11 21:55:59.000000000 +0200
+++ linux.dev/arch/mips/Makefile 2006-10-11 21:56:38.000000000 +0200
@@ -580,6 +580,13 @@
--- linux.old/arch/mips/Makefile 2006-12-14 03:13:55.000000000 +0100
+++ linux.dev/arch/mips/Makefile 2006-12-14 04:09:50.000000000 +0100
@@ -586,6 +586,13 @@
load-$(CONFIG_TOSHIBA_JMR3927) += 0xffffffff80050000
#
@@ -48,9 +48,9 @@ diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
# Toshiba RBTX4937 board
#
diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
--- linux.old/arch/mips/mm/tlbex.c 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/arch/mips/mm/tlbex.c 2006-10-11 21:56:38.000000000 +0200
@@ -876,7 +876,6 @@
--- linux.old/arch/mips/mm/tlbex.c 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/arch/mips/mm/tlbex.c 2006-12-14 04:09:50.000000000 +0100
@@ -874,7 +874,6 @@
case CPU_R10000:
case CPU_R12000:
case CPU_R14000:
@@ -58,7 +58,7 @@ diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
case CPU_SB1:
case CPU_SB1A:
case CPU_4KSC:
@@ -904,6 +903,7 @@
@@ -902,6 +901,7 @@
tlbw(p);
break;
@@ -68,7 +68,7 @@ diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
case CPU_34K:
diff -urN linux.old/arch/mips/pci/fixup-rb500.c linux.dev/arch/mips/pci/fixup-rb500.c
--- linux.old/arch/mips/pci/fixup-rb500.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/pci/fixup-rb500.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/pci/fixup-rb500.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2001 MontaVista Software Inc.
@@ -96,7 +96,7 @@ diff -urN linux.old/arch/mips/pci/fixup-rb500.c linux.dev/arch/mips/pci/fixup-rb
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
@@ -120,16 +120,16 @@ diff -urN linux.old/arch/mips/pci/fixup-rb500.c linux.dev/arch/mips/pci/fixup-rb
+}
+
diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile
--- linux.old/arch/mips/pci/Makefile 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/arch/mips/pci/Makefile 2006-10-11 21:56:38.000000000 +0200
@@ -57,3 +57,4 @@
obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-tx4938.o ops-tx4938.o
--- linux.old/arch/mips/pci/Makefile 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/arch/mips/pci/Makefile 2006-12-14 04:09:50.000000000 +0100
@@ -53,3 +53,4 @@
obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o
+obj-$(CONFIG_MIKROTIK_RB500) += pci-rc32434.o ops-rc32434.o fixup-rb500.o
diff -urN linux.old/arch/mips/pci/ops-rc32434.c linux.dev/arch/mips/pci/ops-rc32434.c
--- linux.old/arch/mips/pci/ops-rc32434.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/pci/ops-rc32434.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/pci/ops-rc32434.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,195 @@
+/**************************************************************************
+ *
@@ -169,7 +169,7 @@ diff -urN linux.old/arch/mips/pci/ops-rc32434.c linux.dev/arch/mips/pci/ops-rc32
+ **************************************************************************
+ */
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/types.h>
@@ -328,7 +328,7 @@ diff -urN linux.old/arch/mips/pci/ops-rc32434.c linux.dev/arch/mips/pci/ops-rc32
+};
diff -urN linux.old/arch/mips/pci/pci-rc32434.c linux.dev/arch/mips/pci/pci-rc32434.c
--- linux.old/arch/mips/pci/pci-rc32434.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/pci/pci-rc32434.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/pci/pci-rc32434.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,234 @@
+/**************************************************************************
+ *
@@ -368,7 +368,7 @@ diff -urN linux.old/arch/mips/pci/pci-rc32434.c linux.dev/arch/mips/pci/pci-rc32
+ **************************************************************************
+ */
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
@@ -566,8 +566,24 @@ diff -urN linux.old/arch/mips/pci/pci-rc32434.c linux.dev/arch/mips/pci/pci-rc32
+
diff -urN linux.old/arch/mips/rb500/devices.c linux.dev/arch/mips/rb500/devices.c
--- linux.old/arch/mips/rb500/devices.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/devices.c 2006-10-11 21:56:38.000000000 +0200
@@ -0,0 +1,198 @@
+++ linux.dev/arch/mips/rb500/devices.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,214 @@
+/*
+ * RouterBoard 500 Platform devices
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * $Id$
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
@@ -768,7 +784,7 @@ diff -urN linux.old/arch/mips/rb500/devices.c linux.dev/arch/mips/rb500/devices.
+#endif
diff -urN linux.old/arch/mips/rb500/early_serial.c linux.dev/arch/mips/rb500/early_serial.c
--- linux.old/arch/mips/rb500/early_serial.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/early_serial.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/rb500/early_serial.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,199 @@
+/**************************************************************************
+ *
@@ -971,7 +987,7 @@ diff -urN linux.old/arch/mips/rb500/early_serial.c linux.dev/arch/mips/rb500/ear
+}
diff -urN linux.old/arch/mips/rb500/irq.c linux.dev/arch/mips/rb500/irq.c
--- linux.old/arch/mips/rb500/irq.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/irq.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/rb500/irq.c 2006-12-14 04:14:16.000000000 +0100
@@ -0,0 +1,264 @@
+/*
+ * BRIEF MODULE DESCRIPTION
@@ -1212,7 +1228,7 @@ diff -urN linux.old/arch/mips/rb500/irq.c linux.dev/arch/mips/rb500/irq.c
+ irq_desc[i].status = IRQ_DISABLED;
+ irq_desc[i].action = NULL;
+ irq_desc[i].depth = 1;
+ irq_desc[i].handler = &rc32434_irq_type;
+ irq_desc[i].chip = &rc32434_irq_type;
+ spin_lock_init(&irq_desc[i].lock);
+ }
+}
@@ -1225,7 +1241,7 @@ diff -urN linux.old/arch/mips/rb500/irq.c linux.dev/arch/mips/rb500/irq.c
+ unsigned int cp0_cause = read_c0_cause() & read_c0_status();
+
+ if (cp0_cause & CAUSEF_IP7) {
+ ll_timer_interrupt(7, regs);
+ ll_timer_interrupt(7);
+ } else if ((ip = (cp0_cause & 0x7c00))) {
+ group = 21 - rc32434_clz(ip);
+
@@ -1234,12 +1250,12 @@ diff -urN linux.old/arch/mips/rb500/irq.c linux.dev/arch/mips/rb500/irq.c
+ pend = READ_PEND(addr);
+ pend &= ~READ_MASK(addr); // only unmasked interrupts
+ pend = 39 - rc32434_clz(pend);
+ do_IRQ((group << 5) + pend, regs);
+ do_IRQ((group << 5) + pend);
+ }
+}
diff -urN linux.old/arch/mips/rb500/Makefile linux.dev/arch/mips/rb500/Makefile
--- linux.old/arch/mips/rb500/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/Makefile 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/rb500/Makefile 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,5 @@
+#
+# Makefile for the RB500 board specific parts of the kernel
@@ -1248,7 +1264,7 @@ diff -urN linux.old/arch/mips/rb500/Makefile linux.dev/arch/mips/rb500/Makefile
+obj-y += irq.o time.o setup.o serial.o early_serial.o prom.o misc.o devices.o
diff -urN linux.old/arch/mips/rb500/misc.c linux.dev/arch/mips/rb500/misc.c
--- linux.old/arch/mips/rb500/misc.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/misc.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/rb500/misc.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,56 @@
+#include <linux/module.h>
+#include <linux/kernel.h> /* printk() */
@@ -1308,7 +1324,7 @@ diff -urN linux.old/arch/mips/rb500/misc.c linux.dev/arch/mips/rb500/misc.c
+EXPORT_SYMBOL(changeLatchU5);
diff -urN linux.old/arch/mips/rb500/prom.c linux.dev/arch/mips/rb500/prom.c
--- linux.old/arch/mips/rb500/prom.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/prom.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/rb500/prom.c 2006-12-14 05:15:05.000000000 +0100
@@ -0,0 +1,181 @@
+/*
+* prom.c
@@ -1337,7 +1353,7 @@ diff -urN linux.old/arch/mips/rb500/prom.c linux.dev/arch/mips/rb500/prom.c
+
+*/
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
@@ -1493,7 +1509,7 @@ diff -urN linux.old/arch/mips/rb500/prom.c linux.dev/arch/mips/rb500/prom.c
+
diff -urN linux.old/arch/mips/rb500/serial.c linux.dev/arch/mips/rb500/serial.c
--- linux.old/arch/mips/rb500/serial.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/serial.c 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/arch/mips/rb500/serial.c 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,79 @@
+/**************************************************************************
+ *
@@ -1534,7 +1550,7 @@ diff -urN linux.old/arch/mips/rb500/serial.c linux.dev/arch/mips/rb500/serial.c
+ */
+
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/pci.h>
@@ -1576,8 +1592,8 @@ diff -urN linux.old/arch/mips/rb500/serial.c linux.dev/arch/mips/rb500/serial.c
+}
diff -urN linux.old/arch/mips/rb500/setup.c linux.dev/arch/mips/rb500/setup.c
--- linux.old/arch/mips/rb500/setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/setup.c 2006-10-11 21:56:38.000000000 +0200
@@ -0,0 +1,84 @@
+++ linux.dev/arch/mips/rb500/setup.c 2006-12-14 04:51:12.000000000 +0100
@@ -0,0 +1,81 @@
+/*
+ * setup.c - boot time setup code
+ */
@@ -1586,22 +1602,20 @@ diff -urN linux.old/arch/mips/rb500/setup.c linux.dev/arch/mips/rb500/setup.c
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/irq.h>
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <linux/ioport.h>
+#include <linux/pm.h>
+#include <asm/bootinfo.h>
+#include <asm/mipsregs.h>
+#include <asm/pgtable.h>
+#include <asm/reboot.h>
+#include <asm/addrspace.h> /* for KSEG1ADDR() */
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/rc32434/rc32434.h>
+#include <linux/pm.h>
+#include <asm/rc32434/pci.h>
+
+extern void (*board_time_init)(void);
+extern void (*board_timer_setup)(struct irqaction *irq);
+extern void rc32434_time_init(void);
+extern void rc32434_timer_setup(struct irqaction *irq);
+#ifdef CONFIG_PCI
+extern void *rc32434_time_init(void);
+extern int __init rc32434_pcibridge_init(void);
+#endif
+
@@ -1629,12 +1643,11 @@ diff -urN linux.old/arch/mips/rb500/setup.c linux.dev/arch/mips/rb500/setup.c
+}
+#endif
+
+void __init plat_setup(void)
+void __init plat_mem_setup(void)
+{
+ unsigned int pciCntlVal;
+
+ board_time_init = rc32434_time_init;
+ board_timer_setup = rc32434_timer_setup;
+
+#ifdef CONFIG_CPU_HAS_WB
+ __wbflush = rb_write_buffer_flush;
@@ -1664,8 +1677,8 @@ diff -urN linux.old/arch/mips/rb500/setup.c linux.dev/arch/mips/rb500/setup.c
+}
diff -urN linux.old/arch/mips/rb500/time.c linux.dev/arch/mips/rb500/time.c
--- linux.old/arch/mips/rb500/time.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/rb500/time.c 2006-10-11 21:56:38.000000000 +0200
@@ -0,0 +1,94 @@
+++ linux.dev/arch/mips/rb500/time.c 2006-12-14 04:48:33.000000000 +0100
@@ -0,0 +1,93 @@
+/*
+****************************************************************************
+* Carsten Langgaard, carstenl@mips.com
@@ -1699,7 +1712,7 @@ diff -urN linux.old/arch/mips/rb500/time.c linux.dev/arch/mips/rb500/time.c
+****************************************************************************
+*/
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <linux/sched.h>
@@ -1715,7 +1728,6 @@ diff -urN linux.old/arch/mips/rb500/time.c linux.dev/arch/mips/rb500/time.c
+
+static unsigned long r4k_offset; /* Amount to incr compare reg each time */
+static unsigned long r4k_cur; /* What counter should be at next timer irq */
+extern void ll_timer_interrupt(int irq, struct pt_regs *regs);
+extern unsigned int mips_hpt_frequency;
+extern unsigned int idt_cpu_freq;
+
@@ -1750,7 +1762,7 @@ diff -urN linux.old/arch/mips/rb500/time.c linux.dev/arch/mips/rb500/time.c
+ local_irq_restore(flags);
+}
+
+void __init rc32434_timer_setup(struct irqaction *irq)
+void __init plat_timer_setup(struct irqaction *irq)
+{
+ /* we are using the cpu counter for timer interrupts */
+ setup_irq(MIPS_CPU_TIMER_IRQ, irq);
@@ -1761,8 +1773,8 @@ diff -urN linux.old/arch/mips/rb500/time.c linux.dev/arch/mips/rb500/time.c
+}
+
diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/devices/block2mtd.c
--- linux.old/drivers/mtd/devices/block2mtd.c 2006-10-11 21:55:59.000000000 +0200
+++ linux.dev/drivers/mtd/devices/block2mtd.c 2006-10-11 22:24:51.000000000 +0200
--- linux.old/drivers/mtd/devices/block2mtd.c 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/drivers/mtd/devices/block2mtd.c 2006-12-14 04:09:50.000000000 +0100
@@ -26,7 +26,6 @@
#define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)
#define INFO(fmt, args...) printk(KERN_INFO "block2mtd: " fmt "\n" , ## args)
@@ -1771,7 +1783,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
/* Info for the block device */
struct block2mtd_dev {
struct list_head list;
@@ -104,7 +103,7 @@
@@ -106,7 +105,7 @@
while (pages) {
page = page_readahead(mapping, index);
@@ -1780,7 +1792,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
return -ENOMEM;
if (IS_ERR(page))
return PTR_ERR(page);
@@ -285,7 +284,7 @@
@@ -287,7 +286,7 @@
/* FIXME: ensure that mtd->size % erase_size == 0 */
@@ -1789,7 +1801,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
{
struct block_device *bdev;
struct block2mtd_dev *dev;
@@ -328,14 +327,15 @@
@@ -330,14 +329,15 @@
/* Setup the MTD structure */
/* make the name contain the block device in */
@@ -1805,9 +1817,9 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
+ dev->mtd.size -= dev->mtd.size % erase_size;
dev->mtd.erasesize = erase_size;
dev->mtd.writesize = 1;
dev->mtd.type = MTD_RAM;
dev->mtd.flags = MTD_CAP_RAM;
@@ -353,7 +353,7 @@
@@ -356,7 +356,7 @@
}
list_add(&dev->list, &blkmtd_device_list);
INFO("mtd%d: [%s] erase_size = %dKiB [%d]", dev->mtd.index,
@@ -1816,7 +1828,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
dev->mtd.erasesize >> 10, dev->mtd.erasesize);
return dev;
@@ -429,7 +429,7 @@
@@ -432,7 +432,7 @@
{
char buf[80 + 12]; /* 80 for device, 12 for erase size */
char *str = buf;
@@ -1825,7 +1837,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
char *name;
size_t erase_size = PAGE_SIZE;
int i, ret;
@@ -440,7 +440,7 @@
@@ -443,7 +443,7 @@
strcpy(str, val);
kill_final_newline(str);
@@ -1834,7 +1846,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
token[i] = strsep(&str, ",");
if (str)
@@ -461,13 +461,13 @@
@@ -464,13 +464,13 @@
}
}
@@ -1850,7 +1862,7 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
{
#ifdef MODULE
return block2mtd_setup2(val);
@@ -496,6 +496,7 @@
@@ -499,6 +499,7 @@
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=<dev>[,<erasesize>]\"");
@@ -1859,22 +1871,22 @@ diff -urN linux.old/drivers/mtd/devices/block2mtd.c linux.dev/drivers/mtd/device
static int __init block2mtd_init(void)
{
diff -urN linux.old/drivers/pci/Makefile linux.dev/drivers/pci/Makefile
--- linux.old/drivers/pci/Makefile 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/drivers/pci/Makefile 2006-10-11 21:56:38.000000000 +0200
@@ -27,6 +27,7 @@
obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
obj-$(CONFIG_X86_VISWS) += setup-irq.o
--- linux.old/drivers/pci/Makefile 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/drivers/pci/Makefile 2006-12-14 04:09:50.000000000 +0100
@@ -16,6 +16,7 @@
# Build the PCI MSI interrupt support
obj-$(CONFIG_PCI_MSI) += msi.o
+obj-$(CONFIG_MIKROTIK_RB500) += setup-irq.o
#
# ACPI Related PCI FW Functions
# Build the Hypertransport interrupt support
obj-$(CONFIG_HT_IRQ) += htirq.o
diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h
--- linux.old/include/asm-mips/bootinfo.h 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/include/asm-mips/bootinfo.h 2006-10-11 21:56:38.000000000 +0200
@@ -218,6 +218,8 @@
#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
#define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
--- linux.old/include/asm-mips/bootinfo.h 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/include/asm-mips/bootinfo.h 2006-12-14 04:09:50.000000000 +0100
@@ -212,6 +212,8 @@
#define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
+#define MACH_GROUP_MIKROTIK 24 /* Mikrotik Boards */
+
@@ -1882,8 +1894,8 @@ diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/booti
const char *get_system_type(void);
diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
--- linux.old/include/asm-mips/cpu.h 2006-06-18 03:49:35.000000000 +0200
+++ linux.dev/include/asm-mips/cpu.h 2006-10-11 21:56:38.000000000 +0200
--- linux.old/include/asm-mips/cpu.h 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/include/asm-mips/cpu.h 2006-12-14 04:09:50.000000000 +0100
@@ -200,7 +200,8 @@
#define CPU_SB1A 62
#define CPU_74K 63
@@ -1896,7 +1908,7 @@ diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
* ISA Level encodings
diff -urN linux.old/include/asm-mips/rc32434/crom.h linux.dev/include/asm-mips/rc32434/crom.h
--- linux.old/include/asm-mips/rc32434/crom.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/crom.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/crom.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,98 @@
+#ifndef __IDT_CROM_H__
+#define __IDT_CROM_H__
@@ -1998,7 +2010,7 @@ diff -urN linux.old/include/asm-mips/rc32434/crom.h linux.dev/include/asm-mips/r
+#endif // __IDT_CROM_H__
diff -urN linux.old/include/asm-mips/rc32434/ddr.h linux.dev/include/asm-mips/rc32434/ddr.h
--- linux.old/include/asm-mips/rc32434/ddr.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/ddr.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/ddr.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,175 @@
+#ifndef __IDT_DDR_H__
+#define __IDT_DDR_H__
@@ -2177,7 +2189,7 @@ diff -urN linux.old/include/asm-mips/rc32434/ddr.h linux.dev/include/asm-mips/rc
+#endif // __IDT_DDR_H__
diff -urN linux.old/include/asm-mips/rc32434/dev.h linux.dev/include/asm-mips/rc32434/dev.h
--- linux.old/include/asm-mips/rc32434/dev.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/dev.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/dev.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,134 @@
+#ifndef __IDT_DEV_H__
+#define __IDT_DEV_H__
@@ -2315,7 +2327,7 @@ diff -urN linux.old/include/asm-mips/rc32434/dev.h linux.dev/include/asm-mips/rc
+
diff -urN linux.old/include/asm-mips/rc32434/dma.h linux.dev/include/asm-mips/rc32434/dma.h
--- linux.old/include/asm-mips/rc32434/dma.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/dma.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/dma.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,202 @@
+#ifndef __IDT_DMA_H__
+#define __IDT_DMA_H__
@@ -2521,7 +2533,7 @@ diff -urN linux.old/include/asm-mips/rc32434/dma.h linux.dev/include/asm-mips/rc
+
diff -urN linux.old/include/asm-mips/rc32434/dma_v.h linux.dev/include/asm-mips/rc32434/dma_v.h
--- linux.old/include/asm-mips/rc32434/dma_v.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/dma_v.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/dma_v.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,73 @@
+#ifndef __IDT_DMA_V_H__
+#define __IDT_DMA_V_H__
@@ -2598,7 +2610,7 @@ diff -urN linux.old/include/asm-mips/rc32434/dma_v.h linux.dev/include/asm-mips/
+
diff -urN linux.old/include/asm-mips/rc32434/eth.h linux.dev/include/asm-mips/rc32434/eth.h
--- linux.old/include/asm-mips/rc32434/eth.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/eth.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/eth.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,322 @@
+#ifndef __IDT_ETH_H__
+#define __IDT_ETH_H__
@@ -2924,7 +2936,7 @@ diff -urN linux.old/include/asm-mips/rc32434/eth.h linux.dev/include/asm-mips/rc
+
diff -urN linux.old/include/asm-mips/rc32434/eth_v.h linux.dev/include/asm-mips/rc32434/eth_v.h
--- linux.old/include/asm-mips/rc32434/eth_v.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/eth_v.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/eth_v.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,64 @@
+#ifndef __IDT_ETH_V_H__
+#define __IDT_ETH_V_H__
@@ -2992,7 +3004,7 @@ diff -urN linux.old/include/asm-mips/rc32434/eth_v.h linux.dev/include/asm-mips/
+
diff -urN linux.old/include/asm-mips/rc32434/gpio.h linux.dev/include/asm-mips/rc32434/gpio.h
--- linux.old/include/asm-mips/rc32434/gpio.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/gpio.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/gpio.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,182 @@
+#ifndef __IDT_GPIO_H__
+#define __IDT_GPIO_H__
@@ -3178,7 +3190,7 @@ diff -urN linux.old/include/asm-mips/rc32434/gpio.h linux.dev/include/asm-mips/r
+
diff -urN linux.old/include/asm-mips/rc32434/i2c.h linux.dev/include/asm-mips/rc32434/i2c.h
--- linux.old/include/asm-mips/rc32434/i2c.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/i2c.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/i2c.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,147 @@
+#ifndef __IDT_I2C_H__
+#define __IDT_I2C_H__
@@ -3329,7 +3341,7 @@ diff -urN linux.old/include/asm-mips/rc32434/i2c.h linux.dev/include/asm-mips/rc
+#endif // __IDT_I2C_H__
diff -urN linux.old/include/asm-mips/rc32434/integ.h linux.dev/include/asm-mips/rc32434/integ.h
--- linux.old/include/asm-mips/rc32434/integ.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/integ.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/integ.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,78 @@
+#ifndef __IDT_INTEG_H__
+#define __IDT_INTEG_H__
@@ -3411,7 +3423,7 @@ diff -urN linux.old/include/asm-mips/rc32434/integ.h linux.dev/include/asm-mips/
+#endif // __IDT_INTEG_H__
diff -urN linux.old/include/asm-mips/rc32434/int.h linux.dev/include/asm-mips/rc32434/int.h
--- linux.old/include/asm-mips/rc32434/int.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/int.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/int.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,167 @@
+#ifndef __IDT_INT_H__
+#define __IDT_INT_H__
@@ -3582,7 +3594,7 @@ diff -urN linux.old/include/asm-mips/rc32434/int.h linux.dev/include/asm-mips/rc
+
diff -urN linux.old/include/asm-mips/rc32434/iparb.h linux.dev/include/asm-mips/rc32434/iparb.h
--- linux.old/include/asm-mips/rc32434/iparb.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/iparb.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/iparb.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,95 @@
+#ifndef __IDT_IPARB_H__
+#define __IDT_IPARB_H__
@@ -3681,7 +3693,7 @@ diff -urN linux.old/include/asm-mips/rc32434/iparb.h linux.dev/include/asm-mips/
+#endif // __IDT_IPARB_H__
diff -urN linux.old/include/asm-mips/rc32434/irm.h linux.dev/include/asm-mips/rc32434/irm.h
--- linux.old/include/asm-mips/rc32434/irm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/irm.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/irm.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,55 @@
+#ifndef __IDT_IRM_H__
+#define __IDT_IRM_H__
@@ -3740,19 +3752,19 @@ diff -urN linux.old/include/asm-mips/rc32434/irm.h linux.dev/include/asm-mips/rc
+#endif // __IDT_IRM_H__
diff -urN linux.old/include/asm-mips/rc32434/irq.h linux.dev/include/asm-mips/rc32434/irq.h
--- linux.old/include/asm-mips/rc32434/irq.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/irq.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/irq.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,8 @@
+#ifndef __ASM_MACH_MIPS_IRQ_H
+#define __ASM_MACH_MIPS_IRQ_H
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+
+#define NR_IRQS 256
+
+#endif /* __ASM_MACH_MIPS_IRQ_H */
diff -urN linux.old/include/asm-mips/rc32434/nvram.h linux.dev/include/asm-mips/rc32434/nvram.h
--- linux.old/include/asm-mips/rc32434/nvram.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/nvram.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/nvram.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,97 @@
+#ifndef __IDT_NVRAM_H
+#define __IDT_NVRAM_H
@@ -3853,7 +3865,7 @@ diff -urN linux.old/include/asm-mips/rc32434/nvram.h linux.dev/include/asm-mips/
+
diff -urN linux.old/include/asm-mips/rc32434/pci.h linux.dev/include/asm-mips/rc32434/pci.h
--- linux.old/include/asm-mips/rc32434/pci.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/pci.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/pci.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,695 @@
+/**************************************************************************
+ *
@@ -4552,7 +4564,7 @@ diff -urN linux.old/include/asm-mips/rc32434/pci.h linux.dev/include/asm-mips/rc
+
diff -urN linux.old/include/asm-mips/rc32434/pcikorina.h linux.dev/include/asm-mips/rc32434/pcikorina.h
--- linux.old/include/asm-mips/rc32434/pcikorina.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/pcikorina.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/pcikorina.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,209 @@
+/* $Id: pciacacia.h,v 1.5 2001/05/01 10:09:17 carstenl Exp $
+ *
@@ -4765,7 +4777,7 @@ diff -urN linux.old/include/asm-mips/rc32434/pcikorina.h linux.dev/include/asm-m
+
diff -urN linux.old/include/asm-mips/rc32434/pci_regs.h linux.dev/include/asm-mips/rc32434/pci_regs.h
--- linux.old/include/asm-mips/rc32434/pci_regs.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/pci_regs.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/pci_regs.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,8 @@
+/* Override the default address space for this arch
+*/
@@ -4777,8 +4789,23 @@ diff -urN linux.old/include/asm-mips/rc32434/pci_regs.h linux.dev/include/asm-mi
+
diff -urN linux.old/include/asm-mips/rc32434/rb.h linux.dev/include/asm-mips/rc32434/rb.h
--- linux.old/include/asm-mips/rc32434/rb.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/rb.h 2006-10-11 21:56:38.000000000 +0200
@@ -0,0 +1,69 @@
+++ linux.dev/include/asm-mips/rc32434/rb.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * $Id$
+ */
+#ifndef __MIPS_RB_H__
+#define __MIPS_RB_H__
+#include <linux/genhd.h>
@@ -4850,7 +4877,7 @@ diff -urN linux.old/include/asm-mips/rc32434/rb.h linux.dev/include/asm-mips/rc3
+#endif
diff -urN linux.old/include/asm-mips/rc32434/rc32434.h linux.dev/include/asm-mips/rc32434/rc32434.h
--- linux.old/include/asm-mips/rc32434/rc32434.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/rc32434.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/rc32434.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,126 @@
+/*
+ ***************************************************************************
@@ -4879,7 +4906,7 @@ diff -urN linux.old/include/asm-mips/rc32434/rc32434.h linux.dev/include/asm-mip
+#ifndef _RC32434_H_
+#define _RC32434_H_
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/delay.h>
+#include <asm/io.h>
+#include <asm/rc32434/timer.h>
@@ -4980,7 +5007,7 @@ diff -urN linux.old/include/asm-mips/rc32434/rc32434.h linux.dev/include/asm-mip
+#endif /* _RC32434_H_ */
diff -urN linux.old/include/asm-mips/rc32434/rst.h linux.dev/include/asm-mips/rc32434/rst.h
--- linux.old/include/asm-mips/rc32434/rst.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/rst.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/rst.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,105 @@
+#ifndef __IDT_RST_H__
+#define __IDT_RST_H__
@@ -5089,7 +5116,7 @@ diff -urN linux.old/include/asm-mips/rc32434/rst.h linux.dev/include/asm-mips/rc
+#endif // __IDT_RST_H__
diff -urN linux.old/include/asm-mips/rc32434/spi.h linux.dev/include/asm-mips/rc32434/spi.h
--- linux.old/include/asm-mips/rc32434/spi.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/spi.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/spi.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,100 @@
+#ifndef __IDT_SPI_H__
+#define __IDT_SPI_H__
@@ -5193,7 +5220,7 @@ diff -urN linux.old/include/asm-mips/rc32434/spi.h linux.dev/include/asm-mips/rc
+#endif // __IDT_SPI_H__
diff -urN linux.old/include/asm-mips/rc32434/timer.h linux.dev/include/asm-mips/rc32434/timer.h
--- linux.old/include/asm-mips/rc32434/timer.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/timer.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/timer.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,91 @@
+/**************************************************************************
+ *
@@ -5288,7 +5315,7 @@ diff -urN linux.old/include/asm-mips/rc32434/timer.h linux.dev/include/asm-mips/
+
diff -urN linux.old/include/asm-mips/rc32434/tim.h linux.dev/include/asm-mips/rc32434/tim.h
--- linux.old/include/asm-mips/rc32434/tim.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/tim.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/tim.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,78 @@
+#ifndef __IDT_TIM_H__
+#define __IDT_TIM_H__
@@ -5370,8 +5397,8 @@ diff -urN linux.old/include/asm-mips/rc32434/tim.h linux.dev/include/asm-mips/rc
+
diff -urN linux.old/include/asm-mips/rc32434/types.h linux.dev/include/asm-mips/rc32434/types.h
--- linux.old/include/asm-mips/rc32434/types.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/types.h 2006-10-11 21:56:38.000000000 +0200
@@ -0,0 +1,39 @@
+++ linux.dev/include/asm-mips/rc32434/types.h 2006-12-14 04:10:43.000000000 +0100
@@ -0,0 +1,35 @@
+#ifndef __IDT_TYPES_H__
+#define __IDT_TYPES_H__
+
@@ -5406,14 +5433,10 @@ diff -urN linux.old/include/asm-mips/rc32434/types.h linux.dev/include/asm-mips/
+typedef unsigned long long U64 ;
+typedef signed long long S64 ;
+
+#ifndef __cplusplus
+ typedef U32 bool ; // (false == 0), (true is != false)
+#endif // __cplusplus
+
+#endif // __IDT_TYPES_H__
diff -urN linux.old/include/asm-mips/rc32434/uart.h linux.dev/include/asm-mips/rc32434/uart.h
--- linux.old/include/asm-mips/rc32434/uart.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/include/asm-mips/rc32434/uart.h 2006-10-11 21:56:38.000000000 +0200
+++ linux.dev/include/asm-mips/rc32434/uart.h 2006-12-14 04:09:50.000000000 +0100
@@ -0,0 +1,178 @@
+#ifndef __IDT_UART_H__
+#define __IDT_UART_H__

View File

@@ -1,7 +1,7 @@
diff -urN linux.old/drivers/net/Kconfig linux.dev/drivers/net/Kconfig
--- linux.old/drivers/net/Kconfig 2006-06-08 20:21:20.000000000 +0200
+++ linux.dev/drivers/net/Kconfig 2006-06-08 20:19:40.000000000 +0200
@@ -310,6 +310,13 @@
--- linux.old/drivers/net/Kconfig 2006-12-14 03:13:47.000000000 +0100
+++ linux.dev/drivers/net/Kconfig 2006-12-14 03:18:45.000000000 +0100
@@ -313,6 +313,13 @@
source "drivers/net/arm/Kconfig"
@@ -17,7 +17,7 @@ diff -urN linux.old/drivers/net/Kconfig linux.dev/drivers/net/Kconfig
depends on NET_ETHERNET && PPC_PMAC && PPC32
diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
--- linux.old/drivers/net/korina.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/drivers/net/korina.c 2006-06-09 00:48:40.000000000 +0200
+++ linux.dev/drivers/net/korina.c 2006-12-14 03:18:45.000000000 +0100
@@ -0,0 +1,1159 @@
+/**************************************************************************
+ *
@@ -59,7 +59,7 @@ diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
+ **************************************************************************
+ */
+
+#include <linux/config.h>
+#include <linux/autoconf.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/moduleparam.h>
@@ -573,7 +573,7 @@ diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
+#ifdef RC32434_REVISION
+/* Ethernet Rx Overflow interrupt */
+static irqreturn_t
+rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+rc32434_ovr_interrupt(int irq, void *dev_id)
+{
+ struct net_device *dev = (struct net_device *)dev_id;
+ struct rc32434_local *lp;
@@ -606,7 +606,7 @@ diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
+
+/* Ethernet Tx Underflow interrupt */
+static irqreturn_t
+rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+rc32434_und_interrupt(int irq, void *dev_id)
+{
+ struct net_device *dev = (struct net_device *)dev_id;
+ struct rc32434_local *lp;
@@ -639,7 +639,7 @@ diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
+
+/* Ethernet Rx DMA interrupt */
+static irqreturn_t
+rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+rc32434_rx_dma_interrupt(int irq, void *dev_id)
+{
+ struct net_device *dev = (struct net_device *)dev_id;
+ struct rc32434_local* lp;
@@ -853,7 +853,7 @@ diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
+
+/* Ethernet Tx DMA interrupt */
+static irqreturn_t
+rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+rc32434_tx_dma_interrupt(int irq, void *dev_id)
+{
+ struct net_device *dev = (struct net_device *)dev_id;
+ struct rc32434_local *lp;
@@ -1179,8 +1179,8 @@ diff -urN linux.old/drivers/net/korina.c linux.dev/drivers/net/korina.c
+module_init(rc32434_init_module);
+module_exit(rc32434_cleanup_module);
diff -urN linux.old/drivers/net/Makefile linux.dev/drivers/net/Makefile
--- linux.old/drivers/net/Makefile 2006-06-08 20:21:20.000000000 +0200
+++ linux.dev/drivers/net/Makefile 2006-06-08 20:19:40.000000000 +0200
--- linux.old/drivers/net/Makefile 2006-12-14 03:13:47.000000000 +0100
+++ linux.dev/drivers/net/Makefile 2006-12-14 03:18:45.000000000 +0100
@@ -23,6 +23,8 @@
#
obj-$(CONFIG_PLIP) += plip.o
@@ -1192,7 +1192,7 @@ diff -urN linux.old/drivers/net/Makefile linux.dev/drivers/net/Makefile
obj-$(CONFIG_HAPPYMEAL) += sunhme.o
diff -urN linux.old/drivers/net/rc32434_eth.h linux.dev/drivers/net/rc32434_eth.h
--- linux.old/drivers/net/rc32434_eth.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/drivers/net/rc32434_eth.h 2006-06-08 21:57:12.000000000 +0200
+++ linux.dev/drivers/net/rc32434_eth.h 2006-12-14 03:18:45.000000000 +0100
@@ -0,0 +1,178 @@
+/**************************************************************************
+ *
@@ -1337,11 +1337,11 @@ diff -urN linux.old/drivers/net/rc32434_eth.h linux.dev/drivers/net/rc32434_eth.
+static int rc32434_open(struct net_device *dev);
+static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
+static void rc32434_mii_handler(unsigned long data);
+static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t rc32434_und_interrupt(int irq, void *dev_id);
+static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id);
+static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id);
+#ifdef RC32434_REVISION
+static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id);
+#endif
+static int rc32434_close(struct net_device *dev);
+static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
@@ -1372,4 +1372,3 @@ diff -urN linux.old/drivers/net/rc32434_eth.h linux.dev/drivers/net/rc32434_eth.
+ __raw_writel(0, &ch->dmadptr);
+ __raw_writel(0, &ch->dmandptr);
+}

View File

@@ -26,7 +26,18 @@ diff -urN linux.old/drivers/block/Makefile linux.dev/drivers/block/Makefile
diff -urN linux.old/drivers/block/rb500/ata.c linux.dev/drivers/block/rb500/ata.c
--- linux.old/drivers/block/rb500/ata.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/drivers/block/rb500/ata.c 2006-10-26 00:11:14.000000000 +0200
@@ -0,0 +1,474 @@
@@ -0,0 +1,485 @@
+/* CF-mips driver
+ This is a block driver for the direct (mmaped) interface to the CF-slot,
+ found in Routerboard.com's RB532 board
+ See SDK provided from routerboard.com.
+
+ Module adapted By P.Christeas <p_christeas@yahoo.com>, 2005-6.
+ Cleaned up and adapted to platform_device by Felix Fietkau <nbd@openwrt.org>
+
+ This work is redistributed under the terms of the GNU General Public License.
+*/
+
+#include <linux/kernel.h> /* printk() */
+#include <linux/module.h> /* module to be loadable */
+#include <linux/delay.h>
@@ -162,7 +173,7 @@ diff -urN linux.old/drivers/block/rb500/ata.c linux.dev/drivers/block/rb500/ata.
+ return CF_TRANS_FAILED;
+}
+
+static irqreturn_t cf_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t cf_irq_handler(int irq, void *dev_id)
+{
+ /* While tasklet has not disabled irq, irq will be retried all the time
+ * because of ILEVEL matching GPIO pin status => deadlock.
@@ -504,7 +515,18 @@ diff -urN linux.old/drivers/block/rb500/ata.c linux.dev/drivers/block/rb500/ata.
diff -urN linux.old/drivers/block/rb500/ata.h linux.dev/drivers/block/rb500/ata.h
--- linux.old/drivers/block/rb500/ata.h 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/drivers/block/rb500/ata.h 2006-10-26 00:11:14.000000000 +0200
@@ -0,0 +1,132 @@
@@ -0,0 +1,143 @@
+/* CF-mips driver
+ This is a block driver for the direct (mmaped) interface to the CF-slot,
+ found in Routerboard.com's RB532 board
+ See SDK provided from routerboard.com.
+
+ Module adapted By P.Christeas <p_christeas@yahoo.com>, 2005-6.
+ Cleaned up and adapted to platform_device by Felix Fietkau <nbd@openwrt.org>
+
+ This work is redistributed under the terms of the GNU General Public License.
+*/
+
+#ifndef __CFMIPS_ATA_H__
+#define __CFMIPS_ATA_H__
+

View File

@@ -1,39 +1,27 @@
diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
--- linux.old/drivers/net/via-rhine.c 2006-12-07 05:53:39.000000000 +0100
+++ linux.dev/drivers/net/via-rhine.c 2006-12-07 07:06:52.000000000 +0100
@@ -131,6 +131,10 @@
- Fix Tx engine race for good
- Craig Brind: Zero padded aligned buffers for short packets.
--- linux.old/drivers/net/via-rhine.c 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/drivers/net/via-rhine.c 2006-12-14 03:39:01.000000000 +0100
@@ -33,6 +33,7 @@
#define DRV_VERSION "1.4.2"
#define DRV_RELDATE "Sept-11-2006"
+ OpenWrt Version (Felix Fietkau <nbd@openwrt.org>)
+ - Performance improvements
+ - NAPI polling
+
*/
+#define PKT_ALIGN 1
#define DRV_NAME "via-rhine"
@@ -142,7 +146,6 @@
/* A few user-configurable values.
These may be modified when a driver module is loaded. */
@@ -40,9 +41,11 @@
static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
-static int max_interrupt_work = 20;
static int max_interrupt_work = 20;
+#ifndef PKT_ALIGN
/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
Setting to > 1518 effectively disables this feature. */
@@ -165,9 +168,9 @@
Making the Tx ring too large decreases the effectiveness of channel
bonding and packet priority.
There are no ill effects from too-large receive rings. */
-#define TX_RING_SIZE 16
-#define TX_QUEUE_LEN 10 /* Limit ring entries actually used. */
-#define RX_RING_SIZE 16
+#define TX_RING_SIZE 64
+#define TX_QUEUE_LEN 60 /* Limit ring entries actually used. */
+#define RX_RING_SIZE 64
static int rx_copybreak;
+#endif
/* Operational parameters that usually are not changed. */
@@ -201,6 +204,7 @@
/* Work-around for broken BIOSes: they are unable to get the chip back out of
power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
@@ -105,6 +108,7 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
@@ -41,138 +29,24 @@ diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
/* These identify the driver base version and may not be removed. */
static char version[] __devinitdata =
@@ -217,10 +221,8 @@
MODULE_DESCRIPTION("VIA Rhine PCI Fast Ethernet driver");
MODULE_LICENSE("GPL");
@@ -123,12 +127,14 @@
-module_param(max_interrupt_work, int, 0);
module_param(max_interrupt_work, int, 0);
module_param(debug, int, 0);
module_param(rx_copybreak, int, 0);
-MODULE_PARM_DESC(max_interrupt_work, "VIA Rhine maximum events handled per interrupt");
-module_param(rx_copybreak, int, 0);
module_param(avoid_D3, bool, 0);
MODULE_PARM_DESC(max_interrupt_work, "VIA Rhine maximum events handled per interrupt");
MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)");
MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");
-MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");
MODULE_PARM_DESC(avoid_D3, "Avoid power state D3 (work-around for broken BIOSes)");
+#ifndef PKT_ALIGN
+module_param(rx_copybreak, int, 0);
+MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");
+#endif
@@ -461,6 +463,8 @@
struct tx_desc *tx_ring;
dma_addr_t rx_ring_dma;
dma_addr_t tx_ring_dma;
+ u32 istat;
+ u32 imask;
/* The addresses of receive-in-place skbuffs. */
struct sk_buff *rx_skbuff[RX_RING_SIZE];
@@ -500,9 +504,10 @@
static void rhine_tx_timeout(struct net_device *dev);
static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-static void rhine_tx(struct net_device *dev);
-static void rhine_rx(struct net_device *dev);
-static void rhine_error(struct net_device *dev, int intr_status);
+static int rhine_poll(struct net_device *dev, int *budget);
+static int rhine_tx(struct net_device *dev);
+static int rhine_rx(struct net_device *dev, int max_work);
+static void rhine_error(struct net_device *dev);
static void rhine_set_rx_mode(struct net_device *dev);
static struct net_device_stats *rhine_get_stats(struct net_device *dev);
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -597,6 +602,7 @@
struct rhine_private *rp = netdev_priv(dev);
void __iomem *ioaddr = rp->base;
+ pci_enable_device(rp->pdev);
iowrite8(Cmd1Reset, ioaddr + ChipCmd1);
IOSYNC;
@@ -618,6 +624,28 @@
"failed" : "succeeded");
}
+static inline void rhine_intr_enable(struct net_device *dev)
+{
+ struct rhine_private *rp = netdev_priv(dev);
+ void __iomem *ioaddr = rp->base;
+
+ iowrite16(rp->imask = (IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
+ IntrRxDropped | IntrRxNoBuf | IntrTxAborted |
+ IntrTxDone | IntrTxError | IntrTxUnderrun |
+ IntrPCIErr | IntrStatsMax | IntrLinkChange),
+ ioaddr + IntrEnable);
+}
+
+static inline void rhine_intr_disable(struct net_device *dev)
+{
+ struct rhine_private *rp = netdev_priv(dev);
+ void __iomem *ioaddr = rp->base;
+
+ iowrite16(rp->imask = (IntrRxOverflow | IntrRxNoBuf | IntrTxAborted |
+ IntrTxError | IntrTxUnderrun | IntrPCIErr | IntrStatsMax | IntrLinkChange),
+ ioaddr + IntrEnable);
+}
+
#ifdef USE_MMIO
static void enable_mmio(long pioaddr, u32 quirks)
{
@@ -660,14 +688,26 @@
}
-#ifdef CONFIG_NET_POLL_CONTROLLER
-static void rhine_poll(struct net_device *dev)
+static int rhine_poll(struct net_device *dev, int *budget)
{
- disable_irq(dev->irq);
- rhine_interrupt(dev->irq, (void *)dev, NULL);
- enable_irq(dev->irq);
+ unsigned int work_done, work_to_do = min(*budget, dev->quota);
+ struct rhine_private *rp = netdev_priv(dev);
+
+ work_done = rhine_rx(dev, (*budget < dev->quota ? *budget : dev->quota));
+
+ if (rp->istat & (IntrTxErrSummary | IntrTxDone))
+ rhine_tx(dev);
+
+ *budget -= work_done;
+ dev->quota -= work_done;
+
+ if (work_done < work_to_do) {
+ netif_rx_complete(dev);
+ rhine_intr_enable(dev);
+ }
+
+ return (work_done >= work_to_do);
}
-#endif
static void rhine_hw_init(struct net_device *dev, long pioaddr)
{
@@ -846,11 +886,10 @@
dev->ethtool_ops = &netdev_ethtool_ops;
dev->tx_timeout = rhine_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = rhine_poll;
-#endif
- if (rp->quirks & rqRhineI)
- dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
+ dev->poll = rhine_poll;
+ dev->weight = 64;
+
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
/* dev->name not defined before register_netdev()! */
rc = register_netdev(dev);
@@ -894,6 +933,10 @@
}
}
rp->mii_if.phy_id = phy_id;
+
+ // shut down until somebody really needs it
+ iowrite8(0x80, ioaddr + 0xa1);
+ pci_set_power_state(rp->pdev, 3);
return 0;
@@ -985,7 +1028,7 @@
/*
Theory of Operation
@@ -923,7 +929,7 @@
/* Fill in the Rx buffers. Handle allocation failure gracefully. */
for (i = 0; i < RX_RING_SIZE; i++) {
@@ -181,299 +55,39 @@ diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
rp->rx_skbuff[i] = skb;
if (skb == NULL)
break;
@@ -1120,11 +1163,7 @@
rhine_set_rx_mode(dev);
@@ -1481,6 +1487,9 @@
/* Length should omit the CRC */
int pkt_len = data_size - 4;
/* Enable interrupts by setting the interrupt mask. */
- iowrite16(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
- IntrRxDropped | IntrRxNoBuf | IntrTxAborted |
- IntrTxDone | IntrTxError | IntrTxUnderrun |
- IntrPCIErr | IntrStatsMax | IntrLinkChange,
- ioaddr + IntrEnable);
+ rhine_intr_enable(dev);
iowrite16(CmdStart | CmdTxOn | CmdRxOn | (Cmd1NoTxPoll << 8),
ioaddr + ChipCmd);
@@ -1235,6 +1274,7 @@
mdio_read(dev, rp->mii_if.phy_id, MII_BMSR));
netif_start_queue(dev);
+ netif_poll_enable(dev);
return 0;
}
@@ -1263,8 +1303,8 @@
/* Reinitialize the hardware. */
rhine_chip_reset(dev);
init_registers(dev);
-
spin_unlock(&rp->lock);
+
enable_irq(rp->pdev->irq);
dev->trans_start = jiffies;
@@ -1358,77 +1398,66 @@
struct net_device *dev = dev_instance;
struct rhine_private *rp = netdev_priv(dev);
void __iomem *ioaddr = rp->base;
- u32 intr_status;
- int boguscnt = max_interrupt_work;
int handled = 0;
- while ((intr_status = get_intr_status(dev))) {
+ if ((rp->istat = (get_intr_status(dev) & rp->imask))) {
handled = 1;
/* Acknowledge all of the current interrupt sources ASAP. */
- if (intr_status & IntrTxDescRace)
+ if (rp->istat & IntrTxDescRace)
iowrite8(0x08, ioaddr + IntrStatus2);
- iowrite16(intr_status & 0xffff, ioaddr + IntrStatus);
+ iowrite16(rp->istat & 0xffff, ioaddr + IntrStatus);
IOSYNC;
- if (debug > 4)
- printk(KERN_DEBUG "%s: Interrupt, status %8.8x.\n",
- dev->name, intr_status);
+ if (likely(rp->istat & ((IntrRxDone | IntrRxErr | IntrRxDropped |
+ IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf |
+ IntrTxErrSummary | IntrTxDone)))) {
+
+ rhine_intr_disable(dev);
- if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped |
- IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf))
- rhine_rx(dev);
-
- if (intr_status & (IntrTxErrSummary | IntrTxDone)) {
- if (intr_status & IntrTxErrSummary) {
- /* Avoid scavenging before Tx engine turned off */
- RHINE_WAIT_FOR(!(ioread8(ioaddr+ChipCmd) & CmdTxOn));
- if (debug > 2 &&
- ioread8(ioaddr+ChipCmd) & CmdTxOn)
- printk(KERN_WARNING "%s: "
- "rhine_interrupt() Tx engine"
- "still on.\n", dev->name);
- }
- rhine_tx(dev);
+ if (likely(netif_rx_schedule_prep(dev)))
+ __netif_rx_schedule(dev);
}
/* Abnormal error summary/uncommon events handlers. */
- if (intr_status & (IntrPCIErr | IntrLinkChange |
+ if (unlikely(rp->istat & (IntrPCIErr | IntrLinkChange |
IntrStatsMax | IntrTxError | IntrTxAborted |
- IntrTxUnderrun | IntrTxDescRace))
- rhine_error(dev, intr_status);
-
- if (--boguscnt < 0) {
- printk(KERN_WARNING "%s: Too much work at interrupt, "
- "status=%#8.8x.\n",
- dev->name, intr_status);
- break;
- }
+ IntrTxUnderrun | IntrTxDescRace)))
+ rhine_error(dev);
}
- if (debug > 3)
- printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n",
- dev->name, ioread16(ioaddr + IntrStatus));
return IRQ_RETVAL(handled);
}
/* This routine is logically part of the interrupt handler, but isolated
for clarity. */
-static void rhine_tx(struct net_device *dev)
+static int rhine_tx(struct net_device *dev)
{
struct rhine_private *rp = netdev_priv(dev);
int txstatus = 0, entry = rp->dirty_tx % TX_RING_SIZE;
+ void __iomem *ioaddr = rp->base;
+ int done = 0;
+
+ /* Avoid scavenging before Tx engine turned off */
+ RHINE_WAIT_FOR(!(ioread8(ioaddr+ChipCmd) & CmdTxOn));
+ if (debug > 2 &&
+ ioread8(ioaddr+ChipCmd) & CmdTxOn)
+ printk(KERN_WARNING "%s: "
+ "rhine_interrupt() Tx engine"
+ "still on.\n", dev->name);
- spin_lock(&rp->lock);
/* find and cleanup dirty tx descriptors */
while (rp->dirty_tx != rp->cur_tx) {
+ spin_lock(&rp->lock);
txstatus = le32_to_cpu(rp->tx_ring[entry].tx_status);
if (debug > 6)
printk(KERN_DEBUG "Tx scavenge %d status %8.8x.\n",
entry, txstatus);
- if (txstatus & DescOwn)
+ if (txstatus & DescOwn) {
+ spin_unlock(&rp->lock);
break;
+ }
if (txstatus & 0x8000) {
if (debug > 1)
printk(KERN_DEBUG "%s: Transmit error, "
@@ -1443,6 +1472,7 @@
(txstatus & 0x0800) || (txstatus & 0x1000)) {
rp->stats.tx_fifo_errors++;
rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
+ spin_unlock(&rp->lock);
break; /* Keep the skb - we try again */
}
/* Transmitter restarted in 'abnormal' handler. */
@@ -1457,6 +1487,7 @@
txstatus & 0xF);
rp->stats.tx_bytes += rp->tx_skbuff[entry]->len;
rp->stats.tx_packets++;
+ done++;
}
/* Free the original skb. */
if (rp->tx_skbuff_dma[entry]) {
@@ -1465,23 +1496,25 @@
rp->tx_skbuff[entry]->len,
PCI_DMA_TODEVICE);
}
- dev_kfree_skb_irq(rp->tx_skbuff[entry]);
+ dev_kfree_skb_any(rp->tx_skbuff[entry]);
rp->tx_skbuff[entry] = NULL;
entry = (++rp->dirty_tx) % TX_RING_SIZE;
+ spin_unlock(&rp->lock);
}
+
if ((rp->cur_tx - rp->dirty_tx) < TX_QUEUE_LEN - 4)
netif_wake_queue(dev);
- spin_unlock(&rp->lock);
+ return done;
}
/* This routine is logically part of the interrupt handler, but isolated
for clarity and better register allocation. */
-static void rhine_rx(struct net_device *dev)
+static int rhine_rx(struct net_device *dev, int max_work)
{
struct rhine_private *rp = netdev_priv(dev);
int entry = rp->cur_rx % RX_RING_SIZE;
- int boguscnt = rp->dirty_rx + RX_RING_SIZE - rp->cur_rx;
+ int done = 0;
if (debug > 4) {
printk(KERN_DEBUG "%s: rhine_rx(), entry %d status %8.8x.\n",
@@ -1498,7 +1531,7 @@
if (debug > 4)
printk(KERN_DEBUG "rhine_rx() status is %8.8x.\n",
desc_status);
- if (--boguscnt < 0)
+ if (--max_work < 0)
break;
if ((desc_status & (RxWholePkt | RxErr)) != RxWholePkt) {
if ((desc_status & RxWholePkt) != RxWholePkt) {
@@ -1523,9 +1556,7 @@
if (desc_status & 0x0004) rp->stats.rx_frame_errors++;
if (desc_status & 0x0002) {
/* this can also be updated outside the interrupt handler */
- spin_lock(&rp->lock);
rp->stats.rx_crc_errors++;
- spin_unlock(&rp->lock);
}
}
} else {
@@ -1553,6 +1584,7 @@
+#ifdef PKT_ALIGN
+ int i;
+#else
/* Check if the packet is long enough to accept without
copying to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak &&
@@ -1500,7 +1509,9 @@
rp->rx_skbuff_dma[entry],
rp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
} else {
+ int i;
- } else {
+ } else
+#endif
+ {
skb = rp->rx_skbuff[entry];
if (skb == NULL) {
printk(KERN_ERR "%s: Inconsistent Rx "
@@ -1561,6 +1593,14 @@
break;
}
rp->rx_skbuff[entry] = NULL;
+
+ /* align the data to the ip header - should be faster than using rx_copybreak */
@@ -1514,6 +1525,14 @@
rp->rx_skbuff_dma[entry],
rp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
+#ifdef PKT_ALIGN
+ /* align the data to the ip header - should be faster than copying the entire packet */
+ for (i = pkt_len - (pkt_len % 4); i >= 0; i -= 4) {
+ put_unaligned(*((u32 *) (skb->data + i)), (u32 *) (skb->data + i + 2));
+ }
+ skb->data += 2;
+ skb->tail += 2;
+
skb_put(skb, pkt_len);
pci_unmap_single(rp->pdev,
rp->rx_skbuff_dma[entry],
@@ -1568,10 +1608,11 @@
PCI_DMA_FROMDEVICE);
+#endif
}
skb->protocol = eth_type_trans(skb, dev);
- netif_rx(skb);
+ netif_receive_skb(skb);
dev->last_rx = jiffies;
rp->stats.rx_bytes += pkt_len;
rp->stats.rx_packets++;
+ done++;
}
entry = (++rp->cur_rx) % RX_RING_SIZE;
rp->rx_head_desc = &rp->rx_ring[entry];
@@ -1582,7 +1623,7 @@
struct sk_buff *skb;
entry = rp->dirty_rx % RX_RING_SIZE;
if (rp->rx_skbuff[entry] == NULL) {
- skb = dev_alloc_skb(rp->rx_buf_sz);
+ skb = dev_alloc_skb(rp->rx_buf_sz + 4);
rp->rx_skbuff[entry] = skb;
if (skb == NULL)
break; /* Better luck next round. */
@@ -1595,6 +1636,8 @@
}
rp->rx_ring[entry].rx_status = cpu_to_le32(DescOwn);
}
+
+ return done;
}
/*
@@ -1644,11 +1687,11 @@
}
-static void rhine_error(struct net_device *dev, int intr_status)
+static void rhine_error(struct net_device *dev)
{
struct rhine_private *rp = netdev_priv(dev);
void __iomem *ioaddr = rp->base;
-
+ u32 intr_status = rp->istat;
spin_lock(&rp->lock);
if (intr_status & IntrLinkChange)
@@ -1895,6 +1938,7 @@
/* Disable interrupts by clearing the interrupt mask. */
iowrite16(0x0000, ioaddr + IntrEnable);
+ rp->imask = 0;
/* Stop the chip's Tx and Rx processes. */
iowrite16(CmdStop, ioaddr + ChipCmd);
@@ -1906,6 +1950,9 @@
free_tbufs(dev);
free_ring(dev);
+ writeb(0x80, ioaddr + 0xa1);
+ pci_set_power_state(rp->pdev, 3);
+
return 0;
}
@@ -1935,6 +1982,7 @@
return; /* Nothing to do for non-WOL adapters */
rhine_power_init(dev);
+ netif_poll_disable(dev);
/* Make sure we use pattern 0, 1 and not 4, 5 */
if (rp->quirks & rq6patterns)
#ifdef CONFIG_VIA_RHINE_NAPI

View File

@@ -1,10 +1,9 @@
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index cfe288a..c528024 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -55,6 +55,12 @@ config MTD_NAND_TOTO
diff -urN linux.old/drivers/mtd/nand/Kconfig linux.dev/drivers/mtd/nand/Kconfig
--- linux.old/drivers/mtd/nand/Kconfig 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/drivers/mtd/nand/Kconfig 2006-12-14 04:38:51.000000000 +0100
@@ -75,6 +75,12 @@
help
Support for NAND flash on Texas Instruments Toto platform.
Support for NAND flash on Technologic Systems TS-7250 platform.
+config MTD_NAND_RB500
+ tristate "NAND Flash device on RB500 board"
@@ -15,24 +14,21 @@ index cfe288a..c528024 100644
config MTD_NAND_IDS
tristate
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 4174202..2be57c1 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_MTD_NAND_IDS) += nand_ids.
diff -urN linux.old/drivers/mtd/nand/Makefile linux.dev/drivers/mtd/nand/Makefile
--- linux.old/drivers/mtd/nand/Makefile 2006-11-29 22:57:37.000000000 +0100
+++ linux.dev/drivers/mtd/nand/Makefile 2006-12-14 04:38:51.000000000 +0100
@@ -9,6 +9,7 @@
obj-$(CONFIG_MTD_NAND_SPIA) += spia.o
obj-$(CONFIG_MTD_NAND_AMS_DELTA) += ams-delta.o
obj-$(CONFIG_MTD_NAND_TOTO) += toto.o
+obj-$(CONFIG_MTD_NAND_RB500) += rbmipsnand.o
obj-$(CONFIG_MTD_NAND_AUTCPU12) += autcpu12.o
obj-$(CONFIG_MTD_NAND_EDB7312) += edb7312.o
obj-$(CONFIG_MTD_NAND_AU1550) += au1550nd.o
diff --git a/drivers/mtd/nand/rbmipsnand.c b/drivers/mtd/nand/rbmipsnand.c
new file mode 100644
index 0000000..6f7452a
--- /dev/null
+++ b/drivers/mtd/nand/rbmipsnand.c
@@ -0,0 +1,211 @@
diff -urN linux.old/drivers/mtd/nand/rbmipsnand.c linux.dev/drivers/mtd/nand/rbmipsnand.c
--- linux.old/drivers/mtd/nand/rbmipsnand.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/drivers/mtd/nand/rbmipsnand.c 2006-12-14 04:39:52.000000000 +0100
@@ -0,0 +1,137 @@
+#include <linux/init.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/mtd.h>
@@ -41,12 +37,9 @@ index 0000000..6f7452a
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/bootinfo.h>
+//#include <asm/rb/rb100.h>
+
+#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(0x18000000))
+
+#define SMEM1(x) (*((volatile unsigned char *) (KSEG1ADDR(SMEM1_BASE) + x)))
+
+#define GPIOF 0x050000
+#define GPIOC 0x050004
+#define GPIOD 0x050008
@@ -56,19 +49,6 @@ index 0000000..6f7452a
+#define GPIO_ALE (1 << 0x0a)
+#define GPIO_CLE (1 << 0x0b)
+
+#define NAND_RW_REG 0x0 //data register
+#define NAND_SET_CEn 0x1 //CE# low
+#define NAND_CLR_CEn 0x2 //CE# high
+#define NAND_CLR_CLE 0x3 //CLE low
+#define NAND_SET_CLE 0x4 //CLE high
+#define NAND_CLR_ALE 0x5 //ALE low
+#define NAND_SET_ALE 0x6 //ALE high
+#define NAND_SET_SPn 0x7 //SP# low (use spare area)
+#define NAND_CLR_SPn 0x8 //SP# high (do not use spare area)
+#define NAND_SET_WPn 0x9 //WP# low
+#define NAND_CLR_WPn 0xA //WP# high
+#define NAND_STS_REG 0xB //Status register
+
+#define DEV2BASE 0x010020
+
+#define LO_WPX (1 << 0)
@@ -84,89 +64,48 @@ index 0000000..6f7452a
+
+extern void changeLatchU5(unsigned char orMask, unsigned char nandMask);
+
+static int rb500_dev_ready(struct mtd_info *mtd) {
+ return MEM32(IDT434_REG_BASE + GPIOD) & GPIO_RDY;
+static int rb500_dev_ready(struct mtd_info *mtd)
+{
+ return MEM32(IDT434_REG_BASE + GPIOD) & GPIO_RDY;
+}
+
+/*
+static int rb100_dev_ready(struct mtd_info *mtd) {
+ return SMEM1(NAND_STS_REG) & 0x80;
+ * hardware specific access to control-lines
+ *
+ * ctrl:
+ * NAND_CLE: bit 2 -> bit 3
+ * NAND_ALE: bit 3 -> bit 2
+ */
+static void rbmips_hwcontrol500(struct mtd_info *mtd, int cmd,
+ unsigned int ctrl)
+{
+ struct nand_chip *chip = mtd->priv;
+ unsigned char orbits, nandbits;
+
+ if (ctrl & NAND_CTRL_CHANGE) {
+
+ orbits = (ctrl & NAND_CLE) << 1;
+ orbits |= (ctrl & NAND_ALE) >> 1;
+
+ nandbits = (~ctrl & NAND_CLE) << 1;
+ nandbits |= (~ctrl & NAND_ALE) >> 1;
+
+ changeLatchU5(orbits, nandbits);
+ }
+ if (cmd != NAND_CMD_NONE)
+ writeb(cmd, chip->IO_ADDR_W);
+
+}
+*/
+static unsigned long iflags = 0;
+static int ioff = 0;
+/*
+static void rbmips_hwcontrol400(struct mtd_info *mtd, int cmd) {
+ switch (cmd) {
+ case NAND_CTL_SETCLE:
+ MEM32(IDT434_REG_BASE + GPIOD) |= GPIO_CLE;
+ break;
+ case NAND_CTL_CLRCLE:
+ MEM32(IDT434_REG_BASE + GPIOD) &= ~GPIO_CLE;
+ break;
+ case NAND_CTL_SETALE:
+ MEM32(IDT434_REG_BASE + GPIOD) |= GPIO_ALE;
+ break;
+ case NAND_CTL_CLRALE:
+ MEM32(IDT434_REG_BASE + GPIOD) &= ~GPIO_ALE;
+ break;
+ default:
+ break;
+ }
+}
+*/
+static void rbmips_hwcontrol500(struct mtd_info *mtd, int cmd) {
+ switch (cmd) {
+ case NAND_CTL_SETCLE:
+ changeLatchU5(LO_CLE, 0);
+ break;
+ case NAND_CTL_CLRCLE:
+ changeLatchU5(0, LO_CLE);
+ break;
+ case NAND_CTL_SETALE:
+ changeLatchU5(LO_ALE, 0);
+ break;
+ case NAND_CTL_CLRALE:
+ changeLatchU5(0, LO_ALE);
+ break;
+ default:
+ break;
+ }
+}
+/*
+static void rbmips_hwcontrol100(struct mtd_info *mtd, int cmd){
+ switch(cmd){
+ case NAND_CTL_SETCLE:
+ SMEM1(NAND_SET_CLE) = 0x01;
+ break;
+ case NAND_CTL_CLRCLE:
+ SMEM1(NAND_CLR_CLE) = 0x01;
+ break;
+ case NAND_CTL_SETALE:
+ SMEM1(NAND_SET_ALE) = 0x01;
+ break;
+ case NAND_CTL_CLRALE:
+ SMEM1(NAND_CLR_ALE) = 0x01;
+ break;
+ case NAND_CTL_SETNCE:
+ SMEM1(NAND_SET_CEn) = 0x01;
+ break;
+ case NAND_CTL_CLRNCE:
+ SMEM1(NAND_CLR_CEn) = 0x01;
+ break;
+ }
+}
+*/
+
+static struct mtd_partition partition_info[] = {
+ {
+ name: "RouterBoard NAND Boot",
+ offset: 0,
+ size: 4 * 1024 * 1024
+ },
+ {
+ name: "RouterBoard NAND Main",
+ offset: MTDPART_OFS_NXTBLK,
+ size: MTDPART_SIZ_FULL
+ }
+ {
+ name:"RouterBoard NAND Boot",
+ offset:0,
+ size:4 * 1024 * 1024},
+ {
+ name:"RouterBoard NAND Main",
+ offset:MTDPART_OFS_NXTBLK,
+ size:MTDPART_SIZ_FULL}
+};
+
+static struct mtd_info rmtd;
@@ -174,64 +113,50 @@ index 0000000..6f7452a
+
+static unsigned init_ok = 0;
+
+unsigned get_rbnand_block_size(void) {
+ if (init_ok) return rmtd.oobblock; else return 0;
+unsigned get_rbnand_block_size(void)
+{
+ if (init_ok)
+ return rmtd.writesize;
+ else
+ return 0;
+}
+
+EXPORT_SYMBOL(get_rbnand_block_size);
+
+int __init rbmips_init(void) {
+int __init rbmips_init(void)
+{
+ int *b;
+ memset(&rmtd, 0, sizeof(rmtd));
+ memset(&rnand, 0, sizeof(rnand));
+/*
+ if (is_rb500()) {
+ if (is_rb400()) {
+ printk("RB400 nand\n");
+ MEM32(IDT434_REG_BASE + GPIOD) |= GPIO_WPX;
+ MEM32(IDT434_REG_BASE + GPIOD) &= ~GPIO_CLE;
+ MEM32(IDT434_REG_BASE + GPIOD) &= ~GPIO_ALE;
+ rnand.hwcontrol = rbmips_hwcontrol400;
+ } else {
+*/
+ printk("RB500 nand\n");
+ changeLatchU5(LO_WPX | LO_FOFF | LO_CEX,
+ LO_ULED | LO_ALE | LO_CLE);
+ rnand.hwcontrol = rbmips_hwcontrol500;
+// }
+
+ rnand.dev_ready = rb500_dev_ready;
+ rnand.IO_ADDR_W = (unsigned char *)
+ KSEG1ADDR(MEM32(IDT434_REG_BASE + DEV2BASE));
+ rnand.IO_ADDR_R = rnand.IO_ADDR_W;
+/* } else if (is_rb100()) {
+ printk("RB100 nand\n");
+ MEM32(0xB2000064) = 0x100;
+ MEM32(0xB2000008) = 0x1;
+ SMEM1(NAND_SET_SPn) = 0x01;
+ SMEM1(NAND_CLR_WPn) = 0x01;
+ rnand.IO_ADDR_R = (unsigned char *)KSEG1ADDR(SMEM1_BASE);
+ rnand.IO_ADDR_W = rnand.IO_ADDR_R;
+ rnand.hwcontrol = rbmips_hwcontrol100;
+ rnand.dev_ready = rb100_dev_ready;
+ }
+*/
+ p_nand = (void __iomem *)ioremap(( void*)0x18a20000, 0x1000);
+
+ printk("RB500 nand\n");
+ changeLatchU5(LO_WPX | LO_FOFF | LO_CEX,
+ LO_ULED | LO_ALE | LO_CLE);
+ rnand.cmd_ctrl = rbmips_hwcontrol500;
+
+ rnand.dev_ready = rb500_dev_ready;
+ rnand.IO_ADDR_W = (unsigned char *)
+ KSEG1ADDR(MEM32(IDT434_REG_BASE + DEV2BASE));
+ rnand.IO_ADDR_R = rnand.IO_ADDR_W;
+
+ p_nand = (void __iomem *) ioremap((void *) 0x18a20000, 0x1000);
+ if (!p_nand) {
+ printk("RBnand Unable ioremap buffer");
+ return -ENXIO;
+ }
+ rnand.eccmode = NAND_ECC_SOFT;
+ rnand.ecc.mode = NAND_ECC_SOFT;
+ rnand.chip_delay = 25;
+ rnand.options |= NAND_NO_AUTOINCR;
+ rmtd.priv = &rnand;
+
+ int *b = ( int *)KSEG1ADDR( 0x18010020);
+ printk( "dev2base 0x%08x mask 0x%08x c 0x%08x tc 0x%08x\n", b[ 0], b[ 1], b[ 2], b[ 3]);
+ b = (int *) KSEG1ADDR(0x18010020);
+ printk("dev2base 0x%08x mask 0x%08x c 0x%08x tc 0x%08x\n", b[0],
+ b[1], b[2], b[3]);
+
+ if (nand_scan(&rmtd, 1) && nand_scan(&rmtd, 1)
+ && nand_scan(&rmtd, 1) && nand_scan(&rmtd, 1)) {
+ && nand_scan(&rmtd, 1) && nand_scan(&rmtd, 1)) {
+ printk("RBxxx nand device not found");
+ iounmap ((void *)p_nand);
+ iounmap((void *) p_nand);
+ return -ENXIO;
+ }
+
@@ -241,8 +166,3 @@ index 0000000..6f7452a
+}
+
+module_init(rbmips_init);
+
+
+
+
+

File diff suppressed because it is too large Load Diff