diff options
Diffstat (limited to 'target/wag54g/patches')
-rw-r--r-- | target/wag54g/patches/ar7.patch | 977 |
1 files changed, 312 insertions, 665 deletions
diff --git a/target/wag54g/patches/ar7.patch b/target/wag54g/patches/ar7.patch index ba2f6ade4..c14c367b0 100644 --- a/target/wag54g/patches/ar7.patch +++ b/target/wag54g/patches/ar7.patch @@ -1,65 +1,6 @@ -diff -Nur linux-2.6.30.orig/arch/mips/Kconfig linux-2.6.30/arch/mips/Kconfig ---- linux-2.6.30.orig/arch/mips/Kconfig 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/arch/mips/Kconfig 2009-06-11 20:55:34.588179514 +0200 -@@ -19,6 +19,24 @@ - prompt "System type" - default SGI_IP22 - -+config AR7 -+ bool "Texas Instruments AR7" -+ select BOOT_ELF32 -+ select DMA_NONCOHERENT -+ select CEVT_R4K -+ select CSRC_R4K -+ select IRQ_CPU -+ select NO_EXCEPT_FILL -+ select SWAP_IO_SPACE -+ select SYS_HAS_CPU_MIPS32_R1 -+ select SYS_HAS_EARLY_PRINTK -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_SUPPORTS_KGDB -+ select SYS_SUPPORTS_LITTLE_ENDIAN -+ select SYS_SUPPORTS_BIG_ENDIAN -+ select GENERIC_GPIO -+ select GENERIC_HARDIRQS_NO__DO_IRQ -+ - config MACH_ALCHEMY - bool "Alchemy processor based machines" - -diff -Nur linux-2.6.30.orig/arch/mips/Makefile linux-2.6.30/arch/mips/Makefile ---- linux-2.6.30.orig/arch/mips/Makefile 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/arch/mips/Makefile 2009-06-11 20:55:34.591474348 +0200 -@@ -174,6 +174,13 @@ - # - - # -+# Texas Instruments AR7 -+# -+core-$(CONFIG_AR7) += arch/mips/ar7/ -+cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7 -+load-$(CONFIG_AR7) += 0xffffffff94100000 -+ -+# - # Acer PICA 61, Mips Magnum 4000 and Olivetti M700. - # - core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ -diff -Nur linux-2.6.30.orig/arch/mips/ar7/Makefile linux-2.6.30/arch/mips/ar7/Makefile ---- linux-2.6.30.orig/arch/mips/ar7/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/Makefile 2009-06-11 20:55:34.591474348 +0200 -@@ -0,0 +1,10 @@ -+ -+obj-y := \ -+ prom.o \ -+ setup.o \ -+ memory.o \ -+ irq.o \ -+ time.o \ -+ platform.o \ -+ gpio.o \ -+ clock.o -diff -Nur linux-2.6.30.orig/arch/mips/ar7/clock.c linux-2.6.30/arch/mips/ar7/clock.c ---- linux-2.6.30.orig/arch/mips/ar7/clock.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/clock.c 2009-06-11 20:55:34.591474348 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/clock.c linux-2.6.30.5/arch/mips/ar7/clock.c +--- linux-2.6.30.5.orig/arch/mips/ar7/clock.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/clock.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,483 @@ +/* + * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> @@ -544,9 +485,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/clock.c linux-2.6.30/arch/mips/ar7/clo + break; + } +} -diff -Nur linux-2.6.30.orig/arch/mips/ar7/gpio.c linux-2.6.30/arch/mips/ar7/gpio.c ---- linux-2.6.30.orig/arch/mips/ar7/gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/gpio.c 2009-06-11 20:55:34.595485753 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/gpio.c linux-2.6.30.5/arch/mips/ar7/gpio.c +--- linux-2.6.30.5.orig/arch/mips/ar7/gpio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/gpio.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> @@ -597,9 +538,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/gpio.c linux-2.6.30/arch/mips/ar7/gpio + ar7_gpio_list[gpio] = NULL; +} +EXPORT_SYMBOL(gpio_free); -diff -Nur linux-2.6.30.orig/arch/mips/ar7/irq.c linux-2.6.30/arch/mips/ar7/irq.c ---- linux-2.6.30.orig/arch/mips/ar7/irq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/irq.c 2009-06-11 20:55:34.595485753 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/irq.c linux-2.6.30.5/arch/mips/ar7/irq.c +--- linux-2.6.30.5.orig/arch/mips/ar7/irq.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/irq.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> @@ -784,9 +725,23 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/irq.c linux-2.6.30/arch/mips/ar7/irq.c + else + spurious_interrupt(); +} -diff -Nur linux-2.6.30.orig/arch/mips/ar7/memory.c linux-2.6.30/arch/mips/ar7/memory.c ---- linux-2.6.30.orig/arch/mips/ar7/memory.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/memory.c 2009-06-11 20:55:34.595485753 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/Makefile linux-2.6.30.5/arch/mips/ar7/Makefile +--- linux-2.6.30.5.orig/arch/mips/ar7/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/Makefile 2009-08-23 22:10:22.000000000 +0200 +@@ -0,0 +1,10 @@ ++ ++obj-y := \ ++ prom.o \ ++ setup.o \ ++ memory.o \ ++ irq.o \ ++ time.o \ ++ platform.o \ ++ gpio.o \ ++ clock.o +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/memory.c linux-2.6.30.5/arch/mips/ar7/memory.c +--- linux-2.6.30.5.orig/arch/mips/ar7/memory.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/memory.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,74 @@ +/* + * Based on arch/mips/mm/init.c @@ -862,10 +817,10 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/memory.c linux-2.6.30/arch/mips/ar7/me +{ + return; +} -diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/platform.c ---- linux-2.6.30.orig/arch/mips/ar7/platform.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/platform.c 2009-06-11 20:55:34.599474529 +0200 -@@ -0,0 +1,554 @@ +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ar7/platform.c +--- linux-2.6.30.5.orig/arch/mips/ar7/platform.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/platform.c 2009-08-23 22:10:22.000000000 +0200 +@@ -0,0 +1,551 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> + * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org> @@ -904,7 +859,6 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/ +#include <linux/phy.h> +#include <linux/phy_fixed.h> + -+ +#include <asm/addrspace.h> +#include <asm/mach-ar7/ar7.h> +#include <asm/mach-ar7/gpio.h> @@ -967,6 +921,13 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/ + .end = 0x107fffff, +}; + ++/* lets assume this is suitable for both high and low cpmacs links */ ++static struct fixed_phy_status fixed_phy_status __initdata = { ++ .link = 1, ++ .speed = 100, ++ .duplex = 1, ++}; ++ +static struct resource cpmac_low_res[] = { + { + .name = "regs", @@ -1076,13 +1037,6 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/ + .width = 2, +}; + -+/* lets assume this is suitable for both high and low cpmacs links */ -+static struct fixed_phy_status fixed_phy_status __initdata = { -+ .link = 1, -+ .speed = 100, -+ .duplex = 1, -+}; -+ +static struct plat_cpmac_data cpmac_low_data = { + .reset_bit = 17, + .power_bit = 20, @@ -1324,12 +1278,11 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/ + + memset(uart_port, 0, sizeof(struct uart_port) * 2); + -+ // use default type -+ //uart_port[0].type = PORT_AR7; ++ uart_port[0].type = PORT_16550A; + uart_port[0].line = 0; + uart_port[0].irq = AR7_IRQ_UART0; + uart_port[0].uartclk = ar7_bus_freq() / 2; -+ uart_port[0].iotype = UPIO_MEM; ++ uart_port[0].iotype = UPIO_MEM32; + uart_port[0].mapbase = AR7_REGS_UART0; + uart_port[0].membase = ioremap(uart_port[0].mapbase, 256); + uart_port[0].regshift = 2; @@ -1340,12 +1293,11 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/ + + /* Only TNETD73xx have a second serial port */ + if (ar7_has_second_uart()) { -+ // use default type -+ //uart_port[1].type = PORT_AR7; ++ uart_port[1].type = PORT_16550A; + uart_port[1].line = 1; + uart_port[1].irq = AR7_IRQ_UART1; + uart_port[1].uartclk = ar7_bus_freq() / 2; -+ uart_port[1].iotype = UPIO_MEM; ++ uart_port[1].iotype = UPIO_MEM32; + uart_port[1].mapbase = UR8_REGS_UART1; + uart_port[1].membase = ioremap(uart_port[1].mapbase, 256); + uart_port[1].regshift = 2; @@ -1420,9 +1372,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/platform.c linux-2.6.30/arch/mips/ar7/ + + +arch_initcall(ar7_register_devices); -diff -Nur linux-2.6.30.orig/arch/mips/ar7/prom.c linux-2.6.30/arch/mips/ar7/prom.c ---- linux-2.6.30.orig/arch/mips/ar7/prom.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/prom.c 2009-06-11 20:55:34.599474529 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/prom.c linux-2.6.30.5/arch/mips/ar7/prom.c +--- linux-2.6.30.5.orig/arch/mips/ar7/prom.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/prom.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,321 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1745,9 +1697,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/prom.c linux-2.6.30/arch/mips/ar7/prom + return prom_getchar(); +} +#endif -diff -Nur linux-2.6.30.orig/arch/mips/ar7/setup.c linux-2.6.30/arch/mips/ar7/setup.c ---- linux-2.6.30.orig/arch/mips/ar7/setup.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/setup.c 2009-06-11 20:55:34.603475038 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/setup.c linux-2.6.30.5/arch/mips/ar7/setup.c +--- linux-2.6.30.5.orig/arch/mips/ar7/setup.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/setup.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,105 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1854,9 +1806,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/setup.c linux-2.6.30/arch/mips/ar7/set +} + +console_initcall(ar7_init_console); -diff -Nur linux-2.6.30.orig/arch/mips/ar7/time.c linux-2.6.30/arch/mips/ar7/time.c ---- linux-2.6.30.orig/arch/mips/ar7/time.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/ar7/time.c 2009-06-11 20:55:34.603475038 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/time.c linux-2.6.30.5/arch/mips/ar7/time.c +--- linux-2.6.30.5.orig/arch/mips/ar7/time.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/ar7/time.c 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,28 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1886,9 +1838,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/ar7/time.c linux-2.6.30/arch/mips/ar7/time +{ + mips_hpt_frequency = ar7_cpu_freq() / 2; +} -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/ar7.h linux-2.6.30/arch/mips/include/asm/mach-ar7/ar7.h ---- linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/ar7.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/include/asm/mach-ar7/ar7.h 2009-06-11 20:55:34.603475038 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/ar7.h linux-2.6.30.5/arch/mips/include/asm/mach-ar7/ar7.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/ar7.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/mach-ar7/ar7.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> @@ -2060,9 +2012,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/ar7.h linux-2.6.30/ar +} + +#endif /* __AR7_H__ */ -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.30/arch/mips/include/asm/mach-ar7/gpio.h ---- linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/gpio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/include/asm/mach-ar7/gpio.h 2009-06-11 20:55:34.603475038 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.30.5/arch/mips/include/asm/mach-ar7/gpio.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/gpio.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/mach-ar7/gpio.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org> @@ -2173,9 +2125,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.30/a +#include <asm-generic/gpio.h> + +#endif -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/irq.h linux-2.6.30/arch/mips/include/asm/mach-ar7/irq.h ---- linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/irq.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/include/asm/mach-ar7/irq.h 2009-06-11 20:55:34.607474989 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/irq.h linux-2.6.30.5/arch/mips/include/asm/mach-ar7/irq.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/irq.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/mach-ar7/irq.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,16 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2193,9 +2145,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/irq.h linux-2.6.30/ar +#include_next <irq.h> + +#endif /* __ASM_AR7_IRQ_H */ -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/prom.h linux-2.6.30/arch/mips/include/asm/mach-ar7/prom.h ---- linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/prom.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/include/asm/mach-ar7/prom.h 2009-06-11 20:55:34.607474989 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/prom.h linux-2.6.30.5/arch/mips/include/asm/mach-ar7/prom.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/prom.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/mach-ar7/prom.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2006, 2007 Florian Fainelli <florian@openwrt.org> @@ -2223,9 +2175,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/prom.h linux-2.6.30/a +extern void prom_meminit(void); + +#endif /* __PROM_H__ */ -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6.30/arch/mips/include/asm/mach-ar7/spaces.h ---- linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/spaces.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/include/asm/mach-ar7/spaces.h 2009-06-11 20:55:34.607474989 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6.30.5/arch/mips/include/asm/mach-ar7/spaces.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/spaces.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/mach-ar7/spaces.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,32 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2240,7 +2192,7 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6.30 +#define _ASM_AR7_SPACES_H + +#define CAC_BASE 0x80000000 -+#define IO_BASE 0xa0000000 ++#define IO_BASE 0xa0000000 +#define UNCAC_BASE 0xa0000000 +#define MAP_BASE 0xc0000000 + @@ -2259,9 +2211,9 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6.30 +#endif + +#endif /* __ASM_AR7_SPACES_H */ -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/war.h linux-2.6.30/arch/mips/include/asm/mach-ar7/war.h ---- linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/war.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/arch/mips/include/asm/mach-ar7/war.h 2009-06-11 20:55:34.607474989 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/war.h linux-2.6.30.5/arch/mips/include/asm/mach-ar7/war.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/war.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/mach-ar7/war.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,25 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2288,26 +2240,53 @@ diff -Nur linux-2.6.30.orig/arch/mips/include/asm/mach-ar7/war.h linux-2.6.30/ar +#define MIPS34K_MISSED_ITLB_WAR 0 + +#endif /* __ASM_MIPS_MACH_BCM947XX_WAR_H */ -diff -Nur linux-2.6.30.orig/arch/mips/include/asm/page.h linux-2.6.30/arch/mips/include/asm/page.h ---- linux-2.6.30.orig/arch/mips/include/asm/page.h 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/arch/mips/include/asm/page.h 2009-06-11 20:55:34.607474989 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/page.h linux-2.6.30.5/arch/mips/include/asm/page.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/page.h 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/arch/mips/include/asm/page.h 2009-08-23 22:10:22.000000000 +0200 @@ -185,8 +185,11 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) -#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) -+#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \ -+ PHYS_OFFSET) -+#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \ -+ PHYS_OFFSET) ++#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \ ++ PHYS_OFFSET) ++#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \ ++ PHYS_OFFSET) + #include <asm-generic/memory_model.h> #include <asm-generic/page.h> -diff -Nur linux-2.6.30.orig/arch/mips/kernel/traps.c linux-2.6.30/arch/mips/kernel/traps.c ---- linux-2.6.30.orig/arch/mips/kernel/traps.c 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/arch/mips/kernel/traps.c 2009-06-11 20:55:34.619476239 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/Kconfig linux-2.6.30.5/arch/mips/Kconfig +--- linux-2.6.30.5.orig/arch/mips/Kconfig 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/arch/mips/Kconfig 2009-08-23 22:10:22.000000000 +0200 +@@ -19,6 +19,23 @@ + prompt "System type" + default SGI_IP22 + ++config AR7 ++ bool "Texas Instruments AR7" ++ select BOOT_ELF32 ++ select DMA_NONCOHERENT ++ select CEVT_R4K ++ select CSRC_R4K ++ select IRQ_CPU ++ select SWAP_IO_SPACE ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_HAS_EARLY_PRINTK ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_SUPPORTS_KGDB ++ select SYS_SUPPORTS_LITTLE_ENDIAN ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select GENERIC_GPIO ++ select GENERIC_HARDIRQS_NO__DO_IRQ ++ + config MACH_ALCHEMY + bool "Alchemy processor based machines" + +diff -Nur linux-2.6.30.5.orig/arch/mips/kernel/traps.c linux-2.6.30.5/arch/mips/kernel/traps.c +--- linux-2.6.30.5.orig/arch/mips/kernel/traps.c 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/arch/mips/kernel/traps.c 2009-08-23 22:10:22.000000000 +0200 @@ -1256,9 +1256,22 @@ exception_handlers[n] = handler; @@ -2334,9 +2313,26 @@ diff -Nur linux-2.6.30.orig/arch/mips/kernel/traps.c linux-2.6.30/arch/mips/kern } return (void *)old_handler; } -diff -Nur linux-2.6.30.orig/drivers/Kconfig linux-2.6.30/drivers/Kconfig ---- linux-2.6.30.orig/drivers/Kconfig 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/Kconfig 2009-06-11 20:55:34.619476239 +0200 +diff -Nur linux-2.6.30.5.orig/arch/mips/Makefile linux-2.6.30.5/arch/mips/Makefile +--- linux-2.6.30.5.orig/arch/mips/Makefile 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/arch/mips/Makefile 2009-08-23 22:10:22.000000000 +0200 +@@ -174,6 +174,13 @@ + # + + # ++# Texas Instruments AR7 ++# ++core-$(CONFIG_AR7) += arch/mips/ar7/ ++cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7 ++load-$(CONFIG_AR7) += 0xffffffff94100000 ++ ++# + # Acer PICA 61, Mips Magnum 4000 and Olivetti M700. + # + core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ +diff -Nur linux-2.6.30.5.orig/drivers/Kconfig linux-2.6.30.5/drivers/Kconfig +--- linux-2.6.30.5.orig/drivers/Kconfig 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/Kconfig 2009-08-23 22:10:22.000000000 +0200 @@ -104,6 +104,8 @@ source "drivers/uio/Kconfig" @@ -2346,9 +2342,9 @@ diff -Nur linux-2.6.30.orig/drivers/Kconfig linux-2.6.30/drivers/Kconfig source "drivers/xen/Kconfig" source "drivers/staging/Kconfig" -diff -Nur linux-2.6.30.orig/drivers/Makefile linux-2.6.30/drivers/Makefile ---- linux-2.6.30.orig/drivers/Makefile 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/Makefile 2009-06-11 20:55:34.619476239 +0200 +diff -Nur linux-2.6.30.5.orig/drivers/Makefile linux-2.6.30.5/drivers/Makefile +--- linux-2.6.30.5.orig/drivers/Makefile 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/Makefile 2009-08-23 22:10:22.000000000 +0200 @@ -103,6 +103,7 @@ obj-$(CONFIG_HID) += hid/ obj-$(CONFIG_PPC_PS3) += ps3/ @@ -2357,201 +2353,25 @@ diff -Nur linux-2.6.30.orig/drivers/Makefile linux-2.6.30/drivers/Makefile obj-$(CONFIG_SSB) += ssb/ obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_STAGING) += staging/ -diff -Nur linux-2.6.30.orig/drivers/char/Kconfig linux-2.6.30/drivers/char/Kconfig ---- linux-2.6.30.orig/drivers/char/Kconfig 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/char/Kconfig 2009-06-11 20:55:34.623477307 +0200 -@@ -974,6 +974,15 @@ - To compile this driver as a module, choose M here: the - module will be called mwave. +diff -Nur linux-2.6.30.5.orig/drivers/mtd/Kconfig linux-2.6.30.5/drivers/mtd/Kconfig +--- linux-2.6.30.5.orig/drivers/mtd/Kconfig 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/mtd/Kconfig 2009-08-23 22:10:22.000000000 +0200 +@@ -170,6 +170,12 @@ + ---help--- + TI AR7 partitioning support -+config AR7_GPIO -+ tristate "TI AR7 GPIO Support" -+ depends on AR7 -+ help -+ Give userspace access to the GPIO pins on the Texas Instruments AR7 -+ processors. -+ -+ If compiled as a module, it will be called ar7_gpio. -+ - config SCx200_GPIO - tristate "NatSemi SCx200 GPIO Support" - depends on SCx200 -diff -Nur linux-2.6.30.orig/drivers/char/Makefile linux-2.6.30/drivers/char/Makefile ---- linux-2.6.30.orig/drivers/char/Makefile 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/char/Makefile 2009-06-11 20:55:34.623477307 +0200 -@@ -90,6 +90,7 @@ - obj-$(CONFIG_PPDEV) += ppdev.o - obj-$(CONFIG_NWBUTTON) += nwbutton.o - obj-$(CONFIG_NWFLASH) += nwflash.o -+obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o - obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o - obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o - obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o -diff -Nur linux-2.6.30.orig/drivers/char/ar7_gpio.c linux-2.6.30/drivers/char/ar7_gpio.c ---- linux-2.6.30.orig/drivers/char/ar7_gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/drivers/char/ar7_gpio.c 2009-06-11 20:55:34.623477307 +0200 -@@ -0,0 +1,158 @@ -+/* -+ * Copyright (C) 2007 Nicolas Thill <nico@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. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include <linux/device.h> -+#include <linux/fs.h> -+#include <linux/module.h> -+#include <linux/errno.h> -+#include <linux/kernel.h> -+#include <linux/init.h> -+#include <linux/platform_device.h> -+#include <linux/uaccess.h> -+#include <linux/io.h> -+#include <linux/types.h> -+#include <linux/cdev.h> -+#include <gpio.h> -+ -+#define DRVNAME "ar7_gpio" -+#define LONGNAME "TI AR7 GPIOs Driver" -+ -+MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); -+MODULE_DESCRIPTION(LONGNAME); -+MODULE_LICENSE("GPL"); ++config MTD_AR7_PARTS ++ tristate "TI AR7 partitioning support" ++ depends on MTD_PARTITIONS ++ ---help--- ++ TI AR7 partitioning support + -+static int ar7_gpio_major; -+ -+static ssize_t ar7_gpio_write(struct file *file, const char __user *buf, -+ size_t len, loff_t *ppos) -+{ -+ int pin = iminor(file->f_dentry->d_inode); -+ size_t i; -+ -+ for (i = 0; i < len; ++i) { -+ char c; -+ if (get_user(c, buf + i)) -+ return -EFAULT; -+ switch (c) { -+ case '0': -+ gpio_set_value(pin, 0); -+ break; -+ case '1': -+ gpio_set_value(pin, 1); -+ break; -+ case 'd': -+ case 'D': -+ ar7_gpio_disable(pin); -+ break; -+ case 'e': -+ case 'E': -+ ar7_gpio_enable(pin); -+ break; -+ case 'i': -+ case 'I': -+ case '<': -+ gpio_direction_input(pin); -+ break; -+ case 'o': -+ case 'O': -+ case '>': -+ gpio_direction_output(pin, 0); -+ break; -+ default: -+ return -EINVAL; -+ } -+ } -+ -+ return len; -+} -+ -+static ssize_t ar7_gpio_read(struct file *file, char __user *buf, -+ size_t len, loff_t *ppos) -+{ -+ int pin = iminor(file->f_dentry->d_inode); -+ int value; -+ -+ value = gpio_get_value(pin); -+ if (put_user(value ? '1' : '0', buf)) -+ return -EFAULT; -+ -+ return 1; -+} -+ -+static int ar7_gpio_open(struct inode *inode, struct file *file) -+{ -+ int m = iminor(inode); -+ -+ if (m >= AR7_GPIO_MAX) -+ return -EINVAL; -+ -+ return nonseekable_open(inode, file); -+} -+ -+static int ar7_gpio_release(struct inode *inode, struct file *file) -+{ -+ return 0; -+} -+ -+static const struct file_operations ar7_gpio_fops = { -+ .owner = THIS_MODULE, -+ .write = ar7_gpio_write, -+ .read = ar7_gpio_read, -+ .open = ar7_gpio_open, -+ .release = ar7_gpio_release, -+ .llseek = no_llseek, -+}; -+ -+static struct platform_device *ar7_gpio_device; -+ -+static int __init ar7_gpio_init(void) -+{ -+ int rc; -+ -+ ar7_gpio_device = platform_device_alloc(DRVNAME, -1); -+ if (!ar7_gpio_device) -+ return -ENOMEM; -+ -+ rc = platform_device_add(ar7_gpio_device); -+ if (rc < 0) -+ goto out_put; -+ -+ rc = register_chrdev(ar7_gpio_major, DRVNAME, &ar7_gpio_fops); -+ if (rc < 0) -+ goto out_put; -+ -+ ar7_gpio_major = rc; -+ -+ rc = 0; -+ -+ goto out; -+ -+out_put: -+ platform_device_put(ar7_gpio_device); -+out: -+ return rc; -+} -+ -+static void __exit ar7_gpio_exit(void) -+{ -+ unregister_chrdev(ar7_gpio_major, DRVNAME); -+ platform_device_unregister(ar7_gpio_device); -+} -+ -+module_init(ar7_gpio_init); -+module_exit(ar7_gpio_exit); -diff -Nur linux-2.6.30.orig/drivers/mtd/maps/physmap.c linux-2.6.30/drivers/mtd/maps/physmap.c ---- linux-2.6.30.orig/drivers/mtd/maps/physmap.c 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/mtd/maps/physmap.c 2009-06-11 20:55:34.627477258 +0200 + comment "User Modules And Translation Layers" + + config MTD_CHAR +diff -Nur linux-2.6.30.5.orig/drivers/mtd/maps/physmap.c linux-2.6.30.5/drivers/mtd/maps/physmap.c +--- linux-2.6.30.5.orig/drivers/mtd/maps/physmap.c 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/mtd/maps/physmap.c 2009-08-23 22:10:22.000000000 +0200 @@ -80,7 +80,7 @@ "map_rom", NULL }; @@ -2561,21 +2381,9 @@ diff -Nur linux-2.6.30.orig/drivers/mtd/maps/physmap.c linux-2.6.30/drivers/mtd/ #endif static int physmap_flash_probe(struct platform_device *dev) -diff -Nur linux-2.6.30.orig/drivers/net/Kconfig linux-2.6.30/drivers/net/Kconfig ---- linux-2.6.30.orig/drivers/net/Kconfig 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/net/Kconfig 2009-06-11 20:55:34.627477258 +0200 -@@ -1760,7 +1760,7 @@ - - config CPMAC - tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)" -- depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN -+ depends on NET_ETHERNET && EXPERIMENTAL && AR7 - select PHYLIB - help - TI AR7 CPMAC Ethernet support -diff -Nur linux-2.6.30.orig/drivers/net/cpmac.c linux-2.6.30/drivers/net/cpmac.c ---- linux-2.6.30.orig/drivers/net/cpmac.c 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/net/cpmac.c 2009-06-11 20:55:34.635477718 +0200 +diff -Nur linux-2.6.30.5.orig/drivers/net/cpmac.c linux-2.6.30.5/drivers/net/cpmac.c +--- linux-2.6.30.5.orig/drivers/net/cpmac.c 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/net/cpmac.c 2009-08-23 22:10:22.000000000 +0200 @@ -615,13 +615,13 @@ dev_kfree_skb_irq(desc->skb); @@ -2634,7 +2442,7 @@ diff -Nur linux-2.6.30.orig/drivers/net/cpmac.c linux-2.6.30/drivers/net/cpmac.c if (phy_id == PHY_MAX_ADDR) { if (external_switch || dumb_switch) { - mdio_bus_id = 0; /* fixed phys bus */ -+ mdio_bus_id = 0; ++ strncpy(mdio_bus_id, "0", BUS_ID_SIZE); phy_id = pdev->id; } else { dev_err(&pdev->dev, "no PHY present\n"); @@ -2648,60 +2456,43 @@ diff -Nur linux-2.6.30.orig/drivers/net/cpmac.c linux-2.6.30/drivers/net/cpmac.c if (!dev) { printk(KERN_ERR "cpmac: Unable to allocate net_device\n"); -@@ -1161,7 +1164,8 @@ +@@ -1161,8 +1164,11 @@ priv->msg_enable = netif_msg_init(debug_level, 0xff); memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); - priv->phy = phy_connect(dev, dev_name(&cpmac_mii->phy_map[phy_id]->dev), -+ snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); -+ priv->phy = phy_connect(dev, priv->phy_name, ++ snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); ++ //priv->phy = phy_connect(dev, dev_name(&cpmac_mii->phy_map[phy_id]->dev), ++ priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0, PHY_INTERFACE_MODE_MII); ++ if (IS_ERR(priv->phy)) { if (netif_msg_drv(priv)) -@@ -1230,31 +1234,34 @@ - #warning FIXME: unhardcode gpio&reset bits - ar7_gpio_disable(26); - ar7_gpio_disable(27); -- ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); - ar7_device_reset(AR7_RESET_BIT_CPMAC_HI); -+ ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); - ar7_device_reset(AR7_RESET_BIT_EPHY); - - cpmac_mii->reset(cpmac_mii); - -- for (i = 0; i < 300000; i++) -+ for (i = 0; i < 300; i++) - if ((mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE))) - break; - else -- cpu_relax(); -+ msleep(10); - - mask &= 0x7fffffff; -- if (mask & (mask - 1)) { -+ -+ //if (mask & (mask - 1)) { - external_switch = 1; - mask = 0; -- } -+ //} + printk(KERN_ERR "%s: Could not attach to PHY\n", +@@ -1249,7 +1255,7 @@ + } -+ /* cpmac_mii->phy_mask = ~(mask | 0x80000000); - snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "0"); + snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1"); res = mdiobus_register(cpmac_mii); if (res) - goto fail_mii; +diff -Nur linux-2.6.30.5.orig/drivers/net/Kconfig linux-2.6.30.5/drivers/net/Kconfig +--- linux-2.6.30.5.orig/drivers/net/Kconfig 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/net/Kconfig 2009-08-23 22:10:22.000000000 +0200 +@@ -1760,7 +1760,7 @@ -+ */ - res = platform_driver_register(&cpmac_driver); - if (res) - goto fail_cpmac; -diff -Nur linux-2.6.30.orig/drivers/vlynq/Kconfig linux-2.6.30/drivers/vlynq/Kconfig ---- linux-2.6.30.orig/drivers/vlynq/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/drivers/vlynq/Kconfig 2009-06-11 20:55:34.635477718 +0200 + config CPMAC + tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)" +- depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN ++ depends on NET_ETHERNET && EXPERIMENTAL && AR7 + select PHYLIB + help + TI AR7 CPMAC Ethernet support +diff -Nur linux-2.6.30.5.orig/drivers/vlynq/Kconfig linux-2.6.30.5/drivers/vlynq/Kconfig +--- linux-2.6.30.5.orig/drivers/vlynq/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/drivers/vlynq/Kconfig 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,13 @@ +menu "TI VLYNQ" + @@ -2716,19 +2507,19 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/Kconfig linux-2.6.30/drivers/vlynq/Kco + If unsure, say N + +endmenu -diff -Nur linux-2.6.30.orig/drivers/vlynq/Makefile linux-2.6.30/drivers/vlynq/Makefile ---- linux-2.6.30.orig/drivers/vlynq/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/drivers/vlynq/Makefile 2009-06-11 20:55:34.635477718 +0200 +diff -Nur linux-2.6.30.5.orig/drivers/vlynq/Makefile linux-2.6.30.5/drivers/vlynq/Makefile +--- linux-2.6.30.5.orig/drivers/vlynq/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/drivers/vlynq/Makefile 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,5 @@ +# +# Makefile for kernel vlynq drivers +# + +obj-$(CONFIG_VLYNQ) += vlynq.o -diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vlynq.c ---- linux-2.6.30.orig/drivers/vlynq/vlynq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/drivers/vlynq/vlynq.c 2009-06-11 20:55:52.962219898 +0200 -@@ -0,0 +1,782 @@ +diff -Nur linux-2.6.30.5.orig/drivers/vlynq/vlynq.c linux-2.6.30.5/drivers/vlynq/vlynq.c +--- linux-2.6.30.5.orig/drivers/vlynq/vlynq.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/drivers/vlynq/vlynq.c 2009-08-23 22:10:22.000000000 +0200 +@@ -0,0 +1,814 @@ +/* + * Copyright (C) 2006, 2007 Eugene Konev <ejka@openwrt.org> + * @@ -2745,6 +2536,9 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * Parts of the VLYNQ specification can be found here: ++ * http://www.ti.com/litv/pdf/sprue36a + */ + +#include <linux/init.h> @@ -2804,15 +2598,11 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + u32 int_device[8]; +}; + -+#define vlynq_reg_read(reg) readl(&(reg)) -+#define vlynq_reg_write(reg, val) writel(val, &(reg)) -+ -+static int __vlynq_enable_device(struct vlynq_device *dev); -+ -+#ifdef VLYNQ_DEBUG ++#ifdef CONFIG_VLYNQ_DEBUG +static void vlynq_dump_regs(struct vlynq_device *dev) +{ + int i; ++ + printk(KERN_DEBUG "VLYNQ local=%p remote=%p\n", + dev->local, dev->remote); + for (i = 0; i < 32; i++) { @@ -2826,20 +2616,23 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly +static void vlynq_dump_mem(u32 *base, int count) +{ + int i; ++ + for (i = 0; i < (count + 3) / 4; i++) { -+ if (i % 4 == 0) printk(KERN_DEBUG "\nMEM[0x%04x]:", i * 4); ++ if (i % 4 == 0) ++ printk(KERN_DEBUG "\nMEM[0x%04x]:", i * 4); + printk(KERN_DEBUG " 0x%08x", *(base + i)); + } + printk(KERN_DEBUG "\n"); +} +#endif + -+int vlynq_linked(struct vlynq_device *dev) ++/* Check the VLYNQ link status with a given device */ ++static int vlynq_linked(struct vlynq_device *dev) +{ + int i; + + for (i = 0; i < 100; i++) -+ if (vlynq_reg_read(dev->local->status) & VLYNQ_STATUS_LINK) ++ if (readl(&dev->local->status) & VLYNQ_STATUS_LINK) + return 1; + else + cpu_relax(); @@ -2849,17 +2642,15 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + +static void vlynq_reset(struct vlynq_device *dev) +{ -+ vlynq_reg_write(dev->local->control, -+ vlynq_reg_read(dev->local->control) | -+ VLYNQ_CTRL_RESET); ++ writel(readl(&dev->local->control) | VLYNQ_CTRL_RESET, ++ &dev->local->control); + + /* Wait for the devices to finish resetting */ + msleep(5); + + /* Remove reset bit */ -+ vlynq_reg_write(dev->local->control, -+ vlynq_reg_read(dev->local->control) & -+ ~VLYNQ_CTRL_RESET); ++ writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET, ++ &dev->local->control); + + /* Give some time for the devices to settle */ + msleep(5); @@ -2873,9 +2664,9 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + + BUG_ON(!dev); + virq = irq - dev->irq_start; -+ val = vlynq_reg_read(dev->remote->int_device[virq >> 2]); ++ val = readl(&dev->remote->int_device[virq >> 2]); + val |= (VINT_ENABLE | virq) << VINT_OFFSET(virq); -+ vlynq_reg_write(dev->remote->int_device[virq >> 2], val); ++ writel(val, &dev->remote->int_device[virq >> 2]); +} + +static void vlynq_irq_mask(unsigned int irq) @@ -2886,9 +2677,9 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + + BUG_ON(!dev); + virq = irq - dev->irq_start; -+ val = vlynq_reg_read(dev->remote->int_device[virq >> 2]); ++ val = readl(&dev->remote->int_device[virq >> 2]); + val &= ~(VINT_ENABLE << VINT_OFFSET(virq)); -+ vlynq_reg_write(dev->remote->int_device[virq >> 2], val); ++ writel(val, &dev->remote->int_device[virq >> 2]); +} + +static int vlynq_irq_type(unsigned int irq, unsigned int flow_type) @@ -2899,7 +2690,7 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + + BUG_ON(!dev); + virq = irq - dev->irq_start; -+ val = vlynq_reg_read(dev->remote->int_device[virq >> 2]); ++ val = readl(&dev->remote->int_device[virq >> 2]); + switch (flow_type & IRQ_TYPE_SENSE_MASK) { + case IRQ_TYPE_EDGE_RISING: + case IRQ_TYPE_EDGE_FALLING: @@ -2918,28 +2709,30 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + default: + return -EINVAL; + } -+ vlynq_reg_write(dev->remote->int_device[virq >> 2], val); ++ writel(val, &dev->remote->int_device[virq >> 2]); + return 0; +} + +static void vlynq_local_ack(unsigned int irq) +{ + struct vlynq_device *dev = get_irq_chip_data(irq); -+ u32 status = vlynq_reg_read(dev->local->status); -+ if (printk_ratelimit()) -+ printk(KERN_DEBUG "%s: local status: 0x%08x\n", ++ ++ u32 status = readl(&dev->local->status); ++ ++ pr_debug("%s: local status: 0x%08x\n", + dev_name(&dev->dev), status); -+ vlynq_reg_write(dev->local->status, status); ++ writel(status, &dev->local->status); +} + +static void vlynq_remote_ack(unsigned int irq) +{ + struct vlynq_device *dev = get_irq_chip_data(irq); -+ u32 status = vlynq_reg_read(dev->remote->status); -+ if (printk_ratelimit()) -+ printk(KERN_DEBUG "%s: remote status: 0x%08x\n", ++ ++ u32 status = readl(&dev->remote->status); ++ ++ pr_debug("%s: remote status: 0x%08x\n", + dev_name(&dev->dev), status); -+ vlynq_reg_write(dev->remote->status, status); ++ writel(status, &dev->remote->status); +} + +static irqreturn_t vlynq_irq(int irq, void *dev_id) @@ -2948,8 +2741,8 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + u32 status; + int virq = 0; + -+ status = vlynq_reg_read(dev->local->int_status); -+ vlynq_reg_write(dev->local->int_status, status); ++ status = readl(&dev->local->int_status); ++ writel(status, &dev->local->int_status); + + if (unlikely(!status)) + spurious_interrupt(); @@ -2998,23 +2791,23 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + } + + /* Clear local and remote error bits */ -+ vlynq_reg_write(dev->local->status, vlynq_reg_read(dev->local->status)); -+ vlynq_reg_write(dev->remote->status, -+ vlynq_reg_read(dev->remote->status)); ++ writel(readl(&dev->local->status), &dev->local->status); ++ writel(readl(&dev->remote->status), &dev->remote->status); + + /* Now setup interrupts */ + val = VLYNQ_CTRL_INT_VECTOR(dev->local_irq); + val |= VLYNQ_CTRL_INT_ENABLE | VLYNQ_CTRL_INT_LOCAL | + VLYNQ_CTRL_INT2CFG; -+ val |= vlynq_reg_read(dev->local->control); -+ vlynq_reg_write(dev->local->int_ptr, VLYNQ_INT_OFFSET); -+ vlynq_reg_write(dev->local->control, val); ++ val |= readl(&dev->local->control); ++ writel(VLYNQ_INT_OFFSET, &dev->local->int_ptr); ++ writel(val, &dev->local->control); + + val = VLYNQ_CTRL_INT_VECTOR(dev->remote_irq); + val |= VLYNQ_CTRL_INT_ENABLE; -+ val |= vlynq_reg_read(dev->remote->control); -+ vlynq_reg_write(dev->remote->int_ptr, VLYNQ_INT_OFFSET); -+ vlynq_reg_write(dev->remote->control, val); ++ val |= readl(&dev->remote->control); ++ writel(VLYNQ_INT_OFFSET, &dev->remote->int_ptr); ++ writel(val, &dev->remote->int_ptr); ++ writel(val, &dev->remote->control); + + for (i = dev->irq_start; i <= dev->irq_end; i++) { + virq = i - dev->irq_start; @@ -3030,12 +2823,13 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + set_irq_chip_and_handler(i, &vlynq_irq_chip, + handle_simple_irq); + set_irq_chip_data(i, dev); -+ vlynq_reg_write(dev->remote->int_device[virq >> 2], 0); ++ writel(0, &dev->remote->int_device[virq >> 2]); + } + } + + if (request_irq(dev->irq, vlynq_irq, IRQF_SHARED, "vlynq", dev)) { -+ printk(KERN_ERR "%s: request_irq failed\n", dev_name(&dev->dev)); ++ printk(KERN_ERR "%s: request_irq failed\n", ++ dev_name(&dev->dev)); + return -EAGAIN; + } + @@ -3059,11 +2853,11 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + if (ids->id == vdev->dev_id) { + vdev->divisor = ids->divisor; + vlynq_set_drvdata(vdev, ids); -+ printk(KERN_INFO "Driver found for VLYNQ " \ ++ printk(KERN_INFO "Driver found for VLYNQ " + "device: %08x\n", vdev->dev_id); + return 1; + } -+ printk(KERN_DEBUG "Not using the %08x VLYNQ device's driver" \ ++ printk(KERN_DEBUG "Not using the %08x VLYNQ device's driver" + " for VLYNQ device: %08x\n", ids->id, vdev->dev_id); + ids++; + } @@ -3077,8 +2871,7 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + struct vlynq_device_id *id = vlynq_get_drvdata(vdev); + int result = -ENODEV; + -+ get_device(dev); -+ if (drv && drv->probe) ++ if (drv->probe) + result = drv->probe(vdev, id); + if (result) + put_device(dev); @@ -3088,9 +2881,10 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly +static int vlynq_device_remove(struct device *dev) +{ + struct vlynq_driver *drv = to_vlynq_driver(dev->driver); -+ if (drv && drv->remove) ++ ++ if (drv->remove) + drv->remove(to_vlynq_device(dev)); -+ put_device(dev); ++ + return 0; +} + @@ -3108,6 +2902,14 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly +} +EXPORT_SYMBOL(vlynq_unregister_driver); + ++/* ++ * A VLYNQ remote device can clock the VLYNQ bus master ++ * using a dedicated clock line. In that case, both the ++ * remove device and the bus master should have the same ++ * serial clock dividers configured. Iterate through the ++ * 8 possible dividers until we actually link with the ++ * device. ++ */ +static int __vlynq_try_remote(struct vlynq_device *dev) +{ + int i; @@ -3120,16 +2922,16 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + if (!vlynq_linked(dev)) + break; + -+ vlynq_reg_write(dev->remote->control, -+ (vlynq_reg_read(dev->remote->control) & ++ writel((readl(&dev->remote->control) & + ~VLYNQ_CTRL_CLOCK_MASK) | + VLYNQ_CTRL_CLOCK_INT | -+ VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1)); -+ vlynq_reg_write(dev->local->control, -+ ((vlynq_reg_read(dev->local->control) ++ VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1), ++ &dev->remote->control); ++ writel((readl(&dev->local->control) + & ~(VLYNQ_CTRL_CLOCK_INT | + VLYNQ_CTRL_CLOCK_MASK)) | -+ VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1))); ++ VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1), ++ &dev->local->control); + + if (vlynq_linked(dev)) { + printk(KERN_DEBUG @@ -3145,21 +2947,28 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + return -ENODEV; +} + ++/* ++ * A VLYNQ remote device can be clocked by the VLYNQ bus ++ * master using a dedicated clock line. In that case, only ++ * the bus master configures the serial clock divider. ++ * Iterate through the 8 possible dividers until we ++ * actually get a link with the device. ++ */ +static int __vlynq_try_local(struct vlynq_device *dev) +{ + int i; -+ ++ + vlynq_reset(dev); + + for (i = dev->dev_id ? vlynq_ldiv2 : vlynq_ldiv8; dev->dev_id ? + i <= vlynq_ldiv8 : i >= vlynq_ldiv2; + dev->dev_id ? i++ : i--) { + -+ vlynq_reg_write(dev->local->control, -+ (vlynq_reg_read(dev->local->control) & ++ writel((readl(&dev->local->control) & + ~VLYNQ_CTRL_CLOCK_MASK) | + VLYNQ_CTRL_CLOCK_INT | -+ VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1)); ++ VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1), ++ &dev->local->control); + + if (vlynq_linked(dev)) { + printk(KERN_DEBUG @@ -3175,19 +2984,25 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + return -ENODEV; +} + ++/* ++ * When using external clocking method, serial clock ++ * is supplied by an external oscillator, therefore we ++ * should mask the local clock bit in the clock control ++ * register for both the bus master and the remote device. ++ */ +static int __vlynq_try_external(struct vlynq_device *dev) +{ + vlynq_reset(dev); + if (!vlynq_linked(dev)) + return -ENODEV; + -+ vlynq_reg_write(dev->remote->control, -+ (vlynq_reg_read(dev->remote->control) & -+ ~VLYNQ_CTRL_CLOCK_INT)); ++ writel((readl(&dev->remote->control) & ++ ~VLYNQ_CTRL_CLOCK_INT), ++ &dev->remote->control); + -+ vlynq_reg_write(dev->local->control, -+ (vlynq_reg_read(dev->local->control) & -+ ~VLYNQ_CTRL_CLOCK_INT)); ++ writel((readl(&dev->local->control) & ++ ~VLYNQ_CTRL_CLOCK_INT), ++ &dev->local->control); + + if (vlynq_linked(dev)) { + printk(KERN_DEBUG "%s: using external clock\n", @@ -3195,7 +3010,7 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + dev->divisor = vlynq_div_external; + return 0; + } -+ ++ + return -ENODEV; +} + @@ -3212,10 +3027,10 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + case vlynq_div_external: + case vlynq_div_auto: + /* When the device is brought from reset it should have clock -+ generation negotiated by hardware. -+ Check which device is generating clocks and perform setup -+ accordingly */ -+ if (vlynq_linked(dev) && vlynq_reg_read(dev->remote->control) & ++ * generation negotiated by hardware. ++ * Check which device is generating clocks and perform setup ++ * accordingly */ ++ if (vlynq_linked(dev) && readl(&dev->remote->control) & + VLYNQ_CTRL_CLOCK_INT) { + if (!__vlynq_try_remote(dev) || + !__vlynq_try_local(dev) || @@ -3228,31 +3043,43 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + return 0; + } + break; -+ case vlynq_ldiv1: case vlynq_ldiv2: case vlynq_ldiv3: case vlynq_ldiv4: -+ case vlynq_ldiv5: case vlynq_ldiv6: case vlynq_ldiv7: case vlynq_ldiv8: -+ vlynq_reg_write(dev->local->control, -+ VLYNQ_CTRL_CLOCK_INT | -+ VLYNQ_CTRL_CLOCK_DIV(dev->divisor - -+ vlynq_ldiv1)); -+ vlynq_reg_write(dev->remote->control, 0); ++ case vlynq_ldiv1: ++ case vlynq_ldiv2: ++ case vlynq_ldiv3: ++ case vlynq_ldiv4: ++ case vlynq_ldiv5: ++ case vlynq_ldiv6: ++ case vlynq_ldiv7: ++ case vlynq_ldiv8: ++ writel(VLYNQ_CTRL_CLOCK_INT | ++ VLYNQ_CTRL_CLOCK_DIV(dev->divisor - ++ vlynq_ldiv1), &dev->local->control); ++ writel(0, &dev->remote->control); + if (vlynq_linked(dev)) { + printk(KERN_DEBUG -+ "%s: using local clock divisor %d\n", -+ dev_name(&dev->dev), dev->divisor - vlynq_ldiv1 + 1); ++ "%s: using local clock divisor %d\n", ++ dev_name(&dev->dev), ++ dev->divisor - vlynq_ldiv1 + 1); + return 0; + } + break; -+ case vlynq_rdiv1: case vlynq_rdiv2: case vlynq_rdiv3: case vlynq_rdiv4: -+ case vlynq_rdiv5: case vlynq_rdiv6: case vlynq_rdiv7: case vlynq_rdiv8: -+ vlynq_reg_write(dev->local->control, 0); -+ vlynq_reg_write(dev->remote->control, -+ VLYNQ_CTRL_CLOCK_INT | -+ VLYNQ_CTRL_CLOCK_DIV(dev->divisor - -+ vlynq_rdiv1)); ++ case vlynq_rdiv1: ++ case vlynq_rdiv2: ++ case vlynq_rdiv3: ++ case vlynq_rdiv4: ++ case vlynq_rdiv5: ++ case vlynq_rdiv6: ++ case vlynq_rdiv7: ++ case vlynq_rdiv8: ++ writel(0, &dev->local->control); ++ writel(VLYNQ_CTRL_CLOCK_INT | ++ VLYNQ_CTRL_CLOCK_DIV(dev->divisor - ++ vlynq_rdiv1), &dev->remote->control); + if (vlynq_linked(dev)) { + printk(KERN_DEBUG -+ "%s: using remote clock divisor %d\n", -+ dev_name(&dev->dev), dev->divisor - vlynq_rdiv1 + 1); ++ "%s: using remote clock divisor %d\n", ++ dev_name(&dev->dev), ++ dev->divisor - vlynq_rdiv1 + 1); + return 0; + } + break; @@ -3299,12 +3126,10 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + if (!dev->enabled) + return -ENXIO; + -+ vlynq_reg_write(dev->local->tx_offset, tx_offset); ++ writel(tx_offset, &dev->local->tx_offset); + for (i = 0; i < 4; i++) { -+ vlynq_reg_write(dev->local->rx_mapping[i].offset, -+ mapping[i].offset); -+ vlynq_reg_write(dev->local->rx_mapping[i].size, -+ mapping[i].size); ++ writel(mapping[i].offset, &dev->local->rx_mapping[i].offset); ++ writel(mapping[i].size, &dev->local->rx_mapping[i].size); + } + return 0; +} @@ -3318,12 +3143,10 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + if (!dev->enabled) + return -ENXIO; + -+ vlynq_reg_write(dev->remote->tx_offset, tx_offset); ++ writel(tx_offset, &dev->remote->tx_offset); + for (i = 0; i < 4; i++) { -+ vlynq_reg_write(dev->remote->rx_mapping[i].offset, -+ mapping[i].offset); -+ vlynq_reg_write(dev->remote->rx_mapping[i].size, -+ mapping[i].size); ++ writel(mapping[i].offset, &dev->remote->rx_mapping[i].offset); ++ writel(mapping[i].size, &dev->remote->rx_mapping[i].size); + } + return 0; +} @@ -3439,7 +3262,7 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + dev->divisor = vlynq_div_auto; + result = __vlynq_enable_device(dev); + if (result == 0) { -+ dev->dev_id = vlynq_reg_read(dev->remote->chip); ++ dev->dev_id = readl(&dev->remote->chip); + ((struct plat_vlynq_ops *)(dev->dev.platform_data))->off(dev); + } + if (dev->dev_id) @@ -3511,148 +3334,9 @@ diff -Nur linux-2.6.30.orig/drivers/vlynq/vlynq.c linux-2.6.30/drivers/vlynq/vly + +module_init(vlynq_init); +module_exit(vlynq_exit); -diff -Nur linux-2.6.30.orig/drivers/watchdog/ar7_wdt.c linux-2.6.30/drivers/watchdog/ar7_wdt.c ---- linux-2.6.30.orig/drivers/watchdog/ar7_wdt.c 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/drivers/watchdog/ar7_wdt.c 2009-06-11 20:55:34.639477111 +0200 -@@ -69,8 +69,7 @@ - u32 prescale; - }; - --static unsigned long wdt_is_open; --static spinlock_t wdt_lock; -+static struct semaphore open_semaphore; - static unsigned expect_close; - - /* XXX currently fixed, allows max margin ~68.72 secs */ -@@ -155,10 +154,8 @@ - u32 change; - - change = new_margin * (ar7_vbus_freq() / prescale_value); -- if (change < 1) -- change = 1; -- if (change > 0xffff) -- change = 0xffff; -+ if (change < 1) change = 1; -+ if (change > 0xffff) change = 0xffff; - ar7_wdt_change(change); - margin = change * prescale_value / ar7_vbus_freq(); - printk(KERN_INFO DRVNAME -@@ -182,7 +179,7 @@ - static int ar7_wdt_open(struct inode *inode, struct file *file) - { - /* only allow one at a time */ -- if (test_and_set_bit(0, &wdt_is_open)) -+ if (down_trylock(&open_semaphore)) - return -EBUSY; - ar7_wdt_enable_wdt(); - expect_close = 0; -@@ -198,7 +195,9 @@ - "will not disable the watchdog timer\n"); - else if (!nowayout) - ar7_wdt_disable_wdt(); -- clear_bit(0, &wdt_is_open); -+ -+ up(&open_semaphore); -+ - return 0; - } - -@@ -213,7 +212,7 @@ - } - - static struct notifier_block ar7_wdt_notifier = { -- .notifier_call = ar7_wdt_notify_sys, -+ .notifier_call = ar7_wdt_notify_sys - }; - - static ssize_t ar7_wdt_write(struct file *file, const char *data, -@@ -223,14 +222,12 @@ - if (len) { - size_t i; - -- spin_lock(&wdt_lock); - ar7_wdt_kick(1); -- spin_unlock(&wdt_lock); - - expect_close = 0; - for (i = 0; i < len; ++i) { - char c; -- if (get_user(c, data + i)) -+ if (get_user(c, data+i)) - return -EFAULT; - if (c == 'V') - expect_close = 1; -@@ -240,17 +237,19 @@ - return len; - } - --static long ar7_wdt_ioctl(struct file *file, -- unsigned int cmd, unsigned long arg) -+static int ar7_wdt_ioctl(struct inode *inode, struct file *file, -+ unsigned int cmd, unsigned long arg) - { - static struct watchdog_info ident = { - .identity = LONGNAME, - .firmware_version = 1, -- .options = (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING), -+ .options = (WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING), - }; - int new_margin; - - switch (cmd) { -+ default: -+ return -ENOTTY; - case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, - sizeof(ident))) -@@ -270,24 +269,20 @@ - if (new_margin < 1) - return -EINVAL; - -- spin_lock(&wdt_lock); - ar7_wdt_update_margin(new_margin); - ar7_wdt_kick(1); -- spin_unlock(&wdt_lock); - - case WDIOC_GETTIMEOUT: - if (put_user(margin, (int *)arg)) - return -EFAULT; - return 0; -- default: -- return -ENOTTY; - } - } - --static const struct file_operations ar7_wdt_fops = { -+static struct file_operations ar7_wdt_fops = { - .owner = THIS_MODULE, - .write = ar7_wdt_write, -- .unlocked_ioctl = ar7_wdt_ioctl, -+ .ioctl = ar7_wdt_ioctl, - .open = ar7_wdt_open, - .release = ar7_wdt_release, - }; -@@ -302,8 +297,6 @@ - { - int rc; - -- spin_lock_init(&wdt_lock); -- - ar7_wdt_get_regs(); - - if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt), -@@ -319,6 +312,8 @@ - ar7_wdt_prescale(prescale_value); - ar7_wdt_update_margin(margin); - -+ sema_init(&open_semaphore, 1); -+ - rc = register_reboot_notifier(&ar7_wdt_notifier); - if (rc) { - printk(KERN_ERR DRVNAME -diff -Nur linux-2.6.30.orig/include/linux/vlynq.h linux-2.6.30/include/linux/vlynq.h ---- linux-2.6.30.orig/include/linux/vlynq.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30/include/linux/vlynq.h 2009-06-11 20:55:34.639477111 +0200 +diff -Nur linux-2.6.30.5.orig/include/linux/vlynq.h linux-2.6.30.5/include/linux/vlynq.h +--- linux-2.6.30.5.orig/include/linux/vlynq.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/linux/vlynq.h 2009-08-23 22:10:22.000000000 +0200 @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2006, 2007 Eugene Konev <ejka@openwrt.org> @@ -3815,40 +3499,3 @@ diff -Nur linux-2.6.30.orig/include/linux/vlynq.h linux-2.6.30/include/linux/vly +extern int vlynq_set_remote_irq(struct vlynq_device *dev, int virq); + +#endif /* __VLYNQ_H__ */ -diff -Nur linux-2.6.30.orig/kernel/futex.c linux-2.6.30/kernel/futex.c ---- linux-2.6.30.orig/kernel/futex.c 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/kernel/futex.c 2009-06-11 20:55:34.643477901 +0200 -@@ -1985,9 +1985,11 @@ - * implementation, the non functional ones will return - * -ENOSYS. - */ -- curval = cmpxchg_futex_value_locked(NULL, 0, 0); -- if (curval == -EFAULT) -- futex_cmpxchg_enabled = 1; -+ // exeption handler on ar7 is broken -+ //curval = cmpxchg_futex_value_locked(NULL, 0, 0); -+ //if (curval == -EFAULT) -+ // futex_cmpxchg_enabled = 1; -+ futex_cmpxchg_enabled = 0; - - for (i = 0; i < ARRAY_SIZE(futex_queues); i++) { - plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock); -diff -Nur linux-2.6.30.orig/kernel/printk.c linux-2.6.30/kernel/printk.c ---- linux-2.6.30.orig/kernel/printk.c 2009-06-10 05:05:27.000000000 +0200 -+++ linux-2.6.30/kernel/printk.c 2009-06-11 20:55:34.643477901 +0200 -@@ -1272,6 +1272,7 @@ - - static int __init disable_boot_consoles(void) - { -+ /* triggers reboot on ar7 - if (console_drivers != NULL) { - if (console_drivers->flags & CON_BOOT) { - printk(KERN_INFO "turn off boot console %s%d\n", -@@ -1279,6 +1280,7 @@ - return unregister_console(console_drivers); - } - } -+ */ - return 0; - } - late_initcall(disable_boot_consoles); |