diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2009-08-27 22:18:04 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2009-08-27 22:18:04 +0200 |
commit | c97a6e61935ad4b5527fe4cad786cdb42489f69c (patch) | |
tree | 264a4cb64c035d8d50a633d0eaac5e928869bf1f /target/wag54g | |
parent | 89a213bd0f0290c66cdf952d5ea5f089cd56d1e9 (diff) |
finally it is booting completely
Diffstat (limited to 'target/wag54g')
-rw-r--r-- | target/wag54g/files/etc/inittab | 3 | ||||
-rw-r--r-- | target/wag54g/kernel.config | 53 | ||||
-rw-r--r-- | target/wag54g/patches/ar7.patch | 1188 |
3 files changed, 1135 insertions, 109 deletions
diff --git a/target/wag54g/files/etc/inittab b/target/wag54g/files/etc/inittab new file mode 100644 index 000000000..4566ae3e8 --- /dev/null +++ b/target/wag54g/files/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS +::shutdown:/etc/init.d/rcK +ttyS0::respawn:/sbin/getty -i -L ttyS0 38400 vt100 diff --git a/target/wag54g/kernel.config b/target/wag54g/kernel.config index eec4f9e43..53e5cb313 100644 --- a/target/wag54g/kernel.config +++ b/target/wag54g/kernel.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.29.1 -# Thu Jun 11 14:39:35 2009 +# Linux kernel version: 2.6.30.5 +# Thu Aug 27 22:00:41 2009 # CONFIG_MIPS=y @@ -74,7 +74,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y -CONFIG_NO_EXCEPT_FILL=y CONFIG_SWAP_IO_SPACE=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT=5 @@ -119,6 +118,7 @@ CONFIG_32BIT=y CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_8KB is not set # CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_32KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_CPU_HAS_PREFETCH=y CONFIG_MIPS_MT_DISABLED=y @@ -143,6 +143,8 @@ CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_ZONE_DMA_FLAG=0 CONFIG_VIRT_TO_BUS=y # CONFIG_UNEVICTABLE_LRU is not set +CONFIG_HAVE_MLOCK=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 CONFIG_TICK_ONESHOT=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y @@ -177,6 +179,7 @@ CONFIG_LOCALVERSION="" CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_AUDIT is not set @@ -204,6 +207,7 @@ CONFIG_EMBEDDED=y CONFIG_SYSCTL_SYSCALL=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set +# CONFIG_STRIP_ASM_SYMS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y @@ -223,7 +227,9 @@ CONFIG_SLAB=y # CONFIG_SLUB is not set # CONFIG_SLOB is not set # CONFIG_PROFILING is not set +# CONFIG_MARKERS is not set CONFIG_HAVE_OPROFILE=y +# CONFIG_SLOW_WORK is not set # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set CONFIG_SLABINFO=y CONFIG_BASE_SMALL=0 @@ -235,7 +241,6 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_BLOCK=y # CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set # CONFIG_BLK_DEV_BSG is not set # CONFIG_BLK_DEV_INTEGRITY is not set @@ -278,7 +283,6 @@ CONFIG_NET=y # # Networking options # -CONFIG_COMPAT_NET_DEV_OPS=y CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y @@ -331,6 +335,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic" # CONFIG_LAPB is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set # CONFIG_NET_SCHED is not set # CONFIG_DCB is not set @@ -343,7 +348,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic" # CONFIG_IRDA is not set # CONFIG_BT is not set # CONFIG_AF_RXRPC is not set -# CONFIG_PHONET is not set CONFIG_WIRELESS=y # CONFIG_CFG80211 is not set CONFIG_WIRELESS_OLD_REGULATORY=y @@ -371,9 +375,8 @@ CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set # CONFIG_MTD_CONCAT is not set CONFIG_MTD_PARTITIONS=y -CONFIG_MTD_ROOTFS_ROOT_DEV=y -CONFIG_MTD_ROOTFS_SPLIT=y # CONFIG_MTD_TESTS is not set +CONFIG_MTD_ROOTFS_ROOT_DEV=y # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_CMDLINE_PARTS is not set CONFIG_MTD_AR7_PARTS=y @@ -473,6 +476,7 @@ CONFIG_HAVE_IDE=y # CONFIG_ATA is not set # CONFIG_MD is not set CONFIG_NETDEVICES=y +CONFIG_COMPAT_NET_DEV_OPS=y # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_MACVLAN is not set @@ -505,6 +509,7 @@ CONFIG_MII=y # CONFIG_AX88796 is not set # CONFIG_SMC91X is not set # CONFIG_DM9000 is not set +# CONFIG_ETHOC is not set # CONFIG_DNET is not set # CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IBM_NEW_EMAC_RGMII is not set @@ -523,7 +528,6 @@ CONFIG_CPMAC=y # # CONFIG_WLAN_PRE80211 is not set # CONFIG_WLAN_80211 is not set -# CONFIG_IWLWIFI_LEDS is not set # # Enable WiMAX (Networking options) to see the WiMAX drivers @@ -646,6 +650,7 @@ CONFIG_SSB_POSSIBLE=y CONFIG_RTC_LIB=y # CONFIG_RTC_CLASS is not set # CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set # @@ -663,19 +668,23 @@ CONFIG_VLYNQ=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set -CONFIG_FILE_LOCKING=y # CONFIG_XFS_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_BTRFS_FS is not set -CONFIG_DNOTIFY=y -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y +CONFIG_FILE_LOCKING=y +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY is not set # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set # +# Caches +# +# CONFIG_FSCACHE is not set + +# # CD-ROM/DVD Filesystems # # CONFIG_ISO9660_FS is not set @@ -720,6 +729,8 @@ CONFIG_MISC_FILESYSTEMS=y # CONFIG_ROMFS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set +# CONFIG_AUFS_FS is not set +# CONFIG_NILFS2_FS is not set CONFIG_NETWORK_FILESYSTEMS=y # CONFIG_NFS_FS is not set # CONFIG_NFSD is not set @@ -753,14 +764,23 @@ CONFIG_MAGIC_SYSRQ=y # CONFIG_DEBUG_MEMORY_INIT is not set # CONFIG_RCU_CPU_STALL_DETECTOR is not set # CONFIG_SYSCTL_SYSCALL_CHECK is not set +CONFIG_TRACING_SUPPORT=y # # Tracers # -# CONFIG_DYNAMIC_PRINTK_DEBUG is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_CONTEXT_SWITCH_TRACER is not set +# CONFIG_EVENT_TRACER is not set +# CONFIG_BOOT_TRACER is not set +# CONFIG_TRACE_BRANCH_PROFILING is not set +# CONFIG_KMEMTRACE is not set +# CONFIG_WORKQUEUE_TRACER is not set +# CONFIG_BLK_DEV_IO_TRACE is not set # CONFIG_SAMPLES is not set CONFIG_HAVE_ARCH_KGDB=y -CONFIG_CMDLINE="console=ttyS0" +CONFIG_CMDLINE="console=ttyS0,38400" # # Security options @@ -847,6 +867,7 @@ CONFIG_CRYPTO=y # Compression # # CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_ZLIB is not set # CONFIG_CRYPTO_LZO is not set # @@ -859,6 +880,7 @@ CONFIG_CRYPTO=y # OCF Configuration # # CONFIG_OCF_OCF is not set +# CONFIG_BINARY_PRINTF is not set # # Library routines @@ -874,3 +896,4 @@ CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAS_DMA=y +CONFIG_NLATTR=y diff --git a/target/wag54g/patches/ar7.patch b/target/wag54g/patches/ar7.patch index c14c367b0..71139fdb8 100644 --- a/target/wag54g/patches/ar7.patch +++ b/target/wag54g/patches/ar7.patch @@ -1,6 +1,6 @@ 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 ++++ linux-2.6.30.5/arch/mips/ar7/clock.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,483 @@ +/* + * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> @@ -27,7 +27,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/clock.c linux-2.6.30.5/arch/mips/ar7 +#include <linux/delay.h> +#include <asm/addrspace.h> +#include <asm/io.h> -+#include <asm/mach-ar7/ar7.h> ++#include <asm/ar7/ar7.h> + +#define BOOT_PLL_SOURCE_MASK 0x3 +#define CPU_PLL_SOURCE_SHIFT 16 @@ -487,7 +487,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/clock.c linux-2.6.30.5/arch/mips/ar7 +} 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 ++++ linux-2.6.30.5/arch/mips/ar7/gpio.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> @@ -510,7 +510,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/gpio.c linux-2.6.30.5/arch/mips/ar7/ + +#include <linux/module.h> + -+#include <asm/mach-ar7/gpio.h> ++#include <asm/ar7/gpio.h> + +static const char *ar7_gpio_list[AR7_GPIO_MAX]; + @@ -540,7 +540,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/gpio.c linux-2.6.30.5/arch/mips/ar7/ +EXPORT_SYMBOL(gpio_free); 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 ++++ linux-2.6.30.5/arch/mips/ar7/irq.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> @@ -566,7 +566,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/irq.c linux-2.6.30.5/arch/mips/ar7/i + +#include <asm/irq_cpu.h> +#include <asm/mipsregs.h> -+#include <asm/mach-ar7/ar7.h> ++#include <asm/ar7/ar7.h> + +#define EXCEPT_OFFSET 0x80 +#define PACE_OFFSET 0xA0 @@ -727,7 +727,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/irq.c linux-2.6.30.5/arch/mips/ar7/i +} 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 ++++ linux-2.6.30.5/arch/mips/ar7/Makefile 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,10 @@ + +obj-y := \ @@ -741,7 +741,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/Makefile linux-2.6.30.5/arch/mips/ar + 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 ++++ linux-2.6.30.5/arch/mips/ar7/memory.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,74 @@ +/* + * Based on arch/mips/mm/init.c @@ -819,8 +819,8 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/memory.c linux-2.6.30.5/arch/mips/ar +} 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 @@ ++++ linux-2.6.30.5/arch/mips/ar7/platform.c 2009-08-26 20:06:50.000000000 +0200 +@@ -0,0 +1,550 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> + * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org> @@ -860,9 +860,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ +#include <linux/phy_fixed.h> + +#include <asm/addrspace.h> -+#include <asm/mach-ar7/ar7.h> -+#include <asm/mach-ar7/gpio.h> -+#include <asm/mach-ar7/prom.h> ++#include <asm/ar7/ar7.h> ++#include <asm/ar7/gpio.h> ++#include <asm/ar7/prom.h> + +struct plat_vlynq_data { + struct plat_vlynq_ops ops; @@ -921,13 +921,6 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ + .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", @@ -1037,6 +1030,13 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ + .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, @@ -1278,11 +1278,11 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ + + memset(uart_port, 0, sizeof(struct uart_port) * 2); + -+ uart_port[0].type = PORT_16550A; ++ uart_port[0].type = PORT_AR7; + 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_MEM32; ++ uart_port[0].iotype = UPIO_MEM; + uart_port[0].mapbase = AR7_REGS_UART0; + uart_port[0].membase = ioremap(uart_port[0].mapbase, 256); + uart_port[0].regshift = 2; @@ -1293,11 +1293,11 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ + + /* Only TNETD73xx have a second serial port */ + if (ar7_has_second_uart()) { -+ uart_port[1].type = PORT_16550A; ++ uart_port[1].type = PORT_AR7; + 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_MEM32; ++ uart_port[1].iotype = UPIO_MEM; + uart_port[1].mapbase = UR8_REGS_UART1; + uart_port[1].membase = ioremap(uart_port[1].mapbase, 256); + uart_port[1].regshift = 2; @@ -1339,9 +1339,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ + + if (ar7_has_high_cpmac()) { + res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); -+ if (res && res != -ENODEV) { ++ if (res && res != -ENODEV) + return res; -+ } ++ + cpmac_get_mac(1, cpmac_high_data.dev_addr); + res = platform_device_register(&cpmac_high); + if (res) @@ -1351,9 +1351,8 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ + } + + res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); -+ if (res && res != -ENODEV) { ++ if (res && res != -ENODEV) + return res; -+ } + + cpmac_get_mac(0, cpmac_low_data.dev_addr); + res = platform_device_register(&cpmac_low); @@ -1374,7 +1373,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/platform.c linux-2.6.30.5/arch/mips/ +arch_initcall(ar7_register_devices); 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 ++++ linux-2.6.30.5/arch/mips/ar7/prom.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,321 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1404,8 +1403,8 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/prom.c linux-2.6.30.5/arch/mips/ar7/ +#include <linux/io.h> +#include <asm/bootinfo.h> + -+#include <asm/mach-ar7/ar7.h> -+#include <asm/mach-ar7/prom.h> ++#include <asm/ar7/ar7.h> ++#include <asm/ar7/prom.h> + +#define MAX_ENTRY 80 + @@ -1699,7 +1698,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/prom.c linux-2.6.30.5/arch/mips/ar7/ +#endif 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 ++++ linux-2.6.30.5/arch/mips/ar7/setup.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,105 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1725,8 +1724,8 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/setup.c linux-2.6.30.5/arch/mips/ar7 + +#include <asm/reboot.h> +#include <asm/time.h> -+#include <asm/mach-ar7/ar7.h> -+#include <asm/mach-ar7/prom.h> ++#include <asm/ar7/ar7.h> ++#include <asm/ar7/prom.h> + +static void ar7_machine_restart(char *command); +static void ar7_machine_halt(void); @@ -1808,7 +1807,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/setup.c linux-2.6.30.5/arch/mips/ar7 +console_initcall(ar7_init_console); 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 ++++ linux-2.6.30.5/arch/mips/ar7/time.c 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,28 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1832,15 +1831,15 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/ar7/time.c linux-2.6.30.5/arch/mips/ar7/ + +#include <linux/version.h> +#include <asm/time.h> -+#include <asm/mach-ar7/ar7.h> ++#include <asm/ar7/ar7.h> + +void __init plat_time_init(void) +{ + mips_hpt_frequency = ar7_cpu_freq() / 2; +} -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 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/ar7/ar7.h linux-2.6.30.5/arch/mips/include/asm/ar7/ar7.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/ar7/ar7.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/ar7/ar7.h 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> @@ -2012,9 +2011,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/ar7.h linux-2.6.30. +} + +#endif /* __AR7_H__ */ -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 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/ar7/gpio.h linux-2.6.30.5/arch/mips/include/asm/ar7/gpio.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/ar7/gpio.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/ar7/gpio.h 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org> @@ -2036,7 +2035,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.30 + +#ifndef __AR7_GPIO_H__ +#define __AR7_GPIO_H__ -+#include <asm/mach-ar7/ar7.h> ++#include <asm/ar7/ar7.h> + +#define AR7_GPIO_MAX 32 + @@ -2125,9 +2124,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.30 +#include <asm-generic/gpio.h> + +#endif -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 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/ar7/irq.h linux-2.6.30.5/arch/mips/include/asm/ar7/irq.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/ar7/irq.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/ar7/irq.h 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,16 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2145,9 +2144,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/irq.h linux-2.6.30. +#include_next <irq.h> + +#endif /* __ASM_AR7_IRQ_H */ -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 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/ar7/prom.h linux-2.6.30.5/arch/mips/include/asm/ar7/prom.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/ar7/prom.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/ar7/prom.h 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2006, 2007 Florian Fainelli <florian@openwrt.org> @@ -2175,9 +2174,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/prom.h linux-2.6.30 +extern void prom_meminit(void); + +#endif /* __PROM_H__ */ -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 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/ar7/spaces.h linux-2.6.30.5/arch/mips/include/asm/ar7/spaces.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/ar7/spaces.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/ar7/spaces.h 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,32 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2192,7 +2191,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6. +#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 + @@ -2211,9 +2210,9 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6. +#endif + +#endif /* __ASM_AR7_SPACES_H */ -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 +diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/ar7/war.h linux-2.6.30.5/arch/mips/include/asm/ar7/war.h +--- linux-2.6.30.5.orig/arch/mips/include/asm/ar7/war.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/arch/mips/include/asm/ar7/war.h 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,25 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2242,24 +2241,23 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/include/asm/mach-ar7/war.h linux-2.6.30. +#endif /* __ASM_MIPS_MACH_BCM947XX_WAR_H */ 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 @@ ++++ linux-2.6.30.5/arch/mips/include/asm/page.h 2009-08-26 20:05:14.000000000 +0200 +@@ -185,8 +185,10 @@ #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.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 ++++ linux-2.6.30.5/arch/mips/Kconfig 2009-08-27 21:44:10.000000000 +0200 @@ -19,6 +19,23 @@ prompt "System type" default SGI_IP22 @@ -2286,7 +2284,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/Kconfig linux-2.6.30.5/arch/mips/Kconfig 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 ++++ linux-2.6.30.5/arch/mips/kernel/traps.c 2009-08-26 20:05:14.000000000 +0200 @@ -1256,9 +1256,22 @@ exception_handlers[n] = handler; @@ -2315,7 +2313,7 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/kernel/traps.c linux-2.6.30.5/arch/mips/ } 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 ++++ linux-2.6.30.5/arch/mips/Makefile 2009-08-26 20:05:14.000000000 +0200 @@ -174,6 +174,13 @@ # @@ -2323,16 +2321,561 @@ diff -Nur linux-2.6.30.5.orig/arch/mips/Makefile linux-2.6.30.5/arch/mips/Makefi +# Texas Instruments AR7 +# +core-$(CONFIG_AR7) += arch/mips/ar7/ -+cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7 ++cflags-$(CONFIG_AR7) += -Iinclude/asm-mips/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/char/ar7_gpio.c linux-2.6.30.5/drivers/char/ar7_gpio.c +--- linux-2.6.30.5.orig/drivers/char/ar7_gpio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/drivers/char/ar7_gpio.c 2009-08-26 20:05:03.000000000 +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"); ++ ++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.5.orig/drivers/char/Kconfig linux-2.6.30.5/drivers/char/Kconfig +--- linux-2.6.30.5.orig/drivers/char/Kconfig 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/char/Kconfig 2009-08-26 20:05:23.000000000 +0200 +@@ -974,6 +974,15 @@ + To compile this driver as a module, choose M here: the + module will be called mwave. + ++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.5.orig/drivers/char/Makefile linux-2.6.30.5/drivers/char/Makefile +--- linux-2.6.30.5.orig/drivers/char/Makefile 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/char/Makefile 2009-08-26 20:05:23.000000000 +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.5.orig/drivers/char/watchdog/ar7_wdt.c linux-2.6.30.5/drivers/char/watchdog/ar7_wdt.c +--- linux-2.6.30.5.orig/drivers/char/watchdog/ar7_wdt.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/drivers/char/watchdog/ar7_wdt.c 2009-08-26 20:05:03.000000000 +0200 +@@ -0,0 +1,349 @@ ++/* ++ * drivers/watchdog/ar7_wdt.c ++ * ++ * Copyright (C) 2007 Nicolas Thill <nico@openwrt.org> ++ * Copyright (c) 2005 Enrik Berkhan <Enrik.Berkhan@akk.org> ++ * ++ * Some code taken from: ++ * National Semiconductor SCx200 Watchdog support ++ * Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> ++ * ++ * 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/module.h> ++#include <linux/moduleparam.h> ++#include <linux/errno.h> ++#include <linux/init.h> ++#include <linux/miscdevice.h> ++#include <linux/watchdog.h> ++#include <linux/notifier.h> ++#include <linux/reboot.h> ++#include <linux/fs.h> ++#include <linux/ioport.h> ++#include <linux/io.h> ++#include <linux/uaccess.h> ++ ++#include <asm/addrspace.h> ++#include <asm/ar7/ar7.h> ++ ++#define DRVNAME "ar7_wdt" ++#define LONGNAME "TI AR7 Watchdog Timer" ++ ++MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); ++MODULE_DESCRIPTION(LONGNAME); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); ++ ++static int margin = 60; ++module_param(margin, int, 0); ++MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); ++ ++static int nowayout = WATCHDOG_NOWAYOUT; ++module_param(nowayout, int, 0); ++MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); ++ ++#define READ_REG(x) readl((void __iomem *)&(x)) ++#define WRITE_REG(x, v) writel((v), (void __iomem *)&(x)) ++ ++struct ar7_wdt { ++ u32 kick_lock; ++ u32 kick; ++ u32 change_lock; ++ u32 change; ++ u32 disable_lock; ++ u32 disable; ++ u32 prescale_lock; ++ u32 prescale; ++}; ++ ++static struct semaphore open_semaphore; ++static unsigned expect_close; ++ ++/* XXX currently fixed, allows max margin ~68.72 secs */ ++#define prescale_value 0xffff ++ ++/* Offset of the WDT registers */ ++static unsigned long ar7_regs_wdt; ++/* Pointer to the remapped WDT IO space */ ++static struct ar7_wdt *ar7_wdt; ++static void ar7_wdt_get_regs(void) ++{ ++ u16 chip_id = ar7_chip_id(); ++ switch (chip_id) { ++ case AR7_CHIP_7100: ++ case AR7_CHIP_7200: ++ ar7_regs_wdt = AR7_REGS_WDT; ++ break; ++ default: ++ ar7_regs_wdt = UR8_REGS_WDT; ++ break; ++ } ++} ++ ++ ++static void ar7_wdt_kick(u32 value) ++{ ++ WRITE_REG(ar7_wdt->kick_lock, 0x5555); ++ if ((READ_REG(ar7_wdt->kick_lock) & 3) == 1) { ++ WRITE_REG(ar7_wdt->kick_lock, 0xaaaa); ++ if ((READ_REG(ar7_wdt->kick_lock) & 3) == 3) { ++ WRITE_REG(ar7_wdt->kick, value); ++ return; ++ } ++ } ++ printk(KERN_ERR DRVNAME ": failed to unlock WDT kick reg\n"); ++} ++ ++static void ar7_wdt_prescale(u32 value) ++{ ++ WRITE_REG(ar7_wdt->prescale_lock, 0x5a5a); ++ if ((READ_REG(ar7_wdt->prescale_lock) & 3) == 1) { ++ WRITE_REG(ar7_wdt->prescale_lock, 0xa5a5); ++ if ((READ_REG(ar7_wdt->prescale_lock) & 3) == 3) { ++ WRITE_REG(ar7_wdt->prescale, value); ++ return; ++ } ++ } ++ printk(KERN_ERR DRVNAME ": failed to unlock WDT prescale reg\n"); ++} ++ ++static void ar7_wdt_change(u32 value) ++{ ++ WRITE_REG(ar7_wdt->change_lock, 0x6666); ++ if ((READ_REG(ar7_wdt->change_lock) & 3) == 1) { ++ WRITE_REG(ar7_wdt->change_lock, 0xbbbb); ++ if ((READ_REG(ar7_wdt->change_lock) & 3) == 3) { ++ WRITE_REG(ar7_wdt->change, value); ++ return; ++ } ++ } ++ printk(KERN_ERR DRVNAME ": failed to unlock WDT change reg\n"); ++} ++ ++static void ar7_wdt_disable(u32 value) ++{ ++ WRITE_REG(ar7_wdt->disable_lock, 0x7777); ++ if ((READ_REG(ar7_wdt->disable_lock) & 3) == 1) { ++ WRITE_REG(ar7_wdt->disable_lock, 0xcccc); ++ if ((READ_REG(ar7_wdt->disable_lock) & 3) == 2) { ++ WRITE_REG(ar7_wdt->disable_lock, 0xdddd); ++ if ((READ_REG(ar7_wdt->disable_lock) & 3) == 3) { ++ WRITE_REG(ar7_wdt->disable, value); ++ return; ++ } ++ } ++ } ++ printk(KERN_ERR DRVNAME ": failed to unlock WDT disable reg\n"); ++} ++ ++static void ar7_wdt_update_margin(int new_margin) ++{ ++ u32 change; ++ ++ change = new_margin * (ar7_vbus_freq() / prescale_value); ++ 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 ++ ": timer margin %d seconds (prescale %d, change %d, freq %d)\n", ++ margin, prescale_value, change, ar7_vbus_freq()); ++} ++ ++static void ar7_wdt_enable_wdt(void) ++{ ++ printk(KERN_DEBUG DRVNAME ": enabling watchdog timer\n"); ++ ar7_wdt_disable(1); ++ ar7_wdt_kick(1); ++} ++ ++static void ar7_wdt_disable_wdt(void) ++{ ++ printk(KERN_DEBUG DRVNAME ": disabling watchdog timer\n"); ++ ar7_wdt_disable(0); ++} ++ ++static int ar7_wdt_open(struct inode *inode, struct file *file) ++{ ++ /* only allow one at a time */ ++ if (down_trylock(&open_semaphore)) ++ return -EBUSY; ++ ar7_wdt_enable_wdt(); ++ expect_close = 0; ++ ++ return nonseekable_open(inode, file); ++} ++ ++static int ar7_wdt_release(struct inode *inode, struct file *file) ++{ ++ if (!expect_close) ++ printk(KERN_WARNING DRVNAME ++ ": watchdog device closed unexpectedly," ++ "will not disable the watchdog timer\n"); ++ else if (!nowayout) ++ ar7_wdt_disable_wdt(); ++ ++ up(&open_semaphore); ++ ++ return 0; ++} ++ ++static int ar7_wdt_notify_sys(struct notifier_block *this, ++ unsigned long code, void *unused) ++{ ++ if (code == SYS_HALT || code == SYS_POWER_OFF) ++ if (!nowayout) ++ ar7_wdt_disable_wdt(); ++ ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block ar7_wdt_notifier = { ++ .notifier_call = ar7_wdt_notify_sys ++}; ++ ++static ssize_t ar7_wdt_write(struct file *file, const char *data, ++ size_t len, loff_t *ppos) ++{ ++ /* check for a magic close character */ ++ if (len) { ++ size_t i; ++ ++ ar7_wdt_kick(1); ++ ++ expect_close = 0; ++ for (i = 0; i < len; ++i) { ++ char c; ++ if (get_user(c, data+i)) ++ return -EFAULT; ++ if (c == 'V') ++ expect_close = 1; ++ } ++ ++ } ++ return len; ++} ++ ++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_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))) ++ return -EFAULT; ++ return 0; ++ case WDIOC_GETSTATUS: ++ case WDIOC_GETBOOTSTATUS: ++ if (put_user(0, (int *)arg)) ++ return -EFAULT; ++ return 0; ++ case WDIOC_KEEPALIVE: ++ ar7_wdt_kick(1); ++ return 0; ++ case WDIOC_SETTIMEOUT: ++ if (get_user(new_margin, (int *)arg)) ++ return -EFAULT; ++ if (new_margin < 1) ++ return -EINVAL; ++ ++ ar7_wdt_update_margin(new_margin); ++ ar7_wdt_kick(1); ++ ++ case WDIOC_GETTIMEOUT: ++ if (put_user(margin, (int *)arg)) ++ return -EFAULT; ++ return 0; ++ } ++} ++ ++static struct file_operations ar7_wdt_fops = { ++ .owner = THIS_MODULE, ++ .write = ar7_wdt_write, ++ .ioctl = ar7_wdt_ioctl, ++ .open = ar7_wdt_open, ++ .release = ar7_wdt_release, ++}; ++ ++static struct miscdevice ar7_wdt_miscdev = { ++ .minor = WATCHDOG_MINOR, ++ .name = "watchdog", ++ .fops = &ar7_wdt_fops, ++}; ++ ++static int __init ar7_wdt_init(void) ++{ ++ int rc; ++ ++ ar7_wdt_get_regs(); ++ ++ if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt), ++ LONGNAME)) { ++ printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n"); ++ return -EBUSY; ++ } ++ ++ ar7_wdt = (struct ar7_wdt *) ++ ioremap(ar7_regs_wdt, sizeof(struct ar7_wdt)); ++ ++ ar7_wdt_disable_wdt(); ++ 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 ++ ": unable to register reboot notifier\n"); ++ goto out_alloc; ++ } ++ ++ rc = misc_register(&ar7_wdt_miscdev); ++ if (rc) { ++ printk(KERN_ERR DRVNAME ": unable to register misc device\n"); ++ goto out_register; ++ } ++ goto out; ++ ++out_register: ++ unregister_reboot_notifier(&ar7_wdt_notifier); ++out_alloc: ++ iounmap(ar7_wdt); ++ release_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt)); ++out: ++ return rc; ++} ++ ++static void __exit ar7_wdt_cleanup(void) ++{ ++ misc_deregister(&ar7_wdt_miscdev); ++ unregister_reboot_notifier(&ar7_wdt_notifier); ++ iounmap(ar7_wdt); ++ release_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt)); ++} ++ ++module_init(ar7_wdt_init); ++module_exit(ar7_wdt_cleanup); 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 ++++ linux-2.6.30.5/drivers/Kconfig 2009-08-26 20:05:30.000000000 +0200 @@ -104,6 +104,8 @@ source "drivers/uio/Kconfig" @@ -2344,7 +2887,7 @@ diff -Nur linux-2.6.30.5.orig/drivers/Kconfig linux-2.6.30.5/drivers/Kconfig source "drivers/staging/Kconfig" 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 ++++ linux-2.6.30.5/drivers/Makefile 2009-08-26 20:05:30.000000000 +0200 @@ -103,6 +103,7 @@ obj-$(CONFIG_HID) += hid/ obj-$(CONFIG_PPC_PS3) += ps3/ @@ -2353,25 +2896,9 @@ diff -Nur linux-2.6.30.5.orig/drivers/Makefile linux-2.6.30.5/drivers/Makefile obj-$(CONFIG_SSB) += ssb/ obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_STAGING) += staging/ -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 MTD_AR7_PARTS -+ tristate "TI AR7 partitioning support" -+ depends on MTD_PARTITIONS -+ ---help--- -+ TI AR7 partitioning support -+ - 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 ++++ linux-2.6.30.5/drivers/mtd/maps/physmap.c 2009-08-26 20:05:19.000000000 +0200 @@ -80,7 +80,7 @@ "map_rom", NULL }; @@ -2383,7 +2910,7 @@ diff -Nur linux-2.6.30.5.orig/drivers/mtd/maps/physmap.c linux-2.6.30.5/drivers/ static int physmap_flash_probe(struct platform_device *dev) 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 ++++ linux-2.6.30.5/drivers/net/cpmac.c 2009-08-26 22:00:29.000000000 +0200 @@ -615,13 +615,13 @@ dev_kfree_skb_irq(desc->skb); @@ -2480,7 +3007,7 @@ diff -Nur linux-2.6.30.5.orig/drivers/net/cpmac.c linux-2.6.30.5/drivers/net/cpm if (res) 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 ++++ linux-2.6.30.5/drivers/net/Kconfig 2009-08-26 20:06:44.000000000 +0200 @@ -1760,7 +1760,7 @@ config CPMAC @@ -2490,9 +3017,38 @@ diff -Nur linux-2.6.30.5.orig/drivers/net/Kconfig linux-2.6.30.5/drivers/net/Kco select PHYLIB help TI AR7 CPMAC Ethernet support +diff -Nur linux-2.6.30.5.orig/drivers/serial/8250.c linux-2.6.30.5/drivers/serial/8250.c +--- linux-2.6.30.5.orig/drivers/serial/8250.c 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/serial/8250.c 2009-08-26 20:06:59.000000000 +0200 +@@ -287,6 +287,13 @@ + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, + .flags = UART_CAP_FIFO, + }, ++ [PORT_AR7] = { ++ .name = "TI-AR7", ++ .fifo_size = 16, ++ .tx_loadsz = 16, ++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, ++ .flags = UART_CAP_FIFO | UART_CAP_AFE, ++ }, + }; + + #if defined (CONFIG_SERIAL_8250_AU1X00) +@@ -2702,7 +2709,11 @@ + { + struct uart_8250_port *up = (struct uart_8250_port *)port; + ++#ifdef CONFIG_AR7 ++ wait_for_xmitr(up, BOTH_EMPTY); ++#else + wait_for_xmitr(up, UART_LSR_THRE); ++#endif + serial_out(up, UART_TX, ch); + } + 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 ++++ linux-2.6.30.5/drivers/vlynq/Kconfig 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,13 @@ +menu "TI VLYNQ" + @@ -2509,7 +3065,7 @@ diff -Nur linux-2.6.30.5.orig/drivers/vlynq/Kconfig linux-2.6.30.5/drivers/vlynq +endmenu 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 ++++ linux-2.6.30.5/drivers/vlynq/Makefile 2009-08-26 20:05:03.000000000 +0200 @@ -0,0 +1,5 @@ +# +# Makefile for kernel vlynq drivers @@ -2518,8 +3074,8 @@ diff -Nur linux-2.6.30.5.orig/drivers/vlynq/Makefile linux-2.6.30.5/drivers/vlyn +obj-$(CONFIG_VLYNQ) += vlynq.o 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 @@ ++++ linux-2.6.30.5/drivers/vlynq/vlynq.c 2009-08-26 20:06:33.000000000 +0200 +@@ -0,0 +1,813 @@ +/* + * Copyright (C) 2006, 2007 Eugene Konev <ejka@openwrt.org> + * @@ -2550,7 +3106,6 @@ diff -Nur linux-2.6.30.5.orig/drivers/vlynq/vlynq.c linux-2.6.30.5/drivers/vlynq +#include <linux/errno.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> -+#include <linux/device.h> +#include <linux/delay.h> +#include <linux/io.h> + @@ -3334,9 +3889,454 @@ diff -Nur linux-2.6.30.5.orig/drivers/vlynq/vlynq.c linux-2.6.30.5/drivers/vlynq + +module_init(vlynq_init); +module_exit(vlynq_exit); +diff -Nur linux-2.6.30.5.orig/drivers/watchdog/ar7_wdt.c linux-2.6.30.5/drivers/watchdog/ar7_wdt.c +--- linux-2.6.30.5.orig/drivers/watchdog/ar7_wdt.c 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/drivers/watchdog/ar7_wdt.c 2009-08-26 20:06:40.000000000 +0200 +@@ -298,14 +298,28 @@ + .fops = &ar7_wdt_fops, + }; + ++#define AR7_WDT_HARDWARE_ENABLE 0x10 ++ + static int __init ar7_wdt_init(void) + { + int rc; ++ u32 *bootcr; ++ u32 bootcr_value; + + spin_lock_init(&wdt_lock); + + ar7_wdt_get_regs(); + ++ /* arch/mips/ar7/clocks.c is the only other thing that reads this */ ++ bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4); ++ bootcr_value = *bootcr; ++ iounmap(bootcr); ++ ++ if (!(bootcr_value & AR7_WDT_HARDWARE_ENABLE)) { ++ printk(KERN_INFO DRVNAME ": watchdog disabled in hardware (bootcr=%#x)\n", bootcr_value); ++ return -ENODEV; ++ } ++ + if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt), + LONGNAME)) { + printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n"); +diff -Nur linux-2.6.30.5.orig/include/asm-mips/ar7/ar7.h linux-2.6.30.5/include/asm-mips/ar7/ar7.h +--- linux-2.6.30.5.orig/include/asm-mips/ar7/ar7.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/asm-mips/ar7/ar7.h 2009-08-26 20:05:02.000000000 +0200 +@@ -0,0 +1,170 @@ ++/* ++ * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> ++ * Copyright (C) 2006,2007 Eugene Konev <ejka@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 ++ */ ++ ++#ifndef __AR7_H__ ++#define __AR7_H__ ++ ++#include <linux/delay.h> ++#include <asm/addrspace.h> ++#include <linux/io.h> ++ ++#define AR7_REGS_BASE 0x08610000 ++ ++#define AR7_REGS_MAC0 (AR7_REGS_BASE + 0x0000) ++#define AR7_REGS_GPIO (AR7_REGS_BASE + 0x0900) ++/* 0x08610A00 - 0x08610BFF (512 bytes, 128 bytes / clock) */ ++#define AR7_REGS_POWER (AR7_REGS_BASE + 0x0a00) ++#define AR7_REGS_UART0 (AR7_REGS_BASE + 0x0e00) ++#define AR7_REGS_USB (AR7_REGS_BASE + 0x1200) ++#define AR7_REGS_RESET (AR7_REGS_BASE + 0x1600) ++#define AR7_REGS_VLYNQ0 (AR7_REGS_BASE + 0x1800) ++#define AR7_REGS_DCL (AR7_REGS_BASE + 0x1a00) ++#define AR7_REGS_VLYNQ1 (AR7_REGS_BASE + 0x1c00) ++#define AR7_REGS_MDIO (AR7_REGS_BASE + 0x1e00) ++#define AR7_REGS_IRQ (AR7_REGS_BASE + 0x2400) ++#define AR7_REGS_MAC1 (AR7_REGS_BASE + 0x2800) ++ ++#define AR7_REGS_WDT (AR7_REGS_BASE + 0x1f00) ++#define UR8_REGS_WDT (AR7_REGS_BASE + 0x0b00) ++#define UR8_REGS_UART1 (AR7_REGS_BASE + 0x0f00) ++ ++#define AR7_RESET_PEREPHERIAL 0x0 ++#define AR7_RESET_SOFTWARE 0x4 ++#define AR7_RESET_STATUS 0x8 ++ ++#define AR7_RESET_BIT_CPMAC_LO 17 ++#define AR7_RESET_BIT_CPMAC_HI 21 ++#define AR7_RESET_BIT_MDIO 22 ++#define AR7_RESET_BIT_EPHY 26 ++ ++/* GPIO control registers */ ++#define AR7_GPIO_INPUT 0x0 ++#define AR7_GPIO_OUTPUT 0x4 ++#define AR7_GPIO_DIR 0x8 ++#define AR7_GPIO_ENABLE 0xc ++ ++#define AR7_CHIP_7100 0x18 ++#define AR7_CHIP_7200 0x2b ++#define AR7_CHIP_7300 0x05 ++ ++/* Interrupts */ ++#define AR7_IRQ_UART0 15 ++#define AR7_IRQ_UART1 16 ++ ++/* Clocks */ ++#define AR7_AFE_CLOCK 35328000 ++#define AR7_REF_CLOCK 25000000 ++#define AR7_XTAL_CLOCK 24000000 ++ ++struct plat_cpmac_data { ++ int reset_bit; ++ int power_bit; ++ u32 phy_mask; ++ char dev_addr[6]; ++}; ++ ++struct plat_dsl_data { ++ int reset_bit_dsl; ++ int reset_bit_sar; ++}; ++ ++extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock; ++ ++static inline u16 ar7_chip_id(void) ++{ ++ return readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) & 0xffff; ++} ++ ++static inline u8 ar7_chip_rev(void) ++{ ++ return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff; ++} ++ ++static inline int ar7_cpu_freq(void) ++{ ++ return ar7_cpu_clock; ++} ++ ++static inline int ar7_bus_freq(void) ++{ ++ return ar7_bus_clock; ++} ++ ++static inline int ar7_vbus_freq(void) ++{ ++ return ar7_bus_clock / 2; ++} ++#define ar7_cpmac_freq ar7_vbus_freq ++ ++static inline int ar7_dsp_freq(void) ++{ ++ return ar7_dsp_clock; ++} ++ ++static inline int ar7_has_high_cpmac(void) ++{ ++ u16 chip_id = ar7_chip_id(); ++ switch (chip_id) { ++ case AR7_CHIP_7100: ++ case AR7_CHIP_7200: ++ return 0; ++ default: ++ return 1; ++ } ++} ++#define ar7_has_high_vlynq ar7_has_high_cpmac ++#define ar7_has_second_uart ar7_has_high_cpmac ++ ++static inline void ar7_device_enable(u32 bit) ++{ ++ void *reset_reg = ++ (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL); ++ writel(readl(reset_reg) | (1 << bit), reset_reg); ++ mdelay(20); ++} ++ ++static inline void ar7_device_disable(u32 bit) ++{ ++ void *reset_reg = ++ (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL); ++ writel(readl(reset_reg) & ~(1 << bit), reset_reg); ++ mdelay(20); ++} ++ ++static inline void ar7_device_reset(u32 bit) ++{ ++ ar7_device_disable(bit); ++ ar7_device_enable(bit); ++} ++ ++static inline void ar7_device_on(u32 bit) ++{ ++ void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER); ++ writel(readl(power_reg) | (1 << bit), power_reg); ++ mdelay(20); ++} ++ ++static inline void ar7_device_off(u32 bit) ++{ ++ void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER); ++ writel(readl(power_reg) & ~(1 << bit), power_reg); ++ mdelay(20); ++} ++ ++#endif /* __AR7_H__ */ +diff -Nur linux-2.6.30.5.orig/include/asm-mips/ar7/gpio.h linux-2.6.30.5/include/asm-mips/ar7/gpio.h +--- linux-2.6.30.5.orig/include/asm-mips/ar7/gpio.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/asm-mips/ar7/gpio.h 2009-08-26 20:05:02.000000000 +0200 +@@ -0,0 +1,109 @@ ++/* ++ * Copyright (C) 2007 Florian Fainelli <florian@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 ++ */ ++ ++#ifndef __AR7_GPIO_H__ ++#define __AR7_GPIO_H__ ++#include <asm/ar7/ar7.h> ++ ++#define AR7_GPIO_MAX 32 ++ ++extern int gpio_request(unsigned gpio, const char *label); ++extern void gpio_free(unsigned gpio); ++ ++/* Common GPIO layer */ ++static inline int gpio_get_value(unsigned gpio) ++{ ++ void __iomem *gpio_in = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT); ++ ++ return readl(gpio_in) & (1 << gpio); ++} ++ ++static inline void gpio_set_value(unsigned gpio, int value) ++{ ++ void __iomem *gpio_out = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT); ++ unsigned tmp; ++ ++ tmp = readl(gpio_out) & ~(1 << gpio); ++ if (value) ++ tmp |= 1 << gpio; ++ writel(tmp, gpio_out); ++} ++ ++static inline int gpio_direction_input(unsigned gpio) ++{ ++ void __iomem *gpio_dir = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR); ++ ++ if (gpio >= AR7_GPIO_MAX) ++ return -EINVAL; ++ ++ writel(readl(gpio_dir) | (1 << gpio), gpio_dir); ++ ++ return 0; ++} ++ ++static inline int gpio_direction_output(unsigned gpio, int value) ++{ ++ void __iomem *gpio_dir = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR); ++ ++ if (gpio >= AR7_GPIO_MAX) ++ return -EINVAL; ++ ++ gpio_set_value(gpio, value); ++ writel(readl(gpio_dir) & ~(1 << gpio), gpio_dir); ++ ++ return 0; ++} ++ ++static inline int gpio_to_irq(unsigned gpio) ++{ ++ return -EINVAL; ++} ++ ++static inline int irq_to_gpio(unsigned irq) ++{ ++ return -EINVAL; ++} ++ ++/* Board specific GPIO functions */ ++static inline int ar7_gpio_enable(unsigned gpio) ++{ ++ void __iomem *gpio_en = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE); ++ ++ writel(readl(gpio_en) | (1 << gpio), gpio_en); ++ ++ return 0; ++} ++ ++static inline int ar7_gpio_disable(unsigned gpio) ++{ ++ void __iomem *gpio_en = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE); ++ ++ writel(readl(gpio_en) & ~(1 << gpio), gpio_en); ++ ++ return 0; ++} ++ ++#include <asm-generic/gpio.h> ++ ++#endif +diff -Nur linux-2.6.30.5.orig/include/asm-mips/ar7/irq.h linux-2.6.30.5/include/asm-mips/ar7/irq.h +--- linux-2.6.30.5.orig/include/asm-mips/ar7/irq.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/asm-mips/ar7/irq.h 2009-08-26 20:05:02.000000000 +0200 +@@ -0,0 +1,16 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Shamelessly copied from asm-mips/mach-emma2rh/ ++ * Copyright (C) 2003 by Ralf Baechle ++ */ ++#ifndef __ASM_AR7_IRQ_H ++#define __ASM_AR7_IRQ_H ++ ++#define NR_IRQS 256 ++ ++#include_next <irq.h> ++ ++#endif /* __ASM_AR7_IRQ_H */ +diff -Nur linux-2.6.30.5.orig/include/asm-mips/ar7/prom.h linux-2.6.30.5/include/asm-mips/ar7/prom.h +--- linux-2.6.30.5.orig/include/asm-mips/ar7/prom.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/asm-mips/ar7/prom.h 2009-08-26 20:05:02.000000000 +0200 +@@ -0,0 +1,26 @@ ++/* ++ * Copyright (C) 2006, 2007 Florian Fainelli <florian@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 ++ */ ++ ++#ifndef __PROM_H__ ++#define __PROM_H__ ++ ++extern char *prom_getenv(const char *name); ++extern void prom_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); ++extern void prom_meminit(void); ++ ++#endif /* __PROM_H__ */ +diff -Nur linux-2.6.30.5.orig/include/asm-mips/ar7/spaces.h linux-2.6.30.5/include/asm-mips/ar7/spaces.h +--- linux-2.6.30.5.orig/include/asm-mips/ar7/spaces.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/asm-mips/ar7/spaces.h 2009-08-26 20:05:02.000000000 +0200 +@@ -0,0 +1,32 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle ++ * Copyright (C) 2000, 2002 Maciej W. Rozycki ++ * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. ++ */ ++#ifndef _ASM_AR7_SPACES_H ++#define _ASM_AR7_SPACES_H ++ ++#define CAC_BASE 0x80000000 ++#define IO_BASE 0xa0000000 ++#define UNCAC_BASE 0xa0000000 ++#define MAP_BASE 0xc0000000 ++ ++/* ++ * This handles the memory map. ++ * We handle pages at KSEG0 for kernels with 32 bit address space. ++ */ ++#define PAGE_OFFSET 0x94000000UL ++#define PHYS_OFFSET 0x14000000UL ++ ++/* ++ * Memory above this physical address will be considered highmem. ++ */ ++#ifndef HIGHMEM_START ++#define HIGHMEM_START 0x40000000UL ++#endif ++ ++#endif /* __ASM_AR7_SPACES_H */ +diff -Nur linux-2.6.30.5.orig/include/asm-mips/ar7/war.h linux-2.6.30.5/include/asm-mips/ar7/war.h +--- linux-2.6.30.5.orig/include/asm-mips/ar7/war.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.30.5/include/asm-mips/ar7/war.h 2009-08-26 20:05:02.000000000 +0200 +@@ -0,0 +1,25 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> ++ */ ++#ifndef __ASM_MIPS_MACH_BCM947XX_WAR_H ++#define __ASM_MIPS_MACH_BCM947XX_WAR_H ++ ++#define R4600_V1_INDEX_ICACHEOP_WAR 0 ++#define R4600_V1_HIT_CACHEOP_WAR 0 ++#define R4600_V2_HIT_CACHEOP_WAR 0 ++#define R5432_CP0_INTERRUPT_WAR 0 ++#define BCM1250_M3_WAR 0 ++#define SIBYTE_1956_WAR 0 ++#define MIPS4K_ICACHE_REFILL_WAR 0 ++#define MIPS_CACHE_SYNC_WAR 0 ++#define TX49XX_ICACHE_INDEX_INV_WAR 0 ++#define RM9000_CDEX_SMP_WAR 0 ++#define ICACHE_REFILLS_WORKAROUND_WAR 0 ++#define R10000_LLSC_WAR 0 ++#define MIPS34K_MISSED_ITLB_WAR 0 ++ ++#endif /* __ASM_MIPS_MACH_BCM947XX_WAR_H */ +diff -Nur linux-2.6.30.5.orig/include/linux/serial_core.h linux-2.6.30.5/include/linux/serial_core.h +--- linux-2.6.30.5.orig/include/linux/serial_core.h 2009-08-16 23:19:38.000000000 +0200 ++++ linux-2.6.30.5/include/linux/serial_core.h 2009-08-26 20:06:59.000000000 +0200 +@@ -41,6 +41,7 @@ + #define PORT_XSCALE 15 + #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ + #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ ++#define PORT_AR7 18 /* TI AR7 internal UART */ + #define PORT_MAX_8250 17 /* max port ID */ + + /* 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 ++++ linux-2.6.30.5/include/linux/vlynq.h 2009-08-26 20:05:02.000000000 +0200 @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2006, 2007 Eugene Konev <ejka@openwrt.org> |