From 56231056ea784f1cec6450f649b1adaed1f56366 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 6 Sep 2007 16:27:37 +0000 Subject: strip the kernel version suffix from target directories, except for brcm-2.4 (the -2.4 will be included in the board name here). CONFIG_LINUX__ becomes CONFIG_TARGET_, same for profiles. SVN-Revision: 8653 --- target/linux/rb532/patches/100-rb5xx_support.patch | 94 ++++++++++++++++++++++ .../linux/rb532/patches/110-korina_ethernet.patch | 30 +++++++ target/linux/rb532/patches/120-cf.patch | 26 ++++++ target/linux/rb532/patches/140-cmdline_hack.patch | 14 ++++ .../rb532/patches/200-bridge_resource_hack.patch | 13 +++ target/linux/rb532/patches/220-serial_fix.patch | 18 +++++ .../rb532/patches/240-via_rhine_performance.patch | 94 ++++++++++++++++++++++ target/linux/rb532/patches/500-Nand.patch | 29 +++++++ target/linux/rb532/patches/510-rb500_led.patch | 29 +++++++ 9 files changed, 347 insertions(+) create mode 100644 target/linux/rb532/patches/100-rb5xx_support.patch create mode 100644 target/linux/rb532/patches/110-korina_ethernet.patch create mode 100644 target/linux/rb532/patches/120-cf.patch create mode 100644 target/linux/rb532/patches/140-cmdline_hack.patch create mode 100644 target/linux/rb532/patches/200-bridge_resource_hack.patch create mode 100644 target/linux/rb532/patches/220-serial_fix.patch create mode 100644 target/linux/rb532/patches/240-via_rhine_performance.patch create mode 100644 target/linux/rb532/patches/500-Nand.patch create mode 100644 target/linux/rb532/patches/510-rb500_led.patch (limited to 'target/linux/rb532/patches') diff --git a/target/linux/rb532/patches/100-rb5xx_support.patch b/target/linux/rb532/patches/100-rb5xx_support.patch new file mode 100644 index 0000000000..fcb6d7c5d5 --- /dev/null +++ b/target/linux/rb532/patches/100-rb5xx_support.patch @@ -0,0 +1,94 @@ +diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig +--- 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 +@@ -780,6 +780,19 @@ + select SYS_SUPPORTS_BIG_ENDIAN + select TOSHIBA_BOARDS + ++config MIKROTIK_RB500 ++ bool "Support for RB5xx boards" ++ select HW_HAS_PCI ++ select IRQ_CPU ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_SUPPORTS_LITTLE_ENDIAN ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SWAP_IO_SPACE ++ select DMA_NONCOHERENT ++ help ++ Support the Mikrotik(tm) Routerboard 500 series, ++ such as the RB532. ++ + config TOSHIBA_RBTX4927 + bool "Toshiba TBTX49[23]7 board" + select DMA_NONCOHERENT +@@ -1106,7 +1119,7 @@ + + config MIPS_L1_CACHE_SHIFT + int +- default "4" if MACH_DECSTATION || SNI_RM ++ default "4" if MACH_DECSTATION || SNI_RM || MIKROTIK_RB500 + default "7" if SGI_IP27 + default "5" + +diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile +--- 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 + + # ++# Routerboard 532 board ++# ++core-$(CONFIG_MIKROTIK_RB500) += arch/mips/rb500/ ++cflags-$(CONFIG_MIKROTIK_RB500) += -Iinclude/asm-mips/rc32434 ++load-$(CONFIG_MIKROTIK_RB500) += 0xffffffff80101000 ++ ++# + # Toshiba RBTX4927 board or + # Toshiba RBTX4937 board + # +diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile +--- 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/drivers/pci/Makefile linux.dev/drivers/pci/Makefile +--- 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 + + # 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-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 */ ++ + #define CL_SIZE COMMAND_LINE_SIZE + + 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-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 + #define CPU_R14000 64 +-#define CPU_LAST 64 ++#define CPU_RC32300 65 ++#define CPU_LAST 65 + + /* + * ISA Level encodings + diff --git a/target/linux/rb532/patches/110-korina_ethernet.patch b/target/linux/rb532/patches/110-korina_ethernet.patch new file mode 100644 index 0000000000..55b9779a87 --- /dev/null +++ b/target/linux/rb532/patches/110-korina_ethernet.patch @@ -0,0 +1,30 @@ +diff -urN linux.old/drivers/net/Kconfig linux.dev/drivers/net/Kconfig +--- 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" + ++config KORINA ++ tristate "Korina Local Ethernet support" ++ depends on NET_ETHERNET && ( IDT_EB434 || MIKROTIK_RB500) ++ 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 -urN linux.old/drivers/net/Makefile linux.dev/drivers/net/Makefile +--- 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 + ++obj-$(CONFIG_KORINA) += korina.o ++ + obj-$(CONFIG_ROADRUNNER) += rrunner.o + + obj-$(CONFIG_HAPPYMEAL) += sunhme.o + diff --git a/target/linux/rb532/patches/120-cf.patch b/target/linux/rb532/patches/120-cf.patch new file mode 100644 index 0000000000..19395ef664 --- /dev/null +++ b/target/linux/rb532/patches/120-cf.patch @@ -0,0 +1,26 @@ +diff -urN linux.old/drivers/block/Kconfig linux.dev/drivers/block/Kconfig +--- linux.old/drivers/block/Kconfig 2006-10-26 02:43:39.000000000 +0200 ++++ linux.dev/drivers/block/Kconfig 2006-10-26 00:11:14.000000000 +0200 +@@ -456,4 +456,12 @@ + This driver provides Support for ATA over Ethernet block + devices like the Coraid EtherDrive (R) Storage Blade. + ++config BLK_DEV_CF_MIPS ++ bool "CF slot of RB532 board" ++ depends on MIKROTIK_RB500 ++ default y ++ help ++ The Routerboard 532 has a CF slot on it. Enable the special block ++ device driver for it. ++ + endmenu +diff -urN linux.old/drivers/block/Makefile linux.dev/drivers/block/Makefile +--- linux.old/drivers/block/Makefile 2006-06-18 03:49:35.000000000 +0200 ++++ linux.dev/drivers/block/Makefile 2006-10-26 02:44:10.000000000 +0200 +@@ -29,4 +29,5 @@ + obj-$(CONFIG_VIODASD) += viodasd.o + obj-$(CONFIG_BLK_DEV_SX8) += sx8.o + obj-$(CONFIG_BLK_DEV_UB) += ub.o ++obj-$(CONFIG_BLK_DEV_CF_MIPS) += rb500/ + + diff --git a/target/linux/rb532/patches/140-cmdline_hack.patch b/target/linux/rb532/patches/140-cmdline_hack.patch new file mode 100644 index 0000000000..4425af7de4 --- /dev/null +++ b/target/linux/rb532/patches/140-cmdline_hack.patch @@ -0,0 +1,14 @@ +Index: linux-2.6.21.1/arch/mips/kernel/head.S +=================================================================== +--- linux-2.6.21.1.orig/arch/mips/kernel/head.S 2007-06-07 01:26:11.862575128 +0200 ++++ linux-2.6.21.1/arch/mips/kernel/head.S 2007-06-07 01:31:06.499783464 +0200 +@@ -133,6 +133,9 @@ + j kernel_entry + nop + ++EXPORT(_image_cmdline) ++ .ascii "CMDLINE:" ++ + /* + * Reserved space for exception handlers. + * Necessary for machines which link their kernels at KSEG0. diff --git a/target/linux/rb532/patches/200-bridge_resource_hack.patch b/target/linux/rb532/patches/200-bridge_resource_hack.patch new file mode 100644 index 0000000000..3017f5dfcd --- /dev/null +++ b/target/linux/rb532/patches/200-bridge_resource_hack.patch @@ -0,0 +1,13 @@ +--- linux.old/arch/mips/pci/pci.c 2006-04-19 08:10:14.000000000 +0200 ++++ linux.dev/arch/mips/pci/pci.c 2006-06-14 20:23:18.000000000 +0200 +@@ -65,8 +65,10 @@ + /* + * Put everything into 0x00-0xff region modulo 0x400 + */ ++#ifndef CONFIG_MIKROTIK_RB500 + if (start & 0x300) + start = (start + 0x3ff) & ~0x3ff; ++#endif + } else if (res->flags & IORESOURCE_MEM) { + /* Make sure we start at our min on all hoses */ + if (start < PCIBIOS_MIN_MEM + hose->mem_resource->start) diff --git a/target/linux/rb532/patches/220-serial_fix.patch b/target/linux/rb532/patches/220-serial_fix.patch new file mode 100644 index 0000000000..d36f263a33 --- /dev/null +++ b/target/linux/rb532/patches/220-serial_fix.patch @@ -0,0 +1,18 @@ +diff -urN linux.old/drivers/serial/8250.c linux.dev/drivers/serial/8250.c +--- linux.old/drivers/serial/8250.c 2006-06-08 20:21:20.000000000 +0200 ++++ linux.dev/drivers/serial/8250.c 2006-06-08 20:19:40.000000000 +0200 +@@ -351,6 +351,13 @@ + default: + outb(value, up->port.iobase + offset); + } ++ ++#if defined(CONFIG_IDT_EB434) || defined(CONFIG_MIKROTIK_RB500) ++ __SLOW_DOWN_IO; ++ __SLOW_DOWN_IO; ++ __SLOW_DOWN_IO; ++ __SLOW_DOWN_IO; ++#endif + } + + /* + diff --git a/target/linux/rb532/patches/240-via_rhine_performance.patch b/target/linux/rb532/patches/240-via_rhine_performance.patch new file mode 100644 index 0000000000..e7cdf8ae24 --- /dev/null +++ b/target/linux/rb532/patches/240-via_rhine_performance.patch @@ -0,0 +1,94 @@ +diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c +--- 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.3" + #define DRV_RELDATE "2007-03-06" + ++#define PKT_ALIGN 1 + + /* 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; + ++#ifndef PKT_ALIGN + /* Set the copy breakpoint for the copy-only-tiny-frames scheme. + Setting to > 1518 effectively disables this feature. */ + static int rx_copybreak; ++#endif + + /* 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 + #include + #include ++#include + #include + + /* These identify the driver base version and may not be removed. */ +@@ -124,12 +128,14 @@ + + module_param(max_interrupt_work, int, 0); + module_param(debug, int, 0); +-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(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 + + /* + Theory of Operation +@@ -924,7 +930,7 @@ + + /* Fill in the Rx buffers. Handle allocation failure gracefully. */ + for (i = 0; i < RX_RING_SIZE; i++) { +- struct sk_buff *skb = dev_alloc_skb(rp->rx_buf_sz); ++ struct sk_buff *skb = dev_alloc_skb(rp->rx_buf_sz + 4); + rp->rx_skbuff[i] = skb; + if (skb == NULL) + break; +@@ -1482,6 +1488,9 @@ + /* Length should omit the CRC */ + int pkt_len = data_size - 4; + ++#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 && +@@ -1501,7 +1510,9 @@ + rp->rx_skbuff_dma[entry], + rp->rx_buf_sz, + PCI_DMA_FROMDEVICE); +- } else { ++ } else ++#endif ++ { + skb = rp->rx_skbuff[entry]; + if (skb == NULL) { + printk(KERN_ERR "%s: Inconsistent Rx " +@@ -1515,6 +1526,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; ++#endif + } + skb->protocol = eth_type_trans(skb, dev); + #ifdef CONFIG_VIA_RHINE_NAPI + diff --git a/target/linux/rb532/patches/500-Nand.patch b/target/linux/rb532/patches/500-Nand.patch new file mode 100644 index 0000000000..7e4cb65c77 --- /dev/null +++ b/target/linux/rb532/patches/500-Nand.patch @@ -0,0 +1,29 @@ +Index: linux-2.6.21.1/drivers/mtd/nand/Kconfig +=================================================================== +--- linux-2.6.21.1.orig/drivers/mtd/nand/Kconfig 2007-04-27 23:49:26.000000000 +0200 ++++ linux-2.6.21.1/drivers/mtd/nand/Kconfig 2007-06-07 01:31:30.927069952 +0200 +@@ -75,6 +75,12 @@ + help + Support for NAND flash on Technologic Systems TS-7250 platform. + ++config MTD_NAND_RB500 ++ tristate "NAND Flash device on RB500 board" ++ depends on MTD_NAND ++ help ++ Support for NAND flash on RB500 platform. ++ + config MTD_NAND_IDS + tristate + +Index: linux-2.6.21.1/drivers/mtd/nand/Makefile +=================================================================== +--- linux-2.6.21.1.orig/drivers/mtd/nand/Makefile 2007-04-27 23:49:26.000000000 +0200 ++++ linux-2.6.21.1/drivers/mtd/nand/Makefile 2007-06-07 01:31:30.927069952 +0200 +@@ -10,6 +10,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/target/linux/rb532/patches/510-rb500_led.patch b/target/linux/rb532/patches/510-rb500_led.patch new file mode 100644 index 0000000000..172682d49c --- /dev/null +++ b/target/linux/rb532/patches/510-rb500_led.patch @@ -0,0 +1,29 @@ +Index: linux-2.6.21.1/drivers/leds/Makefile +=================================================================== +--- linux-2.6.21.1.orig/drivers/leds/Makefile 2007-07-10 20:56:30.000000000 +0200 ++++ linux-2.6.21.1/drivers/leds/Makefile 2007-07-19 16:43:07.000000000 +0200 +@@ -16,6 +16,7 @@ + obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o + obj-$(CONFIG_LEDS_H1940) += leds-h1940.o + obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o ++obj-$(CONFIG_LEDS_RB500) += leds-rb500.o + + # LED Triggers + obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o +Index: linux-2.6.21.1/drivers/leds/Kconfig +=================================================================== +--- linux-2.6.21.1.orig/drivers/leds/Kconfig 2007-07-10 20:56:30.000000000 +0200 ++++ linux-2.6.21.1/drivers/leds/Kconfig 2007-07-19 16:42:55.000000000 +0200 +@@ -95,6 +95,12 @@ + help + This option enables support for the front LED on Cobalt Server + ++config LEDS_RB500 ++ tristate "LED Support for RB5xx boards" ++ depends LEDS_CLASS && MIKROTIK_RB500 ++ help ++ This option enables support for the yellow user LED on RB5xx boards. ++ + comment "LED Triggers" + + config LEDS_TRIGGERS -- cgit v1.2.3