diff --git a/include/autotools.mk b/include/autotools.mk index 5d51d7a32..cd333577c 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -22,9 +22,11 @@ update_libtool_ucxx=$(call replace,libtool,$(STAGING_DIR)/host/bin,$(CONFIGURE_P # prevent libtool from linking against host development libraries define libtool_fixup_libdir find $(1) -name '*.la' | $(XARGS) \ - $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" + $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" \ + -e "s,$(STAGING_DIR)/usr/lib/\(libstdc++\|libsupc++\).la,$(TOOLCHAIN_DIR)/usr/lib/\1.la,g" find $(2) -name '*.la' | $(XARGS) \ - $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" + $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" \ + -e "s,$(STAGING_DIR)/usr/lib/\(libstdc++\|libsupc++\).la,$(TOOLCHAIN_DIR)/usr/lib/\1.la,g" endef define remove_version_check diff --git a/include/verbose.mk b/include/verbose.mk index f795e2804..857be24a3 100644 --- a/include/verbose.mk +++ b/include/verbose.mk @@ -44,7 +44,7 @@ ifneq ($(KBUILD_VERBOSE),99) SILENT:= endif export QUIET:=1 - SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* || { echo "make $$*: build failed. Please re-run make with V=99 to see what's going on"; false; } } 8>&1 9>&2; cmd + SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with V=99 to see what's going on"; false; } } 8>&1 9>&2; cmd endif .SILENT: $(MAKECMDGOALS) diff --git a/package/ar7-atm/patches/190-2.6.32_proc_fixes.patch b/package/ar7-atm/patches/190-2.6.32_proc_fixes.patch new file mode 100644 index 000000000..42e89c318 --- /dev/null +++ b/package/ar7-atm/patches/190-2.6.32_proc_fixes.patch @@ -0,0 +1,29 @@ +Index: sangam_atm-D7.04.03.00/tn7dsl.c +=================================================================== +--- sangam_atm-D7.04.03.00.orig/tn7dsl.c 2010-02-01 22:30:45.000000000 +0100 ++++ sangam_atm-D7.04.03.00/tn7dsl.c 2010-02-01 22:32:41.000000000 +0100 +@@ -3431,8 +3431,11 @@ + */ + if(write) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) + ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); +- ++#else ++ ret = proc_dostring(ctl, write, buffer, lenp, 0); ++#endif + switch (ctl->ctl_name) + { + case DEV_DSLMOD: +@@ -3517,7 +3520,11 @@ + else + { + len += sprintf(info+len, mod_req); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) + ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++#else ++ ret = proc_dostring(ctl, write, buffer, lenp, 0); ++#endif + } + return ret; + } diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 2d114bcea..cd410adf8 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=base-files -PKG_RELEASE:=37 +PKG_RELEASE:=38 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 2ed4c5061..7927af154 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -2,6 +2,7 @@ # Copyright (C) 2006 OpenWrt.org START=10 +STOP=98 system_config() { local cfg="$1" @@ -80,3 +81,8 @@ start() { load_modules /etc/modules.d/* } + +stop() { + killall -9 syslogd 2> /dev/null +} + diff --git a/package/base-files/files/etc/init.d/network b/package/base-files/files/etc/init.d/network index e77db0251..74478c731 100755 --- a/package/base-files/files/etc/init.d/network +++ b/package/base-files/files/etc/init.d/network @@ -2,7 +2,7 @@ # Copyright (C) 2006 OpenWrt.org START=40 -STOP=40 +STOP=90 boot() { setup_switch() { return 0; } diff --git a/package/base-files/files/etc/init.d/umount b/package/base-files/files/etc/init.d/umount index a4e477e2e..d360afed3 100755 --- a/package/base-files/files/etc/init.d/umount +++ b/package/base-files/files/etc/init.d/umount @@ -4,5 +4,5 @@ STOP=99 stop() { sync - umount -a -r + umount -a -r -l } diff --git a/package/base-files/files/lib/preinit/10_check_for_mtd b/package/base-files/files/lib/preinit/10_check_for_mtd index e1f3c07a2..66f185e1a 100644 --- a/package/base-files/files/lib/preinit/10_check_for_mtd +++ b/package/base-files/files/lib/preinit/10_check_for_mtd @@ -10,7 +10,7 @@ mount_no_mtd() { check_for_mtd() { check_skip || { - grep rootfs_data /proc/mtd >/dev/null 2>/dev/null || { + grep -qs rootfs_data /proc/mtd || { mount_no_mtd && pi_mount_skip_next=true } } diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index cd3ca5571..ab6930518 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -9,19 +9,19 @@ preinit_ip() { pi_ifname=$ifname fi - [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up } } preinit_ip_deconfig() { - [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { ifconfig $pi_ifname 0.0.0.0 down } } preinit_net_echo() { - [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { { [ "$pi_preinit_net_messages" = "y" ] || { [ "$pi_failsafe_net_message" = "true" ] && diff --git a/package/base-files/files/lib/preinit/20_device_fs_mount b/package/base-files/files/lib/preinit/20_device_fs_mount index 6b2a6e8f3..f82f9a6f4 100644 --- a/package/base-files/files/lib/preinit/20_device_fs_mount +++ b/package/base-files/files/lib/preinit/20_device_fs_mount @@ -15,7 +15,7 @@ do_mount_udev() { } choose_device_fs() { - if grep devfs /proc/filesystems > /dev/null; then + if grep -q devfs /proc/filesystems; then do_mount_devfs elif [ -x /sbin/hotplug2 ]; then do_mount_hotplug diff --git a/package/base-files/files/lib/preinit/30_device_fs_daemons b/package/base-files/files/lib/preinit/30_device_fs_daemons index 5a3aaf3d6..5b3e2ad00 100644 --- a/package/base-files/files/lib/preinit/30_device_fs_daemons +++ b/package/base-files/files/lib/preinit/30_device_fs_daemons @@ -23,7 +23,7 @@ init_udev() { init_device_fs() { HOTPLUG= - if grep devfs /proc/filesystems > /dev/null; then + if grep -q devfs /proc/filesystems; then init_devfs elif [ -x /sbin/hotplug2 ]; then init_hotplug2 diff --git a/package/base-files/files/lib/preinit/50_choose_console b/package/base-files/files/lib/preinit/50_choose_console index 346479640..ecbc2eaf4 100644 --- a/package/base-files/files/lib/preinit/50_choose_console +++ b/package/base-files/files/lib/preinit/50_choose_console @@ -7,7 +7,7 @@ choose_console() { # that's why we use /dev/pty/m0 and m1 (or equivalent) as replacement # for /dev/console if there's no serial console available - if grep devfs /proc/filesystems > /dev/null; then + if grep -q devfs /proc/filesystems; then M0=/dev/pty/m0 M1=/dev/pty/m1 M2=/dev/pty/m1 diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 7c77c0b2a..e21ea6ba9 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -84,7 +84,10 @@ wifi_fixup_hwmode() { } wifi_updown() { - [ enable = "$1" ] && wifi_updown disable "$2" + [ enable = "$1" ] && { + wifi_updown disable "$2" + scan_wifi + } for device in ${2:-$DEVICES}; do ( config_get disabled "$device" disabled [ 1 == "$disabled" ] && { @@ -134,7 +137,7 @@ set_wifi_down() { local vifs vif vifstr [ -f "/var/run/wifi-${cfg}.pid" ] && - kill "$(cat "/var/run/wifi-${cfg}.pid")" + kill "$(cat "/var/run/wifi-${cfg}.pid")" 2>/dev/null uci_revert_state wireless "$cfg" config_get vifs "$cfg" vifs for vif in $vifs; do @@ -144,11 +147,13 @@ set_wifi_down() { scan_wifi() { local cfgfile="$1" + DEVICES= config_cb() { config_get TYPE "$CONFIG_SECTION" TYPE case "$TYPE" in wifi-device) append DEVICES "$CONFIG_SECTION" + config_set "$CONFIG_SECTION" vifs "" ;; wifi-iface) config_get device "$CONFIG_SECTION" device diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script index b32b2c9f2..f704a7bf2 100755 --- a/package/base-files/files/usr/share/udhcpc/default.script +++ b/package/base-files/files/usr/share/udhcpc/default.script @@ -31,7 +31,8 @@ setup_interface () { config_get old_subnet "$ifc" netmask } - [ "$ip" != "$old_ip" ] \ + [ "$1" = "ifup" ] \ + || [ "$ip" != "$old_ip" ] \ || [ "${broadcast:-+}" != "$old_broadcast" ] \ || [ "${subnet:-255.255.255.0}" != "$old_subnet" ] && { echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}" diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh index 75f8b085b..c444ce8fd 100644 --- a/package/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh @@ -335,9 +335,9 @@ EOF detect_broadcom() { - local i=0 + local i=-1 - while [ -f /proc/net/wl$((i++)) ]; do + while [ -f /proc/net/wl$((++i)) ]; do config_get type wl${i} type [ "$type" = broadcom ] && continue cat < endef define Package/hostapd @@ -116,6 +117,7 @@ define Package/wpad/Default TITLE:=IEEE 802.1x Authenticator/Supplicant URL:=http://hostap.epitest.fi/ DEPENDS:=@!TARGET_avr32 @!TARGET_etrax +PACKAGE_kmod-mac80211:libnl-tiny + MAINTAINER:=Felix Fietkau endef define Package/wpad @@ -146,6 +148,7 @@ define Package/wpa-supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ DEPENDS:=@!TARGET_avr32 @!TARGET_etrax +PACKAGE_kmod-mac80211:libnl-tiny VARIANT:=supplicant-full + MAINTAINER:=Felix Fietkau endef define Package/wpa-supplicant/Description @@ -172,6 +175,7 @@ define Package/wpa-cli CATEGORY:=Network DEPENDS:=wpa-supplicant TITLE:=WPA Supplicant command line interface + MAINTAINER:=Felix Fietkau endef define Package/wpa-cli/Description diff --git a/package/hostapd/patches/150-mbss_driver_handling.patch b/package/hostapd/patches/150-mbss_driver_handling.patch index ccae4e6db..6c55b4095 100644 --- a/package/hostapd/patches/150-mbss_driver_handling.patch +++ b/package/hostapd/patches/150-mbss_driver_handling.patch @@ -735,7 +735,7 @@ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr); NLA_PUT_U32(msg, NL80211_ATTR_STA_VLAN, if_nametoindex(ifname)); -@@ -4181,10 +4174,11 @@ static int i802_set_sta_vlan(void *priv, +@@ -4181,18 +4174,19 @@ static int i802_set_sta_vlan(void *priv, static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val) { @@ -747,9 +747,10 @@ - os_snprintf(name, sizeof(name), "%s.sta%d", drv->ifname, aid); + os_snprintf(name, sizeof(name), "%s.sta%d", bss->ifname, aid); if (val) { - if (nl80211_create_iface(priv, name, NL80211_IFTYPE_AP_VLAN, +- if (nl80211_create_iface(priv, name, NL80211_IFTYPE_AP_VLAN, ++ if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, NULL, 1) < 0) -@@ -4192,7 +4186,7 @@ static int i802_set_wds_sta(void *priv, + return -1; linux_set_iface_flags(drv->ioctl_sock, name, 1); return i802_set_sta_vlan(priv, addr, name, 0); } else { @@ -902,8 +903,12 @@ return -1; } -@@ -4484,9 +4483,12 @@ static int wpa_driver_nl80211_if_add(con - os_free(bss); +@@ -4481,12 +4480,15 @@ static int wpa_driver_nl80211_if_add(con + if (type == WPA_IF_AP_BSS) { + if (linux_set_iface_flags(drv->ioctl_sock, ifname, 1)) { + nl80211_remove_iface(drv, ifidx); +- os_free(bss); ++ os_free(new_bss); return -1; } - bss->ifindex = ifidx; diff --git a/package/kernel/modules/netsupport.mk b/package/kernel/modules/netsupport.mk index 21abc4c86..9e9cdcbb6 100644 --- a/package/kernel/modules/netsupport.mk +++ b/package/kernel/modules/netsupport.mk @@ -43,6 +43,29 @@ endef $(eval $(call KernelPackage,atmtcp)) +define KernelPackage/appletalk + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Appletalk protocol support + DEPENDS:=@LINUX_2_6 + KCONFIG:= \ + CONFIG_ATALK \ + CONFIG_DEV_APPLETALK \ + CONFIG_IPDDP \ + CONFIG_IPDDP_ENCAP=y \ + CONFIG_IPDDP_DECAP=y + FILES:= \ + $(LINUX_DIR)/net/appletalk/appletalk.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/net/appletalk/ipddp.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,40,appletalk ipddp) +endef + +define KernelPackage/appletalk/description + Kernel module for AppleTalk protocol. +endef + +$(eval $(call KernelPackage,appletalk)) + + define KernelPackage/bonding SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Ethernet bonding driver diff --git a/package/kernel/modules/other.mk b/package/kernel/modules/other.mk index f6c73c049..47fee9f53 100644 --- a/package/kernel/modules/other.mk +++ b/package/kernel/modules/other.mk @@ -785,6 +785,24 @@ endef $(eval $(call KernelPackage,cs5535-gpio)) +define KernelPackage/ixp4xx-beeper + SUBMENU:=$(OTHER_MENU) + TITLE:=IXP4XX Beeper support + DEPENDS:=@TARGET_ixp4xx +kmod-input-core + KCONFIG:= \ + CONFIG_INPUT_MISC=y \ + CONFIG_INPUT_IXP4XX_BEEPER + FILES:=$(LINUX_DIR)/drivers/input/misc/ixp4xx-beeper.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,50,ixp4xx-beeper) +endef + +define KernelPackage/ixp4xx-beeper/description + IXP4XX Beeper support +endef + +$(eval $(call KernelPackage,ixp4xx-beeper)) + + define KernelPackage/textsearch SUBMENU:=$(OTHER_MENU) TITLE:=Textsearch support is selected if needed diff --git a/package/libtool/patches/100-libdir_path.patch b/package/libtool/patches/100-libdir_path.patch index 08c4c6806..1132c3816 100644 --- a/package/libtool/patches/100-libdir_path.patch +++ b/package/libtool/patches/100-libdir_path.patch @@ -10,6 +10,15 @@ (rm -f $@ && cp ltmain.shT $@ && rm -f ltmain.shT) --- a/ltmain.in +++ b/ltmain.in +@@ -2827,7 +2827,7 @@ EOF + fi + else + # We cannot seem to hardcode it, guess we'll fake it. +- add_dir="-L$libdir" ++ add_dir="-L@GLOBAL_LIBDIR@" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in @@ -5669,7 +5669,7 @@ fi\ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index 99b771948..4e98a5dc0 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2010-01-25 -PKG_RELEASE:=2 +PKG_VERSION:=2010-02-02 +PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources # http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \ # http://wireless.kernel.org/download/compat-wireless-2.6 -PKG_MD5SUM:=66a1d519e7ebcbadd4e47e6e56f705af +PKG_MD5SUM:=32602171b840132cbaa62d4b67f32d2c PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) @@ -33,6 +33,7 @@ WMENU:=Wireless Drivers define KernelPackage/mac80211/Default SUBMENU:=$(WMENU) URL:=http://linuxwireless.org/ + MAINTAINER:=Felix Fietkau DEPENDS:=@LINUX_2_6 @!TARGET_avr32 @(!(TARGET_ep93xx||TARGET_ps3||TARGET_pxcab)||BROKEN) endef diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 44082aa99..62b8e7ed3 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -247,6 +247,7 @@ enable_mac80211() { # Hostapd will handle recreating the interface and # it's accompanying monitor apidx="$(($apidx + 1))" + i=$(($i + 1)) [ "$apidx" -gt 1 ] || iw phy "$phy" interface add "$ifname" type managed ;; mesh) diff --git a/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch b/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch index c41495175..bb3796ab0 100644 --- a/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch +++ b/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch @@ -8,7 +8,7 @@ #include #include "hw.h" -@@ -437,8 +438,18 @@ static int ath9k_hw_init_macaddr(struct +@@ -441,8 +442,18 @@ static int ath9k_hw_init_macaddr(struct common->macaddr[2 * i] = eeval >> 8; common->macaddr[2 * i + 1] = eeval & 0xff; } diff --git a/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch b/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch index 2f33d2e20..e9bd60447 100644 --- a/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch +++ b/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch @@ -8,7 +8,7 @@ #include "ath9k.h" static struct pci_device_id ath_pci_id_table[] __devinitdata = { -@@ -61,21 +62,36 @@ static void ath_pci_cleanup(struct ath_c +@@ -52,21 +53,36 @@ static void ath_pci_read_cachesize(struc static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) { diff --git a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch index a83242f91..799c1186f 100644 --- a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch +++ b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -381,11 +381,8 @@ static void ath9k_hw_init_defaults(struc +@@ -385,11 +385,8 @@ static void ath9k_hw_init_defaults(struc ah->hw_version.magic = AR5416_MAGIC; ah->hw_version.subvendorid = 0; diff --git a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch index dae663dd7..c92cd17e0 100644 --- a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch +++ b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch @@ -11,7 +11,7 @@ #include "hw.h" #include "rc.h" #include "initvals.h" -@@ -424,17 +426,23 @@ static int ath9k_hw_rf_claim(struct ath_ +@@ -428,17 +430,23 @@ static int ath9k_hw_rf_claim(struct ath_ static int ath9k_hw_init_macaddr(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); diff --git a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch index 72d638e9f..949a9a7e2 100644 --- a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch +++ b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2087,7 +2087,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2092,7 +2092,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st if (ah->config.rx_intr_mitigation) { REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500); diff --git a/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch b/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch index 7d043d693..eaed50091 100644 --- a/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch +++ b/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch @@ -1,8 +1,8 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -75,6 +75,90 @@ static const struct file_operations fops +@@ -77,6 +77,90 @@ static const struct file_operations fops - #endif + #define DMA_BUF_LEN 1024 +static ssize_t read_file_tx_chainmask(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) @@ -91,7 +91,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { -@@ -710,6 +794,16 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -719,6 +803,16 @@ int ath9k_init_debug(struct ath_hw *ah) goto err; #endif @@ -108,7 +108,7 @@ sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_dma); if (!sc->debug.debugfs_dma) -@@ -760,6 +854,8 @@ void ath9k_exit_debug(struct ath_hw *ah) +@@ -769,6 +863,8 @@ void ath9k_exit_debug(struct ath_hw *ah) struct ath_common *common = ath9k_hw_common(ah); struct ath_softc *sc = (struct ath_softc *) common->priv; diff --git a/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch b/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch index 02e4cac37..dda4b88e8 100644 --- a/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch +++ b/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -774,6 +774,86 @@ static const struct file_operations fops +@@ -783,6 +783,86 @@ static const struct file_operations fops .owner = THIS_MODULE }; @@ -87,7 +87,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -843,6 +923,17 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -852,6 +932,17 @@ int ath9k_init_debug(struct ath_hw *ah) if (!sc->debug.debugfs_recv) goto err; @@ -105,7 +105,7 @@ return 0; err: ath9k_exit_debug(ah); -@@ -856,6 +947,8 @@ void ath9k_exit_debug(struct ath_hw *ah) +@@ -865,6 +956,8 @@ void ath9k_exit_debug(struct ath_hw *ah) debugfs_remove(sc->debug.debugfs_tx_chainmask); debugfs_remove(sc->debug.debugfs_rx_chainmask); diff --git a/package/mac80211/patches/520-ath9k_ack_timeout_workaround.patch b/package/mac80211/patches/520-ath9k_ack_timeout_workaround.patch index 7b51204a5..398bec8eb 100644 --- a/package/mac80211/patches/520-ath9k_ack_timeout_workaround.patch +++ b/package/mac80211/patches/520-ath9k_ack_timeout_workaround.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1228,6 +1228,11 @@ void ath9k_hw_init_global_settings(struc +@@ -1233,6 +1233,11 @@ void ath9k_hw_init_global_settings(struc /* As defined by IEEE 802.11-2007 17.3.8.6 */ slottime = ah->slottime + 3 * ah->coverage_class; acktimeout = slottime + sifstime; diff --git a/package/mac80211/patches/540-ath9k_fix_eap_handling.patch b/package/mac80211/patches/540-ath9k_fix_eap_handling.patch new file mode 100644 index 000000000..75e5e938c --- /dev/null +++ b/package/mac80211/patches/540-ath9k_fix_eap_handling.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -1610,7 +1610,7 @@ static int ath_tx_setup_buffer(struct ie + bf->bf_frmlen -= padsize; + } + +- if (conf_is_ht(&hw->conf) && !is_pae(skb)) ++ if (conf_is_ht(&hw->conf)) + bf->bf_state.bf_type |= BUF_HT; + + bf->bf_flags = setup_tx_flags(sc, skb, txctl->txq); +@@ -1696,7 +1696,7 @@ static void ath_tx_start_dma(struct ath_ + goto tx_done; + } + +- if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { ++ if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && !is_pae(skb)) { + /* + * Try aggregation if it's a unicast data frame + * and the destination is HT capable. diff --git a/package/madwifi/Makefile b/package/madwifi/Makefile index 79a3b3f87..73167d37e 100644 --- a/package/madwifi/Makefile +++ b/package/madwifi/Makefile @@ -161,6 +161,7 @@ define KernelPackage/madwifi SUBMENU:=Wireless Drivers TITLE:=Driver for Atheros wireless chipsets URL:=http://madwifi-project.org/ + MAINTAINER:=Felix Fietkau DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_avr32 @!TARGET_etrax @!TARGET_sibyte @!TARGET_cobalt @!TARGET_octeon @LINUX_2_6 @(!(TARGET_ep93xx||TARGET_pxcab)||BROKEN) FILES:=$(MADWIFI_FILES) AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD)) diff --git a/package/nvram/Makefile b/package/nvram/Makefile index c2270714f..f5eba9e2b 100644 --- a/package/nvram/Makefile +++ b/package/nvram/Makefile @@ -18,7 +18,7 @@ define Package/nvram SECTION:=utils CATEGORY:=Base system TITLE:=Userspace port of the Broadcom NVRAM manipulation tool - DEPENDS:=@TARGET_brcm_2_4||@TARGET_brcm47xx + DEPENDS:=@TARGET_brcm_2_4||@TARGET_brcm47xx||@TARGET_ar71xx endef define Package/nvram/description diff --git a/package/nvram/src/nvram.c b/package/nvram/src/nvram.c index ed3da4312..7ab8c81ab 100644 --- a/package/nvram/src/nvram.c +++ b/package/nvram/src/nvram.c @@ -2,7 +2,7 @@ * NVRAM variable manipulation (common) * * Copyright 2004, Broadcom Corporation - * Copyright 2009, OpenWrt.org + * Copyright 2009-2010, OpenWrt.org * All Rights Reserved. * * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY @@ -357,7 +357,7 @@ nvram_handle_t * nvram_open(const char *file, int rdonly) { char *mmap_area = (char *) mmap( NULL, nvram_erase_size, PROT_READ | PROT_WRITE, - ( rdonly == NVRAM_RO ) ? MAP_PRIVATE : MAP_SHARED, fd, 0); + (( rdonly == NVRAM_RO ) ? MAP_PRIVATE : MAP_SHARED) | MAP_LOCKED, fd, 0); if( mmap_area != MAP_FAILED ) { diff --git a/package/wprobe/Makefile b/package/wprobe/Makefile index 85667b771..9e0b11adb 100644 --- a/package/wprobe/Makefile +++ b/package/wprobe/Makefile @@ -30,6 +30,7 @@ define KernelPackage/wprobe $(call Package/wprobe/Default) SUBMENU:=Network Support TITLE:=Wireless driver probe infrastructure + MAINTAINER:=Felix Fietkau FILES:= \ $(PKG_BUILD_DIR)/kernel/wprobe.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,01,wprobe) diff --git a/package/wprobe/src/user/wprobe-lib.c b/package/wprobe/src/user/wprobe-lib.c index 7ba67cfcb..7a5460bb0 100644 --- a/package/wprobe/src/user/wprobe-lib.c +++ b/package/wprobe/src/user/wprobe-lib.c @@ -560,7 +560,9 @@ wprobe_msg_to_network(int socket, struct nl_msg *msg) mhdr.status = WPROBE_MSG_DATA; mhdr.len = buflen; wprobe_swap_msg_hdr(&mhdr); - write(socket, &mhdr, sizeof(mhdr)); + ret = write(socket, &mhdr, sizeof(mhdr)); + if (ret < 0) + goto out; memcpy(buf, nlh, buflen); nlh = buf; @@ -572,6 +574,8 @@ wprobe_msg_to_network(int socket, struct nl_msg *msg) swap_genlmsghdr(gnlh); swap_nlmsghdr(nlh); ret = write(socket, buf, buflen); + +out: free(buf); return ret; diff --git a/target/linux/amazon/Makefile b/target/linux/amazon/Makefile index 826937a5f..aae39a00e 100644 --- a/target/linux/amazon/Makefile +++ b/target/linux/amazon/Makefile @@ -18,12 +18,4 @@ define Target/Description Build firmware images for Infineon Amazon boards endef -ifeq ($(KERNEL_PATCHVER),2.6.30) - define Kernel/Prepare - $(call Kernel/Prepare/Default) - mv $(LINUX_DIR)/include/asm-mips/mach-amazon $(LINUX_DIR)/arch/mips/include/asm/mach-amazon - mv $(LINUX_DIR)/drivers/char/watchdog/amazon_wdt.c $(LINUX_DIR)/drivers/watchdog/amazon_wdt.c - endef -endif - $(eval $(call BuildTarget)) diff --git a/target/linux/amazon/config-2.6.21 b/target/linux/amazon/config-2.6.32 similarity index 62% rename from target/linux/amazon/config-2.6.21 rename to target/linux/amazon/config-2.6.32 index cfe6fa540..d68558c7f 100644 --- a/target/linux/amazon/config-2.6.21 +++ b/target/linux/amazon/config-2.6.32 @@ -1,28 +1,42 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set -# CONFIG_64BIT_PHYS_ADDR is not set CONFIG_ADM6996_SUPPORT=y +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_AMAZON=y CONFIG_AMAZON_ASC_UART=y CONFIG_AMAZON_MTD=y CONFIG_AMAZON_NET_SW=y CONFIG_AMAZON_PCI=y CONFIG_AMAZON_WDT=y -CONFIG_AMAZON=y +# CONFIG_AR7 is not set # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set CONFIG_BITREVERSE=y +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +CONFIG_CEVT_R4K=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 init=/bin/sh" CONFIG_CPU_BIG_ENDIAN=y -CONFIG_CPU_HAS_LLSC=y +# CONFIG_CPU_CAVIUM_OCTEON is not set CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y # CONFIG_CPU_LITTLE_ENDIAN is not set -CONFIG_CPU_MIPS32_R1=y -# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_LOONGSON2E is not set CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y # CONFIG_CPU_MIPS64_R1 is not set # CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_MIPSR1=y +CONFIG_CPU_MIPSR2=y # CONFIG_CPU_NEVADA is not set # CONFIG_CPU_R10000 is not set # CONFIG_CPU_R3000 is not set @@ -30,6 +44,7 @@ CONFIG_CPU_MIPSR1=y # CONFIG_CPU_R4X00 is not set # CONFIG_CPU_R5000 is not set # CONFIG_CPU_R5432 is not set +# CONFIG_CPU_R5500 is not set # CONFIG_CPU_R6000 is not set # CONFIG_CPU_R8000 is not set # CONFIG_CPU_RM7000 is not set @@ -40,59 +55,52 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y # CONFIG_CPU_TX39XX is not set # CONFIG_CPU_TX49XX is not set # CONFIG_CPU_VR41XX is not set -# CONFIG_DDB5477 is not set +CONFIG_CSRC_R4K=y +CONFIG_CSRC_R4K_LIB=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DEVPORT=y # CONFIG_DM9000 is not set CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y +# CONFIG_FSNOTIFY is not set +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y -# CONFIG_GENERIC_GPIO is not set -# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set -# CONFIG_GEN_RTC is not set +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_STD_PC_SERIAL_PORT=y CONFIG_HW_HAS_PCI=y CONFIG_HW_RANDOM=y -# CONFIG_IDE is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQ_CPU=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_KALLSYMS=y +# CONFIG_MACH_ALCHEMY is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set -# CONFIG_MIPS_ATLAS is not set -# CONFIG_MIPS_BOSPORUS is not set +# CONFIG_MIKROTIK_RB532 is not set +CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set -# CONFIG_MIPS_DB1000 is not set -# CONFIG_MIPS_DB1100 is not set -# CONFIG_MIPS_DB1200 is not set -# CONFIG_MIPS_DB1500 is not set -# CONFIG_MIPS_DB1550 is not set -# CONFIG_MIPS_EV64120 is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set # CONFIG_MIPS_MALTA is not set -# CONFIG_MIPS_MIRAGE is not set CONFIG_MIPS_MT_DISABLED=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_MT_SMTC is not set -# CONFIG_MIPS_MTX1 is not set -# CONFIG_MIPS_PB1000 is not set -# CONFIG_MIPS_PB1100 is not set -# CONFIG_MIPS_PB1200 is not set -# CONFIG_MIPS_PB1500 is not set -# CONFIG_MIPS_PB1550 is not set -# CONFIG_MIPS_SEAD is not set # CONFIG_MIPS_SIM is not set -# CONFIG_MIPS_VPE_LOADER is not set -# CONFIG_MIPS_XXS1500 is not set -CONFIG_MIPS=y -# CONFIG_MOMENCO_JAGUAR_ATX is not set -# CONFIG_MOMENCO_OCELOT_3 is not set -# CONFIG_MOMENCO_OCELOT_C is not set -# CONFIG_MOMENCO_OCELOT_G is not set -# CONFIG_MOMENCO_OCELOT is not set CONFIG_MTD_AMAZON_BUS_WIDTH_16=y # CONFIG_MTD_AMAZON_BUS_WIDTH_32 is not set # CONFIG_MTD_AMAZON_BUS_WIDTH_8 is not set @@ -103,44 +111,44 @@ CONFIG_MTD_AMAZON_FLASH_SIZE_4=y CONFIG_MTD_CFI_ADV_OPTIONS=y # CONFIG_MTD_CFI_GEOMETRY is not set # CONFIG_MTD_CFI_INTELEXT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set -CONFIG_MTD_PHYSMAP_BANKWIDTH=0 -CONFIG_MTD_PHYSMAP_LEN=0x0 -CONFIG_MTD_PHYSMAP_START=0x0 CONFIG_MTD_PHYSMAP=y CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-3 -# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set CONFIG_MTD_REDBOOT_PARTS=y # CONFIG_NET_PCI is not set -CONFIG_NET_SCH_FIFO=y -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PCI_DOMAINS=y +# CONFIG_PMC_MSP is not set # CONFIG_PMC_YOSEMITE is not set -# CONFIG_PNPACPI is not set # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_STB810 is not set -# CONFIG_RTC is not set -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +# CONFIG_PROBE_INITRD_HEADER is not set +CONFIG_SCHED_OMIT_FRAME_POINTER=y +# CONFIG_SCSI_DMA is not set # CONFIG_SERIAL_8250 is not set # CONFIG_SGI_IP22 is not set # CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set # CONFIG_SGI_IP32 is not set # CONFIG_SIBYTE_BIGSUR is not set # CONFIG_SIBYTE_CARMEL is not set # CONFIG_SIBYTE_CRHINE is not set # CONFIG_SIBYTE_CRHONE is not set # CONFIG_SIBYTE_LITTLESUR is not set -# CONFIG_SIBYTE_PTSWARM is not set # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set +CONFIG_SWAP_IO_SPACE=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y CONFIG_SYS_HAS_EARLY_PRINTK=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -# CONFIG_TOSHIBA_JMR3927 is not set -# CONFIG_TOSHIBA_RBTX4927 is not set -# CONFIG_TOSHIBA_RBTX4938 is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y +CONFIG_USB_SUPPORT=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/amazon/files/arch/mips/amazon/dma-core.c b/target/linux/amazon/files/arch/mips/amazon/dma-core.c index 242bc77af..6362895f8 100644 --- a/target/linux/amazon/files/arch/mips/amazon/dma-core.c +++ b/target/linux/amazon/files/arch/mips/amazon/dma-core.c @@ -1387,7 +1387,7 @@ static int dma_init(void) AMAZON_DMA_EMSG("cannot register device dma-core!\n"); return result; } - result = request_irq(AMAZON_DMA_INT, dma_interrupt, SA_INTERRUPT, "dma-core", (void *) &dma_interrupt); + result = request_irq(AMAZON_DMA_INT, dma_interrupt, IRQF_DISABLED, "dma-core", (void *) &dma_interrupt); if (result) { AMAZON_DMA_EMSG("error, cannot get dma_irq!\n"); free_irq(AMAZON_DMA_INT, (void *) &dma_interrupt); diff --git a/target/linux/amazon/files/arch/mips/amazon/interrupt.c b/target/linux/amazon/files/arch/mips/amazon/interrupt.c index 5e34e0577..e264ca759 100644 --- a/target/linux/amazon/files/arch/mips/amazon/interrupt.c +++ b/target/linux/amazon/files/arch/mips/amazon/interrupt.c @@ -109,8 +109,8 @@ static void amazon_end_irq(unsigned int irq) } } -static struct hw_interrupt_type amazon_irq_type = { - "AMAZON", +static struct irq_chip amazon_irq_type = { + .name = "AMAZON", .startup = amazon_startup_irq, .enable = amazon_enable_irq, .disable = amazon_disable_irq, @@ -157,7 +157,7 @@ out: static struct irqaction cascade = { .handler = no_action, - .flags = SA_INTERRUPT, + .flags = IRQF_DISABLED, .name = "cascade", }; @@ -177,10 +177,16 @@ void __init arch_init_irq(void) setup_irq(i, &cascade); } - for (i = INT_NUM_IRQ0; i <= INT_NUM_IM4_IRL31; i++) { - irq_desc[i].status = IRQ_DISABLED; - irq_desc[i].action = 0; - irq_desc[i].depth = 1; - set_irq_chip(i, &amazon_irq_type); - } + for (i = INT_NUM_IRQ0; i <= INT_NUM_IM4_IRL31; i++) + set_irq_chip_and_handler(i, &amazon_irq_type, + handle_level_irq); + + set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5); +} + +void __cpuinit arch_fixup_c0_irqs(void) +{ + /* FIXME: check for CPUID and only do fix for specific chips/versions */ + cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; + cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ; } diff --git a/target/linux/amazon/files/arch/mips/amazon/prom.c b/target/linux/amazon/files/arch/mips/amazon/prom.c index c5db4f5cd..3095fd50b 100644 --- a/target/linux/amazon/files/arch/mips/amazon/prom.c +++ b/target/linux/amazon/files/arch/mips/amazon/prom.c @@ -39,33 +39,12 @@ void prom_putchar(char c) amazon_writel(c, AMAZON_ASC_TBUF); } -void prom_printf(const char * fmt, ...) -{ - va_list args; - int l; - char *p, *buf_end; - char buf[1024]; - - va_start(args, fmt); - /* FIXME - hopefully i < sizeof(buf) */ - l = vsprintf(buf, fmt, args); - va_end(args); - buf_end = buf + l; - - for (p = buf; p < buf_end; p++) - prom_putchar(*p); -} - - void __init prom_init(void) { char **envp = (char **) fw_arg2; int memsize = 16; /* assume 16M as default */ - mips_machgroup = MACH_GROUP_INFINEON; - mips_machtype = MACH_INFINEON_AMAZON; - envp = (char **)KSEG1ADDR((unsigned long)envp); while (*envp) { char *e = (char *)KSEG1ADDR(*envp); diff --git a/target/linux/amazon/files/arch/mips/amazon/setup.c b/target/linux/amazon/files/arch/mips/amazon/setup.c index 45ff2544f..ff1a109d4 100644 --- a/target/linux/amazon/files/arch/mips/amazon/setup.c +++ b/target/linux/amazon/files/arch/mips/amazon/setup.c @@ -36,7 +36,12 @@ #include #include -extern void prom_printf(const char * fmt, ...); +static unsigned int r4k_offset; +static unsigned int r4k_cur; + +/* required in arch/mips/kernel/kspd.c */ +unsigned long cpu_khz; + static void amazon_reboot_setup(void); /* the CPU clock rate - lifted from u-boot */ @@ -81,6 +86,7 @@ unsigned int amazon_get_fpi_hz(void) /* '11' is reserved */ } } +EXPORT_SYMBOL(amazon_get_fpi_hz); /* this doesn't really belong here, but it's a convenient location */ unsigned int amazon_get_cpu_ver(void) @@ -91,35 +97,32 @@ unsigned int amazon_get_cpu_ver(void) return cpu_ver; } -void amazon_time_init(void) +static inline u32 amazon_get_counter_resolution(void) { - mips_hpt_frequency = amazon_get_cpu_hz()/2; + u32 res; + __asm__ __volatile__( + ".set push\n" + ".set mips32r2\n" + ".set noreorder\n" + "rdhwr %0, $3\n" + "ehb\n" + ".set pop\n" + : "=&r" (res) + : /* no input */ + : "memory"); + instruction_hazard(); + return res; +} + +void __init plat_time_init(void) +{ + mips_hpt_frequency = amazon_get_cpu_hz() / amazon_get_counter_resolution(); + r4k_offset = mips_hpt_frequency / HZ; printk("mips_hpt_frequency:%d\n", mips_hpt_frequency); -} + printk("r4k_offset: %08x(%d)\n", r4k_offset, r4k_offset); -extern int hr_time_resolution; - -/* ISR GPTU Timer 6 for high resolution timer */ -static void amazon_timer6_interrupt(int irq, void *dev_id) -{ - timer_interrupt(AMAZON_TIMER6_INT, NULL); -} - -static struct irqaction hrt_irqaction = { - .handler = amazon_timer6_interrupt, - .flags = SA_INTERRUPT, - .name = "hrt", -}; - -/* - * THe CPU counter for System timer, set to HZ - * GPTU Timer 6 for high resolution timer, set to hr_time_resolution - * Also misuse this routine to print out the CPU type and clock. - */ -void __init plat_timer_setup(struct irqaction *irq) -{ - /* cpu counter for timer interrupts */ - setup_irq(MIPS_CPU_TIMER_IRQ, irq); + r4k_cur = (read_c0_count() + r4k_offset); + write_c0_compare(r4k_cur); /* enable the timer in the PMU */ amazon_writel(amazon_readl(AMAZON_PMU_PWDCR)| AMAZON_PMU_PWDCR_GPT|AMAZON_PMU_PWDCR_FPI, AMAZON_PMU_PWDCR); @@ -139,15 +142,14 @@ void __init plat_mem_setup(void) part_no = AMAZON_MCD_CHIPID_PART_NUMBER_GET(chipid); if(part_no == AMAZON_CHIPID_YANGTSE){ - prom_printf("Yangtse Version\n"); + printk("Yangtse Version\n"); } else if (part_no == AMAZON_CHIPID_STANDARD) { - prom_printf(SYSTEM_MODEL_NAME "\n"); + printk(SYSTEM_MODEL_NAME "\n"); } else { - prom_printf("unknown version %8x\n",part_no); + printk("unknown version %8x\n",part_no); } amazon_reboot_setup(); - board_time_init = amazon_time_init; //stop reset TPE and DFE amazon_writel(0, AMAZON_RST_REQ); diff --git a/target/linux/amazon/files/include/asm-mips/mach-amazon/irq.h b/target/linux/amazon/files/arch/mips/include/asm/mach-amazon/irq.h similarity index 100% rename from target/linux/amazon/files/include/asm-mips/mach-amazon/irq.h rename to target/linux/amazon/files/arch/mips/include/asm/mach-amazon/irq.h diff --git a/target/linux/amazon/files/include/asm-mips/mach-amazon/mangle-port.h b/target/linux/amazon/files/arch/mips/include/asm/mach-amazon/mangle-port.h similarity index 100% rename from target/linux/amazon/files/include/asm-mips/mach-amazon/mangle-port.h rename to target/linux/amazon/files/arch/mips/include/asm/mach-amazon/mangle-port.h diff --git a/target/linux/amazon/files/include/asm-mips/mach-amazon/war.h b/target/linux/amazon/files/arch/mips/include/asm/mach-amazon/war.h similarity index 100% rename from target/linux/amazon/files/include/asm-mips/mach-amazon/war.h rename to target/linux/amazon/files/arch/mips/include/asm/mach-amazon/war.h diff --git a/target/linux/amazon/files/drivers/atm/amazon_tpe.c b/target/linux/amazon/files/drivers/atm/amazon_tpe.c index cf3e40732..b50749440 100644 --- a/target/linux/amazon/files/drivers/atm/amazon_tpe.c +++ b/target/linux/amazon/files/drivers/atm/amazon_tpe.c @@ -2404,13 +2404,13 @@ amazon_atm_dev_t * amazon_atm_create(void) // Register interrupts for insertion and extraction - request_irq(AMAZON_SWIE_INT, amazon_atm_swie_isr, SA_INTERRUPT, "tpe_swie", NULL); - request_irq(AMAZON_CBM_INT, amazon_atm_cbm_isr, SA_INTERRUPT, "tpe_cbm", NULL); + request_irq(AMAZON_SWIE_INT, amazon_atm_swie_isr, IRQF_DISABLED, "tpe_swie", NULL); + request_irq(AMAZON_CBM_INT, amazon_atm_cbm_isr, IRQF_DISABLED, "tpe_cbm", NULL); #ifdef AMAZON_ATM_DEBUG - request_irq(AMAZON_HTU_INT , amazon_atm_htu_isr, SA_INTERRUPT, "tpe_htu", NULL); + request_irq(AMAZON_HTU_INT , amazon_atm_htu_isr, IRQF_DISABLED, "tpe_htu", NULL); #endif #ifdef AMAZON_TPE_TEST_AAL5_INT - request_irq(AMAZON_AAL5_INT, amazon_atm_aal5_isr, SA_INTERRUPT, "tpe_aal5", NULL); + request_irq(AMAZON_AAL5_INT, amazon_atm_aal5_isr, IRQF_DISABLED, "tpe_aal5", NULL); #endif return &g_atm_dev; } diff --git a/target/linux/amazon/files/drivers/net/amazon_sw.c b/target/linux/amazon/files/drivers/net/amazon_sw.c index 1101d840d..54a70622e 100644 --- a/target/linux/amazon/files/drivers/net/amazon_sw.c +++ b/target/linux/amazon/files/drivers/net/amazon_sw.c @@ -778,6 +778,17 @@ int switch_set_mac_address(struct net_device *dev, void *p) return OK; } +static const struct net_device_ops amazon_mii_ops = { + .ndo_init = switch_init, + .ndo_open = switch_open, + .ndo_stop = switch_release, + .ndo_start_xmit = switch_tx, + .ndo_do_ioctl = switch_ioctl, + .ndo_get_stats = switch_stats, + .ndo_change_mtu = switch_change_mtu, + .ndo_set_mac_address = switch_set_mac_address, + .ndo_tx_timeout = switch_tx_timeout, +}; int switch_init(struct net_device *dev) { @@ -787,14 +798,6 @@ int switch_init(struct net_device *dev) struct switch_priv *priv; ether_setup(dev); /* assign some of the fields */ printk(KERN_INFO "amazon_mii0: %s up using ", dev->name); - dev->open = switch_open; - dev->stop = switch_release; - dev->hard_start_xmit = switch_tx; - dev->do_ioctl = switch_ioctl; - dev->get_stats = switch_stats; - dev->change_mtu = switch_change_mtu; - dev->set_mac_address = switch_set_mac_address; - dev->tx_timeout = switch_tx_timeout; dev->watchdog_timeo = timeout; priv = netdev_priv(dev); @@ -836,7 +839,7 @@ static int amazon_mii_probe(struct platform_device *dev) for (i = 0; i < AMAZON_SW_INT_NO; i++) { switch_devs[i] = alloc_etherdev(sizeof(struct switch_priv)); - switch_devs[i]->init = switch_init; + switch_devs[i]->netdev_ops = &amazon_mii_ops; strcpy(switch_devs[i]->name, "eth%d"); priv = (struct switch_priv *) netdev_priv(switch_devs[i]); priv->num = i; diff --git a/target/linux/amazon/files/drivers/serial/amazon_asc.c b/target/linux/amazon/files/drivers/serial/amazon_asc.c index f7fa907b0..449208616 100644 --- a/target/linux/amazon/files/drivers/serial/amazon_asc.c +++ b/target/linux/amazon/files/drivers/serial/amazon_asc.c @@ -68,11 +68,9 @@ #define SERIAL_AMAZONASC_NR UART_NR static void amazonasc_tx_chars(struct uart_port *port); -extern void prom_printf(const char * fmt, ...); static struct uart_port amazonasc_ports[UART_NR]; static struct uart_driver amazonasc_reg; static unsigned int uartclk = 0; -extern unsigned int amazon_get_fpi_hz(void); static void amazonasc_stop_tx(struct uart_port *port) { @@ -108,10 +106,10 @@ static void amazonasc_enable_ms(struct uart_port *port) static void amazonasc_rx_chars(struct uart_port *port) { -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26)) - struct tty_struct *tty = port->info->port.tty; +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 31)) + struct tty_struct *tty = port->state->port.tty; #else - struct tty_struct *tty = port->info->tty; + struct tty_struct *tty = port->info->port.tty; #endif unsigned int ch = 0, rsr = 0, fifocnt; @@ -169,7 +167,11 @@ amazonasc_rx_chars(struct uart_port *port) static void amazonasc_tx_chars(struct uart_port *port) { +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 31)) + struct circ_buf *xmit = &port->state->xmit; +#else struct circ_buf *xmit = &port->info->xmit; +#endif if (uart_tx_stopped(port)) { amazonasc_stop_tx(port); @@ -654,13 +656,6 @@ static struct console amazonasc_console = { data: &amazonasc_reg, }; -static int __init amazonasc_console_init(void) -{ - register_console(&amazonasc_console); - return 0; -} -console_initcall(amazonasc_console_init); - static struct uart_driver amazonasc_reg = { .owner = THIS_MODULE, .driver_name = "serial", @@ -679,7 +674,7 @@ static int __init amazon_asc_probe(struct platform_device *dev) return res; } -static int __exit amazon_asc_remove(struct platform_device *dev) +static int amazon_asc_remove(struct platform_device *dev) { uart_unregister_driver(&amazonasc_reg); return 0; diff --git a/target/linux/amazon/files/drivers/char/watchdog/amazon_wdt.c b/target/linux/amazon/files/drivers/watchdog/amazon_wdt.c similarity index 99% rename from target/linux/amazon/files/drivers/char/watchdog/amazon_wdt.c rename to target/linux/amazon/files/drivers/watchdog/amazon_wdt.c index 6e1eb799a..fcf1649d8 100644 --- a/target/linux/amazon/files/drivers/char/watchdog/amazon_wdt.c +++ b/target/linux/amazon/files/drivers/watchdog/amazon_wdt.c @@ -44,7 +44,6 @@ #undef AMAZON_WDT_DEBUG -extern unsigned int amazon_get_fpi_hz(void); static int amazon_wdt_isopen = 0; #ifdef AMAZON_WDT_DEBUG diff --git a/target/linux/amazon/files/include/asm-mips/amazon/amazon.h b/target/linux/amazon/files/include/asm-mips/amazon/amazon.h index 1ec3c3b99..28af7f59d 100644 --- a/target/linux/amazon/files/include/asm-mips/amazon/amazon.h +++ b/target/linux/amazon/files/include/asm-mips/amazon/amazon.h @@ -29,6 +29,8 @@ #define amazon_writel(a,b) __raw_writel(a, ((u32*)(b))) #define amazon_writel_masked(a,b,c) __raw_writel((__raw_readl(((u32*)(a))) & ~b) | (c & b), ((u32*)(a))) +unsigned int amazon_get_fpi_hz(void); + #define IOPORT_RESOURCE_START 0x10000000 #define IOPORT_RESOURCE_END 0xffffffff #define IOMEM_RESOURCE_START 0x10000000 diff --git a/target/linux/amazon/patches-2.6.30/200-fix_deprecated_interrupt_definations.patch b/target/linux/amazon/patches-2.6.30/200-fix_deprecated_interrupt_definations.patch deleted file mode 100644 index 3c683e03c..000000000 --- a/target/linux/amazon/patches-2.6.30/200-fix_deprecated_interrupt_definations.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- a/arch/mips/amazon/dma-core.c -+++ b/arch/mips/amazon/dma-core.c -@@ -1387,7 +1387,7 @@ static int dma_init(void) - AMAZON_DMA_EMSG("cannot register device dma-core!\n"); - return result; - } -- result = request_irq(AMAZON_DMA_INT, dma_interrupt, SA_INTERRUPT, "dma-core", (void *) &dma_interrupt); -+ result = request_irq(AMAZON_DMA_INT, dma_interrupt, IRQF_DISABLED, "dma-core", (void *) &dma_interrupt); - if (result) { - AMAZON_DMA_EMSG("error, cannot get dma_irq!\n"); - free_irq(AMAZON_DMA_INT, (void *) &dma_interrupt); ---- a/arch/mips/amazon/interrupt.c -+++ b/arch/mips/amazon/interrupt.c -@@ -157,7 +157,7 @@ out: - - static struct irqaction cascade = { - .handler = no_action, -- .flags = SA_INTERRUPT, -+ .flags = IRQF_DISABLED, - .name = "cascade", - }; - ---- a/arch/mips/amazon/setup.c -+++ b/arch/mips/amazon/setup.c -@@ -107,7 +107,7 @@ static void amazon_timer6_interrupt(int - - static struct irqaction hrt_irqaction = { - .handler = amazon_timer6_interrupt, -- .flags = SA_INTERRUPT, -+ .flags = IRQF_DISABLED, - .name = "hrt", - }; - ---- a/drivers/atm/amazon_tpe.c -+++ b/drivers/atm/amazon_tpe.c -@@ -2404,13 +2404,13 @@ amazon_atm_dev_t * amazon_atm_create(voi - - - // Register interrupts for insertion and extraction -- request_irq(AMAZON_SWIE_INT, amazon_atm_swie_isr, SA_INTERRUPT, "tpe_swie", NULL); -- request_irq(AMAZON_CBM_INT, amazon_atm_cbm_isr, SA_INTERRUPT, "tpe_cbm", NULL); -+ request_irq(AMAZON_SWIE_INT, amazon_atm_swie_isr, IRQF_DISABLED, "tpe_swie", NULL); -+ request_irq(AMAZON_CBM_INT, amazon_atm_cbm_isr, IRQF_DISABLED, "tpe_cbm", NULL); - #ifdef AMAZON_ATM_DEBUG -- request_irq(AMAZON_HTU_INT , amazon_atm_htu_isr, SA_INTERRUPT, "tpe_htu", NULL); -+ request_irq(AMAZON_HTU_INT , amazon_atm_htu_isr, IRQF_DISABLED, "tpe_htu", NULL); - #endif - #ifdef AMAZON_TPE_TEST_AAL5_INT -- request_irq(AMAZON_AAL5_INT, amazon_atm_aal5_isr, SA_INTERRUPT, "tpe_aal5", NULL); -+ request_irq(AMAZON_AAL5_INT, amazon_atm_aal5_isr, IRQF_DISABLED, "tpe_aal5", NULL); - #endif - return &g_atm_dev; - } diff --git a/target/linux/amazon/patches-2.6.30/210-remove_unnedded_variables.patch b/target/linux/amazon/patches-2.6.30/210-remove_unnedded_variables.patch deleted file mode 100644 index 3683a2732..000000000 --- a/target/linux/amazon/patches-2.6.30/210-remove_unnedded_variables.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/arch/mips/amazon/prom.c -+++ b/arch/mips/amazon/prom.c -@@ -63,9 +63,6 @@ void __init prom_init(void) - - int memsize = 16; /* assume 16M as default */ - -- mips_machgroup = MACH_GROUP_INFINEON; -- mips_machtype = MACH_INFINEON_AMAZON; -- - envp = (char **)KSEG1ADDR((unsigned long)envp); - while (*envp) { - char *e = (char *)KSEG1ADDR(*envp); diff --git a/target/linux/amazon/patches-2.6.30/220-fix_timer.patch b/target/linux/amazon/patches-2.6.30/220-fix_timer.patch deleted file mode 100644 index 6408b88f9..000000000 --- a/target/linux/amazon/patches-2.6.30/220-fix_timer.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- a/arch/mips/amazon/setup.c -+++ b/arch/mips/amazon/setup.c -@@ -36,6 +36,12 @@ - #include - #include - -+static unsigned int r4k_offset; -+static unsigned int r4k_cur; -+ -+/* required in arch/mips/kernel/kspd.c */ -+unsigned long cpu_khz; -+ - extern void prom_printf(const char * fmt, ...); - static void amazon_reboot_setup(void); - -@@ -91,35 +97,32 @@ unsigned int amazon_get_cpu_ver(void) - return cpu_ver; - } - --void amazon_time_init(void) -+static inline u32 amazon_get_counter_resolution(void) - { -- mips_hpt_frequency = amazon_get_cpu_hz()/2; -- printk("mips_hpt_frequency:%d\n", mips_hpt_frequency); -+ u32 res; -+ __asm__ __volatile__( -+ ".set push\n" -+ ".set mips32r2\n" -+ ".set noreorder\n" -+ "rdhwr %0, $3\n" -+ "ehb\n" -+ ".set pop\n" -+ : "=&r" (res) -+ : /* no input */ -+ : "memory"); -+ instruction_hazard(); -+ return res; - } - --extern int hr_time_resolution; -- --/* ISR GPTU Timer 6 for high resolution timer */ --static void amazon_timer6_interrupt(int irq, void *dev_id) -+void __init plat_time_init(void) - { -- timer_interrupt(AMAZON_TIMER6_INT, NULL); --} -- --static struct irqaction hrt_irqaction = { -- .handler = amazon_timer6_interrupt, -- .flags = IRQF_DISABLED, -- .name = "hrt", --}; -+ mips_hpt_frequency = amazon_get_cpu_hz() / amazon_get_counter_resolution(); -+ r4k_offset = mips_hpt_frequency / HZ; -+ printk("mips_hpt_frequency:%d\n", mips_hpt_frequency); -+ printk("r4k_offset: %08x(%d)\n", r4k_offset, r4k_offset); - --/* -- * THe CPU counter for System timer, set to HZ -- * GPTU Timer 6 for high resolution timer, set to hr_time_resolution -- * Also misuse this routine to print out the CPU type and clock. -- */ --void __init plat_timer_setup(struct irqaction *irq) --{ -- /* cpu counter for timer interrupts */ -- setup_irq(MIPS_CPU_TIMER_IRQ, irq); -+ r4k_cur = (read_c0_count() + r4k_offset); -+ write_c0_compare(r4k_cur); - - /* enable the timer in the PMU */ - amazon_writel(amazon_readl(AMAZON_PMU_PWDCR)| AMAZON_PMU_PWDCR_GPT|AMAZON_PMU_PWDCR_FPI, AMAZON_PMU_PWDCR); -@@ -147,7 +150,6 @@ void __init plat_mem_setup(void) - } - - amazon_reboot_setup(); -- board_time_init = amazon_time_init; - - //stop reset TPE and DFE - amazon_writel(0, AMAZON_RST_REQ); ---- a/arch/mips/amazon/interrupt.c -+++ b/arch/mips/amazon/interrupt.c -@@ -184,3 +184,10 @@ void __init arch_init_irq(void) - set_irq_chip(i, &amazon_irq_type); - } - } -+ -+void __cpuinit arch_fixup_c0_irqs(void) -+{ -+ /* FIXME: check for CPUID and only do fix for specific chips/versions */ -+ cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; -+ cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ; -+} diff --git a/target/linux/amazon/patches-2.6.30/240-irq_fix.patch b/target/linux/amazon/patches-2.6.30/240-irq_fix.patch deleted file mode 100644 index 151f1b4fc..000000000 --- a/target/linux/amazon/patches-2.6.30/240-irq_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/arch/mips/amazon/interrupt.c -+++ b/arch/mips/amazon/interrupt.c -@@ -177,12 +177,11 @@ void __init arch_init_irq(void) - setup_irq(i, &cascade); - } - -- for (i = INT_NUM_IRQ0; i <= INT_NUM_IM4_IRL31; i++) { -- irq_desc[i].status = IRQ_DISABLED; -- irq_desc[i].action = 0; -- irq_desc[i].depth = 1; -- set_irq_chip(i, &amazon_irq_type); -- } -+ for (i = INT_NUM_IRQ0; i <= INT_NUM_IM4_IRL31; i++) -+ set_irq_chip_and_handler(i, &amazon_irq_type, -+ handle_level_irq); -+ -+ set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5); - } - - void __cpuinit arch_fixup_c0_irqs(void) diff --git a/target/linux/amazon/patches-2.6.32/000-mips-bad-intctl.patch b/target/linux/amazon/patches-2.6.32/000-mips-bad-intctl.patch new file mode 100644 index 000000000..ad3fe9fb3 --- /dev/null +++ b/target/linux/amazon/patches-2.6.32/000-mips-bad-intctl.patch @@ -0,0 +1,32 @@ +--- a/arch/mips/kernel/traps.c ++++ b/arch/mips/kernel/traps.c +@@ -1537,7 +1537,16 @@ void __cpuinit per_cpu_trap_init(void) + */ + if (cpu_has_mips_r2) { + cp0_compare_irq = (read_c0_intctl() >> 29) & 7; ++ if (!cp0_compare_irq) ++ cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; ++ + cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7; ++ if (!cp0_perfcount_irq) ++ cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ; ++ ++ if (arch_fixup_c0_irqs) ++ arch_fixup_c0_irqs(); ++ + if (cp0_perfcount_irq == cp0_compare_irq) + cp0_perfcount_irq = -1; + } else { +--- a/arch/mips/include/asm/irq.h ++++ b/arch/mips/include/asm/irq.h +@@ -158,8 +158,10 @@ extern void free_irqno(unsigned int irq) + * IE7. Since R2 their number has to be read from the c0_intctl register. + */ + #define CP0_LEGACY_COMPARE_IRQ 7 ++#define CP0_LEGACY_PERFCNT_IRQ 7 + + extern int cp0_compare_irq; + extern int cp0_perfcount_irq; ++extern void __weak arch_fixup_c0_irqs(void); + + #endif /* _ASM_IRQ_H */ diff --git a/target/linux/amazon/patches-2.6.32/010-mips_clocksource_init_war.patch b/target/linux/amazon/patches-2.6.32/010-mips_clocksource_init_war.patch new file mode 100644 index 000000000..81eabc6dc --- /dev/null +++ b/target/linux/amazon/patches-2.6.32/010-mips_clocksource_init_war.patch @@ -0,0 +1,33 @@ +--- a/arch/mips/kernel/cevt-r4k.c ++++ b/arch/mips/kernel/cevt-r4k.c +@@ -22,6 +22,22 @@ + + #ifndef CONFIG_MIPS_MT_SMTC + ++/* ++ * Compare interrupt can be routed and latched outside the core, ++ * so a single execution hazard barrier may not be enough to give ++ * it time to clear as seen in the Cause register. 4 time the ++ * pipeline depth seems reasonably conservative, and empirically ++ * works better in configurations with high CPU/bus clock ratios. ++ */ ++ ++#define compare_change_hazard() \ ++ do { \ ++ irq_disable_hazard(); \ ++ irq_disable_hazard(); \ ++ irq_disable_hazard(); \ ++ irq_disable_hazard(); \ ++ } while (0) ++ + static int mips_next_event(unsigned long delta, + struct clock_event_device *evt) + { +@@ -31,6 +47,7 @@ static int mips_next_event(unsigned long + cnt = read_c0_count(); + cnt += delta; + write_c0_compare(cnt); ++ compare_change_hazard(); + res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0; + return res; + } diff --git a/target/linux/amazon/patches-2.6.32/017-wdt-driver.patch b/target/linux/amazon/patches-2.6.32/017-wdt-driver.patch new file mode 100644 index 000000000..433abd51e --- /dev/null +++ b/target/linux/amazon/patches-2.6.32/017-wdt-driver.patch @@ -0,0 +1,10 @@ +--- a/drivers/watchdog/Makefile ++++ b/drivers/watchdog/Makefile +@@ -113,6 +113,7 @@ obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o + obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o + obj-$(CONFIG_AR7_WDT) += ar7_wdt.o + obj-$(CONFIG_TXX9_WDT) += txx9wdt.o ++obj-$(CONFIG_AMAZON_WDT) += amazon_wdt.o + + # PARISC Architecture + diff --git a/target/linux/amazon/patches-2.6.32/100-board.patch b/target/linux/amazon/patches-2.6.32/100-board.patch new file mode 100644 index 000000000..d1d9c471a --- /dev/null +++ b/target/linux/amazon/patches-2.6.32/100-board.patch @@ -0,0 +1,49 @@ +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -96,6 +96,22 @@ config BCM63XX + help + Support for BCM63XX based boards + ++config AMAZON ++ bool "Amazon support (EXPERIMENTAL)" ++ depends on EXPERIMENTAL ++ select DMA_NONCOHERENT ++ select IRQ_CPU ++ select CEVT_R4K ++ select CSRC_R4K ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_HAS_CPU_MIPS32_R2 ++ select HAVE_STD_PC_SERIAL_PORT ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_HAS_EARLY_PRINTK ++ select HW_HAS_PCI ++ select SWAP_IO_SPACE ++ + config MIPS_COBALT + bool "Cobalt Server" + select CEVT_R4K +@@ -673,6 +689,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD + + endchoice + ++source "arch/mips/amazon/Kconfig" + source "arch/mips/alchemy/Kconfig" + source "arch/mips/basler/excite/Kconfig" + source "arch/mips/bcm63xx/Kconfig" +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -296,6 +296,13 @@ cflags-$(CONFIG_SOC_AU1X00) += -I$(srctr + + + # ++# Infineon AMAZON ++# ++core-$(CONFIG_AMAZON) += arch/mips/amazon/ ++cflags-$(CONFIG_AMAZON) += -I$(srctree)/arch/mips/include/asm/mach-amazon ++load-$(CONFIG_AMAZON) += 0xffffffff80002000 ++ ++# + # Cobalt Server + # + core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ diff --git a/target/linux/amazon/patches-2.6.32/130-mtd_drivers.patch b/target/linux/amazon/patches-2.6.32/130-mtd_drivers.patch new file mode 100644 index 000000000..fafd99670 --- /dev/null +++ b/target/linux/amazon/patches-2.6.32/130-mtd_drivers.patch @@ -0,0 +1,7 @@ +--- a/drivers/mtd/maps/Makefile ++++ b/drivers/mtd/maps/Makefile +@@ -61,3 +61,4 @@ obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-asy + obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o + obj-$(CONFIG_MTD_VMU) += vmu-flash.o + obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o ++obj-$(CONFIG_AMAZON_MTD) += amazon.o diff --git a/target/linux/amazon/patches/140-net_drivers.patch b/target/linux/amazon/patches-2.6.32/140-net_drivers.patch similarity index 52% rename from target/linux/amazon/patches/140-net_drivers.patch rename to target/linux/amazon/patches-2.6.32/140-net_drivers.patch index 2b5c1b632..e64908c76 100644 --- a/target/linux/amazon/patches/140-net_drivers.patch +++ b/target/linux/amazon/patches-2.6.32/140-net_drivers.patch @@ -1,9 +1,9 @@ --- a/drivers/net/Makefile +++ b/drivers/net/Makefile -@@ -219,3 +219,6 @@ obj-$(CONFIG_NETCONSOLE) += netconsole.o - obj-$(CONFIG_FS_ENET) += fs_enet/ +@@ -286,3 +286,6 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o + obj-$(CONFIG_SFC) += sfc/ - obj-$(CONFIG_NETXEN_NIC) += netxen/ + obj-$(CONFIG_WIMAX) += wimax/ + +obj-$(CONFIG_AMAZON_NET_SW) += amazon_sw.o +obj-$(CONFIG_ADM6996_SUPPORT) += admmod.o diff --git a/target/linux/amazon/patches/150-serial_driver.patch b/target/linux/amazon/patches-2.6.32/150-serial_driver.patch similarity index 66% rename from target/linux/amazon/patches/150-serial_driver.patch rename to target/linux/amazon/patches-2.6.32/150-serial_driver.patch index 170f86480..8b7741c93 100644 --- a/target/linux/amazon/patches/150-serial_driver.patch +++ b/target/linux/amazon/patches-2.6.32/150-serial_driver.patch @@ -1,10 +1,10 @@ --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile -@@ -5,6 +5,7 @@ +@@ -3,6 +3,7 @@ # obj-$(CONFIG_SERIAL_CORE) += serial_core.o +obj-$(CONFIG_AMAZON_ASC_UART) += amazon_asc.o obj-$(CONFIG_SERIAL_21285) += 21285.o - obj-$(CONFIG_SERIAL_8250) += 8250.o - obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o + + # These Sparc drivers have to appear before others such as 8250 diff --git a/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch b/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch new file mode 100644 index 000000000..bb89f6110 --- /dev/null +++ b/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch @@ -0,0 +1,56 @@ +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1079,6 +1079,9 @@ static int __xipram do_write_oneword(str + int retry_cnt = 0; + + adr += chip->start; ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif + + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr, FL_WRITING); +@@ -1361,7 +1364,11 @@ static int __xipram do_write_buffer(stru + z = 0; + while(z < words * map_bankwidth(map)) { + datum = map_word_load(map, buf); ++#ifdef CONFIG_AMAZON ++ map_write(map, datum, (adr + z) ^ 0x2); ++#else + map_write(map, datum, adr + z); ++#endif + + z += map_bankwidth(map); + buf += map_bankwidth(map); +@@ -1606,6 +1613,9 @@ static int __xipram do_erase_oneblock(st + int ret = 0; + + adr += chip->start; ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif + + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr, FL_ERASING); +@@ -1734,6 +1744,10 @@ static int do_atmel_lock(struct map_info + struct cfi_private *cfi = map->fldrv_priv; + int ret; + ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif ++ + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); + if (ret) +@@ -1770,6 +1784,10 @@ static int do_atmel_unlock(struct map_in + struct cfi_private *cfi = map->fldrv_priv; + int ret; + ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif ++ + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr + chip->start, FL_UNLOCKING); + if (ret) diff --git a/target/linux/amazon/patches/017-wdt-driver.patch b/target/linux/amazon/patches/017-wdt-driver.patch deleted file mode 100644 index ad60b06cd..000000000 --- a/target/linux/amazon/patches/017-wdt-driver.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/char/watchdog/Makefile -+++ b/drivers/char/watchdog/Makefile -@@ -74,6 +74,7 @@ obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o - # MIPS Architecture - obj-$(CONFIG_INDYDOG) += indydog.o - obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o -+obj-$(CONFIG_AMAZON_WDT) += amazon_wdt.o - - # S390 Architecture - diff --git a/target/linux/amazon/patches/100-board.patch b/target/linux/amazon/patches/100-board.patch deleted file mode 100644 index 6c03e70b6..000000000 --- a/target/linux/amazon/patches/100-board.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -159,6 +159,17 @@ config BASLER_EXCITE_PROTOTYPE - note that a kernel built with this option selected will not be - able to run on normal units. - -+config AMAZON -+ bool "Amazon support (EXPERIMENTAL)" -+ depends on EXPERIMENTAL -+ select DMA_NONCOHERENT -+ select IRQ_CPU -+ select SYS_HAS_CPU_MIPS32_R1 -+ select HAVE_STD_PC_SERIAL_PORT -+ select SYS_SUPPORTS_BIG_ENDIAN -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_HAS_EARLY_PRINTK -+ - config MIPS_COBALT - bool "Cobalt Server" - select DMA_NONCOHERENT -@@ -823,6 +834,7 @@ config TOSHIBA_RBTX4938 - - endchoice - -+source "arch/mips/amazon/Kconfig" - source "arch/mips/ddb5xxx/Kconfig" - source "arch/mips/gt64120/ev64120/Kconfig" - source "arch/mips/jazz/Kconfig" ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -267,6 +267,13 @@ libs-$(CONFIG_MIPS_XXS1500) += arch/mips - load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000 - - # -+# Infineon AMAZON -+# -+core-$(CONFIG_AMAZON) += arch/mips/amazon/ -+cflags-$(CONFIG_AMAZON) += -Iinclude/asm-mips/mach-amazon -+load-$(CONFIG_AMAZON) += 0xffffffff80002000 -+ -+# - # Cobalt Server - # - core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ ---- a/include/asm-mips/bootinfo.h -+++ b/include/asm-mips/bootinfo.h -@@ -213,6 +213,12 @@ - #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */ - #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */ - -+/* -+ * Valid machtype for group Infineon -+ */ -+#define MACH_GROUP_INFINEON 27 -+#define MACH_INFINEON_AMAZON 0 -+ - #define CL_SIZE COMMAND_LINE_SIZE - - const char *get_system_type(void); diff --git a/target/linux/amazon/patches/130-mtd_drivers.patch b/target/linux/amazon/patches/130-mtd_drivers.patch deleted file mode 100644 index 552a7fde8..000000000 --- a/target/linux/amazon/patches/130-mtd_drivers.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- a/drivers/mtd/maps/Makefile -+++ b/drivers/mtd/maps/Makefile -@@ -72,3 +72,4 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o - obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o - obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o - obj-$(CONFIG_MTD_TQM834x) += tqm834x.o -+obj-$(CONFIG_AMAZON_MTD) += amazon.o diff --git a/target/linux/amazon/patches/160-cfi-swap.patch b/target/linux/amazon/patches/160-cfi-swap.patch deleted file mode 100644 index 03c26da24..000000000 --- a/target/linux/amazon/patches/160-cfi-swap.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1007,7 +1007,9 @@ static int __xipram do_write_oneword(str - int ret = 0; - map_word oldd; - int retry_cnt = 0; -- -+#ifdef CONFIG_AMAZON -+ adr ^= 2; -+#endif - adr += chip->start; - - spin_lock(chip->mutex); -@@ -1291,7 +1293,11 @@ static int __xipram do_write_buffer(stru - z = 0; - while(z < words * map_bankwidth(map)) { - datum = map_word_load(map, buf); -+#ifdef CONFIG_AMAZON -+ map_write(map, datum, (adr + z) ^ 0x2); -+#else - map_write(map, datum, adr + z); -+#endif - - z += map_bankwidth(map); - buf += map_bankwidth(map); diff --git a/target/linux/ar7/config-default b/target/linux/ar7/config-2.6.30 similarity index 100% rename from target/linux/ar7/config-default rename to target/linux/ar7/config-2.6.30 diff --git a/target/linux/ramips/rt288x/config-2.6.30 b/target/linux/ar7/config-2.6.32 similarity index 74% rename from target/linux/ramips/rt288x/config-2.6.30 rename to target/linux/ar7/config-2.6.32 index 0167eb5aa..4f0d145e0 100644 --- a/target/linux/ramips/rt288x/config-2.6.30 +++ b/target/linux/ar7/config-2.6.32 @@ -1,34 +1,39 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_AR7=y +CONFIG_AR7_GPIO=y +CONFIG_AR7_WDT=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SUPPORTS_MSI is not set CONFIG_ARCH_SUPPORTS_OPROFILE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y # CONFIG_BCM47XX is not set -# CONFIG_BINARY_PRINTF is not set +# CONFIG_BCM63XX is not set CONFIG_BITREVERSE=y +CONFIG_BOOT_ELF32=y # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CEVT_R4K_LIB=y -CONFIG_CMDLINE="console=ttyS1,57600 rootfstype=squashfs,jffs2" +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 +CONFIG_CMDLINE="rootfstype=squashfs,jffs2" +CONFIG_CPMAC=y # CONFIG_CPU_BIG_ENDIAN is not set # CONFIG_CPU_CAVIUM_OCTEON is not set -CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y CONFIG_CPU_LITTLE_ENDIAN=y -# CONFIG_CPU_LOONGSON2 is not set +# CONFIG_CPU_LOONGSON2E is not set CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set -CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPS32_R1=y +# CONFIG_CPU_MIPS32_R2 is not set # CONFIG_CPU_MIPS64_R1 is not set # CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MIPSR1=y # CONFIG_CPU_NEVADA is not set # CONFIG_CPU_R10000 is not set # CONFIG_CPU_R3000 is not set @@ -50,11 +55,12 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CSRC_R4K=y CONFIG_CSRC_R4K_LIB=y CONFIG_DECOMPRESS_LZMA=y -CONFIG_DEVPORT=y # CONFIG_DM9000 is not set CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y +CONFIG_FIXED_PHY=y +# CONFIG_FSNOTIFY is not set CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -62,67 +68,54 @@ CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_GPIO=y CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y -CONFIG_HAVE_MLOCK=y CONFIG_HAVE_OPROFILE=y -CONFIG_HW_HAS_PCI=y -CONFIG_HW_RANDOM=m +CONFIG_HW_RANDOM=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQ_CPU=y # CONFIG_ISDN is not set -# CONFIG_LEDS_GPIO is not set -# CONFIG_LEMOTE_FULONG is not set +CONFIG_KALLSYMS=y +CONFIG_LEDS_GPIO=y # CONFIG_MACH_ALCHEMY is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_LOONGSON is not set # CONFIG_MACH_TX39XX is not set # CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set -# CONFIG_MII is not set # CONFIG_MIKROTIK_RB532 is not set CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set -CONFIG_MIPS_L1_CACHE_SHIFT=4 -CONFIG_MIPS_MACHINE=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set # CONFIG_MIPS_MALTA is not set CONFIG_MIPS_MT_DISABLED=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_MT_SMTC is not set -CONFIG_MIPS_RALINK=y -# CONFIG_MIPS_RAMIPS_NET is not set # CONFIG_MIPS_SIM is not set -# CONFIG_MTD_CFI_INTELEXT is not set -# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_AR7_PARTS=y +CONFIG_MTD_CFI_STAA=y CONFIG_MTD_PHYSMAP=y +CONFIG_NO_EXCEPT_FILL=y # CONFIG_NO_IOPORT is not set # CONFIG_NXP_STB220 is not set # CONFIG_NXP_STB225 is not set CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PCI_DOMAINS=y CONFIG_PHYLIB=y # CONFIG_PMC_MSP is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_STB810 is not set # CONFIG_PROBE_INITRD_HEADER is not set -CONFIG_RALINK_DEV_GPIO_LEDS=y -CONFIG_RALINK_RT288X=y -# CONFIG_RALINK_RT305X is not set -CONFIG_RT288X_MACH_RT_N15=y -CONFIG_RT288X_MACH_WZR_AGL300NH=y CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCSI_DMA is not set # CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RT288X=y # CONFIG_SGI_IP22 is not set # CONFIG_SGI_IP27 is not set # CONFIG_SGI_IP28 is not set @@ -135,18 +128,14 @@ CONFIG_SERIAL_8250_RT288X=y # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set -# CONFIG_SLAB is not set -# CONFIG_SLOW_WORK is not set -CONFIG_SLUB=y -CONFIG_SOC_RT288X=y +CONFIG_SWAP_IO_SPACE=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R2=y CONFIG_SYS_HAS_EARLY_PRINTK=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -# CONFIG_TC35815 is not set -CONFIG_TRACING_SUPPORT=y CONFIG_TRAD_SIGNALS=y -CONFIG_USB_SUPPORT=y +# CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y +CONFIG_VLYNQ=y CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ar7/files/arch/mips/ar7/Makefile b/target/linux/ar7/files-2.6.30/arch/mips/ar7/Makefile similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/Makefile rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/Makefile diff --git a/target/linux/ar7/files/arch/mips/ar7/clock.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/clock.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/clock.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/clock.c diff --git a/target/linux/ar7/files/arch/mips/ar7/gpio.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/gpio.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/gpio.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/gpio.c diff --git a/target/linux/ar7/files/arch/mips/ar7/irq.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/irq.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/irq.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/irq.c diff --git a/target/linux/ar7/files/arch/mips/ar7/memory.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/memory.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/memory.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/memory.c diff --git a/target/linux/ar7/files/arch/mips/ar7/platform.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/platform.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/platform.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/platform.c diff --git a/target/linux/ar7/files/arch/mips/ar7/prom.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/prom.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/prom.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/prom.c diff --git a/target/linux/ar7/files/arch/mips/ar7/setup.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/setup.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/setup.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/setup.c diff --git a/target/linux/ar7/files/arch/mips/ar7/time.c b/target/linux/ar7/files-2.6.30/arch/mips/ar7/time.c similarity index 100% rename from target/linux/ar7/files/arch/mips/ar7/time.c rename to target/linux/ar7/files-2.6.30/arch/mips/ar7/time.c diff --git a/target/linux/ar7/files/arch/mips/include/asm/ar7 b/target/linux/ar7/files-2.6.30/arch/mips/include/asm/ar7 similarity index 100% rename from target/linux/ar7/files/arch/mips/include/asm/ar7 rename to target/linux/ar7/files-2.6.30/arch/mips/include/asm/ar7 diff --git a/target/linux/ar7/files/drivers/char/ar7_gpio.c b/target/linux/ar7/files-2.6.30/drivers/char/ar7_gpio.c similarity index 100% rename from target/linux/ar7/files/drivers/char/ar7_gpio.c rename to target/linux/ar7/files-2.6.30/drivers/char/ar7_gpio.c diff --git a/target/linux/ar7/files/drivers/char/watchdog/ar7_wdt.c b/target/linux/ar7/files-2.6.30/drivers/char/watchdog/ar7_wdt.c similarity index 100% rename from target/linux/ar7/files/drivers/char/watchdog/ar7_wdt.c rename to target/linux/ar7/files-2.6.30/drivers/char/watchdog/ar7_wdt.c diff --git a/target/linux/ar7/files/drivers/vlynq/Kconfig b/target/linux/ar7/files-2.6.30/drivers/vlynq/Kconfig similarity index 100% rename from target/linux/ar7/files/drivers/vlynq/Kconfig rename to target/linux/ar7/files-2.6.30/drivers/vlynq/Kconfig diff --git a/target/linux/ar7/files/drivers/vlynq/Makefile b/target/linux/ar7/files-2.6.30/drivers/vlynq/Makefile similarity index 100% rename from target/linux/ar7/files/drivers/vlynq/Makefile rename to target/linux/ar7/files-2.6.30/drivers/vlynq/Makefile diff --git a/target/linux/ar7/files/drivers/vlynq/vlynq.c b/target/linux/ar7/files-2.6.30/drivers/vlynq/vlynq.c similarity index 100% rename from target/linux/ar7/files/drivers/vlynq/vlynq.c rename to target/linux/ar7/files-2.6.30/drivers/vlynq/vlynq.c diff --git a/target/linux/ar7/files/include/asm-mips/ar7/ar7.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/ar7.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/ar7.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/ar7.h diff --git a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/gpio.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/gpio.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/gpio.h diff --git a/target/linux/ar7/files/include/asm-mips/ar7/irq.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/irq.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/irq.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/irq.h diff --git a/target/linux/ar7/files/include/asm-mips/ar7/prom.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/prom.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/prom.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/prom.h diff --git a/target/linux/ar7/files/include/asm-mips/ar7/spaces.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/spaces.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/spaces.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/spaces.h diff --git a/target/linux/ar7/files/include/asm-mips/ar7/titan.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/titan.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/titan.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/titan.h diff --git a/target/linux/ar7/files/include/asm-mips/ar7/war.h b/target/linux/ar7/files-2.6.30/include/asm-mips/ar7/war.h similarity index 100% rename from target/linux/ar7/files/include/asm-mips/ar7/war.h rename to target/linux/ar7/files-2.6.30/include/asm-mips/ar7/war.h diff --git a/target/linux/ar7/files/include/linux/vlynq.h b/target/linux/ar7/files-2.6.30/include/linux/vlynq.h similarity index 100% rename from target/linux/ar7/files/include/linux/vlynq.h rename to target/linux/ar7/files-2.6.30/include/linux/vlynq.h diff --git a/target/linux/ar7/files-2.6.32/drivers/char/ar7_gpio.c b/target/linux/ar7/files-2.6.32/drivers/char/ar7_gpio.c new file mode 100644 index 000000000..6b38bbd89 --- /dev/null +++ b/target/linux/ar7/files-2.6.32/drivers/char/ar7_gpio.c @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2007 Nicolas Thill + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "ar7_gpio" +#define LONGNAME "TI AR7 GPIOs Driver" + +MODULE_AUTHOR("Nicolas Thill "); +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_is_titan() ? TITAN_GPIO_MAX : 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 --git a/target/linux/ar7/patches-2.6.32/110-flash.patch b/target/linux/ar7/patches-2.6.32/110-flash.patch new file mode 100644 index 000000000..7311a6734 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/110-flash.patch @@ -0,0 +1,11 @@ +--- a/drivers/mtd/maps/physmap.c ++++ b/drivers/mtd/maps/physmap.c +@@ -80,7 +80,7 @@ static const char *rom_probe_types[] = { + "map_rom", + NULL }; + #ifdef CONFIG_MTD_PARTITIONS +-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; ++static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "ar7part", NULL }; + #endif + + static int physmap_flash_probe(struct platform_device *dev) diff --git a/target/linux/ar7/patches-2.6.32/120-gpio_chrdev.patch b/target/linux/ar7/patches-2.6.32/120-gpio_chrdev.patch new file mode 100644 index 000000000..d648d08c8 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/120-gpio_chrdev.patch @@ -0,0 +1,28 @@ +--- a/drivers/char/Kconfig ++++ b/drivers/char/Kconfig +@@ -987,6 +987,15 @@ config MWAVE + 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 +--- a/drivers/char/Makefile ++++ b/drivers/char/Makefile +@@ -92,6 +92,7 @@ obj-$(CONFIG_HW_RANDOM) += hw_random/ + 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 --git a/target/linux/ar7/patches-2.6.32/500-serial_kludge.patch b/target/linux/ar7/patches-2.6.32/500-serial_kludge.patch new file mode 100644 index 000000000..4d9bcb931 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/500-serial_kludge.patch @@ -0,0 +1,28 @@ +--- a/drivers/serial/8250.c ++++ b/drivers/serial/8250.c +@@ -296,6 +296,13 @@ static const struct serial8250_config ua + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO | UART_CAP_AFE, + }, ++ [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) +@@ -2712,7 +2719,11 @@ static void serial8250_console_putchar(s + { + 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 --git a/target/linux/ar7/patches-2.6.32/930-titan-platform.patch b/target/linux/ar7/patches-2.6.32/930-titan-platform.patch new file mode 100644 index 000000000..484ce2d19 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/930-titan-platform.patch @@ -0,0 +1,772 @@ +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -131,6 +131,36 @@ static struct resource cpmac_high_res[] + }, + }; + ++static struct resource cpmac_low_res_titan[] = { ++ { ++ .name = "regs", ++ .flags = IORESOURCE_MEM, ++ .start = TITAN_REGS_MAC0, ++ .end = TITAN_REGS_MAC0 + 0x7ff, ++ }, ++ { ++ .name = "irq", ++ .flags = IORESOURCE_IRQ, ++ .start = 27, ++ .end = 27, ++ }, ++}; ++ ++static struct resource cpmac_high_res_titan[] = { ++ { ++ .name = "regs", ++ .flags = IORESOURCE_MEM, ++ .start = TITAN_REGS_MAC1, ++ .end = TITAN_REGS_MAC1 + 0x7ff, ++ }, ++ { ++ .name = "irq", ++ .flags = IORESOURCE_IRQ, ++ .start = 41, ++ .end = 41, ++ }, ++}; ++ + static struct resource vlynq_low_res[] = { + { + .name = "regs", +@@ -185,6 +215,60 @@ static struct resource vlynq_high_res[] + }, + }; + ++static struct resource vlynq_low_res_titan[] = { ++ { ++ .name = "regs", ++ .flags = IORESOURCE_MEM, ++ .start = TITAN_REGS_VLYNQ0, ++ .end = TITAN_REGS_VLYNQ0 + 0xff, ++ }, ++ { ++ .name = "irq", ++ .flags = IORESOURCE_IRQ, ++ .start = 33, ++ .end = 33, ++ }, ++ { ++ .name = "mem", ++ .flags = IORESOURCE_MEM, ++ .start = 0x0c000000, ++ .end = 0x0fffffff, ++ }, ++ { ++ .name = "devirq", ++ .flags = IORESOURCE_IRQ, ++ .start = 80, ++ .end = 111, ++ }, ++}; ++ ++static struct resource vlynq_high_res_titan[] = { ++ { ++ .name = "regs", ++ .flags = IORESOURCE_MEM, ++ .start = TITAN_REGS_VLYNQ1, ++ .end = TITAN_REGS_VLYNQ1 + 0xff, ++ }, ++ { ++ .name = "irq", ++ .flags = IORESOURCE_IRQ, ++ .start = 34, ++ .end = 34, ++ }, ++ { ++ .name = "mem", ++ .flags = IORESOURCE_MEM, ++ .start = 0x40000000, ++ .end = 0x43ffffff, ++ }, ++ { ++ .name = "devirq", ++ .flags = IORESOURCE_IRQ, ++ .start = 112, ++ .end = 143, ++ }, ++}; ++ + static struct resource usb_res[] = { + { + .name = "regs", +@@ -228,6 +312,18 @@ static struct plat_cpmac_data cpmac_high + .phy_mask = 0x7fffffff, + }; + ++static struct plat_cpmac_data cpmac_low_data_titan = { ++ .reset_bit = 17, ++ .power_bit = 20, ++ .phy_mask = 0x40000000, ++}; ++ ++static struct plat_cpmac_data cpmac_high_data_titan = { ++ .reset_bit = 21, ++ .power_bit = 22, ++ .phy_mask = 0x80000000, ++}; ++ + static struct plat_vlynq_data vlynq_low_data = { + .ops.on = vlynq_on, + .ops.off = vlynq_off, +@@ -242,6 +338,20 @@ static struct plat_vlynq_data vlynq_high + .gpio_bit = 19, + }; + ++static struct plat_vlynq_data vlynq_low_data_titan = { ++ .ops.on = vlynq_on, ++ .ops.off = vlynq_off, ++ .reset_bit = 15, ++ .gpio_bit = 14, ++}; ++ ++static struct plat_vlynq_data vlynq_high_data_titan = { ++ .ops.on = vlynq_on, ++ .ops.off = vlynq_off, ++ .reset_bit = 16, ++ .gpio_bit = 7, ++}; ++ + static struct platform_device physmap_flash = { + .id = 0, + .name = "physmap-flash", +@@ -275,6 +385,30 @@ static struct platform_device cpmac_high + .num_resources = ARRAY_SIZE(cpmac_high_res), + }; + ++static struct platform_device cpmac_low_titan = { ++ .id = 0, ++ .name = "cpmac", ++ .dev = { ++ .dma_mask = &cpmac_dma_mask, ++ .coherent_dma_mask = DMA_BIT_MASK(32), ++ .platform_data = &cpmac_low_data_titan, ++ }, ++ .resource = cpmac_low_res_titan, ++ .num_resources = ARRAY_SIZE(cpmac_low_res_titan), ++}; ++ ++static struct platform_device cpmac_high_titan = { ++ .id = 1, ++ .name = "cpmac", ++ .dev = { ++ .dma_mask = &cpmac_dma_mask, ++ .coherent_dma_mask = DMA_BIT_MASK(32), ++ .platform_data = &cpmac_high_data_titan, ++ }, ++ .resource = cpmac_high_res_titan, ++ .num_resources = ARRAY_SIZE(cpmac_high_res_titan), ++}; ++ + static struct platform_device vlynq_low = { + .id = 0, + .name = "vlynq", +@@ -291,6 +425,22 @@ static struct platform_device vlynq_high + .num_resources = ARRAY_SIZE(vlynq_high_res), + }; + ++static struct platform_device vlynq_low_titan = { ++ .id = 0, ++ .name = "vlynq", ++ .dev.platform_data = &vlynq_low_data_titan, ++ .resource = vlynq_low_res_titan, ++ .num_resources = ARRAY_SIZE(vlynq_low_res_titan), ++}; ++ ++static struct platform_device vlynq_high_titan = { ++ .id = 1, ++ .name = "vlynq", ++ .dev.platform_data = &vlynq_high_data_titan, ++ .resource = vlynq_high_res_titan, ++ .num_resources = ARRAY_SIZE(vlynq_high_res_titan), ++}; ++ + + static struct gpio_led default_leds[] = { + { +@@ -300,6 +450,11 @@ static struct gpio_led default_leds[] = + }, + }; + ++static struct gpio_led titan_leds[] = { ++ { .name = "status", .gpio = 8, .active_low = 1, }, ++ { .name = "wifi", .gpio = 13, .active_low = 1, }, ++}; ++ + static struct gpio_led dsl502t_leds[] = { + { + .name = "status", +@@ -496,6 +651,9 @@ static void __init detect_leds(void) + } else if (strstr(prid, "DG834")) { + ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds); + ar7_led_data.leds = dg834g_leds; ++ } else if (strstr(prid, "CYWM")) { ++ ar7_led_data.num_leds = ARRAY_SIZE(titan_leds); ++ ar7_led_data.leds = titan_leds; + } + } + +@@ -541,14 +699,18 @@ static int __init ar7_register_devices(v + if (res) + return res; + +- ar7_device_disable(vlynq_low_data.reset_bit); +- res = platform_device_register(&vlynq_low); ++ ar7_device_disable(ar7_is_titan() ? vlynq_low_data_titan.reset_bit : ++ vlynq_low_data.reset_bit); ++ res = platform_device_register(ar7_is_titan() ? &vlynq_low_titan : ++ &vlynq_low); + if (res) + return res; + + if (ar7_has_high_vlynq()) { +- ar7_device_disable(vlynq_high_data.reset_bit); +- res = platform_device_register(&vlynq_high); ++ ar7_device_disable(ar7_is_titan() ? vlynq_high_data_titan.reset_bit : ++ vlynq_high_data.reset_bit); ++ res = platform_device_register(ar7_is_titan() ? &vlynq_high_titan : ++ &vlynq_high); + if (res) + return res; + } +--- a/arch/mips/ar7/gpio.c ++++ b/arch/mips/ar7/gpio.c +@@ -21,11 +21,11 @@ + + #include + +-static const char *ar7_gpio_list[AR7_GPIO_MAX]; ++static const char *ar7_gpio_list[TITAN_GPIO_MAX]; + + int gpio_request(unsigned gpio, const char *label) + { +- if (gpio >= AR7_GPIO_MAX) ++ if (gpio >= (ar7_is_titan() ? TITAN_GPIO_MAX : AR7_GPIO_MAX)) + return -EINVAL; + + if (ar7_gpio_list[gpio]) +--- a/arch/mips/ar7/setup.c ++++ b/arch/mips/ar7/setup.c +@@ -23,6 +23,9 @@ + #include + #include + #include ++#include ++ ++static int titan_variant; + + static void ar7_machine_restart(char *command) + { +@@ -55,6 +58,18 @@ const char *get_system_type(void) + return "TI AR7 (TNETD7100)"; + case AR7_CHIP_7200: + return "TI AR7 (TNETD7200)"; ++ case AR7_CHIP_TITAN: ++ titan_variant = ar7_init_titan_variant(); ++ switch (titan_variant /*(gpio_get_value_titan(1) >> 12) & 0xf*/) { ++ case TITAN_CHIP_1050: ++ return "TI AR7 (TNETV1050)"; ++ case TITAN_CHIP_1055: ++ return "TI AR7 (TNETV1055)"; ++ case TITAN_CHIP_1056: ++ return "TI AR7 (TNETV1056)"; ++ case TITAN_CHIP_1060: ++ return "TI AR7 (TNETV1060)"; ++ } + default: + return "TI AR7 (Unknown)"; + } +--- a/arch/mips/include/asm/mach-ar7/ar7.h ++++ b/arch/mips/include/asm/mach-ar7/ar7.h +@@ -50,6 +50,11 @@ + #define UR8_REGS_WDT (AR7_REGS_BASE + 0x0b00) + #define UR8_REGS_UART1 (AR7_REGS_BASE + 0x0f00) + ++#define TITAN_REGS_MAC0 (0x08640000) ++#define TITAN_REGS_MAC1 (TITAN_REGS_MAC0 + 0x0800) ++#define TITAN_REGS_VLYNQ0 (AR7_REGS_BASE + 0x1c00) ++#define TITAN_REGS_VLYNQ1 (AR7_REGS_BASE + 0x1300) ++ + #define AR7_RESET_PEREPHERIAL 0x0 + #define AR7_RESET_SOFTWARE 0x4 + #define AR7_RESET_STATUS 0x8 +@@ -59,15 +64,30 @@ + #define AR7_RESET_BIT_MDIO 22 + #define AR7_RESET_BIT_EPHY 26 + ++#define TITAN_RESET_BIT_EPHY1 28 ++ + /* GPIO control registers */ + #define AR7_GPIO_INPUT 0x0 + #define AR7_GPIO_OUTPUT 0x4 + #define AR7_GPIO_DIR 0x8 + #define AR7_GPIO_ENABLE 0xc ++#define TITAN_GPIO_INPUT_0 0x0 ++#define TITAN_GPIO_INPUT_1 0x4 ++#define TITAN_GPIO_OUTPUT_0 0x8 ++#define TITAN_GPIO_OUTPUT_1 0xc ++#define TITAN_GPIO_DIR_0 0x10 ++#define TITAN_GPIO_DIR_1 0x14 ++#define TITAN_GPIO_ENBL_0 0x18 ++#define TITAN_GPIO_ENBL_1 0x1c + + #define AR7_CHIP_7100 0x18 + #define AR7_CHIP_7200 0x2b + #define AR7_CHIP_7300 0x05 ++#define AR7_CHIP_TITAN 0x07 ++#define TITAN_CHIP_1050 0x0f ++#define TITAN_CHIP_1055 0x0e ++#define TITAN_CHIP_1056 0x0d ++#define TITAN_CHIP_1060 0x07 + + /* Interrupts */ + #define AR7_IRQ_UART0 15 +@@ -95,14 +115,22 @@ struct plat_dsl_data { + + extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock; + ++static inline int ar7_is_titan(void) ++{ ++ return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x24)) & 0xffff) == ++ AR7_CHIP_TITAN; ++} ++ + static inline u16 ar7_chip_id(void) + { +- return readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) & 0xffff; ++ return ar7_is_titan() ? AR7_CHIP_TITAN : (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; ++ return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + (ar7_is_titan() ? 0x24 : ++ 0x14))) >> 16) & 0xff; + } + + static inline int ar7_cpu_freq(void) +--- a/arch/mips/include/asm/mach-ar7/gpio.h ++++ b/arch/mips/include/asm/mach-ar7/gpio.h +@@ -20,14 +20,18 @@ + #define __AR7_GPIO_H__ + + #include ++#ifndef __AR7_TITAN_H__ ++#include ++#endif + + #define AR7_GPIO_MAX 32 ++#define TITAN_GPIO_MAX 51 + + 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) ++static inline int gpio_get_value_ar7(unsigned gpio) + { + void __iomem *gpio_in = + (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT); +@@ -35,7 +39,23 @@ static inline int gpio_get_value(unsigne + return readl(gpio_in) & (1 << gpio); + } + +-static inline void gpio_set_value(unsigned gpio, int value) ++static inline int gpio_get_value_titan(unsigned gpio) ++{ ++ void __iomem *gpio_in0 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_INPUT_0); ++ void __iomem *gpio_in1 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_INPUT_1); ++ ++ return readl(gpio >> 5 ? gpio_in1 : gpio_in0) & (1 << (gpio & 0x1f)); ++} ++ ++static inline int gpio_get_value(unsigned gpio) ++{ ++ return ar7_is_titan() ? gpio_get_value_titan(gpio) : ++ gpio_get_value_ar7(gpio); ++} ++ ++static inline void gpio_set_value_ar7(unsigned gpio, int value) + { + void __iomem *gpio_out = + (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT); +@@ -47,7 +67,29 @@ static inline void gpio_set_value(unsign + writel(tmp, gpio_out); + } + +-static inline int gpio_direction_input(unsigned gpio) ++static inline void gpio_set_value_titan(unsigned gpio, int value) ++{ ++ void __iomem *gpio_out0 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_OUTPUT_0); ++ void __iomem *gpio_out1 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_OUTPUT_1); ++ unsigned tmp; ++ ++ tmp = readl(gpio >> 5 ? gpio_out1 : gpio_out0) & ~(1 << (gpio & 0x1f)); ++ if (value) ++ tmp |= 1 << (gpio & 0x1f); ++ writel(tmp, gpio >> 5 ? gpio_out1 : gpio_out0); ++} ++ ++static inline void gpio_set_value(unsigned gpio, int value) ++{ ++ if (ar7_is_titan()) ++ gpio_set_value_titan(gpio, value); ++ else ++ gpio_set_value_ar7(gpio, value); ++} ++ ++static inline int gpio_direction_input_ar7(unsigned gpio) + { + void __iomem *gpio_dir = + (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR); +@@ -60,7 +102,29 @@ static inline int gpio_direction_input(u + return 0; + } + +-static inline int gpio_direction_output(unsigned gpio, int value) ++static inline int gpio_direction_input_titan(unsigned gpio) ++{ ++ void __iomem *gpio_dir0 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_DIR_0); ++ void __iomem *gpio_dir1 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_DIR_1); ++ ++ if (gpio >= TITAN_GPIO_MAX) ++ return -EINVAL; ++ ++ writel(readl(gpio >> 5 ? gpio_dir1 : gpio_dir0) | (1 << (gpio & 0x1f)), ++ gpio >> 5 ? gpio_dir1 : gpio_dir0); ++ ++ return 0; ++} ++ ++static inline int gpio_direction_input(unsigned gpio) ++{ ++ return ar7_is_titan() ? gpio_direction_input_titan(gpio) : ++ gpio_direction_input_ar7(gpio); ++} ++ ++static inline int gpio_direction_output_ar7(unsigned gpio, int value) + { + void __iomem *gpio_dir = + (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR); +@@ -74,6 +138,29 @@ static inline int gpio_direction_output( + return 0; + } + ++static inline int gpio_direction_output_titan(unsigned gpio, int value) ++{ ++ void __iomem *gpio_dir0 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_DIR_0); ++ void __iomem *gpio_dir1 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_DIR_1); ++ ++ if (gpio >= TITAN_GPIO_MAX) ++ return -EINVAL; ++ ++ gpio_set_value_titan(gpio, value); ++ writel(readl(gpio >> 5 ? gpio_dir1 : gpio_dir0) & ~(1 << ++ (gpio & 0x1f)), gpio >> 5 ? gpio_dir1 : gpio_dir0); ++ ++ return 0; ++} ++ ++static inline int gpio_direction_output(unsigned gpio, int value) ++{ ++ return ar7_is_titan() ? gpio_direction_output_titan(gpio, value) : ++ gpio_direction_output_ar7(gpio, value); ++} ++ + static inline int gpio_to_irq(unsigned gpio) + { + return -EINVAL; +@@ -85,7 +172,7 @@ static inline int irq_to_gpio(unsigned i + } + + /* Board specific GPIO functions */ +-static inline int ar7_gpio_enable(unsigned gpio) ++static inline int ar7_gpio_enable_ar7(unsigned gpio) + { + void __iomem *gpio_en = + (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE); +@@ -95,7 +182,26 @@ static inline int ar7_gpio_enable(unsign + return 0; + } + +-static inline int ar7_gpio_disable(unsigned gpio) ++static inline int ar7_gpio_enable_titan(unsigned gpio) ++{ ++ void __iomem *gpio_en0 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_ENBL_0); ++ void __iomem *gpio_en1 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_ENBL_1); ++ ++ writel(readl(gpio >> 5 ? gpio_en1 : gpio_en0) | (1 << (gpio & 0x1f)), ++ gpio >> 5 ? gpio_en1 : gpio_en0); ++ ++ return 0; ++} ++ ++static inline int ar7_gpio_enable(unsigned gpio) ++{ ++ return ar7_is_titan() ? ar7_gpio_enable_titan(gpio) : ++ ar7_gpio_enable_ar7(gpio); ++} ++ ++static inline int ar7_gpio_disable_ar7(unsigned gpio) + { + void __iomem *gpio_en = + (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE); +@@ -105,6 +211,60 @@ static inline int ar7_gpio_disable(unsig + return 0; + } + ++static inline int ar7_gpio_disable_titan(unsigned gpio) ++{ ++ void __iomem *gpio_en0 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_ENBL_0); ++ void __iomem *gpio_en1 = ++ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_ENBL_1); ++ ++ writel(readl(gpio >> 5 ? gpio_en1 : gpio_en0) & ~(1 << (gpio & 0x1f)), ++ gpio >> 5 ? gpio_en1 : gpio_en0); ++ ++ return 0; ++} ++ ++static inline int ar7_gpio_disable(unsigned gpio) ++{ ++ return ar7_is_titan() ? ar7_gpio_disable_titan(gpio) : ++ ar7_gpio_disable_ar7(gpio); ++} ++ ++static inline int ar7_init_titan_variant(void) ++{ ++ /*UINT32 new_val;*/ ++ unsigned new_val; ++ ++ /* set GPIO 44 - 47 as input */ ++ /*PAL_sysGpioCtrl(const int, GPIO_PIN, GPIO_INPUT_PIN); */ ++ /*define titan_gpio_ctrl in titan.h*/ ++ titan_gpio_ctrl(44, GPIO_PIN, GPIO_INPUT_PIN); ++ titan_gpio_ctrl(45, GPIO_PIN, GPIO_INPUT_PIN); ++ titan_gpio_ctrl(46, GPIO_PIN, GPIO_INPUT_PIN); ++ titan_gpio_ctrl(47, GPIO_PIN, GPIO_INPUT_PIN); ++ ++ /* read GPIO to get Titan variant type */ ++ /*fix this*/ ++ titan_sysGpioInValue( &new_val, 1 ); ++ ++ new_val >>= 12; ++ new_val &= 0x0f; ++ ++ switch ( new_val ) ++ { ++ case TITAN_CHIP_1050: ++ case TITAN_CHIP_1055: ++ case TITAN_CHIP_1056: ++ case TITAN_CHIP_1060: ++ return new_val; ++ ++ default: ++ break; ++ } ++ /* In case we get an invalid value, return the default Titan chip */ ++ return TITAN_CHIP_1050; ++} ++ + #include + + #endif +--- /dev/null ++++ b/arch/mips/include/asm/mach-ar7/titan.h +@@ -0,0 +1,176 @@ ++/* ++ * Copyright (C) 2008 Stanley Pinchak ++ * ++ * 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_TITAN_H__ ++#define __AR7_TITAN_H__ ++ ++#include ++ ++typedef enum TITAN_GPIO_PIN_MODE_tag ++{ ++ FUNCTIONAL_PIN = 0, ++ GPIO_PIN = 1 ++} TITAN_GPIO_PIN_MODE_T; ++ ++typedef enum TITAN_GPIO_PIN_DIRECTION_tag ++{ ++ GPIO_OUTPUT_PIN = 0, ++ GPIO_INPUT_PIN = 1 ++} TITAN_GPIO_PIN_DIRECTION_T; ++ ++/********************************************************************** ++ * GPIO Control ++ **********************************************************************/ ++ ++typedef struct ++{ ++ int pinSelReg; ++ int shift; ++ int func; ++ ++} GPIO_CFG; ++ ++static GPIO_CFG gptable[]= { ++ /* PIN_SEL_REG, START_BIT, GPIO_CFG_MUX_VALUE */ ++ {4,24,1}, ++ {4,26,1}, ++ {4,28,1}, ++ {4,30,1}, ++ {5,6,1}, ++ {5,8,1}, ++ {5,10,1}, ++ {5,12,1}, ++ {7,14,3}, ++ {7,16,3}, ++ {7,18,3}, ++ {7,20,3}, ++ {7,22,3}, ++ {7,26,3}, ++ {7,28,3}, ++ {7,30,3}, ++ {8,0,3}, ++ {8,2,3}, ++ {8,4,3}, ++ {8,10,3}, ++ {8,14,3}, ++ {8,16,3}, ++ {8,18,3}, ++ {8,20,3}, ++ {9,8,3}, ++ {9,10,3}, ++ {9,12,3}, ++ {9,14,3}, ++ {9,18,3}, ++ {9,20,3}, ++ {9,24,3}, ++ {9,26,3}, ++ {9,28,3}, ++ {9,30,3}, ++ {10,0,3}, ++ {10,2,3}, ++ {10,8,3}, ++ {10,10,3}, ++ {10,12,3}, ++ {10,14,3}, ++ {13,12,3}, ++ {13,14,3}, ++ {13,16,3}, ++ {13,18,3}, ++ {13,24,3}, ++ {13,26,3}, ++ {13,28,3}, ++ {13,30,3}, ++ {14,2,3}, ++ {14,6,3}, ++ {14,8,3}, ++ {14,12,3} ++}; ++ ++typedef struct ++{ ++ volatile unsigned int reg[21]; ++} ++PIN_SEL_REG_ARRAY_T; ++ ++typedef struct ++{ ++ unsigned int data_in [2]; ++ unsigned int data_out[2]; ++ unsigned int dir[2]; ++ unsigned int enable[2]; ++ ++} TITAN_GPIO_CONTROL_T; ++ ++#define AVALANCHE_PIN_SEL_BASE 0xA861160C /*replace with KSEG1ADDR()*/ ++ ++static inline int titan_gpio_ctrl(unsigned int gpio_pin, TITAN_GPIO_PIN_MODE_T pin_mode, ++ TITAN_GPIO_PIN_DIRECTION_T pin_direction) ++{ ++ int reg_index = 0; ++ int mux_status; ++ GPIO_CFG gpio_cfg; ++ volatile PIN_SEL_REG_ARRAY_T *pin_sel_array = (PIN_SEL_REG_ARRAY_T*) AVALANCHE_PIN_SEL_BASE; ++ volatile TITAN_GPIO_CONTROL_T *gpio_cntl = (TITAN_GPIO_CONTROL_T*) KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_INPUT_0); ++ ++ if (gpio_pin > 51 ) ++ return(-1); ++ ++ gpio_cfg = gptable[gpio_pin]; ++ mux_status = (pin_sel_array->reg[gpio_cfg.pinSelReg - 1] >> gpio_cfg.shift) & 0x3; ++ if(!((mux_status == 0 /* tri-stated */ ) || (mux_status == gpio_cfg.func /*GPIO functionality*/))) ++ { ++ return(-1); /* Pin have been configured for non GPIO funcs. */ ++ } ++ ++ /* Set the pin to be used as GPIO. */ ++ pin_sel_array->reg[gpio_cfg.pinSelReg - 1] |= ((gpio_cfg.func & 0x3) << gpio_cfg.shift); ++ ++ /* Check whether gpio refers to the first GPIO reg or second. */ ++ if(gpio_pin > 31) ++ { ++ reg_index = 1; ++ gpio_pin -= 32; ++ } ++ ++ if(pin_mode) ++ gpio_cntl->enable[reg_index] |= (1 << gpio_pin); /* Enable */ ++ else ++ gpio_cntl->enable[reg_index] &= ~(1 << gpio_pin); ++ ++ if(pin_direction) ++ gpio_cntl->dir[reg_index] |= (1 << gpio_pin); /* Input */ ++ else ++ gpio_cntl->dir[reg_index] &= ~(1 << gpio_pin); ++ ++ return(0); ++ ++}/* end of function titan_gpio_ctrl */ ++ ++static inline int titan_sysGpioInValue(unsigned int *in_val, unsigned int reg_index) ++{ ++ volatile TITAN_GPIO_CONTROL_T *gpio_cntl = (TITAN_GPIO_CONTROL_T*) KSEG1ADDR(AR7_REGS_GPIO + TITAN_GPIO_INPUT_0); ++ ++ if(reg_index > 1) ++ return (-1); ++ ++ *in_val = gpio_cntl->data_in[reg_index]; ++ ++ return (0); ++} ++ ++ ++#endif diff --git a/target/linux/ar7/patches-2.6.32/940-cpmac-titan.patch b/target/linux/ar7/patches-2.6.32/940-cpmac-titan.patch new file mode 100644 index 000000000..981740c56 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/940-cpmac-titan.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -716,23 +716,35 @@ static int __init ar7_register_devices(v + } + + if (ar7_has_high_cpmac()) { +- res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); ++ res = fixed_phy_add(PHY_POLL, ar7_is_titan() ? cpmac_high_titan.id : cpmac_high.id, ++ &fixed_phy_status); + if (res && res != -ENODEV) + return res; +- cpmac_get_mac(1, cpmac_high_data.dev_addr); +- res = platform_device_register(&cpmac_high); ++ ++ cpmac_get_mac(1, ar7_is_titan() ? cpmac_high_data_titan.dev_addr : ++ cpmac_high_data.dev_addr); ++ res = platform_device_register(ar7_is_titan() ? &cpmac_high_titan : ++ &cpmac_high); ++ + if (res) + return res; + } else { +- cpmac_low_data.phy_mask = 0xffffffff; ++ if (ar7_is_titan()) ++ cpmac_low_data_titan.phy_mask = 0xffffffff; ++ else ++ cpmac_low_data.phy_mask = 0xffffffff; ++ + } + +- res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); ++ res = fixed_phy_add(PHY_POLL, ar7_is_titan() ? cpmac_low_titan.id : ++ cpmac_low.id, &fixed_phy_status); + if (res && res != -ENODEV) + return res; + +- cpmac_get_mac(0, cpmac_low_data.dev_addr); +- res = platform_device_register(&cpmac_low); ++ cpmac_get_mac(0, ar7_is_titan() ? cpmac_low_data_titan.dev_addr : ++ cpmac_low_data.dev_addr); ++ res = platform_device_register(ar7_is_titan() ? &cpmac_low_titan : ++ &cpmac_low); + if (res) + return res; + +--- a/drivers/net/cpmac.c ++++ b/drivers/net/cpmac.c +@@ -1243,6 +1243,10 @@ int __devinit cpmac_init(void) + ar7_device_reset(AR7_RESET_BIT_CPMAC_HI); + ar7_device_reset(AR7_RESET_BIT_EPHY); + ++ if (ar7_is_titan()) { ++ ar7_device_reset(TITAN_RESET_BIT_EPHY1); ++ } ++ + cpmac_mii->reset(cpmac_mii); + + for (i = 0; i < 300; i++) +@@ -1257,7 +1261,8 @@ int __devinit cpmac_init(void) + mask = 0; + } + +- cpmac_mii->phy_mask = ~(mask | 0x80000000); ++ cpmac_mii->phy_mask = ar7_is_titan()? ~(mask | 0x80000000 | 0x40000000): ++ ~(mask | 0x80000000); + snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1"); + + res = mdiobus_register(cpmac_mii); diff --git a/target/linux/ar71xx/config-2.6.30 b/target/linux/ar71xx/config-2.6.30 deleted file mode 100644 index 89146ecd1..000000000 --- a/target/linux/ar71xx/config-2.6.30 +++ /dev/null @@ -1,238 +0,0 @@ -CONFIG_32BIT=y -# CONFIG_64BIT is not set -CONFIG_AG71XX=y -CONFIG_AG71XX_AR8216_SUPPORT=y -# CONFIG_AG71XX_DEBUG is not set -# CONFIG_AG71XX_DEBUG_FS is not set -CONFIG_AR71XX_DEV_AP91_PCI=y -CONFIG_AR71XX_DEV_AP94_PCI=y -CONFIG_AR71XX_DEV_AR913X_WMAC=y -CONFIG_AR71XX_DEV_DSA=y -CONFIG_AR71XX_DEV_GPIO_BUTTONS=y -CONFIG_AR71XX_DEV_LEDS_GPIO=y -CONFIG_AR71XX_DEV_M25P80=y -CONFIG_AR71XX_DEV_PB42_PCI=y -CONFIG_AR71XX_DEV_USB=y -CONFIG_AR71XX_MACH_AP81=y -CONFIG_AR71XX_MACH_AP83=y -CONFIG_AR71XX_MACH_AW_NR580=y -CONFIG_AR71XX_MACH_DIR_600_A1=y -CONFIG_AR71XX_MACH_DIR_615_C1=y -CONFIG_AR71XX_MACH_DIR_825_B1=y -CONFIG_AR71XX_MACH_MZK_W04NU=y -CONFIG_AR71XX_MACH_MZK_W300NH=y -CONFIG_AR71XX_MACH_PB42=y -CONFIG_AR71XX_MACH_PB44=y -CONFIG_AR71XX_MACH_RB_4XX=y -CONFIG_AR71XX_MACH_TEW_632BRP=y -CONFIG_AR71XX_MACH_TL_WR1043ND=y -CONFIG_AR71XX_MACH_TL_WR741ND=y -CONFIG_AR71XX_MACH_TL_WR841N_V1=y -CONFIG_AR71XX_MACH_TL_WR941ND=y -CONFIG_AR71XX_MACH_UBNT=y -CONFIG_AR71XX_MACH_WNDR3700=y -CONFIG_AR71XX_MACH_WNR2000=y -CONFIG_AR71XX_MACH_WP543=y -CONFIG_AR71XX_MACH_WRT160NL=y -CONFIG_AR71XX_MACH_WRT400N=y -CONFIG_AR71XX_MACH_WZR_HP_G300NH=y -CONFIG_AR71XX_NVRAM=y -CONFIG_AR71XX_WDT=y -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -CONFIG_ARCH_SUPPORTS_OPROFILE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ATHEROS_AR71XX=y -# CONFIG_BCM47XX is not set -# CONFIG_BINARY_PRINTF is not set -CONFIG_BITREVERSE=y -# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set -# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_CEVT_R4K=y -CONFIG_CEVT_R4K_LIB=y -CONFIG_CMDLINE="rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200" -CONFIG_CPU_BIG_ENDIAN=y -# CONFIG_CPU_CAVIUM_OCTEON is not set -CONFIG_CPU_HAS_LLSC=y -CONFIG_CPU_HAS_PREFETCH=y -CONFIG_CPU_HAS_SYNC=y -# CONFIG_CPU_LITTLE_ENDIAN is not set -# CONFIG_CPU_LOONGSON2 is not set -CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set -CONFIG_CPU_MIPS32_R2=y -# CONFIG_CPU_MIPS64_R1 is not set -# CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_MIPSR2=y -# CONFIG_CPU_NEVADA is not set -# CONFIG_CPU_R10000 is not set -# CONFIG_CPU_R3000 is not set -# CONFIG_CPU_R4300 is not set -# CONFIG_CPU_R4X00 is not set -# CONFIG_CPU_R5000 is not set -# CONFIG_CPU_R5432 is not set -# CONFIG_CPU_R5500 is not set -# CONFIG_CPU_R6000 is not set -# CONFIG_CPU_R8000 is not set -# CONFIG_CPU_RM7000 is not set -# CONFIG_CPU_RM9000 is not set -# CONFIG_CPU_SB1 is not set -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -CONFIG_CPU_SUPPORTS_HIGHMEM=y -# CONFIG_CPU_TX39XX is not set -# CONFIG_CPU_TX49XX is not set -# CONFIG_CPU_VR41XX is not set -CONFIG_CSRC_R4K=y -CONFIG_CSRC_R4K_LIB=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DEVPORT=y -# CONFIG_DM9000 is not set -CONFIG_DMA_NEED_PCI_MAP_STATE=y -CONFIG_DMA_NONCOHERENT=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_FIND_LAST_BIT=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -CONFIG_GENERIC_GPIO=y -CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_NXP_74HC153=y -CONFIG_GPIO_PCF857X=y -CONFIG_GPIO_SYSFS=y -CONFIG_HARDWARE_WATCHPOINTS=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set -CONFIG_HAVE_IDE=y -CONFIG_HAVE_MLOCK=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HW_HAS_PCI=y -# CONFIG_HW_RANDOM is not set -CONFIG_I2C=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_GPIO=y -CONFIG_ICPLUS_PHY=y -CONFIG_IMAGE_CMDLINE_HACK=y -CONFIG_INITRAMFS_ROOT_GID=0 -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_SOURCE="../../root" -CONFIG_IRQ_CPU=y -# CONFIG_ISDN is not set -# CONFIG_LEDS_GPIO is not set -# CONFIG_LEDS_WNDR3700_USB is not set -# CONFIG_LEMOTE_FULONG is not set -# CONFIG_M25PXX_USE_FAST_READ is not set -# CONFIG_MACH_ALCHEMY is not set -# CONFIG_MACH_DECSTATION is not set -# CONFIG_MACH_JAZZ is not set -# CONFIG_MACH_TX39XX is not set -# CONFIG_MACH_TX49XX is not set -# CONFIG_MACH_VR41XX is not set -CONFIG_MICREL_PHY=y -# CONFIG_MIKROTIK_RB532 is not set -CONFIG_MIPS=y -# CONFIG_MIPS_COBALT is not set -CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_MIPS_MACHINE=y -# CONFIG_MIPS_MALTA is not set -CONFIG_MIPS_MT_DISABLED=y -# CONFIG_MIPS_MT_SMP is not set -# CONFIG_MIPS_MT_SMTC is not set -# CONFIG_MIPS_SIM is not set -CONFIG_MTD_AR91XX_FLASH=y -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_MYLOADER_PARTS=y -CONFIG_MTD_NAND=y -CONFIG_MTD_NAND_RB4XX=y -CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2 -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_WRT160NL_PARTS=y -CONFIG_MYLOADER=y -CONFIG_NET_DSA=y -CONFIG_NET_DSA_MV88E6060=y -CONFIG_NET_DSA_MV88E6063=y -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set -# CONFIG_NET_DSA_TAG_DSA is not set -# CONFIG_NET_DSA_TAG_EDSA is not set -CONFIG_NET_DSA_TAG_TRAILER=y -# CONFIG_NO_IOPORT is not set -# CONFIG_NXP_STB220 is not set -# CONFIG_NXP_STB225 is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y -CONFIG_PHYLIB=y -# CONFIG_PMC_MSP is not set -# CONFIG_PMC_YOSEMITE is not set -# CONFIG_PNX8550_JBS is not set -# CONFIG_PNX8550_STB810 is not set -# CONFIG_PROBE_INITRD_HEADER is not set -CONFIG_RTL8306_PHY=y -CONFIG_RTL8366S_PHY=y -CONFIG_RTL8366S_PHY_DEBUG_FS=y -CONFIG_RTL8366_SMI=y -CONFIG_SCHED_OMIT_FRAME_POINTER=y -# CONFIG_SCSI_DMA is not set -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=1 -CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -# CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP27 is not set -# CONFIG_SGI_IP28 is not set -# CONFIG_SGI_IP32 is not set -# CONFIG_SIBYTE_BIGSUR is not set -# CONFIG_SIBYTE_CARMEL is not set -# CONFIG_SIBYTE_CRHINE is not set -# CONFIG_SIBYTE_CRHONE is not set -# CONFIG_SIBYTE_LITTLESUR is not set -# CONFIG_SIBYTE_RHONE is not set -# CONFIG_SIBYTE_SENTOSA is not set -# CONFIG_SIBYTE_SWARM is not set -# CONFIG_SLAB is not set -# CONFIG_SLOW_WORK is not set -CONFIG_SLUB=y -CONFIG_SPI=y -CONFIG_SPI_AP83=y -CONFIG_SPI_AR71XX=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_GPIO=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_PB44=y -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_VSC7385 is not set -CONFIG_SWCONFIG=y -CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R2=y -CONFIG_SYS_HAS_EARLY_PRINTK=y -CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y -CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -# CONFIG_TC35815 is not set -CONFIG_TRACING_SUPPORT=y -CONFIG_TRAD_SIGNALS=y -CONFIG_USB_SUPPORT=y -CONFIG_YAFFS_9BYTE_TAGS=y -CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED=y -CONFIG_YAFFS_AUTO_YAFFS2=y -# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set -# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set -CONFIG_YAFFS_FS=y -CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y -CONFIG_YAFFS_YAFFS1=y -CONFIG_YAFFS_YAFFS2=y -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ar71xx/config-2.6.31 b/target/linux/ar71xx/config-2.6.31 deleted file mode 100644 index 3b8529b22..000000000 --- a/target/linux/ar71xx/config-2.6.31 +++ /dev/null @@ -1,240 +0,0 @@ -CONFIG_32BIT=y -# CONFIG_64BIT is not set -CONFIG_AG71XX=y -CONFIG_AG71XX_AR8216_SUPPORT=y -# CONFIG_AG71XX_DEBUG is not set -# CONFIG_AG71XX_DEBUG_FS is not set -# CONFIG_ALCHEMY_GPIO_INDIRECT is not set -# CONFIG_AR7 is not set -CONFIG_AR71XX_DEV_AP91_PCI=y -CONFIG_AR71XX_DEV_AP94_PCI=y -CONFIG_AR71XX_DEV_AR913X_WMAC=y -CONFIG_AR71XX_DEV_DSA=y -CONFIG_AR71XX_DEV_GPIO_BUTTONS=y -CONFIG_AR71XX_DEV_LEDS_GPIO=y -CONFIG_AR71XX_DEV_M25P80=y -CONFIG_AR71XX_DEV_PB42_PCI=y -CONFIG_AR71XX_DEV_USB=y -CONFIG_AR71XX_MACH_AP81=y -CONFIG_AR71XX_MACH_AP83=y -CONFIG_AR71XX_MACH_AW_NR580=y -CONFIG_AR71XX_MACH_DIR_600_A1=y -CONFIG_AR71XX_MACH_DIR_615_C1=y -CONFIG_AR71XX_MACH_DIR_825_B1=y -CONFIG_AR71XX_MACH_MZK_W04NU=y -CONFIG_AR71XX_MACH_MZK_W300NH=y -CONFIG_AR71XX_MACH_PB42=y -CONFIG_AR71XX_MACH_PB44=y -CONFIG_AR71XX_MACH_RB_4XX=y -CONFIG_AR71XX_MACH_TEW_632BRP=y -CONFIG_AR71XX_MACH_TL_WR1043ND=y -CONFIG_AR71XX_MACH_TL_WR741ND=y -CONFIG_AR71XX_MACH_TL_WR841N_V1=y -CONFIG_AR71XX_MACH_TL_WR941ND=y -CONFIG_AR71XX_MACH_UBNT=y -CONFIG_AR71XX_MACH_WNDR3700=y -CONFIG_AR71XX_MACH_WNR2000=y -CONFIG_AR71XX_MACH_WP543=y -CONFIG_AR71XX_MACH_WRT160NL=y -CONFIG_AR71XX_MACH_WRT400N=y -CONFIG_AR71XX_MACH_WZR_HP_G300NH=y -CONFIG_AR71XX_NVRAM=y -CONFIG_AR71XX_WDT=y -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -CONFIG_ARCH_SUPPORTS_OPROFILE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ATHEROS_AR71XX=y -# CONFIG_BCM47XX is not set -CONFIG_BITREVERSE=y -# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set -# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_CEVT_R4K=y -CONFIG_CEVT_R4K_LIB=y -CONFIG_CMDLINE="rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200" -CONFIG_CPU_BIG_ENDIAN=y -# CONFIG_CPU_CAVIUM_OCTEON is not set -CONFIG_CPU_HAS_LLSC=y -CONFIG_CPU_HAS_PREFETCH=y -CONFIG_CPU_HAS_SYNC=y -# CONFIG_CPU_LITTLE_ENDIAN is not set -# CONFIG_CPU_LOONGSON2 is not set -CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set -CONFIG_CPU_MIPS32_R2=y -# CONFIG_CPU_MIPS64_R1 is not set -# CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_MIPSR2=y -# CONFIG_CPU_NEVADA is not set -# CONFIG_CPU_R10000 is not set -# CONFIG_CPU_R3000 is not set -# CONFIG_CPU_R4300 is not set -# CONFIG_CPU_R4X00 is not set -# CONFIG_CPU_R5000 is not set -# CONFIG_CPU_R5432 is not set -# CONFIG_CPU_R5500 is not set -# CONFIG_CPU_R6000 is not set -# CONFIG_CPU_R8000 is not set -# CONFIG_CPU_RM7000 is not set -# CONFIG_CPU_RM9000 is not set -# CONFIG_CPU_SB1 is not set -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -CONFIG_CPU_SUPPORTS_HIGHMEM=y -# CONFIG_CPU_TX39XX is not set -# CONFIG_CPU_TX49XX is not set -# CONFIG_CPU_VR41XX is not set -CONFIG_CSRC_R4K=y -CONFIG_CSRC_R4K_LIB=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DEVPORT=y -# CONFIG_DM9000 is not set -CONFIG_DMA_NEED_PCI_MAP_STATE=y -CONFIG_DMA_NONCOHERENT=y -CONFIG_EARLY_PRINTK=y -# CONFIG_FSNOTIFY is not set -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_FIND_LAST_BIT=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -CONFIG_GENERIC_GPIO=y -CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_NXP_74HC153=y -CONFIG_GPIO_SYSFS=y -CONFIG_HARDWARE_WATCHPOINTS=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set -CONFIG_HAVE_IDE=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HW_HAS_PCI=y -# CONFIG_HW_RANDOM is not set -CONFIG_I2C=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_GPIO=y -CONFIG_ICPLUS_PHY=y -CONFIG_IMAGE_CMDLINE_HACK=y -# CONFIG_INITRAMFS_COMPRESSION_LZO is not set -CONFIG_INITRAMFS_ROOT_GID=0 -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_SOURCE="../../root" -CONFIG_IRQ_CPU=y -# CONFIG_ISDN is not set -# CONFIG_LEDS_GPIO is not set -# CONFIG_LEDS_WNDR3700_USB is not set -# CONFIG_LEMOTE_FULONG is not set -# CONFIG_M25PXX_USE_FAST_READ is not set -CONFIG_MAC80211_DEFAULT_PS_VALUE=0 -# CONFIG_MACH_ALCHEMY is not set -# CONFIG_MACH_DECSTATION is not set -# CONFIG_MACH_JAZZ is not set -# CONFIG_MACH_TX39XX is not set -# CONFIG_MACH_TX49XX is not set -# CONFIG_MACH_VR41XX is not set -CONFIG_MICREL_PHY=y -# CONFIG_MIKROTIK_RB532 is not set -CONFIG_MIPS=y -# CONFIG_MIPS_COBALT is not set -CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_MIPS_MACHINE=y -# CONFIG_MIPS_MALTA is not set -CONFIG_MIPS_MT_DISABLED=y -# CONFIG_MIPS_MT_SMP is not set -# CONFIG_MIPS_MT_SMTC is not set -# CONFIG_MIPS_SIM is not set -CONFIG_MTD_AR91XX_FLASH=y -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_MYLOADER_PARTS=y -CONFIG_MTD_NAND=y -CONFIG_MTD_NAND_RB4XX=y -CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2 -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_WRT160NL_PARTS=y -CONFIG_MYLOADER=y -CONFIG_NET_DSA=y -CONFIG_NET_DSA_MV88E6060=y -CONFIG_NET_DSA_MV88E6063=y -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set -# CONFIG_NET_DSA_TAG_DSA is not set -# CONFIG_NET_DSA_TAG_EDSA is not set -CONFIG_NET_DSA_TAG_TRAILER=y -# CONFIG_NO_IOPORT is not set -# CONFIG_NXP_STB220 is not set -# CONFIG_NXP_STB225 is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y -CONFIG_PHYLIB=y -# CONFIG_PMC_MSP is not set -# CONFIG_PMC_YOSEMITE is not set -# CONFIG_PNX8550_JBS is not set -# CONFIG_PNX8550_STB810 is not set -# CONFIG_PROBE_INITRD_HEADER is not set -CONFIG_RTL8306_PHY=y -CONFIG_RTL8366S_PHY=y -# CONFIG_RTL8366S_PHY_DEBUG_FS is not set -CONFIG_RTL8366_SMI=y -CONFIG_SCHED_OMIT_FRAME_POINTER=y -# CONFIG_SCSI_DMA is not set -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=1 -CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -# CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP27 is not set -# CONFIG_SGI_IP28 is not set -# CONFIG_SGI_IP32 is not set -# CONFIG_SIBYTE_BIGSUR is not set -# CONFIG_SIBYTE_CARMEL is not set -# CONFIG_SIBYTE_CRHINE is not set -# CONFIG_SIBYTE_CRHONE is not set -# CONFIG_SIBYTE_LITTLESUR is not set -# CONFIG_SIBYTE_RHONE is not set -# CONFIG_SIBYTE_SENTOSA is not set -# CONFIG_SIBYTE_SWARM is not set -# CONFIG_SLAB is not set -CONFIG_SLUB=y -CONFIG_SPI=y -CONFIG_SPI_AP83=y -CONFIG_SPI_AR71XX=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_GPIO=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_PB44=y -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_VSC7385 is not set -CONFIG_SWCONFIG=y -CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R2=y -CONFIG_SYS_HAS_EARLY_PRINTK=y -CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y -CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -# CONFIG_TC35815 is not set -CONFIG_TRAD_SIGNALS=y -CONFIG_USB_SUPPORT=y -CONFIG_YAFFS_9BYTE_TAGS=y -CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED=y -CONFIG_YAFFS_AUTO_YAFFS2=y -# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set -# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set -CONFIG_YAFFS_FS=y -CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y -CONFIG_YAFFS_YAFFS1=y -CONFIG_YAFFS_YAFFS2=y -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c b/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c index 5b929e1db..01433c2fb 100644 --- a/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c +++ b/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c @@ -1,7 +1,7 @@ /* * Bus Glue for Atheros AR71xx built-in EHCI controller. * - * Copyright (C) 2008 Gabor Juhos + * Copyright (C) 2008-2010 Gabor Juhos * Copyright (C) 2008 Imre Kaloz * * Parts of this file are based on Atheros' 2.6.15 BSP @@ -152,6 +152,7 @@ static const struct hc_driver ehci_ar71xx_hc_driver = { .urb_enqueue = ehci_urb_enqueue, .urb_dequeue = ehci_urb_dequeue, .endpoint_disable = ehci_endpoint_disable, + .endpoint_reset = ehci_endpoint_reset, .get_frame_number = ehci_get_frame, @@ -163,6 +164,8 @@ static const struct hc_driver ehci_ar71xx_hc_driver = { #endif .relinquish_port = ehci_relinquish_port, .port_handed_over = ehci_port_handed_over, + + .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, }; static const struct hc_driver ehci_ar91xx_hc_driver = { @@ -180,6 +183,7 @@ static const struct hc_driver ehci_ar91xx_hc_driver = { .urb_enqueue = ehci_urb_enqueue, .urb_dequeue = ehci_urb_dequeue, .endpoint_disable = ehci_endpoint_disable, + .endpoint_reset = ehci_endpoint_reset, .get_frame_number = ehci_get_frame, @@ -191,6 +195,8 @@ static const struct hc_driver ehci_ar91xx_hc_driver = { #endif .relinquish_port = ehci_relinquish_port, .port_handed_over = ehci_port_handed_over, + + .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, }; static int ehci_ar71xx_driver_probe(struct platform_device *pdev) diff --git a/target/linux/ar71xx/patches-2.6.30/001-ar71xx_core.patch b/target/linux/ar71xx/patches-2.6.30/001-ar71xx_core.patch deleted file mode 100644 index b94aff751..000000000 --- a/target/linux/ar71xx/patches-2.6.30/001-ar71xx_core.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -607,6 +607,13 @@ ifdef CONFIG_PHYSICAL_START - load-y = $(CONFIG_PHYSICAL_START) - endif - -+# -+# Atheros AR71xx -+# -+core-$(CONFIG_ATHEROS_AR71XX) += arch/mips/ar71xx/ -+cflags-$(CONFIG_ATHEROS_AR71XX) += -I$(srctree)/arch/mips/include/asm/mach-ar71xx -+load-$(CONFIG_ATHEROS_AR71XX) += 0xffffffff80060000 -+ - # temporary until string.h is fixed - cflags-y += -ffreestanding - ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -22,6 +22,23 @@ choice - config MACH_ALCHEMY - bool "Alchemy processor based machines" - -+config ATHEROS_AR71XX -+ bool "Atheros AR71xx based boards" -+ select CEVT_R4K -+ select CSRC_R4K -+ select DMA_NONCOHERENT -+ select HW_HAS_PCI -+ select IRQ_CPU -+ select ARCH_REQUIRE_GPIOLIB -+ select SYS_HAS_CPU_MIPS32_R1 -+ select SYS_HAS_CPU_MIPS32_R2 -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_SUPPORTS_BIG_ENDIAN -+ select SYS_HAS_EARLY_PRINTK -+ select MIPS_MACHINE -+ help -+ Support for Atheros AR71xx based boards. -+ - config BASLER_EXCITE - bool "Basler eXcite smart camera" - select CEVT_R4K -@@ -634,6 +651,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD - endchoice - - source "arch/mips/alchemy/Kconfig" -+source "arch/mips/ar71xx/Kconfig" - source "arch/mips/basler/excite/Kconfig" - source "arch/mips/jazz/Kconfig" - source "arch/mips/lasat/Kconfig" diff --git a/target/linux/ar71xx/patches-2.6.30/002-ar71xx_pci.patch b/target/linux/ar71xx/patches-2.6.30/002-ar71xx_pci.patch deleted file mode 100644 index 737c21f10..000000000 --- a/target/linux/ar71xx/patches-2.6.30/002-ar71xx_pci.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/mips/pci/Makefile -+++ b/arch/mips/pci/Makefile -@@ -16,6 +16,7 @@ obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o - obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o - obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o - obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o -+obj-$(CONFIG_ATHEROS_AR71XX) += pci-ar71xx.o pci-ar724x.o - - # - # These are still pretty much in the old state, watch, go blind. diff --git a/target/linux/ar71xx/patches-2.6.30/003-ar71xx_usb_host.patch b/target/linux/ar71xx/patches-2.6.30/003-ar71xx_usb_host.patch deleted file mode 100644 index 4a08987be..000000000 --- a/target/linux/ar71xx/patches-2.6.30/003-ar71xx_usb_host.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -78,6 +78,13 @@ config USB_EHCI_BIG_ENDIAN_DESC - depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX) - default y - -+config USB_EHCI_AR71XX -+ bool "USB EHCI support for AR71xx" -+ depends on USB_EHCI_HCD && ATHEROS_AR71XX -+ default y -+ help -+ Support for Atheros AR71xx built-in EHCI controller -+ - config USB_EHCI_FSL - bool "Support for Freescale on-chip EHCI USB controller" - depends on USB_EHCI_HCD && FSL_SOC -@@ -151,6 +158,13 @@ config USB_OHCI_HCD - To compile this driver as a module, choose M here: the - module will be called ohci-hcd. - -+config USB_OHCI_AR71XX -+ bool "USB OHCI support for Atheros AR71xx" -+ depends on USB_OHCI_HCD && ATHEROS_AR71XX -+ default y -+ help -+ Support for Atheros AR71xx built-in OHCI controller -+ - config USB_OHCI_HCD_PPC_SOC - bool "OHCI support for on-chip PPC USB controller" - depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx) ---- a/drivers/usb/host/ehci-hcd.c -+++ b/drivers/usb/host/ehci-hcd.c -@@ -1075,6 +1075,11 @@ MODULE_LICENSE ("GPL"); - #define PLATFORM_DRIVER ixp4xx_ehci_driver - #endif - -+#ifdef CONFIG_USB_EHCI_AR71XX -+#include "ehci-ar71xx.c" -+#define PLATFORM_DRIVER ehci_ar71xx_driver -+#endif -+ - #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ - !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) - #error "missing bus glue for ehci-hcd" ---- a/drivers/usb/host/ohci-hcd.c -+++ b/drivers/usb/host/ohci-hcd.c -@@ -1081,6 +1081,11 @@ MODULE_LICENSE ("GPL"); - #define TMIO_OHCI_DRIVER ohci_hcd_tmio_driver - #endif - -+#ifdef CONFIG_USB_OHCI_AR71XX -+#include "ohci-ar71xx.c" -+#define PLATFORM_DRIVER ohci_hcd_ar71xx_driver -+#endif -+ - #if !defined(PCI_DRIVER) && \ - !defined(PLATFORM_DRIVER) && \ - !defined(OF_PLATFORM_DRIVER) && \ diff --git a/target/linux/ar71xx/patches-2.6.30/004-ar71xx_spi_controller.patch b/target/linux/ar71xx/patches-2.6.30/004-ar71xx_spi_controller.patch deleted file mode 100644 index 9c196e077..000000000 --- a/target/linux/ar71xx/patches-2.6.30/004-ar71xx_spi_controller.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -53,6 +53,13 @@ if SPI_MASTER - - comment "SPI Master Controller Drivers" - -+config SPI_AR71XX -+ tristate "Atheros AR71xx SPI Controller" -+ depends on SPI_MASTER && ATHEROS_AR71XX -+ select SPI_BITBANG -+ help -+ This is the SPI contoller driver for Atheros AR71xx. -+ - config SPI_ATMEL - tristate "Atmel SPI Controller" - depends on (ARCH_AT91 || AVR32) ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -11,6 +11,7 @@ endif - obj-$(CONFIG_SPI_MASTER) += spi.o - - # SPI master controller drivers (bus) -+obj-$(CONFIG_SPI_AR71XX) += ar71xx_spi.o - obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o - obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o - obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o diff --git a/target/linux/ar71xx/patches-2.6.30/005-ar71xx_mac_driver.patch b/target/linux/ar71xx/patches-2.6.30/005-ar71xx_mac_driver.patch deleted file mode 100644 index e780ba954..000000000 --- a/target/linux/ar71xx/patches-2.6.30/005-ar71xx_mac_driver.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/drivers/net/Kconfig -+++ b/drivers/net/Kconfig -@@ -2087,6 +2087,8 @@ config ACENIC_OMIT_TIGON_I - - The safe and default value for this is N. - -+source drivers/net/ag71xx/Kconfig -+ - config DL2K - tristate "DL2000/TC902x-based Gigabit Ethernet support" - depends on PCI ---- a/drivers/net/Makefile -+++ b/drivers/net/Makefile -@@ -97,6 +97,7 @@ obj-$(CONFIG_SH_ETH) += sh_eth.o - obj-$(CONFIG_MII) += mii.o - obj-$(CONFIG_PHYLIB) += phy/ - -+obj-$(CONFIG_AG71XX) += ag71xx/ - obj-$(CONFIG_SUNDANCE) += sundance.o - obj-$(CONFIG_HAMACHI) += hamachi.o - obj-$(CONFIG_NET) += Space.o loopback.o diff --git a/target/linux/ar71xx/patches-2.6.30/006-ar71xx_wdt_driver.patch b/target/linux/ar71xx/patches-2.6.30/006-ar71xx_wdt_driver.patch deleted file mode 100644 index 2c3b68ff5..000000000 --- a/target/linux/ar71xx/patches-2.6.30/006-ar71xx_wdt_driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -764,6 +764,13 @@ config TXX9_WDT - help - Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs. - -+config AR71XX_WDT -+ tristate "Atheros AR71xx Watchdog Timer" -+ depends on ATHEROS_AR71XX -+ help -+ Hardware driver for the built-in watchdog timer on the Atheros -+ AR71xx SoCs. -+ - # PARISC Architecture - - # POWERPC Architecture ---- a/drivers/watchdog/Makefile -+++ b/drivers/watchdog/Makefile -@@ -105,6 +105,7 @@ obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o - obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o - obj-$(CONFIG_AR7_WDT) += ar7_wdt.o - obj-$(CONFIG_TXX9_WDT) += txx9wdt.o -+obj-$(CONFIG_AR71XX_WDT) += ar71xx_wdt.o - - # PARISC Architecture - diff --git a/target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch b/target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch deleted file mode 100644 index 943af6e42..000000000 --- a/target/linux/ar71xx/patches-2.6.30/007-ar91xx_flash_driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/mtd/maps/Kconfig -+++ b/drivers/mtd/maps/Kconfig -@@ -268,6 +268,13 @@ config MTD_ALCHEMY - help - Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards - -+config MTD_AR91XX_FLASH -+ tristate "Atheros AR91xx parallel flash support" -+ depends on ATHEROS_AR71XX -+ select MTD_COMPLEX_MAPPINGS -+ help -+ Parallel flash driver for the Atheros AR91xx based boards. -+ - config MTD_DILNETPC - tristate "CFI Flash device mapped on DIL/Net PC" - depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT ---- a/drivers/mtd/maps/Makefile -+++ b/drivers/mtd/maps/Makefile -@@ -42,6 +42,7 @@ obj-$(CONFIG_MTD_DBOX2) += dbox2-flash. - obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o - obj-$(CONFIG_MTD_PCI) += pci.o - obj-$(CONFIG_MTD_ALCHEMY) += alchemy-flash.o -+obj-$(CONFIG_MTD_AR91XX_FLASH) += ar91xx_flash.o - obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o - obj-$(CONFIG_MTD_EDB7312) += edb7312.o - obj-$(CONFIG_MTD_IMPA7) += impa7.o diff --git a/target/linux/ar71xx/patches-2.6.30/100-mtd_m25p80_add_pm25lv_flash_support.patch b/target/linux/ar71xx/patches-2.6.30/100-mtd_m25p80_add_pm25lv_flash_support.patch deleted file mode 100644 index 2fac990c7..000000000 --- a/target/linux/ar71xx/patches-2.6.30/100-mtd_m25p80_add_pm25lv_flash_support.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -500,6 +500,10 @@ static struct flash_info __devinitdata m - { "at26df161a", 0x1f4601, 0, 64 * 1024, 32, SECT_4K, }, - { "at26df321", 0x1f4701, 0, 64 * 1024, 64, SECT_4K, }, - -+ /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ -+ { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, -+ { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, -+ - /* Spansion -- single (large) sector size only, at least - * for the chips listed here (without boot sectors). - */ diff --git a/target/linux/ar71xx/patches-2.6.30/101-ksz8041_phy_driver.patch b/target/linux/ar71xx/patches-2.6.30/101-ksz8041_phy_driver.patch deleted file mode 100644 index 2a09911e1..000000000 --- a/target/linux/ar71xx/patches-2.6.30/101-ksz8041_phy_driver.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -108,6 +108,11 @@ config RTL8306_PHY - tristate "Driver for Realtek RTL8306S switches" - select SWCONFIG - -+config MICREL_PHY -+ tristate "Drivers for Micrel/Kendin PHYs" -+ ---help--- -+ Currently has a driver for the KSZ8041 -+ - config FIXED_PHY - bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" - depends on PHYLIB=y ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -22,6 +22,7 @@ obj-$(CONFIG_RTL8306_PHY) += rtl8306.o - obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o - obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o - obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o -+obj-$(CONFIG_MICREL) += micrel.o - obj-$(CONFIG_FIXED_PHY) += fixed.o - obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o - obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o diff --git a/target/linux/ar71xx/patches-2.6.30/102-mtd_m25p80_add_myloader_parser.patch b/target/linux/ar71xx/patches-2.6.30/102-mtd_m25p80_add_myloader_parser.patch deleted file mode 100644 index 4fde6ed43..000000000 --- a/target/linux/ar71xx/patches-2.6.30/102-mtd_m25p80_add_myloader_parser.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -718,6 +718,16 @@ static int __devinit m25p_probe(struct s - part_probes, &parts, 0); - } - -+#ifdef CONFIG_MTD_MYLOADER_PARTS -+ if (nr_parts <= 0) { -+ static const char *part_probes[] -+ = { "MyLoader", NULL, }; -+ -+ nr_parts = parse_mtd_partitions(&flash->mtd, -+ part_probes, &parts, 0); -+ } -+#endif -+ - if (nr_parts <= 0 && data && data->parts) { - parts = data->parts; - nr_parts = data->nr_parts; diff --git a/target/linux/ar71xx/patches-2.6.30/103-mtd_m25p80_add_en25pxx_support.patch b/target/linux/ar71xx/patches-2.6.30/103-mtd_m25p80_add_en25pxx_support.patch deleted file mode 100644 index 4bd8bfaf1..000000000 --- a/target/linux/ar71xx/patches-2.6.30/103-mtd_m25p80_add_en25pxx_support.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -500,6 +500,10 @@ static struct flash_info __devinitdata m - { "at26df161a", 0x1f4601, 0, 64 * 1024, 32, SECT_4K, }, - { "at26df321", 0x1f4701, 0, 64 * 1024, 64, SECT_4K, }, - -+ /* EON -- en25pxx */ -+ { "en25p32", 0x1c2016, 0, 64 * 1024, 64, }, -+ { "en25p64", 0x1c2017, 0, 64 * 1024, 128, }, -+ - /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ - { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, - { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, diff --git a/target/linux/ar71xx/patches-2.6.30/104-mtd_m25p80_add_redboot_parser.patch b/target/linux/ar71xx/patches-2.6.30/104-mtd_m25p80_add_redboot_parser.patch deleted file mode 100644 index 45731ed25..000000000 --- a/target/linux/ar71xx/patches-2.6.30/104-mtd_m25p80_add_redboot_parser.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -732,6 +732,15 @@ static int __devinit m25p_probe(struct s - } - #endif - -+#ifdef CONFIG_MTD_REDBOOT_PARTS -+ if (nr_parts <= 0) { -+ static const char *part_probes[] -+ = { "RedBoot", NULL, }; -+ -+ nr_parts = parse_mtd_partitions(&flash->mtd, -+ part_probes, &parts, 0); -+ } -+#endif - if (nr_parts <= 0 && data && data->parts) { - parts = data->parts; - nr_parts = data->nr_parts; diff --git a/target/linux/ar71xx/patches-2.6.30/105-mtd_m25p80_add_mx25lxxx_support.patch b/target/linux/ar71xx/patches-2.6.30/105-mtd_m25p80_add_mx25lxxx_support.patch deleted file mode 100644 index a9acede4f..000000000 --- a/target/linux/ar71xx/patches-2.6.30/105-mtd_m25p80_add_mx25lxxx_support.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -504,6 +504,11 @@ static struct flash_info __devinitdata m - { "en25p32", 0x1c2016, 0, 64 * 1024, 64, }, - { "en25p64", 0x1c2017, 0, 64 * 1024, 128, }, - -+ /* Macronix -- mx25lxxx */ -+ { "mx25l32", 0xc22016, 0, 64 * 1024, 64, }, -+ { "mx25l64", 0xc22017, 0, 64 * 1024, 128, }, -+ { "mx25l128", 0xc22018, 0, 64 * 1024, 256, }, -+ - /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ - { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, - { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, diff --git a/target/linux/ar71xx/patches-2.6.30/106-mtd_m25p80_add_xxxs33b_support.patch b/target/linux/ar71xx/patches-2.6.30/106-mtd_m25p80_add_xxxs33b_support.patch deleted file mode 100644 index 5bd20a769..000000000 --- a/target/linux/ar71xx/patches-2.6.30/106-mtd_m25p80_add_xxxs33b_support.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -509,6 +509,11 @@ static struct flash_info __devinitdata m - { "mx25l64", 0xc22017, 0, 64 * 1024, 128, }, - { "mx25l128", 0xc22018, 0, 64 * 1024, 256, }, - -+ /* Numonyx -- xxxs33b */ -+ { "160s33b", 0x898911, 0, 64 * 1024, 64, }, -+ { "320s33b", 0x898912, 0, 64 * 1024, 128, }, -+ { "640s33b", 0x898913, 0, 64 * 1024, 256, }, -+ - /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ - { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, - { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, -@@ -656,11 +661,12 @@ static int __devinit m25p_probe(struct s - dev_set_drvdata(&spi->dev, flash); - - /* -- * Atmel serial flash tend to power up -+ * Atmel and Intel/Numonyx serial flash tend to power up - * with the software protection bits set - */ - -- if (info->jedec_id >> 16 == 0x1f) { -+ if (info->jedec_id >> 16 == 0x1f || -+ info->jedec_id >> 16 == 0x89) { - write_enable(flash); - write_sr(flash, 0); - } diff --git a/target/linux/ar71xx/patches-2.6.30/107-mtd-SST39VF6401B-support.patch b/target/linux/ar71xx/patches-2.6.30/107-mtd-SST39VF6401B-support.patch deleted file mode 100644 index d04f6bb53..000000000 --- a/target/linux/ar71xx/patches-2.6.30/107-mtd-SST39VF6401B-support.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/mtd/chips/jedec_probe.c -+++ b/drivers/mtd/chips/jedec_probe.c -@@ -160,6 +160,7 @@ - #define SST39LF160 0x2782 - #define SST39VF1601 0x234b - #define SST39VF3201 0x235b -+#define SST39VF6401B 0x236d - #define SST39LF512 0x00D4 - #define SST39LF010 0x00D5 - #define SST39LF020 0x00D6 -@@ -1518,6 +1519,18 @@ static const struct amd_flash_info jedec - ERASEINFO(0x10000,64), - } - }, { -+ .mfr_id = MANUFACTURER_SST, -+ .dev_id = SST39VF6401B, -+ .name = "SST 39VF6401B", -+ .devtypes = CFI_DEVICETYPE_X16, -+ .uaddr = MTD_UADDR_0xAAAA_0x5555, -+ .dev_size = SIZE_8MiB, -+ .cmd_set = P_ID_AMD_STD, -+ .nr_regions = 1, -+ .regions = { -+ ERASEINFO(0x10000,128) -+ } -+ }, { - .mfr_id = MANUFACTURER_ST, - .dev_id = M29F800AB, - .name = "ST M29F800AB", diff --git a/target/linux/ar71xx/patches-2.6.30/108-mtd_fix_cfi_cmdset_0002_status_check.patch b/target/linux/ar71xx/patches-2.6.30/108-mtd_fix_cfi_cmdset_0002_status_check.patch deleted file mode 100644 index 2ddd0d3dd..000000000 --- a/target/linux/ar71xx/patches-2.6.30/108-mtd_fix_cfi_cmdset_0002_status_check.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1152,8 +1152,8 @@ static int __xipram do_write_oneword(str - break; - } - -- if (chip_ready(map, adr)) -- break; -+ if (chip_good(map, adr, datum)) -+ goto enable_xip; - - /* Latency issues. Drop the lock, wait a while and retry */ - UDELAY(map, chip, adr, 1); -@@ -1169,6 +1169,8 @@ static int __xipram do_write_oneword(str - - ret = -EIO; - } -+ -+ enable_xip: - xip_enable(map, chip, adr); - op_done: - chip->state = FL_READY; -@@ -1515,7 +1517,6 @@ static int cfi_amdstd_write_buffers(stru - return 0; - } - -- - /* - * Handle devices with one erase region, that only implement - * the chip erase command. -@@ -1579,8 +1580,8 @@ static int __xipram do_erase_chip(struct - chip->erase_suspended = 0; - } - -- if (chip_ready(map, adr)) -- break; -+ if (chip_good(map, adr, map_word_ff(map))) -+ goto op_done; - - if (time_after(jiffies, timeo)) { - printk(KERN_WARNING "MTD %s(): software timeout\n", -@@ -1600,6 +1601,7 @@ static int __xipram do_erase_chip(struct - ret = -EIO; - } - -+ op_done: - chip->state = FL_READY; - xip_enable(map, chip, adr); - put_chip(map, chip, adr); -@@ -1667,9 +1669,9 @@ static int __xipram do_erase_oneblock(st - chip->erase_suspended = 0; - } - -- if (chip_ready(map, adr)) { -+ if (chip_good(map, adr, map_word_ff(map))) { - xip_enable(map, chip, adr); -- break; -+ goto op_done; - } - - if (time_after(jiffies, timeo)) { -@@ -1691,6 +1693,7 @@ static int __xipram do_erase_oneblock(st - ret = -EIO; - } - -+ op_done: - chip->state = FL_READY; - put_chip(map, chip, adr); - spin_unlock(chip->mutex); diff --git a/target/linux/ar71xx/patches-2.6.30/109-mtd-wrt160nl-trx-parser.patch b/target/linux/ar71xx/patches-2.6.30/109-mtd-wrt160nl-trx-parser.patch deleted file mode 100644 index 5696d3965..000000000 --- a/target/linux/ar71xx/patches-2.6.30/109-mtd-wrt160nl-trx-parser.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -752,6 +752,16 @@ static int __devinit m25p_probe(struct s - part_probes, &parts, 0); - } - #endif -+ -+#ifdef CONFIG_MTD_WRT160NL_PARTS -+ if (nr_parts <= 0) { -+ static const char *part_probes[] -+ = { "wrt160nl", NULL, }; -+ -+ nr_parts = parse_mtd_partitions(&flash->mtd, -+ part_probes, &parts, 0); -+ } -+#endif - if (nr_parts <= 0 && data && data->parts) { - parts = data->parts; - nr_parts = data->nr_parts; ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -180,6 +180,12 @@ config MTD_AR7_PARTS - ---help--- - TI AR7 partitioning support - -+config MTD_WRT160NL_PARTS -+ tristate "Linksys WRT160NL partitioning support" -+ depends on MTD_PARTITIONS && AR71XX_MACH_WRT160NL -+ ---help--- -+ Linksys WRT160NL partitioning support -+ - config MTD_MYLOADER_PARTS - tristate "MyLoader partition parsing" - depends on MTD_PARTITIONS && (ADM5120 || ATHEROS_AR231X || ATHEROS_AR71XX) ---- a/drivers/mtd/Makefile -+++ b/drivers/mtd/Makefile -@@ -12,6 +12,7 @@ obj-$(CONFIG_MTD_REDBOOT_PARTS) += redbo - obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o - obj-$(CONFIG_MTD_AFS_PARTS) += afs.o - obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o -+obj-$(CONFIG_MTD_WRT160NL_PARTS) += wrt160nl_part.o - obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o - obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o - diff --git a/target/linux/ar71xx/patches-2.6.30/110-usb-ehci-add-war-for-synopsys-hc-bug.patch b/target/linux/ar71xx/patches-2.6.30/110-usb-ehci-add-war-for-synopsys-hc-bug.patch deleted file mode 100644 index a34155a20..000000000 --- a/target/linux/ar71xx/patches-2.6.30/110-usb-ehci-add-war-for-synopsys-hc-bug.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/drivers/usb/host/ehci-q.c -+++ b/drivers/usb/host/ehci-q.c -@@ -1127,6 +1127,9 @@ static void end_unlink_async (struct ehc - ehci->reclaim = NULL; - start_unlink_async (ehci, next); - } -+ -+ if (ehci->has_synopsys_hc_bug) -+ writel((u32)ehci->async->qh_dma, &ehci->regs->async_next); - } - - /* makes sure the async qh will become idle */ ---- a/drivers/usb/host/ehci.h -+++ b/drivers/usb/host/ehci.h -@@ -125,6 +125,7 @@ struct ehci_hcd { /* one per controlle - unsigned big_endian_mmio:1; - unsigned big_endian_desc:1; - unsigned has_amcc_usb23:1; -+ unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ - - /* required for usb32 quirk */ - #define OHCI_CTRL_HCFS (3 << 6) diff --git a/target/linux/ar71xx/patches-2.6.30/111-mtd-cfi_cmdset_0002-force-word-write.patch b/target/linux/ar71xx/patches-2.6.30/111-mtd-cfi_cmdset_0002-force-word-write.patch deleted file mode 100644 index 8c966d272..000000000 --- a/target/linux/ar71xx/patches-2.6.30/111-mtd-cfi_cmdset_0002-force-word-write.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -39,7 +39,7 @@ - #include - - #define AMD_BOOTLOC_BUG --#define FORCE_WORD_WRITE 0 -+#define FORCE_WORD_WRITE 1 - - #define MAX_WORD_RETRIES 3 - -@@ -55,7 +55,9 @@ - - static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); - static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); -+#if !FORCE_WORD_WRITE - static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); -+#endif - static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *); - static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *); - static void cfi_amdstd_sync (struct mtd_info *); -@@ -190,6 +192,7 @@ static void fixup_amd_bootblock(struct m - } - #endif - -+#if !FORCE_WORD_WRITE - static void fixup_use_write_buffers(struct mtd_info *mtd, void *param) - { - struct map_info *map = mtd->priv; -@@ -199,6 +202,7 @@ static void fixup_use_write_buffers(stru - mtd->write = cfi_amdstd_write_buffers; - } - } -+#endif /* !FORCE_WORD_WRITE */ - - /* Atmel chips don't use the same PRI format as AMD chips */ - static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) -@@ -1326,6 +1330,7 @@ static int cfi_amdstd_write_words(struct - /* - * FIXME: interleaved mode not tested, and probably not supported! - */ -+#if !FORCE_WORD_WRITE - static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, - unsigned long adr, const u_char *buf, - int len) -@@ -1437,7 +1442,6 @@ static int __xipram do_write_buffer(stru - return ret; - } - -- - static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, - size_t *retlen, const u_char *buf) - { -@@ -1516,6 +1520,7 @@ static int cfi_amdstd_write_buffers(stru - - return 0; - } -+#endif /* !FORCE_WORD_WRITE */ - - /* - * Handle devices with one erase region, that only implement diff --git a/target/linux/ar71xx/patches-2.6.30/120-dsa-trailer-tag-validation-fix.patch b/target/linux/ar71xx/patches-2.6.30/120-dsa-trailer-tag-validation-fix.patch deleted file mode 100644 index b58aeedc3..000000000 --- a/target/linux/ar71xx/patches-2.6.30/120-dsa-trailer-tag-validation-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/dsa/tag_trailer.c -+++ b/net/dsa/tag_trailer.c -@@ -86,7 +86,7 @@ static int trailer_rcv(struct sk_buff *s - - trailer = skb_tail_pointer(skb) - 4; - if (trailer[0] != 0x80 || (trailer[1] & 0xf8) != 0x00 || -- (trailer[3] & 0xef) != 0x00 || trailer[3] != 0x00) -+ (trailer[2] & 0xef) != 0x00 || (trailer[3] & 0xfe) != 0x00) - goto out_drop; - - source_port = trailer[1] & 7; diff --git a/target/linux/ar71xx/patches-2.6.30/121-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-2.6.30/121-dsa-add-88e6063-driver.patch deleted file mode 100644 index 1a11a69c6..000000000 --- a/target/linux/ar71xx/patches-2.6.30/121-dsa-add-88e6063-driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/net/dsa/Kconfig -+++ b/net/dsa/Kconfig -@@ -36,6 +36,13 @@ config NET_DSA_MV88E6060 - This enables support for the Marvell 88E6060 ethernet switch - chip. - -+config NET_DSA_MV88E6063 -+ bool "Marvell 88E6063 ethernet switch chip support" -+ select NET_DSA_TAG_TRAILER -+ ---help--- -+ This enables support for the Marvell 88E6063 ethernet switch -+ chip -+ - config NET_DSA_MV88E6XXX_NEED_PPU - bool - default n ---- a/net/dsa/Makefile -+++ b/net/dsa/Makefile -@@ -6,6 +6,7 @@ obj-$(CONFIG_NET_DSA_TAG_TRAILER) += tag - # switch drivers - obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o - obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o -+obj-$(CONFIG_NET_DSA_MV88E6063) += mv88e6063.o - obj-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o - obj-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o - diff --git a/target/linux/ar71xx/patches-2.6.30/140-redboot_partition_scan.patch b/target/linux/ar71xx/patches-2.6.30/140-redboot_partition_scan.patch deleted file mode 100644 index 289d4eb99..000000000 --- a/target/linux/ar71xx/patches-2.6.30/140-redboot_partition_scan.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -60,31 +60,32 @@ static int parse_redboot_partitions(stru - static char nullstring[] = "unallocated"; - #endif - -+ buf = vmalloc(master->erasesize); -+ if (!buf) -+ return -ENOMEM; -+ -+ restart: - if ( directory < 0 ) { - offset = master->size + directory * master->erasesize; -- while (master->block_isbad && -+ while (master->block_isbad && - master->block_isbad(master, offset)) { - if (!offset) { - nogood: - printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n"); -+ vfree(buf); - return -EIO; - } - offset -= master->erasesize; - } - } else { - offset = directory * master->erasesize; -- while (master->block_isbad && -+ while (master->block_isbad && - master->block_isbad(master, offset)) { - offset += master->erasesize; - if (offset == master->size) - goto nogood; - } - } -- buf = vmalloc(master->erasesize); -- -- if (!buf) -- return -ENOMEM; -- - printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n", - master->name, offset); - -@@ -156,6 +157,11 @@ static int parse_redboot_partitions(stru - } - if (i == numslots) { - /* Didn't find it */ -+ if (offset + master->erasesize < master->size) { -+ /* not at the end of the flash yet, maybe next block :) */ -+ directory++; -+ goto restart; -+ } - printk(KERN_NOTICE "No RedBoot partition table detected in %s\n", - master->name); - ret = 0; diff --git a/target/linux/ar71xx/patches-2.6.30/200-rb4xx_nand_driver.patch b/target/linux/ar71xx/patches-2.6.30/200-rb4xx_nand_driver.patch deleted file mode 100644 index 1ca9f6ed7..000000000 --- a/target/linux/ar71xx/patches-2.6.30/200-rb4xx_nand_driver.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/drivers/mtd/nand/Kconfig -+++ b/drivers/mtd/nand/Kconfig -@@ -446,4 +446,8 @@ config MTD_NAND_SOCRATES - help - Enables support for NAND Flash chips wired onto Socrates board. - -+config MTD_NAND_RB4XX -+ tristate "NAND flash driver for RouterBoard 4xx series" -+ depends on MTD_NAND && ATHEROS_AR71XX -+ - endif # MTD_NAND ---- a/drivers/mtd/nand/Makefile -+++ b/drivers/mtd/nand/Makefile -@@ -30,6 +30,7 @@ obj-$(CONFIG_MTD_NAND_BASLER_EXCITE) += - obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o - obj-$(CONFIG_MTD_NAND_TMIO) += tmio_nand.o - obj-$(CONFIG_MTD_NAND_PLATFORM) += plat_nand.o -+obj-$(CONFIG_MTD_NAND_RB4XX) += rb4xx_nand.o - obj-$(CONFIG_MTD_ALAUDA) += alauda.o - obj-$(CONFIG_MTD_NAND_PASEMI) += pasemi_nand.o - obj-$(CONFIG_MTD_NAND_ORION) += orion_nand.o diff --git a/target/linux/ar71xx/patches-2.6.30/201-ap83_spi_controller.patch b/target/linux/ar71xx/patches-2.6.30/201-ap83_spi_controller.patch deleted file mode 100644 index a8e889a7b..000000000 --- a/target/linux/ar71xx/patches-2.6.30/201-ap83_spi_controller.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -11,6 +11,7 @@ endif - obj-$(CONFIG_SPI_MASTER) += spi.o - - # SPI master controller drivers (bus) -+obj-$(CONFIG_SPI_AP83) += ap83_spi.o - obj-$(CONFIG_SPI_AR71XX) += ar71xx_spi.o - obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o - obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -53,6 +53,14 @@ if SPI_MASTER - - comment "SPI Master Controller Drivers" - -+config SPI_AP83 -+ tristate "Atheros AP83 specific SPI Controller" -+ depends on SPI_MASTER && AR71XX_MACH_AP83 -+ select SPI_BITBANG -+ help -+ This is a specific SPI controller driver for the Atheros AP83 -+ reference board. -+ - config SPI_AR71XX - tristate "Atheros AR71xx SPI Controller" - depends on SPI_MASTER && ATHEROS_AR71XX diff --git a/target/linux/ar71xx/patches-2.6.30/202-spi_vsc7385_driver.patch b/target/linux/ar71xx/patches-2.6.30/202-spi_vsc7385_driver.patch deleted file mode 100644 index b071d5d21..000000000 --- a/target/linux/ar71xx/patches-2.6.30/202-spi_vsc7385_driver.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -272,6 +272,11 @@ config SPI_TLE62X0 - sysfs interface, with each line presented as a kind of GPIO - exposing both switch control and diagnostic feedback. - -+config SPI_VSC7385 -+ tristate "Vitesse VSC7385 ethernet switch driver" -+ help -+ SPI driver for the Vitesse VSC7385 ethernet switch. -+ - # - # Add new SPI protocol masters in alphabetical order above this line - # ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -37,6 +37,7 @@ obj-$(CONFIG_SPI_SH_SCI) += spi_sh_sci. - - # SPI protocol drivers (device/link on bus) - obj-$(CONFIG_SPI_SPIDEV) += spidev.o -+obj-$(CONFIG_SPI_VSC7385) += spi_vsc7385.o - obj-$(CONFIG_SPI_TLE62X0) += tle62x0.o - # ... add above this line ... - diff --git a/target/linux/ar71xx/patches-2.6.30/203-pb44_spi_controller.patch b/target/linux/ar71xx/patches-2.6.30/203-pb44_spi_controller.patch deleted file mode 100644 index e48710ca9..000000000 --- a/target/linux/ar71xx/patches-2.6.30/203-pb44_spi_controller.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -68,6 +68,14 @@ config SPI_AR71XX - help - This is the SPI contoller driver for Atheros AR71xx. - -+config SPI_PB44 -+ tristate "Atheros PB44 board specific SPI controller" -+ depends on SPI_MASTER && AR71XX_MACH_PB44 -+ select SPI_BITBANG -+ help -+ This is a specific SPI controller driver for the Atheros PB44 -+ reference board. -+ - config SPI_ATMEL - tristate "Atmel SPI Controller" - depends on (ARCH_AT91 || AVR32) ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -22,6 +22,7 @@ obj-$(CONFIG_SPI_GPIO) += spi_gpio.o - obj-$(CONFIG_SPI_GPIO_OLD) += spi_gpio_old.o - obj-$(CONFIG_SPI_IMX) += spi_imx.o - obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o -+obj-$(CONFIG_SPI_PB44) += pb44_spi.o - obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o - obj-$(CONFIG_SPI_OMAP_UWIRE) += omap_uwire.o - obj-$(CONFIG_SPI_OMAP24XX) += omap2_mcspi.o diff --git a/target/linux/ar71xx/patches-2.6.30/205-wndr3700-usb-led-driver.patch b/target/linux/ar71xx/patches-2.6.30/205-wndr3700-usb-led-driver.patch deleted file mode 100644 index 8284f9a03..000000000 --- a/target/linux/ar71xx/patches-2.6.30/205-wndr3700-usb-led-driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -227,6 +227,13 @@ config LEDS_BD2802 - This option enables support for BD2802GU RGB LED driver chips - accessed via the I2C bus. - -+config LEDS_WNDR3700_USB -+ tristate "NETGEAR WNDR3700 USB LED driver" -+ depends on LEDS_CLASS && AR71XX_MACH_WNDR3700 -+ help -+ This option enables support for the USB LED found on the -+ NETGEAR WNDR3700 board. -+ - comment "LED Triggers" - - config LEDS_TRIGGERS ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -27,6 +27,7 @@ obj-$(CONFIG_LEDS_PCA955X) += leds-pca9 - obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o - obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o - obj-$(CONFIG_LEDS_PWM) += leds-pwm.o -+obj-${CONFIG_LEDS_WNDR3700_USB} += leds-wndr3700-usb.o - - # LED SPI Drivers - obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o diff --git a/target/linux/ar71xx/patches-2.6.30/206-nxp-74hc153-gpio-chip-driver.patch b/target/linux/ar71xx/patches-2.6.30/206-nxp-74hc153-gpio-chip-driver.patch deleted file mode 100644 index 0f1613c84..000000000 --- a/target/linux/ar71xx/patches-2.6.30/206-nxp-74hc153-gpio-chip-driver.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -176,4 +176,12 @@ config GPIO_MCP23S08 - SPI driver for Microchip MCP23S08 I/O expander. This provides - a GPIO interface supporting inputs and outputs. - -+comment "Other GPIO expanders" -+ -+config GPIO_NXP_74HC153 -+ tristate "NXP 74HC153 Dual 4-input multiplexer" -+ help -+ Platform driver for NXP 74HC153 Dual 4-input Multiplexer. This -+ provides a GPIO interface supporting inputs. -+ - endif ---- a/drivers/gpio/Makefile -+++ b/drivers/gpio/Makefile -@@ -7,6 +7,7 @@ obj-$(CONFIG_GPIOLIB) += gpiolib.o - obj-$(CONFIG_GPIO_MAX7301) += max7301.o - obj-$(CONFIG_GPIO_MAX732X) += max732x.o - obj-$(CONFIG_GPIO_MCP23S08) += mcp23s08.o -+obj-$(CONFIG_GPIO_NXP_74HC153) += nxp_74hc153.o - obj-$(CONFIG_GPIO_PCA953X) += pca953x.o - obj-$(CONFIG_GPIO_PCF857X) += pcf857x.o - obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o diff --git a/target/linux/ar71xx/patches-2.6.30/300-mips_fw_myloader.patch b/target/linux/ar71xx/patches-2.6.30/300-mips_fw_myloader.patch deleted file mode 100644 index 55e7e8bde..000000000 --- a/target/linux/ar71xx/patches-2.6.30/300-mips_fw_myloader.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -165,6 +165,7 @@ endif - # - libs-$(CONFIG_ARC) += arch/mips/fw/arc/ - libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ -+libs-$(CONFIG_MYLOADER) += arch/mips/fw/myloader/ - libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/ - libs-y += arch/mips/fw/lib/ - libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/ ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -829,6 +829,9 @@ config MIPS_NILE4 - config MIPS_DISABLE_OBSOLETE_IDE - bool - -+config MYLOADER -+ bool -+ - config SYNC_R4K - bool - diff --git a/target/linux/ar71xx/patches-2.6.30/901-get_c0_compare_irq_function.patch b/target/linux/ar71xx/patches-2.6.30/901-get_c0_compare_irq_function.patch deleted file mode 100644 index adb8044af..000000000 --- a/target/linux/ar71xx/patches-2.6.30/901-get_c0_compare_irq_function.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - extern void check_wait(void); - extern asmlinkage void r4k_wait(void); -@@ -1542,6 +1543,8 @@ void __cpuinit per_cpu_trap_init(void) - */ - if (cpu_has_mips_r2) { - cp0_compare_irq = (read_c0_intctl() >> 29) & 7; -+ if (get_c0_compare_irq) -+ cp0_compare_irq = get_c0_compare_irq(); - cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7; - if (cp0_perfcount_irq == cp0_compare_irq) - cp0_perfcount_irq = -1; ---- a/arch/mips/include/asm/time.h -+++ b/arch/mips/include/asm/time.h -@@ -52,6 +52,7 @@ extern int (*perf_irq)(void); - */ - #ifdef CONFIG_CEVT_R4K_LIB - extern unsigned int __weak get_c0_compare_int(void); -+extern unsigned int __weak get_c0_compare_irq(void); - extern int r4k_clockevent_init(void); - #endif - diff --git a/target/linux/ar71xx/patches-2.6.30/902-mips_clocksource_init_war.patch b/target/linux/ar71xx/patches-2.6.30/902-mips_clocksource_init_war.patch deleted file mode 100644 index 03a66ff13..000000000 --- a/target/linux/ar71xx/patches-2.6.30/902-mips_clocksource_init_war.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/arch/mips/kernel/cevt-r4k.c -+++ b/arch/mips/kernel/cevt-r4k.c -@@ -15,6 +15,22 @@ - #include - - /* -+ * Compare interrupt can be routed and latched outside the core, -+ * so a single execution hazard barrier may not be enough to give -+ * it time to clear as seen in the Cause register. 4 time the -+ * pipeline depth seems reasonably conservative, and empirically -+ * works better in configurations with high CPU/bus clock ratios. -+ */ -+ -+#define compare_change_hazard() \ -+ do { \ -+ irq_disable_hazard(); \ -+ irq_disable_hazard(); \ -+ irq_disable_hazard(); \ -+ irq_disable_hazard(); \ -+ } while (0) -+ -+/* - * The SMTC Kernel for the 34K, 1004K, et. al. replaces several - * of these routines with SMTC-specific variants. - */ -@@ -30,6 +46,7 @@ static int mips_next_event(unsigned long - cnt = read_c0_count(); - cnt += delta; - write_c0_compare(cnt); -+ compare_change_hazard(); - res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0; - return res; - } -@@ -99,22 +116,6 @@ static int c0_compare_int_pending(void) - return (read_c0_cause() >> cp0_compare_irq) & 0x100; - } - --/* -- * Compare interrupt can be routed and latched outside the core, -- * so a single execution hazard barrier may not be enough to give -- * it time to clear as seen in the Cause register. 4 time the -- * pipeline depth seems reasonably conservative, and empirically -- * works better in configurations with high CPU/bus clock ratios. -- */ -- --#define compare_change_hazard() \ -- do { \ -- irq_disable_hazard(); \ -- irq_disable_hazard(); \ -- irq_disable_hazard(); \ -- irq_disable_hazard(); \ -- } while (0) -- - int c0_compare_int_usable(void) - { - unsigned int delta; diff --git a/target/linux/ar71xx/patches-2.6.31/001-ar71xx_core.patch b/target/linux/ar71xx/patches-2.6.31/001-ar71xx_core.patch deleted file mode 100644 index 9c84eeae9..000000000 --- a/target/linux/ar71xx/patches-2.6.31/001-ar71xx_core.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -612,6 +612,13 @@ else - load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff81100000 - endif - -+# -+# Atheros AR71xx -+# -+core-$(CONFIG_ATHEROS_AR71XX) += arch/mips/ar71xx/ -+cflags-$(CONFIG_ATHEROS_AR71XX) += -I$(srctree)/arch/mips/include/asm/mach-ar71xx -+load-$(CONFIG_ATHEROS_AR71XX) += 0xffffffff80060000 -+ - # temporary until string.h is fixed - cflags-y += -ffreestanding - ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -42,6 +42,23 @@ config AR7 - Support for the Texas Instruments AR7 System-on-a-Chip - family: TNETD7100, 7200 and 7300. - -+config ATHEROS_AR71XX -+ bool "Atheros AR71xx based boards" -+ select CEVT_R4K -+ select CSRC_R4K -+ select DMA_NONCOHERENT -+ select HW_HAS_PCI -+ select IRQ_CPU -+ select ARCH_REQUIRE_GPIOLIB -+ select SYS_HAS_CPU_MIPS32_R1 -+ select SYS_HAS_CPU_MIPS32_R2 -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_SUPPORTS_BIG_ENDIAN -+ select SYS_HAS_EARLY_PRINTK -+ select MIPS_MACHINE -+ help -+ Support for Atheros AR71xx based boards. -+ - config BASLER_EXCITE - bool "Basler eXcite smart camera" - select CEVT_R4K -@@ -659,6 +676,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD - endchoice - - source "arch/mips/alchemy/Kconfig" -+source "arch/mips/ar71xx/Kconfig" - source "arch/mips/basler/excite/Kconfig" - source "arch/mips/jazz/Kconfig" - source "arch/mips/lasat/Kconfig" diff --git a/target/linux/ar71xx/patches-2.6.31/002-ar71xx_pci.patch b/target/linux/ar71xx/patches-2.6.31/002-ar71xx_pci.patch deleted file mode 100644 index 737c21f10..000000000 --- a/target/linux/ar71xx/patches-2.6.31/002-ar71xx_pci.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/mips/pci/Makefile -+++ b/arch/mips/pci/Makefile -@@ -16,6 +16,7 @@ obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o - obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o - obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o - obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o -+obj-$(CONFIG_ATHEROS_AR71XX) += pci-ar71xx.o pci-ar724x.o - - # - # These are still pretty much in the old state, watch, go blind. diff --git a/target/linux/ar71xx/patches-2.6.31/003-ar71xx_usb_host.patch b/target/linux/ar71xx/patches-2.6.31/003-ar71xx_usb_host.patch deleted file mode 100644 index 0294faf99..000000000 --- a/target/linux/ar71xx/patches-2.6.31/003-ar71xx_usb_host.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -98,6 +98,13 @@ config USB_EHCI_BIG_ENDIAN_DESC - depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX) - default y - -+config USB_EHCI_AR71XX -+ bool "USB EHCI support for AR71xx" -+ depends on USB_EHCI_HCD && ATHEROS_AR71XX -+ default y -+ help -+ Support for Atheros AR71xx built-in EHCI controller -+ - config USB_EHCI_FSL - bool "Support for Freescale on-chip EHCI USB controller" - depends on USB_EHCI_HCD && FSL_SOC -@@ -171,6 +178,13 @@ config USB_OHCI_HCD - To compile this driver as a module, choose M here: the - module will be called ohci-hcd. - -+config USB_OHCI_AR71XX -+ bool "USB OHCI support for Atheros AR71xx" -+ depends on USB_OHCI_HCD && ATHEROS_AR71XX -+ default y -+ help -+ Support for Atheros AR71xx built-in OHCI controller -+ - config USB_OHCI_HCD_PPC_SOC - bool "OHCI support for on-chip PPC USB controller" - depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx) ---- a/drivers/usb/host/ehci-hcd.c -+++ b/drivers/usb/host/ehci-hcd.c -@@ -1119,6 +1119,11 @@ MODULE_LICENSE ("GPL"); - #define PLATFORM_DRIVER ixp4xx_ehci_driver - #endif - -+#ifdef CONFIG_USB_EHCI_AR71XX -+#include "ehci-ar71xx.c" -+#define PLATFORM_DRIVER ehci_ar71xx_driver -+#endif -+ - #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ - !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) - #error "missing bus glue for ehci-hcd" ---- a/drivers/usb/host/ohci-hcd.c -+++ b/drivers/usb/host/ohci-hcd.c -@@ -1086,6 +1086,11 @@ MODULE_LICENSE ("GPL"); - #define TMIO_OHCI_DRIVER ohci_hcd_tmio_driver - #endif - -+#ifdef CONFIG_USB_OHCI_AR71XX -+#include "ohci-ar71xx.c" -+#define PLATFORM_DRIVER ohci_hcd_ar71xx_driver -+#endif -+ - #if !defined(PCI_DRIVER) && \ - !defined(PLATFORM_DRIVER) && \ - !defined(OF_PLATFORM_DRIVER) && \ diff --git a/target/linux/ar71xx/patches-2.6.31/004-ar71xx_spi_controller.patch b/target/linux/ar71xx/patches-2.6.31/004-ar71xx_spi_controller.patch deleted file mode 100644 index 9c196e077..000000000 --- a/target/linux/ar71xx/patches-2.6.31/004-ar71xx_spi_controller.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -53,6 +53,13 @@ if SPI_MASTER - - comment "SPI Master Controller Drivers" - -+config SPI_AR71XX -+ tristate "Atheros AR71xx SPI Controller" -+ depends on SPI_MASTER && ATHEROS_AR71XX -+ select SPI_BITBANG -+ help -+ This is the SPI contoller driver for Atheros AR71xx. -+ - config SPI_ATMEL - tristate "Atmel SPI Controller" - depends on (ARCH_AT91 || AVR32) ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -11,6 +11,7 @@ endif - obj-$(CONFIG_SPI_MASTER) += spi.o - - # SPI master controller drivers (bus) -+obj-$(CONFIG_SPI_AR71XX) += ar71xx_spi.o - obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o - obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o - obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o diff --git a/target/linux/ar71xx/patches-2.6.31/005-ar71xx_mac_driver.patch b/target/linux/ar71xx/patches-2.6.31/005-ar71xx_mac_driver.patch deleted file mode 100644 index 043a3ec2c..000000000 --- a/target/linux/ar71xx/patches-2.6.31/005-ar71xx_mac_driver.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/drivers/net/Kconfig -+++ b/drivers/net/Kconfig -@@ -2103,6 +2103,8 @@ config ACENIC_OMIT_TIGON_I - - The safe and default value for this is N. - -+source drivers/net/ag71xx/Kconfig -+ - config DL2K - tristate "DL2000/TC902x-based Gigabit Ethernet support" - depends on PCI ---- a/drivers/net/Makefile -+++ b/drivers/net/Makefile -@@ -103,6 +103,7 @@ obj-$(CONFIG_MII) += mii.o - obj-$(CONFIG_MDIO) += mdio.o - obj-$(CONFIG_PHYLIB) += phy/ - -+obj-$(CONFIG_AG71XX) += ag71xx/ - obj-$(CONFIG_SUNDANCE) += sundance.o - obj-$(CONFIG_HAMACHI) += hamachi.o - obj-$(CONFIG_NET) += Space.o loopback.o diff --git a/target/linux/ar71xx/patches-2.6.31/006-ar71xx_wdt_driver.patch b/target/linux/ar71xx/patches-2.6.31/006-ar71xx_wdt_driver.patch deleted file mode 100644 index 08e58e221..000000000 --- a/target/linux/ar71xx/patches-2.6.31/006-ar71xx_wdt_driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -805,6 +805,13 @@ config TXX9_WDT - help - Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs. - -+config AR71XX_WDT -+ tristate "Atheros AR71xx Watchdog Timer" -+ depends on ATHEROS_AR71XX -+ help -+ Hardware driver for the built-in watchdog timer on the Atheros -+ AR71xx SoCs. -+ - # PARISC Architecture - - # POWERPC Architecture ---- a/drivers/watchdog/Makefile -+++ b/drivers/watchdog/Makefile -@@ -110,6 +110,7 @@ obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o - obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o - obj-$(CONFIG_AR7_WDT) += ar7_wdt.o - obj-$(CONFIG_TXX9_WDT) += txx9wdt.o -+obj-$(CONFIG_AR71XX_WDT) += ar71xx_wdt.o - - # PARISC Architecture - diff --git a/target/linux/ar71xx/patches-2.6.31/007-ar91xx_flash_driver.patch b/target/linux/ar71xx/patches-2.6.31/007-ar91xx_flash_driver.patch deleted file mode 100644 index 244d820da..000000000 --- a/target/linux/ar71xx/patches-2.6.31/007-ar91xx_flash_driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/mtd/maps/Kconfig -+++ b/drivers/mtd/maps/Kconfig -@@ -259,6 +259,13 @@ config MTD_ALCHEMY - help - Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards - -+config MTD_AR91XX_FLASH -+ tristate "Atheros AR91xx parallel flash support" -+ depends on ATHEROS_AR71XX -+ select MTD_COMPLEX_MAPPINGS -+ help -+ Parallel flash driver for the Atheros AR91xx based boards. -+ - config MTD_DILNETPC - tristate "CFI Flash device mapped on DIL/Net PC" - depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT && BROKEN ---- a/drivers/mtd/maps/Makefile -+++ b/drivers/mtd/maps/Makefile -@@ -41,6 +41,7 @@ obj-$(CONFIG_MTD_DBOX2) += dbox2-flash. - obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o - obj-$(CONFIG_MTD_PCI) += pci.o - obj-$(CONFIG_MTD_ALCHEMY) += alchemy-flash.o -+obj-$(CONFIG_MTD_AR91XX_FLASH) += ar91xx_flash.o - obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o - obj-$(CONFIG_MTD_EDB7312) += edb7312.o - obj-$(CONFIG_MTD_IMPA7) += impa7.o diff --git a/target/linux/ar71xx/patches-2.6.31/100-mtd_m25p80_add_pm25lv_flash_support.patch b/target/linux/ar71xx/patches-2.6.31/100-mtd_m25p80_add_pm25lv_flash_support.patch deleted file mode 100644 index d5b89ad82..000000000 --- a/target/linux/ar71xx/patches-2.6.31/100-mtd_m25p80_add_pm25lv_flash_support.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -503,6 +503,10 @@ static struct flash_info __devinitdata m - /* Macronix */ - { "mx25l12805d", 0xc22018, 0, 64 * 1024, 256, }, - -+ /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ -+ { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, -+ { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, -+ - /* Spansion -- single (large) sector size only, at least - * for the chips listed here (without boot sectors). - */ diff --git a/target/linux/ar71xx/patches-2.6.31/101-ksz8041_phy_driver.patch b/target/linux/ar71xx/patches-2.6.31/101-ksz8041_phy_driver.patch deleted file mode 100644 index 2a09911e1..000000000 --- a/target/linux/ar71xx/patches-2.6.31/101-ksz8041_phy_driver.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -108,6 +108,11 @@ config RTL8306_PHY - tristate "Driver for Realtek RTL8306S switches" - select SWCONFIG - -+config MICREL_PHY -+ tristate "Drivers for Micrel/Kendin PHYs" -+ ---help--- -+ Currently has a driver for the KSZ8041 -+ - config FIXED_PHY - bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" - depends on PHYLIB=y ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -22,6 +22,7 @@ obj-$(CONFIG_RTL8306_PHY) += rtl8306.o - obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o - obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o - obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o -+obj-$(CONFIG_MICREL) += micrel.o - obj-$(CONFIG_FIXED_PHY) += fixed.o - obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o - obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o diff --git a/target/linux/ar71xx/patches-2.6.31/102-mtd_m25p80_add_myloader_parser.patch b/target/linux/ar71xx/patches-2.6.31/102-mtd_m25p80_add_myloader_parser.patch deleted file mode 100644 index be84b35a7..000000000 --- a/target/linux/ar71xx/patches-2.6.31/102-mtd_m25p80_add_myloader_parser.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -722,6 +722,16 @@ static int __devinit m25p_probe(struct s - part_probes, &parts, 0); - } - -+#ifdef CONFIG_MTD_MYLOADER_PARTS -+ if (nr_parts <= 0) { -+ static const char *part_probes[] -+ = { "MyLoader", NULL, }; -+ -+ nr_parts = parse_mtd_partitions(&flash->mtd, -+ part_probes, &parts, 0); -+ } -+#endif -+ - if (nr_parts <= 0 && data && data->parts) { - parts = data->parts; - nr_parts = data->nr_parts; diff --git a/target/linux/ar71xx/patches-2.6.31/103-mtd_m25p80_add_en25pxx_support.patch b/target/linux/ar71xx/patches-2.6.31/103-mtd_m25p80_add_en25pxx_support.patch deleted file mode 100644 index 0b53151ae..000000000 --- a/target/linux/ar71xx/patches-2.6.31/103-mtd_m25p80_add_en25pxx_support.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -503,6 +503,10 @@ static struct flash_info __devinitdata m - /* Macronix */ - { "mx25l12805d", 0xc22018, 0, 64 * 1024, 256, }, - -+ /* EON -- en25pxx */ -+ { "en25p32", 0x1c2016, 0, 64 * 1024, 64, }, -+ { "en25p64", 0x1c2017, 0, 64 * 1024, 128, }, -+ - /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ - { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, - { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, diff --git a/target/linux/ar71xx/patches-2.6.31/104-mtd_m25p80_add_redboot_parser.patch b/target/linux/ar71xx/patches-2.6.31/104-mtd_m25p80_add_redboot_parser.patch deleted file mode 100644 index 105778a99..000000000 --- a/target/linux/ar71xx/patches-2.6.31/104-mtd_m25p80_add_redboot_parser.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -736,6 +736,15 @@ static int __devinit m25p_probe(struct s - } - #endif - -+#ifdef CONFIG_MTD_REDBOOT_PARTS -+ if (nr_parts <= 0) { -+ static const char *part_probes[] -+ = { "RedBoot", NULL, }; -+ -+ nr_parts = parse_mtd_partitions(&flash->mtd, -+ part_probes, &parts, 0); -+ } -+#endif - if (nr_parts <= 0 && data && data->parts) { - parts = data->parts; - nr_parts = data->nr_parts; diff --git a/target/linux/ar71xx/patches-2.6.31/105-mtd_m25p80_add_mx25lxxx_support.patch b/target/linux/ar71xx/patches-2.6.31/105-mtd_m25p80_add_mx25lxxx_support.patch deleted file mode 100644 index d4b8ee93e..000000000 --- a/target/linux/ar71xx/patches-2.6.31/105-mtd_m25p80_add_mx25lxxx_support.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -507,6 +507,11 @@ static struct flash_info __devinitdata m - { "en25p32", 0x1c2016, 0, 64 * 1024, 64, }, - { "en25p64", 0x1c2017, 0, 64 * 1024, 128, }, - -+ /* Macronix -- mx25lxxx */ -+ { "mx25l32", 0xc22016, 0, 64 * 1024, 64, }, -+ { "mx25l64", 0xc22017, 0, 64 * 1024, 128, }, -+ { "mx25l128", 0xc22018, 0, 64 * 1024, 256, }, -+ - /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ - { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, - { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, diff --git a/target/linux/ar71xx/patches-2.6.31/106-mtd_m25p80_add_xxxs33b_support.patch b/target/linux/ar71xx/patches-2.6.31/106-mtd_m25p80_add_xxxs33b_support.patch deleted file mode 100644 index dfd855a49..000000000 --- a/target/linux/ar71xx/patches-2.6.31/106-mtd_m25p80_add_xxxs33b_support.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -512,6 +512,11 @@ static struct flash_info __devinitdata m - { "mx25l64", 0xc22017, 0, 64 * 1024, 128, }, - { "mx25l128", 0xc22018, 0, 64 * 1024, 256, }, - -+ /* Numonyx -- xxxs33b */ -+ { "160s33b", 0x898911, 0, 64 * 1024, 64, }, -+ { "320s33b", 0x898912, 0, 64 * 1024, 128, }, -+ { "640s33b", 0x898913, 0, 64 * 1024, 256, }, -+ - /* PMC -- pm25x "blocks" are 32K, sectors are 4K */ - { "pm25lv512", 0, 32 * 1024, 2, SECT_4K }, - { "pm25lv010", 0, 32 * 1024, 4, SECT_4K }, -@@ -660,11 +665,12 @@ static int __devinit m25p_probe(struct s - dev_set_drvdata(&spi->dev, flash); - - /* -- * Atmel serial flash tend to power up -+ * Atmel and Intel/Numonyx serial flash tend to power up - * with the software protection bits set - */ - -- if (info->jedec_id >> 16 == 0x1f) { -+ if (info->jedec_id >> 16 == 0x1f || -+ info->jedec_id >> 16 == 0x89) { - write_enable(flash); - write_sr(flash, 0); - } diff --git a/target/linux/ar71xx/patches-2.6.31/107-mtd-SST39VF6401B-support.patch b/target/linux/ar71xx/patches-2.6.31/107-mtd-SST39VF6401B-support.patch deleted file mode 100644 index 93f9176b2..000000000 --- a/target/linux/ar71xx/patches-2.6.31/107-mtd-SST39VF6401B-support.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/mtd/chips/jedec_probe.c -+++ b/drivers/mtd/chips/jedec_probe.c -@@ -160,6 +160,7 @@ - #define SST39LF160 0x2782 - #define SST39VF1601 0x234b - #define SST39VF3201 0x235b -+#define SST39VF6401B 0x236d - #define SST39LF512 0x00D4 - #define SST39LF010 0x00D5 - #define SST39LF020 0x00D6 -@@ -1531,6 +1532,18 @@ static const struct amd_flash_info jedec - ERASEINFO(0x10000,64), - } - }, { -+ .mfr_id = MANUFACTURER_SST, -+ .dev_id = SST39VF6401B, -+ .name = "SST 39VF6401B", -+ .devtypes = CFI_DEVICETYPE_X16, -+ .uaddr = MTD_UADDR_0xAAAA_0x5555, -+ .dev_size = SIZE_8MiB, -+ .cmd_set = P_ID_AMD_STD, -+ .nr_regions = 1, -+ .regions = { -+ ERASEINFO(0x10000,128) -+ } -+ }, { - .mfr_id = MANUFACTURER_ST, - .dev_id = M29F800AB, - .name = "ST M29F800AB", diff --git a/target/linux/ar71xx/patches-2.6.31/108-mtd_fix_cfi_cmdset_0002_status_check.patch b/target/linux/ar71xx/patches-2.6.31/108-mtd_fix_cfi_cmdset_0002_status_check.patch deleted file mode 100644 index d4272ab1b..000000000 --- a/target/linux/ar71xx/patches-2.6.31/108-mtd_fix_cfi_cmdset_0002_status_check.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1141,8 +1141,8 @@ static int __xipram do_write_oneword(str - break; - } - -- if (chip_ready(map, adr)) -- break; -+ if (chip_good(map, adr, datum)) -+ goto enable_xip; - - /* Latency issues. Drop the lock, wait a while and retry */ - UDELAY(map, chip, adr, 1); -@@ -1158,6 +1158,8 @@ static int __xipram do_write_oneword(str - - ret = -EIO; - } -+ -+ enable_xip: - xip_enable(map, chip, adr); - op_done: - chip->state = FL_READY; -@@ -1504,7 +1506,6 @@ static int cfi_amdstd_write_buffers(stru - return 0; - } - -- - /* - * Handle devices with one erase region, that only implement - * the chip erase command. -@@ -1568,8 +1569,8 @@ static int __xipram do_erase_chip(struct - chip->erase_suspended = 0; - } - -- if (chip_ready(map, adr)) -- break; -+ if (chip_good(map, adr, map_word_ff(map))) -+ goto op_done; - - if (time_after(jiffies, timeo)) { - printk(KERN_WARNING "MTD %s(): software timeout\n", -@@ -1589,6 +1590,7 @@ static int __xipram do_erase_chip(struct - ret = -EIO; - } - -+ op_done: - chip->state = FL_READY; - xip_enable(map, chip, adr); - put_chip(map, chip, adr); -@@ -1656,9 +1658,9 @@ static int __xipram do_erase_oneblock(st - chip->erase_suspended = 0; - } - -- if (chip_ready(map, adr)) { -+ if (chip_good(map, adr, map_word_ff(map))) { - xip_enable(map, chip, adr); -- break; -+ goto op_done; - } - - if (time_after(jiffies, timeo)) { -@@ -1680,6 +1682,7 @@ static int __xipram do_erase_oneblock(st - ret = -EIO; - } - -+ op_done: - chip->state = FL_READY; - put_chip(map, chip, adr); - spin_unlock(chip->mutex); diff --git a/target/linux/ar71xx/patches-2.6.31/109-mtd-wrt160nl-trx-parser.patch b/target/linux/ar71xx/patches-2.6.31/109-mtd-wrt160nl-trx-parser.patch deleted file mode 100644 index ccf4b66b6..000000000 --- a/target/linux/ar71xx/patches-2.6.31/109-mtd-wrt160nl-trx-parser.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -756,6 +756,16 @@ static int __devinit m25p_probe(struct s - part_probes, &parts, 0); - } - #endif -+ -+#ifdef CONFIG_MTD_WRT160NL_PARTS -+ if (nr_parts <= 0) { -+ static const char *part_probes[] -+ = { "wrt160nl", NULL, }; -+ -+ nr_parts = parse_mtd_partitions(&flash->mtd, -+ part_probes, &parts, 0); -+ } -+#endif - if (nr_parts <= 0 && data && data->parts) { - parts = data->parts; - nr_parts = data->nr_parts; ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -181,6 +181,12 @@ config MTD_AR7_PARTS - ---help--- - TI AR7 partitioning support - -+config MTD_WRT160NL_PARTS -+ tristate "Linksys WRT160NL partitioning support" -+ depends on MTD_PARTITIONS && AR71XX_MACH_WRT160NL -+ ---help--- -+ Linksys WRT160NL partitioning support -+ - config MTD_MYLOADER_PARTS - tristate "MyLoader partition parsing" - depends on MTD_PARTITIONS && (ADM5120 || ATHEROS_AR231X || ATHEROS_AR71XX) ---- a/drivers/mtd/Makefile -+++ b/drivers/mtd/Makefile -@@ -12,6 +12,7 @@ obj-$(CONFIG_MTD_REDBOOT_PARTS) += redbo - obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o - obj-$(CONFIG_MTD_AFS_PARTS) += afs.o - obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o -+obj-$(CONFIG_MTD_WRT160NL_PARTS) += wrt160nl_part.o - obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o - obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o - diff --git a/target/linux/ar71xx/patches-2.6.31/110-usb-ehci-add-war-for-synopsys-hc-bug.patch b/target/linux/ar71xx/patches-2.6.31/110-usb-ehci-add-war-for-synopsys-hc-bug.patch deleted file mode 100644 index 2e607ab23..000000000 --- a/target/linux/ar71xx/patches-2.6.31/110-usb-ehci-add-war-for-synopsys-hc-bug.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/drivers/usb/host/ehci-q.c -+++ b/drivers/usb/host/ehci-q.c -@@ -1140,6 +1140,9 @@ static void end_unlink_async (struct ehc - ehci->reclaim = NULL; - start_unlink_async (ehci, next); - } -+ -+ if (ehci->has_synopsys_hc_bug) -+ writel((u32)ehci->async->qh_dma, &ehci->regs->async_next); - } - - /* makes sure the async qh will become idle */ ---- a/drivers/usb/host/ehci.h -+++ b/drivers/usb/host/ehci.h -@@ -128,6 +128,7 @@ struct ehci_hcd { /* one per controlle - unsigned big_endian_desc:1; - unsigned has_amcc_usb23:1; - unsigned broken_periodic:1; -+ unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ - - /* required for usb32 quirk */ - #define OHCI_CTRL_HCFS (3 << 6) diff --git a/target/linux/ar71xx/patches-2.6.31/111-mtd-cfi_cmdset_0002-force-word-write.patch b/target/linux/ar71xx/patches-2.6.31/111-mtd-cfi_cmdset_0002-force-word-write.patch deleted file mode 100644 index 4be025d87..000000000 --- a/target/linux/ar71xx/patches-2.6.31/111-mtd-cfi_cmdset_0002-force-word-write.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -39,7 +39,7 @@ - #include - - #define AMD_BOOTLOC_BUG --#define FORCE_WORD_WRITE 0 -+#define FORCE_WORD_WRITE 1 - - #define MAX_WORD_RETRIES 3 - -@@ -55,7 +55,9 @@ - - static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); - static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); -+#if !FORCE_WORD_WRITE - static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); -+#endif - static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *); - static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *); - static void cfi_amdstd_sync (struct mtd_info *); -@@ -190,6 +192,7 @@ static void fixup_amd_bootblock(struct m - } - #endif - -+#if !FORCE_WORD_WRITE - static void fixup_use_write_buffers(struct mtd_info *mtd, void *param) - { - struct map_info *map = mtd->priv; -@@ -199,6 +202,7 @@ static void fixup_use_write_buffers(stru - mtd->write = cfi_amdstd_write_buffers; - } - } -+#endif /* !FORCE_WORD_WRITE */ - - /* Atmel chips don't use the same PRI format as AMD chips */ - static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) -@@ -1315,6 +1319,7 @@ static int cfi_amdstd_write_words(struct - /* - * FIXME: interleaved mode not tested, and probably not supported! - */ -+#if !FORCE_WORD_WRITE - static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, - unsigned long adr, const u_char *buf, - int len) -@@ -1426,7 +1431,6 @@ static int __xipram do_write_buffer(stru - return ret; - } - -- - static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, - size_t *retlen, const u_char *buf) - { -@@ -1505,6 +1509,7 @@ static int cfi_amdstd_write_buffers(stru - - return 0; - } -+#endif /* !FORCE_WORD_WRITE */ - - /* - * Handle devices with one erase region, that only implement diff --git a/target/linux/ar71xx/patches-2.6.31/120-dsa-trailer-tag-validation-fix.patch b/target/linux/ar71xx/patches-2.6.31/120-dsa-trailer-tag-validation-fix.patch deleted file mode 100644 index b58aeedc3..000000000 --- a/target/linux/ar71xx/patches-2.6.31/120-dsa-trailer-tag-validation-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/dsa/tag_trailer.c -+++ b/net/dsa/tag_trailer.c -@@ -86,7 +86,7 @@ static int trailer_rcv(struct sk_buff *s - - trailer = skb_tail_pointer(skb) - 4; - if (trailer[0] != 0x80 || (trailer[1] & 0xf8) != 0x00 || -- (trailer[3] & 0xef) != 0x00 || trailer[3] != 0x00) -+ (trailer[2] & 0xef) != 0x00 || (trailer[3] & 0xfe) != 0x00) - goto out_drop; - - source_port = trailer[1] & 7; diff --git a/target/linux/ar71xx/patches-2.6.31/121-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-2.6.31/121-dsa-add-88e6063-driver.patch deleted file mode 100644 index 1a11a69c6..000000000 --- a/target/linux/ar71xx/patches-2.6.31/121-dsa-add-88e6063-driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/net/dsa/Kconfig -+++ b/net/dsa/Kconfig -@@ -36,6 +36,13 @@ config NET_DSA_MV88E6060 - This enables support for the Marvell 88E6060 ethernet switch - chip. - -+config NET_DSA_MV88E6063 -+ bool "Marvell 88E6063 ethernet switch chip support" -+ select NET_DSA_TAG_TRAILER -+ ---help--- -+ This enables support for the Marvell 88E6063 ethernet switch -+ chip -+ - config NET_DSA_MV88E6XXX_NEED_PPU - bool - default n ---- a/net/dsa/Makefile -+++ b/net/dsa/Makefile -@@ -6,6 +6,7 @@ obj-$(CONFIG_NET_DSA_TAG_TRAILER) += tag - # switch drivers - obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o - obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o -+obj-$(CONFIG_NET_DSA_MV88E6063) += mv88e6063.o - obj-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o - obj-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o - diff --git a/target/linux/ar71xx/patches-2.6.31/200-rb4xx_nand_driver.patch b/target/linux/ar71xx/patches-2.6.31/200-rb4xx_nand_driver.patch deleted file mode 100644 index 020793086..000000000 --- a/target/linux/ar71xx/patches-2.6.31/200-rb4xx_nand_driver.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/drivers/mtd/nand/Kconfig -+++ b/drivers/mtd/nand/Kconfig -@@ -452,4 +452,8 @@ config MTD_NAND_SOCRATES - help - Enables support for NAND Flash chips wired onto Socrates board. - -+config MTD_NAND_RB4XX -+ tristate "NAND flash driver for RouterBoard 4xx series" -+ depends on MTD_NAND && ATHEROS_AR71XX -+ - endif # MTD_NAND ---- a/drivers/mtd/nand/Makefile -+++ b/drivers/mtd/nand/Makefile -@@ -31,6 +31,7 @@ obj-$(CONFIG_MTD_NAND_BASLER_EXCITE) += - obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o - obj-$(CONFIG_MTD_NAND_TMIO) += tmio_nand.o - obj-$(CONFIG_MTD_NAND_PLATFORM) += plat_nand.o -+obj-$(CONFIG_MTD_NAND_RB4XX) += rb4xx_nand.o - obj-$(CONFIG_MTD_ALAUDA) += alauda.o - obj-$(CONFIG_MTD_NAND_PASEMI) += pasemi_nand.o - obj-$(CONFIG_MTD_NAND_ORION) += orion_nand.o diff --git a/target/linux/ar71xx/patches-2.6.31/201-ap83_spi_controller.patch b/target/linux/ar71xx/patches-2.6.31/201-ap83_spi_controller.patch deleted file mode 100644 index a8e889a7b..000000000 --- a/target/linux/ar71xx/patches-2.6.31/201-ap83_spi_controller.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -11,6 +11,7 @@ endif - obj-$(CONFIG_SPI_MASTER) += spi.o - - # SPI master controller drivers (bus) -+obj-$(CONFIG_SPI_AP83) += ap83_spi.o - obj-$(CONFIG_SPI_AR71XX) += ar71xx_spi.o - obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o - obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -53,6 +53,14 @@ if SPI_MASTER - - comment "SPI Master Controller Drivers" - -+config SPI_AP83 -+ tristate "Atheros AP83 specific SPI Controller" -+ depends on SPI_MASTER && AR71XX_MACH_AP83 -+ select SPI_BITBANG -+ help -+ This is a specific SPI controller driver for the Atheros AP83 -+ reference board. -+ - config SPI_AR71XX - tristate "Atheros AR71xx SPI Controller" - depends on SPI_MASTER && ATHEROS_AR71XX diff --git a/target/linux/ar71xx/patches-2.6.31/202-spi_vsc7385_driver.patch b/target/linux/ar71xx/patches-2.6.31/202-spi_vsc7385_driver.patch deleted file mode 100644 index d8f61bb90..000000000 --- a/target/linux/ar71xx/patches-2.6.31/202-spi_vsc7385_driver.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -279,6 +279,11 @@ config SPI_TLE62X0 - sysfs interface, with each line presented as a kind of GPIO - exposing both switch control and diagnostic feedback. - -+config SPI_VSC7385 -+ tristate "Vitesse VSC7385 ethernet switch driver" -+ help -+ SPI driver for the Vitesse VSC7385 ethernet switch. -+ - # - # Add new SPI protocol masters in alphabetical order above this line - # ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -38,6 +38,7 @@ obj-$(CONFIG_SPI_SH_SCI) += spi_sh_sci. - - # SPI protocol drivers (device/link on bus) - obj-$(CONFIG_SPI_SPIDEV) += spidev.o -+obj-$(CONFIG_SPI_VSC7385) += spi_vsc7385.o - obj-$(CONFIG_SPI_TLE62X0) += tle62x0.o - # ... add above this line ... - diff --git a/target/linux/ar71xx/patches-2.6.31/203-pb44_spi_controller.patch b/target/linux/ar71xx/patches-2.6.31/203-pb44_spi_controller.patch deleted file mode 100644 index e48710ca9..000000000 --- a/target/linux/ar71xx/patches-2.6.31/203-pb44_spi_controller.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -68,6 +68,14 @@ config SPI_AR71XX - help - This is the SPI contoller driver for Atheros AR71xx. - -+config SPI_PB44 -+ tristate "Atheros PB44 board specific SPI controller" -+ depends on SPI_MASTER && AR71XX_MACH_PB44 -+ select SPI_BITBANG -+ help -+ This is a specific SPI controller driver for the Atheros PB44 -+ reference board. -+ - config SPI_ATMEL - tristate "Atmel SPI Controller" - depends on (ARCH_AT91 || AVR32) ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -22,6 +22,7 @@ obj-$(CONFIG_SPI_GPIO) += spi_gpio.o - obj-$(CONFIG_SPI_GPIO_OLD) += spi_gpio_old.o - obj-$(CONFIG_SPI_IMX) += spi_imx.o - obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o -+obj-$(CONFIG_SPI_PB44) += pb44_spi.o - obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o - obj-$(CONFIG_SPI_OMAP_UWIRE) += omap_uwire.o - obj-$(CONFIG_SPI_OMAP24XX) += omap2_mcspi.o diff --git a/target/linux/ar71xx/patches-2.6.31/205-wndr3700-usb-led-driver.patch b/target/linux/ar71xx/patches-2.6.31/205-wndr3700-usb-led-driver.patch deleted file mode 100644 index d9fba35b3..000000000 --- a/target/linux/ar71xx/patches-2.6.31/205-wndr3700-usb-led-driver.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -229,6 +229,13 @@ config LEDS_BD2802 - This option enables support for BD2802GU RGB LED driver chips - accessed via the I2C bus. - -+config LEDS_WNDR3700_USB -+ tristate "NETGEAR WNDR3700 USB LED driver" -+ depends on LEDS_CLASS && AR71XX_MACH_WNDR3700 -+ help -+ This option enables support for the USB LED found on the -+ NETGEAR WNDR3700 board. -+ - comment "LED Triggers" - - config LEDS_TRIGGERS ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -28,6 +28,7 @@ obj-$(CONFIG_LEDS_PCA955X) += leds-pca9 - obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o - obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o - obj-$(CONFIG_LEDS_PWM) += leds-pwm.o -+obj-${CONFIG_LEDS_WNDR3700_USB} += leds-wndr3700-usb.o - - # LED SPI Drivers - obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o diff --git a/target/linux/ar71xx/patches-2.6.31/206-nxp-74hc153-gpio-chip-driver.patch b/target/linux/ar71xx/patches-2.6.31/206-nxp-74hc153-gpio-chip-driver.patch deleted file mode 100644 index c722f34e8..000000000 --- a/target/linux/ar71xx/patches-2.6.31/206-nxp-74hc153-gpio-chip-driver.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -188,4 +188,12 @@ config GPIO_MCP23S08 - SPI driver for Microchip MCP23S08 I/O expander. This provides - a GPIO interface supporting inputs and outputs. - -+comment "Other GPIO expanders" -+ -+config GPIO_NXP_74HC153 -+ tristate "NXP 74HC153 Dual 4-input multiplexer" -+ help -+ Platform driver for NXP 74HC153 Dual 4-input Multiplexer. This -+ provides a GPIO interface supporting inputs. -+ - endif ---- a/drivers/gpio/Makefile -+++ b/drivers/gpio/Makefile -@@ -7,6 +7,7 @@ obj-$(CONFIG_GPIOLIB) += gpiolib.o - obj-$(CONFIG_GPIO_MAX7301) += max7301.o - obj-$(CONFIG_GPIO_MAX732X) += max732x.o - obj-$(CONFIG_GPIO_MCP23S08) += mcp23s08.o -+obj-$(CONFIG_GPIO_NXP_74HC153) += nxp_74hc153.o - obj-$(CONFIG_GPIO_PCA953X) += pca953x.o - obj-$(CONFIG_GPIO_PCF857X) += pcf857x.o - obj-$(CONFIG_GPIO_PL061) += pl061.o diff --git a/target/linux/ar71xx/patches-2.6.31/300-mips_fw_myloader.patch b/target/linux/ar71xx/patches-2.6.31/300-mips_fw_myloader.patch deleted file mode 100644 index bad0423eb..000000000 --- a/target/linux/ar71xx/patches-2.6.31/300-mips_fw_myloader.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -165,6 +165,7 @@ endif - # - libs-$(CONFIG_ARC) += arch/mips/fw/arc/ - libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ -+libs-$(CONFIG_MYLOADER) += arch/mips/fw/myloader/ - libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/ - libs-y += arch/mips/fw/lib/ - ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -863,6 +863,9 @@ config MIPS_NILE4 - config MIPS_DISABLE_OBSOLETE_IDE - bool - -+config MYLOADER -+ bool -+ - config SYNC_R4K - bool - diff --git a/target/linux/ar71xx/patches-2.6.31/400-mips-multi-machine-update.patch b/target/linux/ar71xx/patches-2.6.31/400-mips-multi-machine-update.patch deleted file mode 100644 index d63587901..000000000 --- a/target/linux/ar71xx/patches-2.6.31/400-mips-multi-machine-update.patch +++ /dev/null @@ -1,134 +0,0 @@ ---- a/arch/mips/kernel/mips_machine.c -+++ b/arch/mips/kernel/mips_machine.c -@@ -7,12 +7,13 @@ - * - */ - #include -+#include - - #include --#include - - static struct list_head mips_machines __initdata = - LIST_HEAD_INIT(mips_machines); -+static char *mips_machid __initdata; - - char *mips_machine_name = "Unknown"; - -@@ -55,20 +56,65 @@ void __init mips_machine_set_name(char * - } - } - --void __init mips_machine_setup(unsigned long machtype) -+void __init mips_machine_setup(void) - { - struct mips_machine *mach; - -- mach = mips_machine_find(machtype); -+ mach = mips_machine_find(mips_machtype); - if (!mach) { -- printk(KERN_ALERT "MIPS: no machine registered for " -- "machtype %lu\n", machtype); -+ printk(KERN_WARNING "MIPS: no machine registered for " -+ "machtype %lu\n", mips_machtype); - return; - } - - mips_machine_set_name(mach->mach_name); -- printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name); -+ printk(KERN_NOTICE "MIPS: machine is %s\n", mips_machine_name); - - if (mach->mach_setup) - mach->mach_setup(); - } -+ -+int __init mips_machtype_setup(char *id) -+{ -+ if (mips_machid == NULL) -+ mips_machid = id; -+ -+ return 1; -+} -+ -+__setup("machtype=", mips_machtype_setup); -+ -+static int __init mips_machtype_init(void) -+{ -+ struct list_head *this; -+ struct mips_machine *mach; -+ -+ if (mips_machid == NULL) -+ return 0; -+ -+ list_for_each(this, &mips_machines) { -+ mach = list_entry(this, struct mips_machine, list); -+ if (mach->mach_id == NULL) -+ continue; -+ -+ if (strcmp(mach->mach_id, mips_machid) == 0) { -+ mips_machtype = mach->mach_type; -+ return 0; -+ } -+ } -+ -+ printk(KERN_WARNING -+ "MIPS: no machine found for id: '%s', registered machines:\n", -+ mips_machid); -+ printk(KERN_WARNING "%32s %s\n", "id", "name"); -+ -+ list_for_each(this, &mips_machines) { -+ mach = list_entry(this, struct mips_machine, list); -+ printk(KERN_WARNING "%32s %s\n", -+ mach->mach_id ? mach->mach_id : "", mach->mach_name); -+ } -+ -+ return 0; -+} -+ -+core_initcall(mips_machtype_init); ---- a/arch/mips/include/asm/mips_machine.h -+++ b/arch/mips/include/asm/mips_machine.h -@@ -13,25 +13,33 @@ - #include - #include - -+#include -+ - struct mips_machine { - unsigned long mach_type; -- void (*mach_setup)(void); -+ char *mach_id; - char *mach_name; -+ void (*mach_setup)(void); - struct list_head list; - }; - - void mips_machine_register(struct mips_machine *) __init; --void mips_machine_setup(unsigned long machtype) __init; -+void mips_machine_setup(void) __init; -+int mips_machtype_setup(char *id) __init; - void mips_machine_set_name(char *name) __init; - - extern char *mips_machine_name; - --#define MIPS_MACHINE(_type, _name, _setup) \ --static char machine_name_##_type[] __initdata = _name; \ -+#define MIPS_MACHINE(_type, _id, _name, _setup) \ -+static const char machine_name_##_type[] __initconst \ -+ __aligned(1) = _name; \ -+static const char machine_id_##_type[] __initconst \ -+ __aligned(1) = _id; \ - static struct mips_machine machine_##_type __initdata = \ - { \ - .mach_type = _type, \ -- .mach_name = machine_name_##_type, \ -+ .mach_id = (char *) machine_id_##_type, \ -+ .mach_name = (char *) machine_name_##_type, \ - .mach_setup = _setup, \ - }; \ - \ -@@ -44,4 +52,3 @@ static int __init register_machine_##_ty - pure_initcall(register_machine_##_type) - - #endif /* __ASM_MIPS_MACHINE_H */ -- diff --git a/target/linux/ar71xx/patches-2.6.31/901-get_c0_compare_irq_function.patch b/target/linux/ar71xx/patches-2.6.31/901-get_c0_compare_irq_function.patch deleted file mode 100644 index cf9c405ca..000000000 --- a/target/linux/ar71xx/patches-2.6.31/901-get_c0_compare_irq_function.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - extern void check_wait(void); - extern asmlinkage void r4k_wait(void); -@@ -1538,6 +1539,8 @@ void __cpuinit per_cpu_trap_init(void) - */ - if (cpu_has_mips_r2) { - cp0_compare_irq = (read_c0_intctl() >> 29) & 7; -+ if (get_c0_compare_irq) -+ cp0_compare_irq = get_c0_compare_irq(); - cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7; - if (cp0_perfcount_irq == cp0_compare_irq) - cp0_perfcount_irq = -1; ---- a/arch/mips/include/asm/time.h -+++ b/arch/mips/include/asm/time.h -@@ -52,6 +52,7 @@ extern int (*perf_irq)(void); - */ - #ifdef CONFIG_CEVT_R4K_LIB - extern unsigned int __weak get_c0_compare_int(void); -+extern unsigned int __weak get_c0_compare_irq(void); - extern int r4k_clockevent_init(void); - #endif - diff --git a/target/linux/ar71xx/patches-2.6.32/112-mtd-m25p80-add-w25q32-chip-support.patch b/target/linux/ar71xx/patches-2.6.32/112-mtd-m25p80-add-w25q32-chip-support.patch new file mode 100644 index 000000000..0e4c060db --- /dev/null +++ b/target/linux/ar71xx/patches-2.6.32/112-mtd-m25p80-add-w25q32-chip-support.patch @@ -0,0 +1,10 @@ +--- a/drivers/mtd/devices/m25p80.c ++++ b/drivers/mtd/devices/m25p80.c +@@ -692,6 +692,7 @@ static struct flash_info __devinitdata m + { "w25x80", 0xef3014, 0, 64 * 1024, 16, SECT_4K, }, + { "w25x16", 0xef3015, 0, 64 * 1024, 32, SECT_4K, }, + { "w25x32", 0xef3016, 0, 64 * 1024, 64, SECT_4K, }, ++ { "w25q32", 0xef4016, 0, 64 * 1024, 64, SECT_4K, }, + { "w25x64", 0xef3017, 0, 64 * 1024, 128, SECT_4K, }, + }; + diff --git a/target/linux/ar71xx/profiles/01-madwifi.mk b/target/linux/ar71xx/profiles/01-madwifi.mk index 6eb17948e..7c22c53db 100644 --- a/target/linux/ar71xx/profiles/01-madwifi.mk +++ b/target/linux/ar71xx/profiles/01-madwifi.mk @@ -7,7 +7,7 @@ define Profile/Madwifi NAME:=Atheros WiFi (madwifi) - PACKAGES:=kmod-madwifi hostapd-mini + PACKAGES:=kmod-madwifi wpad-mini endef define Profile/Madwifi/Description diff --git a/target/linux/ar71xx/profiles/atheros.mk b/target/linux/ar71xx/profiles/atheros.mk index 91494a873..c80931142 100644 --- a/target/linux/ar71xx/profiles/atheros.mk +++ b/target/linux/ar71xx/profiles/atheros.mk @@ -7,7 +7,7 @@ define Profile/AP81 NAME:=Atheros AP81 reference board - PACKAGES:=hostapd-mini kmod-ath9k kmod-usb-core kmod-usb2 + PACKAGES:=wpad-mini kmod-ath9k kmod-usb-core kmod-usb2 endef define Profile/AP81/Description @@ -18,7 +18,7 @@ $(eval $(call Profile,AP81)) define Profile/AP83 NAME:=Atheros AP83 reference board - PACKAGES:=hostapd-mini kmod-ath9k kmod-usb-core kmod-usb2 + PACKAGES:=wpad-mini kmod-ath9k kmod-usb-core kmod-usb2 endef define Profile/AP83/Description @@ -29,7 +29,7 @@ $(eval $(call Profile,AP83)) define Profile/PB42 NAME:=Atheros PB42 reference board - PACKAGES:=hostapd-mini kmod-ath9k kmod-usb-core kmod-usb-ohci kmod-usb2 + PACKAGES:=wpad-mini kmod-ath9k kmod-usb-core kmod-usb-ohci kmod-usb2 endef define Profile/PB42/Description @@ -40,7 +40,7 @@ $(eval $(call Profile,PB42)) define Profile/PB44 NAME:=Atheros PB44 reference board - PACKAGES:=hostapd-mini kmod-ath9k kmod-usb-core kmod-usb-ohci kmod-usb2 + PACKAGES:=wpad-mini kmod-ath9k kmod-usb-core kmod-usb-ohci kmod-usb2 endef define Profile/PB44/Description diff --git a/target/linux/ar71xx/profiles/atlantis.mk b/target/linux/ar71xx/profiles/atlantis.mk index c756bdd12..c63fd9c27 100644 --- a/target/linux/ar71xx/profiles/atlantis.mk +++ b/target/linux/ar71xx/profiles/atlantis.mk @@ -7,7 +7,7 @@ define Profile/A02RBW300N NAME:=Atlantis-Land A02-RB-W300N - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/A02RBW300N/Description diff --git a/target/linux/ar71xx/profiles/buffalo.mk b/target/linux/ar71xx/profiles/buffalo.mk index 939977bb6..69819e586 100644 --- a/target/linux/ar71xx/profiles/buffalo.mk +++ b/target/linux/ar71xx/profiles/buffalo.mk @@ -7,7 +7,7 @@ define Profile/WZRHPG300NH NAME:=Buffalo WZR-HP-G300NH - PACKAGES:=kmod-ath9k hostapd-mini kmod-usb-core kmod-usb2 + PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 endef define Profile/WZRHPG300NH/Description diff --git a/target/linux/ar71xx/profiles/d-link.mk b/target/linux/ar71xx/profiles/d-link.mk index 82e108bc7..bf99e099a 100644 --- a/target/linux/ar71xx/profiles/d-link.mk +++ b/target/linux/ar71xx/profiles/d-link.mk @@ -7,7 +7,7 @@ define Profile/DIR600A1 NAME:=D-Link DIR-600 rev. A1 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/DIR600A1/Description @@ -19,7 +19,7 @@ $(eval $(call Profile,DIR600A1)) define Profile/DIR615C1 NAME:=D-Link DIR-615 rev. C1 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/DIR615C1/Description @@ -31,7 +31,7 @@ $(eval $(call Profile,DIR615C1)) define Profile/DIR825B1 NAME:=D-Link DIR-825 rev. B1 - PACKAGES:=kmod-ath9k hostapd-mini kmod-usb-core kmod-usb2 + PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 endef define Profile/DIR825B1/Description diff --git a/target/linux/ar71xx/profiles/linksys.mk b/target/linux/ar71xx/profiles/linksys.mk index a2d4bbd51..f3253e728 100644 --- a/target/linux/ar71xx/profiles/linksys.mk +++ b/target/linux/ar71xx/profiles/linksys.mk @@ -7,7 +7,7 @@ define Profile/WRT160NL NAME:=Linksys WRT160NL - PACKAGES:=kmod-ath9k hostapd-mini kmod-usb-core kmod-usb2 swconfig + PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 swconfig endef define Profile/WRT160NL/Description @@ -16,7 +16,7 @@ endef define Profile/WRT400N NAME:=Linksys WRT400N - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/WRT400N/Description diff --git a/target/linux/ar71xx/profiles/netgear.mk b/target/linux/ar71xx/profiles/netgear.mk index 896ab0605..8545cad0c 100644 --- a/target/linux/ar71xx/profiles/netgear.mk +++ b/target/linux/ar71xx/profiles/netgear.mk @@ -7,7 +7,7 @@ define Profile/WNDR3700 NAME:=NETGEAR WNDR3700 - PACKAGES:=kmod-ath9k hostapd-mini kmod-usb-core kmod-usb2 + PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 endef define Profile/WNDR3700/Description diff --git a/target/linux/ar71xx/profiles/planex.mk b/target/linux/ar71xx/profiles/planex.mk index 40f45b50e..63e539c4e 100644 --- a/target/linux/ar71xx/profiles/planex.mk +++ b/target/linux/ar71xx/profiles/planex.mk @@ -7,7 +7,7 @@ define Profile/MZKW04NU NAME:=Planex MZK-W04NU - PACKAGES:=kmod-ath9k hostapd-mini kmod-usb-core kmod-usb2 + PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 endef define Profile/MZKW04NU/Description @@ -18,7 +18,7 @@ $(eval $(call Profile,MZKW04NU)) define Profile/MZKW300NH NAME:=Planex MZK-W300NH - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/MZKW300NH/Description diff --git a/target/linux/ar71xx/profiles/tp-link.mk b/target/linux/ar71xx/profiles/tp-link.mk index 1b9cace93..09fbcc9e7 100644 --- a/target/linux/ar71xx/profiles/tp-link.mk +++ b/target/linux/ar71xx/profiles/tp-link.mk @@ -7,7 +7,7 @@ define Profile/TLWR741NDV1 NAME:=TP-LINK TL-WR741ND v1 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/TLWR741NDV1/Description @@ -18,7 +18,7 @@ $(eval $(call Profile,TLWR741NDV1)) define Profile/TLWR841NV15 NAME:=TP-LINK TL-WR841N v1.5 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/TLWR841NV15/Description @@ -29,7 +29,7 @@ $(eval $(call Profile,TLWR841NV15)) define Profile/TLWR841NDV3 NAME:=TP-LINK TL-WR841ND v3 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/TLWR841NDV3/Description @@ -40,7 +40,7 @@ $(eval $(call Profile,TLWR841NDV3)) define Profile/TLWR841NDV5 NAME:=TP-LINK TL-WR841ND v5 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/TLWR841NDV5/Description @@ -51,7 +51,7 @@ $(eval $(call Profile,TLWR841NDV5)) define Profile/TLWR941NDV2 NAME:=TP-LINK TL-WR941ND v2 - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/TLWR941NDV2/Description @@ -62,7 +62,7 @@ $(eval $(call Profile,TLWR941NDV2)) define Profile/TLWR1043NDV1 NAME:=TP-LINK TL-WR1043ND v1 - PACKAGES:=kmod-ath9k hostapd-mini kmod-usb-core kmod-usb2 + PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 endef define Profile/TLWR1043NDV1/Description diff --git a/target/linux/ar71xx/profiles/trendnet.mk b/target/linux/ar71xx/profiles/trendnet.mk index 22dfe9009..20a08f384 100644 --- a/target/linux/ar71xx/profiles/trendnet.mk +++ b/target/linux/ar71xx/profiles/trendnet.mk @@ -7,7 +7,7 @@ define Profile/TEW632BRP NAME:=TRENDNet TEW-632BRP - PACKAGES:=kmod-ath9k hostapd-mini + PACKAGES:=kmod-ath9k wpad-mini endef define Profile/TEW632BRP/Description diff --git a/target/linux/atheros/base-files/lib/preinit/15_preinit_iface_atheros b/target/linux/atheros/base-files/lib/preinit/15_preinit_iface_atheros index c15b4de1e..9807365c2 100644 --- a/target/linux/atheros/base-files/lib/preinit/15_preinit_iface_atheros +++ b/target/linux/atheros/base-files/lib/preinit/15_preinit_iface_atheros @@ -3,7 +3,7 @@ # reset button only supported on ar5315+ at the moment preinit_ip() { if [ -z "$pi_ifname" ]; then - grep 'Atheros AR231[567]' /proc/cpuinfo > /dev/null && { + grep -q 'Atheros AR231[567]' /proc/cpuinfo && { if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \ -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then vconfig set_name_type DEV_PLUS_VID_NO_PAD @@ -13,9 +13,10 @@ preinit_ip() { else ifname=eth0 fi - pi_ifname=$ifname - } - [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && { + pi_ifname=$ifname + } + fi + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up } } diff --git a/target/linux/ramips/rt305x/config-2.6.30 b/target/linux/atheros/config-2.6.32 similarity index 72% rename from target/linux/ramips/rt305x/config-2.6.30 rename to target/linux/atheros/config-2.6.32 index 9ba59af50..82317436c 100644 --- a/target/linux/ramips/rt305x/config-2.6.30 +++ b/target/linux/atheros/config-2.6.32 @@ -1,34 +1,43 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set +CONFIG_ADM6996_PHY=y +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_AR231X_ETHERNET=y +# CONFIG_AR7 is not set +CONFIG_AR8216_PHY=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SUPPORTS_MSI is not set CONFIG_ARCH_SUPPORTS_OPROFILE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ATHEROS_AR2315=y +CONFIG_ATHEROS_AR2315_PCI=y +CONFIG_ATHEROS_AR231X=y +CONFIG_ATHEROS_AR5312=y +CONFIG_ATHEROS_WDT=y # CONFIG_BCM47XX is not set -# CONFIG_BINARY_PRINTF is not set +# CONFIG_BCM63XX is not set CONFIG_BITREVERSE=y # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CEVT_R4K_LIB=y -CONFIG_CMDLINE="console=ttyS1,57600 rootfstype=squashfs,jffs2" -# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 +CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2" +CONFIG_CPU_BIG_ENDIAN=y # CONFIG_CPU_CAVIUM_OCTEON is not set -CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y -CONFIG_CPU_LITTLE_ENDIAN=y -# CONFIG_CPU_LOONGSON2 is not set +# CONFIG_CPU_LITTLE_ENDIAN is not set +# CONFIG_CPU_LOONGSON2E is not set CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set -CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPS32_R1=y +# CONFIG_CPU_MIPS32_R2 is not set # CONFIG_CPU_MIPS64_R1 is not set # CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MIPSR1=y # CONFIG_CPU_NEVADA is not set # CONFIG_CPU_R10000 is not set # CONFIG_CPU_R3000 is not set @@ -50,10 +59,11 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CSRC_R4K=y CONFIG_CSRC_R4K_LIB=y CONFIG_DECOMPRESS_LZMA=y +CONFIG_DEVPORT=y # CONFIG_DM9000 is not set CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y -CONFIG_EARLY_PRINTK=y +# CONFIG_FSNOTIFY is not set CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -61,66 +71,65 @@ CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_GPIO=y CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_DEVICE=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y -CONFIG_HAVE_MLOCK=y CONFIG_HAVE_OPROFILE=y -CONFIG_HW_RANDOM=m +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y CONFIG_INITRAMFS_SOURCE="" +CONFIG_IP175C_PHY=y CONFIG_IRQ_CPU=y # CONFIG_ISDN is not set # CONFIG_LEDS_GPIO is not set -# CONFIG_LEMOTE_FULONG is not set # CONFIG_MACH_ALCHEMY is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_LOONGSON is not set # CONFIG_MACH_TX39XX is not set # CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set -# CONFIG_MII is not set # CONFIG_MIKROTIK_RB532 is not set CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 -CONFIG_MIPS_MACHINE=y +# CONFIG_MIPS_MACHINE is not set # CONFIG_MIPS_MALTA is not set CONFIG_MIPS_MT_DISABLED=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_MT_SMTC is not set -CONFIG_MIPS_RALINK=y -CONFIG_MIPS_RAMIPS_NET=y # CONFIG_MIPS_SIM is not set +CONFIG_MTD_AR2315=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set # CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_MYLOADER_PARTS=y CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-3 +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MVSWITCH_PHY=y +# CONFIG_NET_PCI is not set # CONFIG_NO_IOPORT is not set # CONFIG_NXP_STB220 is not set # CONFIG_NXP_STB225 is not set CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PCI_DOMAINS=y CONFIG_PHYLIB=y # CONFIG_PMC_MSP is not set # CONFIG_PMC_YOSEMITE is not set # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_STB810 is not set # CONFIG_PROBE_INITRD_HEADER is not set -CONFIG_RALINK_DEV_GPIO_LEDS=y -# CONFIG_RALINK_RT288X is not set -CONFIG_RALINK_RT305X=y -CONFIG_RT305X_MACH_DIR_300_REVB=y -CONFIG_RT305X_MACH_FONERA20N=y -CONFIG_RT305X_MACH_V22RW_2X2=y -CONFIG_RT305X_MACH_WHR_G300N=y CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCSI_DMA is not set # CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RT288X=y +CONFIG_SERIAL_8250_NR_UARTS=1 +CONFIG_SERIAL_8250_RUNTIME_UARTS=1 # CONFIG_SGI_IP22 is not set # CONFIG_SGI_IP27 is not set # CONFIG_SGI_IP28 is not set @@ -133,20 +142,13 @@ CONFIG_SERIAL_8250_RT288X=y # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set -# CONFIG_SLAB is not set -# CONFIG_SLOW_WORK is not set -CONFIG_SLUB=y -CONFIG_SOC_RT305X=y +CONFIG_SWCONFIG=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R2=y -CONFIG_SYS_HAS_EARLY_PRINTK=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -CONFIG_TRACING_SUPPORT=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y CONFIG_TRAD_SIGNALS=y -# CONFIG_USB_ARCH_HAS_EHCI is not set -# CONFIG_USB_ARCH_HAS_HCD is not set -# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y CONFIG_USB_SUPPORT=y CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/atheros/patches-2.6.32/001-get_c0_compare_int_fix.patch b/target/linux/atheros/patches-2.6.32/001-get_c0_compare_int_fix.patch new file mode 100644 index 000000000..ab0ffdf6f --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/001-get_c0_compare_int_fix.patch @@ -0,0 +1,41 @@ +Fix the usage of get_c0_compare_int: override cp0_compare_irq if the returned +value is in the MIPS CPU IRQ range to ensure that c0_compare_int_usable() +still works. + +Signed-off-by: Felix Fietkau + +Index: linux-2.6.32.7/arch/mips/kernel/cevt-r4k.c +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/kernel/cevt-r4k.c 2010-01-29 00:06:20.000000000 +0100 ++++ linux-2.6.32.7/arch/mips/kernel/cevt-r4k.c 2010-02-03 16:59:28.310430064 +0100 +@@ -168,20 +168,23 @@ + struct clock_event_device *cd; + unsigned int irq; + +- if (!cpu_has_counter || !mips_hpt_frequency) +- return -ENXIO; +- +- if (!c0_compare_int_usable()) +- return -ENXIO; +- + /* + * With vectored interrupts things are getting platform specific. + * get_c0_compare_int is a hook to allow a platform to return the + * interrupt number of it's liking. + */ + irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; +- if (get_c0_compare_int) ++ if (get_c0_compare_int) { + irq = get_c0_compare_int(); ++ if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8)) ++ cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE; ++ } ++ ++ if (!cpu_has_counter || !mips_hpt_frequency) ++ return -ENXIO; ++ ++ if (!c0_compare_int_usable()) ++ return -ENXIO; + + cd = &per_cpu(mips_clockevent_device, cpu); + diff --git a/target/linux/ar71xx/patches-2.6.31/902-mips_clocksource_init_war.patch b/target/linux/atheros/patches-2.6.32/002-mips_clocksource_init_war.patch similarity index 81% rename from target/linux/ar71xx/patches-2.6.31/902-mips_clocksource_init_war.patch rename to target/linux/atheros/patches-2.6.32/002-mips_clocksource_init_war.patch index 894eed1e5..3f9970f99 100644 --- a/target/linux/ar71xx/patches-2.6.31/902-mips_clocksource_init_war.patch +++ b/target/linux/atheros/patches-2.6.32/002-mips_clocksource_init_war.patch @@ -1,5 +1,7 @@ ---- a/arch/mips/kernel/cevt-r4k.c -+++ b/arch/mips/kernel/cevt-r4k.c +Index: linux-2.6.32.7/arch/mips/kernel/cevt-r4k.c +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/kernel/cevt-r4k.c 2010-02-03 16:59:28.310430064 +0100 ++++ linux-2.6.32.7/arch/mips/kernel/cevt-r4k.c 2010-02-03 16:59:54.578430015 +0100 @@ -16,6 +16,22 @@ #include @@ -23,7 +25,7 @@ * The SMTC Kernel for the 34K, 1004K, et. al. replaces several * of these routines with SMTC-specific variants. */ -@@ -31,6 +47,7 @@ static int mips_next_event(unsigned long +@@ -31,6 +47,7 @@ cnt = read_c0_count(); cnt += delta; write_c0_compare(cnt); @@ -31,7 +33,7 @@ res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0; return res; } -@@ -100,22 +117,6 @@ static int c0_compare_int_pending(void) +@@ -100,22 +117,6 @@ return (read_c0_cause() >> cp0_compare_irq) & 0x100; } diff --git a/target/linux/atheros/patches-2.6.32/100-board.patch b/target/linux/atheros/patches-2.6.32/100-board.patch new file mode 100644 index 000000000..1f9a87476 --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/100-board.patch @@ -0,0 +1,3166 @@ +Index: linux-2.6.32.7/arch/mips/Kconfig +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/Kconfig 2010-02-03 16:57:31.290430165 +0100 ++++ linux-2.6.32.7/arch/mips/Kconfig 2010-02-03 17:00:08.814429898 +0100 +@@ -96,6 +96,19 @@ + help + Support for BCM63XX based boards + ++config ATHEROS_AR231X ++ bool "Atheros 231x/531x SoC support" ++ select CEVT_R4K ++ select CSRC_R4K ++ select DMA_NONCOHERENT ++ select IRQ_CPU ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select GENERIC_GPIO ++ help ++ Support for AR231x and AR531x based boards ++ + config MIPS_COBALT + bool "Cobalt Server" + select CEVT_R4K +@@ -673,6 +686,7 @@ + + endchoice + ++source "arch/mips/ar231x/Kconfig" + source "arch/mips/alchemy/Kconfig" + source "arch/mips/basler/excite/Kconfig" + source "arch/mips/bcm63xx/Kconfig" +Index: linux-2.6.32.7/arch/mips/Makefile +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/Makefile 2010-02-03 16:57:31.851429682 +0100 ++++ linux-2.6.32.7/arch/mips/Makefile 2010-02-03 17:00:08.814429898 +0100 +@@ -296,6 +296,13 @@ + + + # ++# Atheros AR5312/AR2312 WiSoC ++# ++core-$(CONFIG_ATHEROS_AR231X) += arch/mips/ar231x/ ++cflags-$(CONFIG_ATHEROS_AR231X) += -I$(srctree)/arch/mips/include/asm/mach-ar231x ++load-$(CONFIG_ATHEROS_AR231X) += 0xffffffff80041000 ++ ++# + # Cobalt Server + # + core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ +Index: linux-2.6.32.7/arch/mips/ar231x/Kconfig +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/Kconfig 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,17 @@ ++config ATHEROS_AR5312 ++ bool "Atheros 5312/2312+ support" ++ depends on ATHEROS_AR231X ++ default y ++ ++config ATHEROS_AR2315 ++ bool "Atheros 2315+ support" ++ depends on ATHEROS_AR231X ++ select DMA_NONCOHERENT ++ select CEVT_R4K ++ select CSRC_R4K ++ select IRQ_CPU ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select GENERIC_GPIO ++ default y +Index: linux-2.6.32.7/arch/mips/ar231x/Makefile +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/Makefile 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,13 @@ ++# ++# 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) 2006 FON Technology, SL. ++# Copyright (C) 2006 Imre Kaloz ++# Copyright (C) 2006-2009 Felix Fietkau ++# ++ ++obj-y += board.o prom.o devices.o ++obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o ++obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o +Index: linux-2.6.32.7/arch/mips/ar231x/board.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/board.c 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,251 @@ ++/* ++ * 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) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006-2009 Felix Fietkau ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include "devices.h" ++#include "ar5312.h" ++#include "ar2315.h" ++ ++void (*ar231x_irq_dispatch)(void); ++ ++static inline bool ++check_radio_magic(u8 *addr) ++{ ++ addr += 0x7a; /* offset for flash magic */ ++ if ((addr[0] == 0x5a) && (addr[1] == 0xa5)) { ++ return 1; ++ } ++ return 0; ++} ++ ++static inline bool ++check_board_data(u8 *flash_limit, u8 *addr, bool broken) ++{ ++ /* config magic found */ ++ if (*((u32 *)addr) == AR531X_BD_MAGIC) ++ return 1; ++ ++ if (!broken) ++ return 0; ++ ++ if (check_radio_magic(addr + 0xf8)) ++ ar231x_board.radio = addr + 0xf8; ++ if ((addr < flash_limit + 0x10000) && ++ check_radio_magic(addr + 0x10000)) ++ ar231x_board.radio = addr + 0x10000; ++ ++ if (ar231x_board.radio) { ++ /* broken board data detected, use radio data to find the offset, ++ * user will fix this */ ++ return 1; ++ } ++ return 0; ++} ++ ++static u8 * ++find_board_config(u8 *flash_limit, bool broken) ++{ ++ u8 *addr; ++ int found = 0; ++ ++ for (addr = flash_limit - 0x1000; ++ addr >= flash_limit - 0x30000; ++ addr -= 0x1000) { ++ ++ if (check_board_data(flash_limit, addr, broken)) { ++ found = 1; ++ break; ++ } ++ } ++ ++ if (!found) ++ addr = NULL; ++ ++ return addr; ++} ++ ++static u8 * ++find_radio_config(u8 *flash_limit, u8 *board_config) ++{ ++ int found; ++ u8 *radio_config; ++ ++ /* ++ * Now find the start of Radio Configuration data, using heuristics: ++ * Search forward from Board Configuration data by 0x1000 bytes ++ * at a time until we find non-0xffffffff. ++ */ ++ found = 0; ++ for (radio_config = board_config + 0x1000; ++ (radio_config < flash_limit); ++ radio_config += 0x1000) { ++ if ((*(u32 *)radio_config != 0xffffffff) && ++ check_radio_magic(radio_config)) { ++ found = 1; ++ break; ++ } ++ } ++ ++ /* AR2316 relocates radio config to new location */ ++ if (!found) { ++ for (radio_config = board_config + 0xf8; ++ (radio_config < flash_limit - 0x1000 + 0xf8); ++ radio_config += 0x1000) { ++ if ((*(u32 *)radio_config != 0xffffffff) && ++ check_radio_magic(radio_config)) { ++ found = 1; ++ break; ++ } ++ } ++ } ++ ++ if (!found) { ++ printk("Could not find Radio Configuration data\n"); ++ radio_config = 0; ++ } ++ ++ return (u8 *) radio_config; ++} ++ ++int __init ++ar231x_find_config(u8 *flash_limit) ++{ ++ struct ar231x_boarddata *config; ++ unsigned int rcfg_size; ++ int broken_boarddata = 0; ++ u8 *bcfg, *rcfg; ++ u8 *board_data; ++ u8 *radio_data; ++ u32 offset; ++ ++ ar231x_board.config = NULL; ++ ar231x_board.radio = NULL; ++ /* Copy the board and radio data to RAM, because accessing the mapped ++ * memory of the flash directly after booting is not safe */ ++ ++ /* Try to find valid board and radio data */ ++ bcfg = find_board_config(flash_limit, false); ++ ++ /* If that fails, try to at least find valid radio data */ ++ if (!bcfg) { ++ bcfg = find_board_config(flash_limit, true); ++ broken_boarddata = 1; ++ } ++ ++ if (!bcfg) { ++ printk(KERN_WARNING "WARNING: No board configuration data found!\n"); ++ return -ENODEV; ++ } ++ ++ board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL); ++ ar231x_board.config = (struct ar231x_boarddata *) board_data; ++ memcpy(board_data, bcfg, 0x100); ++ if (broken_boarddata) { ++ printk(KERN_WARNING "WARNING: broken board data detected\n"); ++ config = ar231x_board.config; ++ if (!memcmp(config->enet0_mac, "\x00\x00\x00\x00\x00\x00", 6)) { ++ printk(KERN_INFO "Fixing up empty mac addresses\n"); ++ config->resetConfigGpio = 0xffff; ++ config->sysLedGpio = 0xffff; ++ random_ether_addr(config->wlan0_mac); ++ config->wlan0_mac[0] &= ~0x06; ++ random_ether_addr(config->enet0_mac); ++ random_ether_addr(config->enet1_mac); ++ } ++ } ++ ++ ++ /* Radio config starts 0x100 bytes after board config, regardless ++ * of what the physical layout on the flash chip looks like */ ++ ++ if (ar231x_board.radio) ++ rcfg = (u8 *) ar231x_board.radio; ++ else ++ rcfg = find_radio_config(flash_limit, bcfg); ++ ++ if (!rcfg) ++ return -ENODEV; ++ ++ radio_data = board_data + 0x100 + ((rcfg - bcfg) & 0xfff); ++ ar231x_board.radio = radio_data; ++ offset = radio_data - board_data; ++ printk(KERN_INFO "Radio config found at offset 0x%x(0x%x)\n", rcfg - bcfg, offset); ++ rcfg_size = BOARD_CONFIG_BUFSZ - offset; ++ memcpy(radio_data, rcfg, rcfg_size); ++ ++ return 0; ++} ++ ++static void ++ar231x_halt(void) ++{ ++ local_irq_disable(); ++ while (1); ++} ++ ++void __init ++plat_mem_setup(void) ++{ ++ _machine_halt = ar231x_halt; ++ pm_power_off = ar231x_halt; ++ ++ ar5312_plat_setup(); ++ ar2315_plat_setup(); ++ ++ /* Disable data watchpoints */ ++ write_c0_watchlo0(0); ++} ++ ++ ++asmlinkage void ++plat_irq_dispatch(void) ++{ ++ ar231x_irq_dispatch(); ++} ++ ++void __init ++plat_time_init(void) ++{ ++ ar5312_time_init(); ++ ar2315_time_init(); ++} ++ ++unsigned int __cpuinit ++get_c0_compare_int(void) ++{ ++ return CP0_LEGACY_COMPARE_IRQ; ++} ++ ++void __init ++arch_init_irq(void) ++{ ++ clear_c0_status(ST0_IM); ++ mips_cpu_irq_init(); ++ ++ /* Initialize interrupt controllers */ ++ ar5312_irq_init(); ++ ar2315_irq_init(); ++} ++ ++ +Index: linux-2.6.32.7/arch/mips/ar231x/prom.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/prom.c 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,37 @@ ++/* ++ * 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 MontaVista Software Inc ++ * Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006 Felix Fietkau ++ */ ++ ++/* ++ * Prom setup file for ar531x ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include "ar5312.h" ++#include "ar2315.h" ++ ++void __init prom_init(void) ++{ ++ ar5312_prom_init(); ++ ar2315_prom_init(); ++} ++ ++void __init prom_free_prom_memory(void) ++{ ++} +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar231x_platform.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar231x_platform.h 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,83 @@ ++#ifndef __AR531X_PLATFORM_H ++#define __AR531X_PLATFORM_H ++ ++/* ++ * This is board-specific data that is stored in a "fixed" location in flash. ++ * It is shared across operating systems, so it should not be changed lightly. ++ * The main reason we need it is in order to extract the ethernet MAC ++ * address(es). ++ */ ++struct ar231x_boarddata { ++ u32 magic; /* board data is valid */ ++#define AR531X_BD_MAGIC 0x35333131 /* "5311", for all 531x platforms */ ++ u16 cksum; /* checksum (starting with BD_REV 2) */ ++ u16 rev; /* revision of this struct */ ++#define BD_REV 4 ++ char boardName[64]; /* Name of board */ ++ u16 major; /* Board major number */ ++ u16 minor; /* Board minor number */ ++ u32 flags; /* Board configuration */ ++#define BD_ENET0 0x00000001 /* ENET0 is stuffed */ ++#define BD_ENET1 0x00000002 /* ENET1 is stuffed */ ++#define BD_UART1 0x00000004 /* UART1 is stuffed */ ++#define BD_UART0 0x00000008 /* UART0 is stuffed (dma) */ ++#define BD_RSTFACTORY 0x00000010 /* Reset factory defaults stuffed */ ++#define BD_SYSLED 0x00000020 /* System LED stuffed */ ++#define BD_EXTUARTCLK 0x00000040 /* External UART clock */ ++#define BD_CPUFREQ 0x00000080 /* cpu freq is valid in nvram */ ++#define BD_SYSFREQ 0x00000100 /* sys freq is set in nvram */ ++#define BD_WLAN0 0x00000200 /* Enable WLAN0 */ ++#define BD_MEMCAP 0x00000400 /* CAP SDRAM @ memCap for testing */ ++#define BD_DISWATCHDOG 0x00000800 /* disable system watchdog */ ++#define BD_WLAN1 0x00001000 /* Enable WLAN1 (ar5212) */ ++#define BD_ISCASPER 0x00002000 /* FLAG for AR2312 */ ++#define BD_WLAN0_2G_EN 0x00004000 /* FLAG for radio0_2G */ ++#define BD_WLAN0_5G_EN 0x00008000 /* FLAG for radio0_2G */ ++#define BD_WLAN1_2G_EN 0x00020000 /* FLAG for radio0_2G */ ++#define BD_WLAN1_5G_EN 0x00040000 /* FLAG for radio0_2G */ ++ u16 resetConfigGpio; /* Reset factory GPIO pin */ ++ u16 sysLedGpio; /* System LED GPIO pin */ ++ ++ u32 cpuFreq; /* CPU core frequency in Hz */ ++ u32 sysFreq; /* System frequency in Hz */ ++ u32 cntFreq; /* Calculated C0_COUNT frequency */ ++ ++ u8 wlan0_mac[6]; ++ u8 enet0_mac[6]; ++ u8 enet1_mac[6]; ++ ++ u16 pciId; /* Pseudo PCIID for common code */ ++ u16 memCap; /* cap bank1 in MB */ ++ ++ /* version 3 */ ++ u8 wlan1_mac[6]; /* (ar5212) */ ++}; ++ ++#define BOARD_CONFIG_BUFSZ 0x1000 ++ ++/* ++ * Platform device information for the Wireless MAC ++ */ ++struct ar231x_board_config { ++ u16 devid; ++ ++ /* board config data */ ++ struct ar231x_boarddata *config; ++ ++ /* radio calibration data */ ++ const char *radio; ++}; ++ ++/* ++ * Platform device information for the Ethernet MAC ++ */ ++struct ar231x_eth { ++ u32 reset_base; ++ u32 reset_mac; ++ u32 reset_phy; ++ u32 phy_base; ++ struct ar231x_board_config *config; ++ char *macaddr; ++}; ++ ++#endif /* __AR531X_PLATFORM_H */ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,84 @@ ++/* ++ * Atheros SoC specific CPU feature overrides ++ * ++ * Copyright (C) 2008 Gabor Juhos ++ * ++ * This file was derived from: include/asm-mips/cpu-features.h ++ * Copyright (C) 2003, 2004 Ralf Baechle ++ * Copyright (C) 2004 Maciej W. Rozycki ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ * ++ */ ++#ifndef __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H ++#define __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H ++ ++/* ++ * The ATHEROS SoCs have MIPS 4Kc/4KEc core. ++ */ ++#define cpu_has_tlb 1 ++#define cpu_has_4kex 1 ++#define cpu_has_3k_cache 0 ++#define cpu_has_4k_cache 1 ++#define cpu_has_tx39_cache 0 ++#define cpu_has_sb1_cache 0 ++#define cpu_has_fpu 0 ++#define cpu_has_32fpr 0 ++#define cpu_has_counter 1 ++/* #define cpu_has_watch ? */ ++/* #define cpu_has_divec ? */ ++/* #define cpu_has_vce ? */ ++/* #define cpu_has_cache_cdex_p ? */ ++/* #define cpu_has_cache_cdex_s ? */ ++/* #define cpu_has_prefetch ? */ ++/* #define cpu_has_mcheck ? */ ++#define cpu_has_ejtag 1 ++ ++#if !defined(CONFIG_ATHEROS_AR5312) ++# define cpu_has_llsc 1 ++#else ++/* ++ * The MIPS 4Kc V0.9 core in the AR5312/AR2312 have problems with the ++ * ll/sc instructions. ++ */ ++# define cpu_has_llsc 0 ++#endif ++ ++#define cpu_has_mips16 0 ++#define cpu_has_mdmx 0 ++#define cpu_has_mips3d 0 ++#define cpu_has_smartmips 0 ++ ++/* #define cpu_has_vtag_icache ? */ ++/* #define cpu_has_dc_aliases ? */ ++/* #define cpu_has_ic_fills_f_dc ? */ ++/* #define cpu_has_pindexed_dcache ? */ ++ ++/* #define cpu_icache_snoops_remote_store ? */ ++ ++#define cpu_has_mips32r1 1 ++ ++#if !defined(CONFIG_ATHEROS_AR5312) ++# define cpu_has_mips32r2 1 ++#endif ++ ++#define cpu_has_mips64r1 0 ++#define cpu_has_mips64r2 0 ++ ++#define cpu_has_dsp 0 ++#define cpu_has_mipsmt 0 ++ ++/* #define cpu_has_nofpuex ? */ ++#define cpu_has_64bits 0 ++#define cpu_has_64bit_zero_reg 0 ++#define cpu_has_64bit_gp_regs 0 ++#define cpu_has_64bit_addresses 0 ++ ++/* #define cpu_has_inclusive_pcaches ? */ ++ ++/* #define cpu_dcache_line_size() ? */ ++/* #define cpu_icache_line_size() ? */ ++ ++#endif /* __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H */ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/dma-coherence.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/dma-coherence.h 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,64 @@ ++/* ++ * 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) 2006 Ralf Baechle ++ * Copyright (C) 2007 Felix Fietkau ++ * ++ */ ++#ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H ++#define __ASM_MACH_GENERIC_DMA_COHERENCE_H ++ ++#define PCI_DMA_OFFSET 0x20000000 ++ ++struct device; ++ ++static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) ++{ ++ return virt_to_phys(addr) + (dev != NULL ? PCI_DMA_OFFSET : 0); ++} ++ ++static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) ++{ ++ return page_to_phys(page) + (dev != NULL ? PCI_DMA_OFFSET : 0); ++} ++ ++static inline unsigned long plat_dma_addr_to_phys(struct device *dev, ++ dma_addr_t dma_addr) ++{ ++ return (dma_addr > PCI_DMA_OFFSET ? dma_addr - PCI_DMA_OFFSET : dma_addr); ++} ++ ++static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, ++ size_t size, enum dma_data_direction direction) ++{ ++} ++ ++static inline int plat_dma_supported(struct device *dev, u64 mask) ++{ ++ return 1; ++} ++ ++static inline void plat_extra_sync_for_device(struct device *dev) ++{ ++ return; ++} ++ ++static inline int plat_dma_mapping_error(struct device *dev, ++ dma_addr_t dma_addr) ++{ ++ return 0; ++} ++ ++static inline int plat_device_is_coherent(struct device *dev) ++{ ++#ifdef CONFIG_DMA_COHERENT ++ return 1; ++#endif ++#ifdef CONFIG_DMA_NONCOHERENT ++ return 0; ++#endif ++} ++ ++#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/gpio.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/gpio.h 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,79 @@ ++#ifndef _ATHEROS_GPIO_H_ ++#define _ATHEROS_GPIO_H_ ++ ++#include ++ ++struct ar231x_gpiodev { ++ u32 valid_mask; ++ u32 (*get_output)(void); ++ u32 (*set_output)(u32 mask, u32 val); ++ u32 (*get)(void); ++ u32 (*set)(u32 mask, u32 val); ++}; ++ ++extern const struct ar231x_gpiodev *ar231x_gpiodev; ++ ++/* ++ * Wrappers for the generic GPIO layer ++ */ ++ ++static inline int gpio_direction_input(unsigned gpio) { ++ u32 mask = 1 << gpio; ++ ++ if (!(ar231x_gpiodev->valid_mask & mask)) ++ return -ENXIO; ++ ++ ar231x_gpiodev->set_output(mask, 0); ++ return 0; ++} ++ ++static inline void gpio_set_value(unsigned gpio, int value) { ++ u32 mask = 1 << gpio; ++ ++ if (!(ar231x_gpiodev->valid_mask & mask)) ++ return; ++ ++ ar231x_gpiodev->set(mask, (!!value) * mask); ++} ++ ++static inline int gpio_direction_output(unsigned gpio, int value) { ++ u32 mask = 1 << gpio; ++ ++ if (!(ar231x_gpiodev->valid_mask & mask)) ++ return -ENXIO; ++ ++ ar231x_gpiodev->set_output(mask, mask); ++ ar231x_gpiodev->set(mask, (!!value) * mask); ++ return 0; ++} ++ ++/* Reads the gpio pin. Unchecked function */ ++static inline int gpio_get_value(unsigned gpio) { ++ u32 mask = 1 << gpio; ++ ++ if (!(ar231x_gpiodev->valid_mask & mask)) ++ return 0; ++ ++ return !!(ar231x_gpiodev->get() & mask); ++} ++ ++static inline int gpio_request(unsigned gpio, const char *label) { ++ return 0; ++} ++ ++static inline void gpio_free(unsigned gpio) { ++} ++ ++/* Returns IRQ to attach for gpio. Unchecked function */ ++static inline int gpio_to_irq(unsigned gpio) { ++ return AR531X_GPIO_IRQ(gpio); ++} ++ ++/* Returns gpio for IRQ attached. Unchecked function */ ++static inline int irq_to_gpio(unsigned irq) { ++ return (irq - (AR531X_GPIO_IRQ(0))); ++} ++ ++#include /* cansleep wrappers */ ++ ++#endif +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/reset.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/reset.h 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,6 @@ ++#ifndef __AR531X_RESET_H ++#define __AR531X_RESET_H ++ ++void ar531x_disable_reset_button(void); ++ ++#endif /* __AR531X_RESET_H */ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/war.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/war.h 2010-02-03 17:00:08.814429898 +0100 +@@ -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) 2008 Felix Fietkau ++ */ ++#ifndef __ASM_MIPS_MACH_ATHEROS_WAR_H ++#define __ASM_MIPS_MACH_ATHEROS_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_ATHEROS_WAR_H */ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar2315_regs.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar2315_regs.h 2010-02-03 17:00:08.814429898 +0100 +@@ -0,0 +1,580 @@ ++/* ++ * Register definitions for AR2315+ ++ * ++ * 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) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006-2008 Felix Fietkau ++ */ ++ ++#ifndef __AR2315_REG_H ++#define __AR2315_REG_H ++ ++/* ++ * IRQs ++ */ ++#define AR2315_IRQ_MISC_INTRS MIPS_CPU_IRQ_BASE+2 /* C0_CAUSE: 0x0400 */ ++#define AR2315_IRQ_WLAN0_INTRS MIPS_CPU_IRQ_BASE+3 /* C0_CAUSE: 0x0800 */ ++#define AR2315_IRQ_ENET0_INTRS MIPS_CPU_IRQ_BASE+4 /* C0_CAUSE: 0x1000 */ ++#define AR2315_IRQ_LCBUS_PCI MIPS_CPU_IRQ_BASE+5 /* C0_CAUSE: 0x2000 */ ++#define AR2315_IRQ_WLAN0_POLL MIPS_CPU_IRQ_BASE+6 /* C0_CAUSE: 0x4000 */ ++ ++/* ++ * Address map ++ */ ++#define AR2315_SPI_READ 0x08000000 /* SPI FLASH */ ++#define AR2315_WLAN0 0xB0000000 /* Wireless MMR */ ++#define AR2315_PCI 0xB0100000 /* PCI MMR */ ++#define AR2315_SDRAMCTL 0xB0300000 /* SDRAM MMR */ ++#define AR2315_LOCAL 0xB0400000 /* LOCAL BUS MMR */ ++#define AR2315_ENET0 0xB0500000 /* ETHERNET MMR */ ++#define AR2315_DSLBASE 0xB1000000 /* RESET CONTROL MMR */ ++#define AR2315_UART0 0xB1100003 /* UART MMR */ ++#define AR2315_SPI 0xB1300000 /* SPI FLASH MMR */ ++#define AR2315_PCIEXT 0x80000000 /* pci external */ ++ ++/* ++ * Reset Register ++ */ ++#define AR2315_COLD_RESET (AR2315_DSLBASE + 0x0000) ++ ++#define AR2315_RESET_COLD_AHB 0x00000001 ++#define AR2315_RESET_COLD_APB 0x00000002 ++#define AR2315_RESET_COLD_CPU 0x00000004 ++#define AR2315_RESET_COLD_CPUWARM 0x00000008 ++#define AR2315_RESET_SYSTEM (RESET_COLD_CPU | RESET_COLD_APB | RESET_COLD_AHB) /* full system */ ++#define AR2317_RESET_SYSTEM 0x00000010 ++ ++ ++#define AR2315_RESET (AR2315_DSLBASE + 0x0004) ++ ++#define AR2315_RESET_WARM_WLAN0_MAC 0x00000001 /* warm reset WLAN0 MAC */ ++#define AR2315_RESET_WARM_WLAN0_BB 0x00000002 /* warm reset WLAN0 BaseBand */ ++#define AR2315_RESET_MPEGTS_RSVD 0x00000004 /* warm reset MPEG-TS */ ++#define AR2315_RESET_PCIDMA 0x00000008 /* warm reset PCI ahb/dma */ ++#define AR2315_RESET_MEMCTL 0x00000010 /* warm reset memory controller */ ++#define AR2315_RESET_LOCAL 0x00000020 /* warm reset local bus */ ++#define AR2315_RESET_I2C_RSVD 0x00000040 /* warm reset I2C bus */ ++#define AR2315_RESET_SPI 0x00000080 /* warm reset SPI interface */ ++#define AR2315_RESET_UART0 0x00000100 /* warm reset UART0 */ ++#define AR2315_RESET_IR_RSVD 0x00000200 /* warm reset IR interface */ ++#define AR2315_RESET_EPHY0 0x00000400 /* cold reset ENET0 phy */ ++#define AR2315_RESET_ENET0 0x00000800 /* cold reset ENET0 mac */ ++ ++/* ++ * AHB master arbitration control ++ */ ++#define AR2315_AHB_ARB_CTL (AR2315_DSLBASE + 0x0008) ++ ++#define AR2315_ARB_CPU 0x00000001 /* CPU, default */ ++#define AR2315_ARB_WLAN 0x00000002 /* WLAN */ ++#define AR2315_ARB_MPEGTS_RSVD 0x00000004 /* MPEG-TS */ ++#define AR2315_ARB_LOCAL 0x00000008 /* LOCAL */ ++#define AR2315_ARB_PCI 0x00000010 /* PCI */ ++#define AR2315_ARB_ETHERNET 0x00000020 /* Ethernet */ ++#define AR2315_ARB_RETRY 0x00000100 /* retry policy, debug only */ ++ ++/* ++ * Config Register ++ */ ++#define AR2315_ENDIAN_CTL (AR2315_DSLBASE + 0x000c) ++ ++#define AR2315_CONFIG_AHB 0x00000001 /* EC - AHB bridge endianess */ ++#define AR2315_CONFIG_WLAN 0x00000002 /* WLAN byteswap */ ++#define AR2315_CONFIG_MPEGTS_RSVD 0x00000004 /* MPEG-TS byteswap */ ++#define AR2315_CONFIG_PCI 0x00000008 /* PCI byteswap */ ++#define AR2315_CONFIG_MEMCTL 0x00000010 /* Memory controller endianess */ ++#define AR2315_CONFIG_LOCAL 0x00000020 /* Local bus byteswap */ ++#define AR2315_CONFIG_ETHERNET 0x00000040 /* Ethernet byteswap */ ++ ++#define AR2315_CONFIG_MERGE 0x00000200 /* CPU write buffer merge */ ++#define AR2315_CONFIG_CPU 0x00000400 /* CPU big endian */ ++#define AR2315_CONFIG_PCIAHB 0x00000800 ++#define AR2315_CONFIG_PCIAHB_BRIDGE 0x00001000 ++#define AR2315_CONFIG_SPI 0x00008000 /* SPI byteswap */ ++#define AR2315_CONFIG_CPU_DRAM 0x00010000 ++#define AR2315_CONFIG_CPU_PCI 0x00020000 ++#define AR2315_CONFIG_CPU_MMR 0x00040000 ++#define AR2315_CONFIG_BIG 0x00000400 ++ ++ ++/* ++ * NMI control ++ */ ++#define AR2315_NMI_CTL (AR2315_DSLBASE + 0x0010) ++ ++#define AR2315_NMI_EN 1 ++ ++/* ++ * Revision Register - Initial value is 0x3010 (WMAC 3.0, AR531X 1.0). ++ */ ++#define AR2315_SREV (AR2315_DSLBASE + 0x0014) ++ ++#define AR2315_REV_MAJ 0x00f0 ++#define AR2315_REV_MAJ_S 4 ++#define AR2315_REV_MIN 0x000f ++#define AR2315_REV_MIN_S 0 ++#define AR2315_REV_CHIP (AR2315_REV_MAJ|AR2315_REV_MIN) ++ ++/* ++ * Interface Enable ++ */ ++#define AR2315_IF_CTL (AR2315_DSLBASE + 0x0018) ++ ++#define AR2315_IF_MASK 0x00000007 ++#define AR2315_IF_DISABLED 0 ++#define AR2315_IF_PCI 1 ++#define AR2315_IF_TS_LOCAL 2 ++#define AR2315_IF_ALL 3 /* only for emulation with separate pins */ ++#define AR2315_IF_LOCAL_HOST 0x00000008 ++#define AR2315_IF_PCI_HOST 0x00000010 ++#define AR2315_IF_PCI_INTR 0x00000020 ++#define AR2315_IF_PCI_CLK_MASK 0x00030000 ++#define AR2315_IF_PCI_CLK_INPUT 0 ++#define AR2315_IF_PCI_CLK_OUTPUT_LOW 1 ++#define AR2315_IF_PCI_CLK_OUTPUT_CLK 2 ++#define AR2315_IF_PCI_CLK_OUTPUT_HIGH 3 ++#define AR2315_IF_PCI_CLK_SHIFT 16 ++ ++/* ++ * APB Interrupt control ++ */ ++ ++#define AR2315_ISR (AR2315_DSLBASE + 0x0020) ++#define AR2315_IMR (AR2315_DSLBASE + 0x0024) ++#define AR2315_GISR (AR2315_DSLBASE + 0x0028) ++ ++#define AR2315_ISR_UART0 0x0001 /* high speed UART */ ++#define AR2315_ISR_I2C_RSVD 0x0002 /* I2C bus */ ++#define AR2315_ISR_SPI 0x0004 /* SPI bus */ ++#define AR2315_ISR_AHB 0x0008 /* AHB error */ ++#define AR2315_ISR_APB 0x0010 /* APB error */ ++#define AR2315_ISR_TIMER 0x0020 /* timer */ ++#define AR2315_ISR_GPIO 0x0040 /* GPIO */ ++#define AR2315_ISR_WD 0x0080 /* watchdog */ ++#define AR2315_ISR_IR_RSVD 0x0100 /* IR */ ++ ++#define AR2315_GISR_MISC 0x0001 ++#define AR2315_GISR_WLAN0 0x0002 ++#define AR2315_GISR_MPEGTS_RSVD 0x0004 ++#define AR2315_GISR_LOCALPCI 0x0008 ++#define AR2315_GISR_WMACPOLL 0x0010 ++#define AR2315_GISR_TIMER 0x0020 ++#define AR2315_GISR_ETHERNET 0x0040 ++ ++/* ++ * Interrupt routing from IO to the processor IP bits ++ * Define our inter mask and level ++ */ ++#define AR2315_INTR_MISCIO SR_IBIT3 ++#define AR2315_INTR_WLAN0 SR_IBIT4 ++#define AR2315_INTR_ENET0 SR_IBIT5 ++#define AR2315_INTR_LOCALPCI SR_IBIT6 ++#define AR2315_INTR_WMACPOLL SR_IBIT7 ++#define AR2315_INTR_COMPARE SR_IBIT8 ++ ++/* ++ * Timers ++ */ ++#define AR2315_TIMER (AR2315_DSLBASE + 0x0030) ++#define AR2315_RELOAD (AR2315_DSLBASE + 0x0034) ++#define AR2315_WD (AR2315_DSLBASE + 0x0038) ++#define AR2315_WDC (AR2315_DSLBASE + 0x003c) ++ ++#define AR2315_WDC_IGNORE_EXPIRATION 0x00000000 ++#define AR2315_WDC_NMI 0x00000001 /* NMI on watchdog */ ++#define AR2315_WDC_RESET 0x00000002 /* reset on watchdog */ ++ ++/* ++ * CPU Performance Counters ++ */ ++#define AR2315_PERFCNT0 (AR2315_DSLBASE + 0x0048) ++#define AR2315_PERFCNT1 (AR2315_DSLBASE + 0x004c) ++ ++#define AR2315_PERF0_DATAHIT 0x0001 /* Count Data Cache Hits */ ++#define AR2315_PERF0_DATAMISS 0x0002 /* Count Data Cache Misses */ ++#define AR2315_PERF0_INSTHIT 0x0004 /* Count Instruction Cache Hits */ ++#define AR2315_PERF0_INSTMISS 0x0008 /* Count Instruction Cache Misses */ ++#define AR2315_PERF0_ACTIVE 0x0010 /* Count Active Processor Cycles */ ++#define AR2315_PERF0_WBHIT 0x0020 /* Count CPU Write Buffer Hits */ ++#define AR2315_PERF0_WBMISS 0x0040 /* Count CPU Write Buffer Misses */ ++ ++#define AR2315_PERF1_EB_ARDY 0x0001 /* Count EB_ARdy signal */ ++#define AR2315_PERF1_EB_AVALID 0x0002 /* Count EB_AValid signal */ ++#define AR2315_PERF1_EB_WDRDY 0x0004 /* Count EB_WDRdy signal */ ++#define AR2315_PERF1_EB_RDVAL 0x0008 /* Count EB_RdVal signal */ ++#define AR2315_PERF1_VRADDR 0x0010 /* Count valid read address cycles */ ++#define AR2315_PERF1_VWADDR 0x0020 /* Count valid write address cycles */ ++#define AR2315_PERF1_VWDATA 0x0040 /* Count valid write data cycles */ ++ ++/* ++ * AHB Error Reporting. ++ */ ++#define AR2315_AHB_ERR0 (AR2315_DSLBASE + 0x0050) /* error */ ++#define AR2315_AHB_ERR1 (AR2315_DSLBASE + 0x0054) /* haddr */ ++#define AR2315_AHB_ERR2 (AR2315_DSLBASE + 0x0058) /* hwdata */ ++#define AR2315_AHB_ERR3 (AR2315_DSLBASE + 0x005c) /* hrdata */ ++#define AR2315_AHB_ERR4 (AR2315_DSLBASE + 0x0060) /* status */ ++ ++#define AHB_ERROR_DET 1 /* AHB Error has been detected, */ ++ /* write 1 to clear all bits in ERR0 */ ++#define AHB_ERROR_OVR 2 /* AHB Error overflow has been detected */ ++#define AHB_ERROR_WDT 4 /* AHB Error due to wdt instead of hresp */ ++ ++#define AR2315_PROCERR_HMAST 0x0000000f ++#define AR2315_PROCERR_HMAST_DFLT 0 ++#define AR2315_PROCERR_HMAST_WMAC 1 ++#define AR2315_PROCERR_HMAST_ENET 2 ++#define AR2315_PROCERR_HMAST_PCIENDPT 3 ++#define AR2315_PROCERR_HMAST_LOCAL 4 ++#define AR2315_PROCERR_HMAST_CPU 5 ++#define AR2315_PROCERR_HMAST_PCITGT 6 ++ ++#define AR2315_PROCERR_HMAST_S 0 ++#define AR2315_PROCERR_HWRITE 0x00000010 ++#define AR2315_PROCERR_HSIZE 0x00000060 ++#define AR2315_PROCERR_HSIZE_S 5 ++#define AR2315_PROCERR_HTRANS 0x00000180 ++#define AR2315_PROCERR_HTRANS_S 7 ++#define AR2315_PROCERR_HBURST 0x00000e00 ++#define AR2315_PROCERR_HBURST_S 9 ++ ++/* ++ * Clock Control ++ */ ++#define AR2315_PLLC_CTL (AR2315_DSLBASE + 0x0064) ++#define AR2315_PLLV_CTL (AR2315_DSLBASE + 0x0068) ++#define AR2315_CPUCLK (AR2315_DSLBASE + 0x006c) ++#define AR2315_AMBACLK (AR2315_DSLBASE + 0x0070) ++#define AR2315_SYNCCLK (AR2315_DSLBASE + 0x0074) ++#define AR2315_DSL_SLEEP_CTL (AR2315_DSLBASE + 0x0080) ++#define AR2315_DSL_SLEEP_DUR (AR2315_DSLBASE + 0x0084) ++ ++/* PLLc Control fields */ ++#define PLLC_REF_DIV_M 0x00000003 ++#define PLLC_REF_DIV_S 0 ++#define PLLC_FDBACK_DIV_M 0x0000007C ++#define PLLC_FDBACK_DIV_S 2 ++#define PLLC_ADD_FDBACK_DIV_M 0x00000080 ++#define PLLC_ADD_FDBACK_DIV_S 7 ++#define PLLC_CLKC_DIV_M 0x0001c000 ++#define PLLC_CLKC_DIV_S 14 ++#define PLLC_CLKM_DIV_M 0x00700000 ++#define PLLC_CLKM_DIV_S 20 ++ ++/* CPU CLK Control fields */ ++#define CPUCLK_CLK_SEL_M 0x00000003 ++#define CPUCLK_CLK_SEL_S 0 ++#define CPUCLK_CLK_DIV_M 0x0000000c ++#define CPUCLK_CLK_DIV_S 2 ++ ++/* AMBA CLK Control fields */ ++#define AMBACLK_CLK_SEL_M 0x00000003 ++#define AMBACLK_CLK_SEL_S 0 ++#define AMBACLK_CLK_DIV_M 0x0000000c ++#define AMBACLK_CLK_DIV_S 2 ++ ++/* ++ * GPIO ++ */ ++#define AR2315_GPIO_DI (AR2315_DSLBASE + 0x0088) ++#define AR2315_GPIO_DO (AR2315_DSLBASE + 0x0090) ++#define AR2315_GPIO_CR (AR2315_DSLBASE + 0x0098) ++#define AR2315_GPIO_INT (AR2315_DSLBASE + 0x00a0) ++ ++#define AR2315_GPIO_CR_M(x) (1 << (x)) /* mask for i/o */ ++#define AR2315_GPIO_CR_O(x) (1 << (x)) /* output */ ++#define AR2315_GPIO_CR_I(x) (0) /* input */ ++ ++#define AR2315_GPIO_INT_S(x) (x) /* interrupt enable */ ++#define AR2315_GPIO_INT_M (0x3F) /* mask for int */ ++#define AR2315_GPIO_INT_LVL(x) ((x) << 6) /* interrupt level */ ++#define AR2315_GPIO_INT_LVL_M ((0x3) << 6) /* mask for int level */ ++ ++#define AR2315_GPIO_INT_MAX_Y 1 /* Maximum value of Y for AR5313_GPIO_INT_* macros */ ++#define AR2315_GPIO_INT_LVL_OFF 0 /* Triggerring off */ ++#define AR2315_GPIO_INT_LVL_LOW 1 /* Low Level Triggered */ ++#define AR2315_GPIO_INT_LVL_HIGH 2 /* High Level Triggered */ ++#define AR2315_GPIO_INT_LVL_EDGE 3 /* Edge Triggered */ ++ ++#define AR2315_RESET_GPIO 5 ++#define AR2315_NUM_GPIO 22 ++ ++/* ++ * PCI Clock Control ++ */ ++#define AR2315_PCICLK (AR2315_DSLBASE + 0x00a4) ++ ++#define AR2315_PCICLK_INPUT_M 0x3 ++#define AR2315_PCICLK_INPUT_S 0 ++ ++#define AR2315_PCICLK_PLLC_CLKM 0 ++#define AR2315_PCICLK_PLLC_CLKM1 1 ++#define AR2315_PCICLK_PLLC_CLKC 2 ++#define AR2315_PCICLK_REF_CLK 3 ++ ++#define AR2315_PCICLK_DIV_M 0xc ++#define AR2315_PCICLK_DIV_S 2 ++ ++#define AR2315_PCICLK_IN_FREQ 0 ++#define AR2315_PCICLK_IN_FREQ_DIV_6 1 ++#define AR2315_PCICLK_IN_FREQ_DIV_8 2 ++#define AR2315_PCICLK_IN_FREQ_DIV_10 3 ++ ++/* ++ * Observation Control Register ++ */ ++#define AR2315_OCR (AR2315_DSLBASE + 0x00b0) ++#define OCR_GPIO0_IRIN 0x0040 ++#define OCR_GPIO1_IROUT 0x0080 ++#define OCR_GPIO3_RXCLR 0x0200 ++ ++/* ++ * General Clock Control ++ */ ++ ++#define AR2315_MISCCLK (AR2315_DSLBASE + 0x00b4) ++#define MISCCLK_PLLBYPASS_EN 0x00000001 ++#define MISCCLK_PROCREFCLK 0x00000002 ++ ++/* ++ * SDRAM Controller ++ * - No read or write buffers are included. ++ */ ++#define AR2315_MEM_CFG (AR2315_SDRAMCTL + 0x00) ++#define AR2315_MEM_CTRL (AR2315_SDRAMCTL + 0x0c) ++#define AR2315_MEM_REF (AR2315_SDRAMCTL + 0x10) ++ ++#define SDRAM_DATA_WIDTH_M 0x00006000 ++#define SDRAM_DATA_WIDTH_S 13 ++ ++#define SDRAM_COL_WIDTH_M 0x00001E00 ++#define SDRAM_COL_WIDTH_S 9 ++ ++#define SDRAM_ROW_WIDTH_M 0x000001E0 ++#define SDRAM_ROW_WIDTH_S 5 ++ ++#define SDRAM_BANKADDR_BITS_M 0x00000018 ++#define SDRAM_BANKADDR_BITS_S 3 ++ ++/* ++ * SPI Flash Interface Registers ++ */ ++ ++#define AR2315_SPI_CTL (AR2315_SPI + 0x00) ++#define AR2315_SPI_OPCODE (AR2315_SPI + 0x04) ++#define AR2315_SPI_DATA (AR2315_SPI + 0x08) ++ ++#define SPI_CTL_START 0x00000100 ++#define SPI_CTL_BUSY 0x00010000 ++#define SPI_CTL_TXCNT_MASK 0x0000000f ++#define SPI_CTL_RXCNT_MASK 0x000000f0 ++#define SPI_CTL_TX_RX_CNT_MASK 0x000000ff ++#define SPI_CTL_SIZE_MASK 0x00060000 ++ ++#define SPI_CTL_CLK_SEL_MASK 0x03000000 ++#define SPI_OPCODE_MASK 0x000000ff ++ ++/* ++ * PCI Bus Interface Registers ++ */ ++#define AR2315_PCI_1MS_REG (AR2315_PCI + 0x0008) ++#define AR2315_PCI_1MS_MASK 0x3FFFF /* # of AHB clk cycles in 1ms */ ++ ++#define AR2315_PCI_MISC_CONFIG (AR2315_PCI + 0x000c) ++#define AR2315_PCIMISC_TXD_EN 0x00000001 /* Enable TXD for fragments */ ++#define AR2315_PCIMISC_CFG_SEL 0x00000002 /* mem or config cycles */ ++#define AR2315_PCIMISC_GIG_MASK 0x0000000C /* bits 31-30 for pci req */ ++#define AR2315_PCIMISC_RST_MODE 0x00000030 ++#define AR2315_PCIRST_INPUT 0x00000000 /* 4:5=0 rst is input */ ++#define AR2315_PCIRST_LOW 0x00000010 /* 4:5=1 rst to GND */ ++#define AR2315_PCIRST_HIGH 0x00000020 /* 4:5=2 rst to VDD */ ++#define AR2315_PCIGRANT_EN 0x00000000 /* 6:7=0 early grant en */ ++#define AR2315_PCIGRANT_FRAME 0x00000040 /* 6:7=1 grant waits 4 frame */ ++#define AR2315_PCIGRANT_IDLE 0x00000080 /* 6:7=2 grant waits 4 idle */ ++#define AR2315_PCIGRANT_GAP 0x00000000 /* 6:7=2 grant waits 4 idle */ ++#define AR2315_PCICACHE_DIS 0x00001000 /* PCI external access cache disable */ ++ ++#define AR2315_PCI_OUT_TSTAMP (AR2315_PCI + 0x0010) ++ ++#define AR2315_PCI_UNCACHE_CFG (AR2315_PCI + 0x0014) ++ ++#define AR2315_PCI_IN_EN (AR2315_PCI + 0x0100) ++#define AR2315_PCI_IN_EN0 0x01 /* Enable chain 0 */ ++#define AR2315_PCI_IN_EN1 0x02 /* Enable chain 1 */ ++#define AR2315_PCI_IN_EN2 0x04 /* Enable chain 2 */ ++#define AR2315_PCI_IN_EN3 0x08 /* Enable chain 3 */ ++ ++#define AR2315_PCI_IN_DIS (AR2315_PCI + 0x0104) ++#define AR2315_PCI_IN_DIS0 0x01 /* Disable chain 0 */ ++#define AR2315_PCI_IN_DIS1 0x02 /* Disable chain 1 */ ++#define AR2315_PCI_IN_DIS2 0x04 /* Disable chain 2 */ ++#define AR2315_PCI_IN_DIS3 0x08 /* Disable chain 3 */ ++ ++#define AR2315_PCI_IN_PTR (AR2315_PCI + 0x0200) ++ ++#define AR2315_PCI_OUT_EN (AR2315_PCI + 0x0400) ++#define AR2315_PCI_OUT_EN0 0x01 /* Enable chain 0 */ ++ ++#define AR2315_PCI_OUT_DIS (AR2315_PCI + 0x0404) ++#define AR2315_PCI_OUT_DIS0 0x01 /* Disable chain 0 */ ++ ++#define AR2315_PCI_OUT_PTR (AR2315_PCI + 0x0408) ++ ++#define AR2315_PCI_INT_STATUS (AR2315_PCI + 0x0500) /* write one to clr */ ++#define AR2315_PCI_TXINT 0x00000001 /* Desc In Completed */ ++#define AR2315_PCI_TXOK 0x00000002 /* Desc In OK */ ++#define AR2315_PCI_TXERR 0x00000004 /* Desc In ERR */ ++#define AR2315_PCI_TXEOL 0x00000008 /* Desc In End-of-List */ ++#define AR2315_PCI_RXINT 0x00000010 /* Desc Out Completed */ ++#define AR2315_PCI_RXOK 0x00000020 /* Desc Out OK */ ++#define AR2315_PCI_RXERR 0x00000040 /* Desc Out ERR */ ++#define AR2315_PCI_RXEOL 0x00000080 /* Desc Out EOL */ ++#define AR2315_PCI_TXOOD 0x00000200 /* Desc In Out-of-Desc */ ++#define AR2315_PCI_MASK 0x0000FFFF /* Desc Mask */ ++#define AR2315_PCI_EXT_INT 0x02000000 ++#define AR2315_PCI_ABORT_INT 0x04000000 ++ ++#define AR2315_PCI_INT_MASK (AR2315_PCI + 0x0504) /* same as INT_STATUS */ ++ ++#define AR2315_PCI_INTEN_REG (AR2315_PCI + 0x0508) ++#define AR2315_PCI_INT_DISABLE 0x00 /* disable pci interrupts */ ++#define AR2315_PCI_INT_ENABLE 0x01 /* enable pci interrupts */ ++ ++#define AR2315_PCI_HOST_IN_EN (AR2315_PCI + 0x0800) ++#define AR2315_PCI_HOST_IN_DIS (AR2315_PCI + 0x0804) ++#define AR2315_PCI_HOST_IN_PTR (AR2315_PCI + 0x0810) ++#define AR2315_PCI_HOST_OUT_EN (AR2315_PCI + 0x0900) ++#define AR2315_PCI_HOST_OUT_DIS (AR2315_PCI + 0x0904) ++#define AR2315_PCI_HOST_OUT_PTR (AR2315_PCI + 0x0908) ++ ++ ++/* ++ * Local Bus Interface Registers ++ */ ++#define AR2315_LB_CONFIG (AR2315_LOCAL + 0x0000) ++#define AR2315_LBCONF_OE 0x00000001 /* =1 OE is low-true */ ++#define AR2315_LBCONF_CS0 0x00000002 /* =1 first CS is low-true */ ++#define AR2315_LBCONF_CS1 0x00000004 /* =1 2nd CS is low-true */ ++#define AR2315_LBCONF_RDY 0x00000008 /* =1 RDY is low-true */ ++#define AR2315_LBCONF_WE 0x00000010 /* =1 Write En is low-true */ ++#define AR2315_LBCONF_WAIT 0x00000020 /* =1 WAIT is low-true */ ++#define AR2315_LBCONF_ADS 0x00000040 /* =1 Adr Strobe is low-true */ ++#define AR2315_LBCONF_MOT 0x00000080 /* =0 Intel, =1 Motorola */ ++#define AR2315_LBCONF_8CS 0x00000100 /* =1 8 bits CS, 0= 16bits */ ++#define AR2315_LBCONF_8DS 0x00000200 /* =1 8 bits Data S, 0=16bits */ ++#define AR2315_LBCONF_ADS_EN 0x00000400 /* =1 Enable ADS */ ++#define AR2315_LBCONF_ADR_OE 0x00000800 /* =1 Adr cap on OE, WE or DS */ ++#define AR2315_LBCONF_ADDT_MUX 0x00001000 /* =1 Adr and Data share bus */ ++#define AR2315_LBCONF_DATA_OE 0x00002000 /* =1 Data cap on OE, WE, DS */ ++#define AR2315_LBCONF_16DATA 0x00004000 /* =1 Data is 16 bits wide */ ++#define AR2315_LBCONF_SWAPDT 0x00008000 /* =1 Byte swap data */ ++#define AR2315_LBCONF_SYNC 0x00010000 /* =1 Bus synchronous to clk */ ++#define AR2315_LBCONF_INT 0x00020000 /* =1 Intr is low true */ ++#define AR2315_LBCONF_INT_CTR0 0x00000000 /* GND high-Z, Vdd is high-Z */ ++#define AR2315_LBCONF_INT_CTR1 0x00040000 /* GND drive, Vdd is high-Z */ ++#define AR2315_LBCONF_INT_CTR2 0x00080000 /* GND high-Z, Vdd drive */ ++#define AR2315_LBCONF_INT_CTR3 0x000C0000 /* GND drive, Vdd drive */ ++#define AR2315_LBCONF_RDY_WAIT 0x00100000 /* =1 RDY is negative of WAIT */ ++#define AR2315_LBCONF_INT_PULSE 0x00200000 /* =1 Interrupt is a pulse */ ++#define AR2315_LBCONF_ENABLE 0x00400000 /* =1 Falcon respond to LB */ ++ ++#define AR2315_LB_CLKSEL (AR2315_LOCAL + 0x0004) ++#define AR2315_LBCLK_EXT 0x0001 /* use external clk for lb */ ++ ++#define AR2315_LB_1MS (AR2315_LOCAL + 0x0008) ++#define AR2315_LB1MS_MASK 0x3FFFF /* # of AHB clk cycles in 1ms */ ++ ++#define AR2315_LB_MISCCFG (AR2315_LOCAL + 0x000C) ++#define AR2315_LBM_TXD_EN 0x00000001 /* Enable TXD for fragments */ ++#define AR2315_LBM_RX_INTEN 0x00000002 /* Enable LB ints on RX ready */ ++#define AR2315_LBM_MBOXWR_INTEN 0x00000004 /* Enable LB ints on mbox wr */ ++#define AR2315_LBM_MBOXRD_INTEN 0x00000008 /* Enable LB ints on mbox rd */ ++#define AR2315_LMB_DESCSWAP_EN 0x00000010 /* Byte swap desc enable */ ++#define AR2315_LBM_TIMEOUT_MASK 0x00FFFF80 ++#define AR2315_LBM_TIMEOUT_SHFT 7 ++#define AR2315_LBM_PORTMUX 0x07000000 ++ ++ ++#define AR2315_LB_RXTSOFF (AR2315_LOCAL + 0x0010) ++ ++#define AR2315_LB_TX_CHAIN_EN (AR2315_LOCAL + 0x0100) ++#define AR2315_LB_TXEN_0 0x01 ++#define AR2315_LB_TXEN_1 0x02 ++#define AR2315_LB_TXEN_2 0x04 ++#define AR2315_LB_TXEN_3 0x08 ++ ++#define AR2315_LB_TX_CHAIN_DIS (AR2315_LOCAL + 0x0104) ++#define AR2315_LB_TX_DESC_PTR (AR2315_LOCAL + 0x0200) ++ ++#define AR2315_LB_RX_CHAIN_EN (AR2315_LOCAL + 0x0400) ++#define AR2315_LB_RXEN 0x01 ++ ++#define AR2315_LB_RX_CHAIN_DIS (AR2315_LOCAL + 0x0404) ++#define AR2315_LB_RX_DESC_PTR (AR2315_LOCAL + 0x0408) ++ ++#define AR2315_LB_INT_STATUS (AR2315_LOCAL + 0x0500) ++#define AR2315_INT_TX_DESC 0x0001 ++#define AR2315_INT_TX_OK 0x0002 ++#define AR2315_INT_TX_ERR 0x0004 ++#define AR2315_INT_TX_EOF 0x0008 ++#define AR2315_INT_RX_DESC 0x0010 ++#define AR2315_INT_RX_OK 0x0020 ++#define AR2315_INT_RX_ERR 0x0040 ++#define AR2315_INT_RX_EOF 0x0080 ++#define AR2315_INT_TX_TRUNC 0x0100 ++#define AR2315_INT_TX_STARVE 0x0200 ++#define AR2315_INT_LB_TIMEOUT 0x0400 ++#define AR2315_INT_LB_ERR 0x0800 ++#define AR2315_INT_MBOX_WR 0x1000 ++#define AR2315_INT_MBOX_RD 0x2000 ++ ++/* Bit definitions for INT MASK are the same as INT_STATUS */ ++#define AR2315_LB_INT_MASK (AR2315_LOCAL + 0x0504) ++ ++#define AR2315_LB_INT_EN (AR2315_LOCAL + 0x0508) ++#define AR2315_LB_MBOX (AR2315_LOCAL + 0x0600) ++ ++/* ++ * IR Interface Registers ++ */ ++#define AR2315_IR_PKTDATA (AR2315_IR + 0x0000) ++ ++#define AR2315_IR_PKTLEN (AR2315_IR + 0x07fc) /* 0 - 63 */ ++ ++#define AR2315_IR_CONTROL (AR2315_IR + 0x0800) ++#define AR2315_IRCTL_TX 0x00000000 /* use as tranmitter */ ++#define AR2315_IRCTL_RX 0x00000001 /* use as receiver */ ++#define AR2315_IRCTL_SAMPLECLK_MASK 0x00003ffe /* Sample clk divisor mask */ ++#define AR2315_IRCTL_SAMPLECLK_SHFT 1 ++#define AR2315_IRCTL_OUTPUTCLK_MASK 0x03ffc000 /* Output clk divisor mask */ ++#define AR2315_IRCTL_OUTPUTCLK_SHFT 14 ++ ++#define AR2315_IR_STATUS (AR2315_IR + 0x0804) ++#define AR2315_IRSTS_RX 0x00000001 /* receive in progress */ ++#define AR2315_IRSTS_TX 0x00000002 /* transmit in progress */ ++ ++#define AR2315_IR_CONFIG (AR2315_IR + 0x0808) ++#define AR2315_IRCFG_INVIN 0x00000001 /* invert input polarity */ ++#define AR2315_IRCFG_INVOUT 0x00000002 /* invert output polarity */ ++#define AR2315_IRCFG_SEQ_START_WIN_SEL 0x00000004 /* 1 => 28, 0 => 7 */ ++#define AR2315_IRCFG_SEQ_START_THRESH 0x000000f0 /* */ ++#define AR2315_IRCFG_SEQ_END_UNIT_SEL 0x00000100 /* */ ++#define AR2315_IRCFG_SEQ_END_UNIT_THRESH 0x00007e00 /* */ ++#define AR2315_IRCFG_SEQ_END_WIN_SEL 0x00008000 /* */ ++#define AR2315_IRCFG_SEQ_END_WIN_THRESH 0x001f0000 /* */ ++#define AR2315_IRCFG_NUM_BACKOFF_WORDS 0x01e00000 /* */ ++ ++#define HOST_PCI_DEV_ID 3 ++#define HOST_PCI_MBAR0 0x10000000 ++#define HOST_PCI_MBAR1 0x20000000 ++#define HOST_PCI_MBAR2 0x30000000 ++ ++#define HOST_PCI_SDRAM_BASEADDR HOST_PCI_MBAR1 ++#define PCI_DEVICE_MEM_SPACE 0x800000 ++ ++#endif /* __AR2315_REG_H */ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar5312_regs.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar5312_regs.h 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,236 @@ ++/* ++ * 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) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006 Felix Fietkau ++ */ ++ ++#ifndef AR5312_H ++#define AR5312_H ++ ++#include ++ ++/* ++ * IRQs ++ */ ++ ++#define AR5312_IRQ_WLAN0_INTRS MIPS_CPU_IRQ_BASE+2 /* C0_CAUSE: 0x0400 */ ++#define AR5312_IRQ_ENET0_INTRS MIPS_CPU_IRQ_BASE+3 /* C0_CAUSE: 0x0800 */ ++#define AR5312_IRQ_ENET1_INTRS MIPS_CPU_IRQ_BASE+4 /* C0_CAUSE: 0x1000 */ ++#define AR5312_IRQ_WLAN1_INTRS MIPS_CPU_IRQ_BASE+5 /* C0_CAUSE: 0x2000 */ ++#define AR5312_IRQ_MISC_INTRS MIPS_CPU_IRQ_BASE+6 /* C0_CAUSE: 0x4000 */ ++ ++ ++/* Address Map */ ++#define AR531X_WLAN0 0x18000000 ++#define AR531X_WLAN1 0x18500000 ++#define AR531X_ENET0 0x18100000 ++#define AR531X_ENET1 0x18200000 ++#define AR531X_SDRAMCTL 0x18300000 ++#define AR531X_FLASHCTL 0x18400000 ++#define AR531X_APBBASE 0x1c000000 ++#define AR531X_FLASH 0x1e000000 ++#define AR531X_UART0 0xbc000003 /* UART MMR */ ++ ++/* ++ * AR531X_NUM_ENET_MAC defines the number of ethernet MACs that ++ * should be considered available. The AR5312 supports 2 enet MACS, ++ * even though many reference boards only actually use 1 of them ++ * (i.e. Only MAC 0 is actually connected to an enet PHY or PHY switch. ++ * The AR2312 supports 1 enet MAC. ++ */ ++#define AR531X_NUM_ENET_MAC 2 ++ ++/* ++ * Need these defines to determine true number of ethernet MACs ++ */ ++#define AR5212_AR5312_REV2 0x0052 /* AR5312 WMAC (AP31) */ ++#define AR5212_AR5312_REV7 0x0057 /* AR5312 WMAC (AP30-040) */ ++#define AR5212_AR2313_REV8 0x0058 /* AR2313 WMAC (AP43-030) */ ++#define AR531X_RADIO_MASK_OFF 0xc8 ++#define AR531X_RADIO0_MASK 0x0003 ++#define AR531X_RADIO1_MASK 0x000c ++#define AR531X_RADIO1_S 2 ++ ++/* ++ * AR531X_NUM_WMAC defines the number of Wireless MACs that\ ++ * should be considered available. ++ */ ++#define AR531X_NUM_WMAC 2 ++ ++/* Reset/Timer Block Address Map */ ++#define AR531X_RESETTMR (AR531X_APBBASE + 0x3000) ++#define AR531X_TIMER (AR531X_RESETTMR + 0x0000) /* countdown timer */ ++#define AR531X_WD_CTRL (AR531X_RESETTMR + 0x0008) /* watchdog cntrl */ ++#define AR531X_WD_TIMER (AR531X_RESETTMR + 0x000c) /* watchdog timer */ ++#define AR531X_ISR (AR531X_RESETTMR + 0x0010) /* Intr Status Reg */ ++#define AR531X_IMR (AR531X_RESETTMR + 0x0014) /* Intr Mask Reg */ ++#define AR531X_RESET (AR531X_RESETTMR + 0x0020) ++#define AR5312_CLOCKCTL1 (AR531X_RESETTMR + 0x0064) ++#define AR5312_SCRATCH (AR531X_RESETTMR + 0x006c) ++#define AR531X_PROCADDR (AR531X_RESETTMR + 0x0070) ++#define AR531X_PROC1 (AR531X_RESETTMR + 0x0074) ++#define AR531X_DMAADDR (AR531X_RESETTMR + 0x0078) ++#define AR531X_DMA1 (AR531X_RESETTMR + 0x007c) ++#define AR531X_ENABLE (AR531X_RESETTMR + 0x0080) /* interface enb */ ++#define AR531X_REV (AR531X_RESETTMR + 0x0090) /* revision */ ++ ++/* AR531X_WD_CTRL register bit field definitions */ ++#define AR531X_WD_CTRL_IGNORE_EXPIRATION 0x0000 ++#define AR531X_WD_CTRL_NMI 0x0001 ++#define AR531X_WD_CTRL_RESET 0x0002 ++ ++/* AR531X_ISR register bit field definitions */ ++#define AR531X_ISR_NONE 0x0000 ++#define AR531X_ISR_TIMER 0x0001 ++#define AR531X_ISR_AHBPROC 0x0002 ++#define AR531X_ISR_AHBDMA 0x0004 ++#define AR531X_ISR_GPIO 0x0008 ++#define AR531X_ISR_UART0 0x0010 ++#define AR531X_ISR_UART0DMA 0x0020 ++#define AR531X_ISR_WD 0x0040 ++#define AR531X_ISR_LOCAL 0x0080 ++ ++/* AR531X_RESET register bit field definitions */ ++#define AR531X_RESET_SYSTEM 0x00000001 /* cold reset full system */ ++#define AR531X_RESET_PROC 0x00000002 /* cold reset MIPS core */ ++#define AR531X_RESET_WLAN0 0x00000004 /* cold reset WLAN MAC and BB */ ++#define AR531X_RESET_EPHY0 0x00000008 /* cold reset ENET0 phy */ ++#define AR531X_RESET_EPHY1 0x00000010 /* cold reset ENET1 phy */ ++#define AR531X_RESET_ENET0 0x00000020 /* cold reset ENET0 mac */ ++#define AR531X_RESET_ENET1 0x00000040 /* cold reset ENET1 mac */ ++#define AR531X_RESET_UART0 0x00000100 /* cold reset UART0 (high speed) */ ++#define AR531X_RESET_WLAN1 0x00000200 /* cold reset WLAN MAC/BB */ ++#define AR531X_RESET_APB 0x00000400 /* cold reset APB (ar5312) */ ++#define AR531X_RESET_WARM_PROC 0x00001000 /* warm reset MIPS core */ ++#define AR531X_RESET_WARM_WLAN0_MAC 0x00002000 /* warm reset WLAN0 MAC */ ++#define AR531X_RESET_WARM_WLAN0_BB 0x00004000 /* warm reset WLAN0 BaseBand */ ++#define AR531X_RESET_NMI 0x00010000 /* send an NMI to the processor */ ++#define AR531X_RESET_WARM_WLAN1_MAC 0x00020000 /* warm reset WLAN1 mac */ ++#define AR531X_RESET_WARM_WLAN1_BB 0x00040000 /* warm reset WLAN1 baseband */ ++#define AR531X_RESET_LOCAL_BUS 0x00080000 /* reset local bus */ ++#define AR531X_RESET_WDOG 0x00100000 /* last reset was a watchdog */ ++ ++#define AR531X_RESET_WMAC0_BITS \ ++ AR531X_RESET_WLAN0 |\ ++ AR531X_RESET_WARM_WLAN0_MAC |\ ++ AR531X_RESET_WARM_WLAN0_BB ++ ++#define AR531X_RESERT_WMAC1_BITS \ ++ AR531X_RESET_WLAN1 |\ ++ AR531X_RESET_WARM_WLAN1_MAC |\ ++ AR531X_RESET_WARM_WLAN1_BB ++ ++/* AR5312_CLOCKCTL1 register bit field definitions */ ++#define AR5312_CLOCKCTL1_PREDIVIDE_MASK 0x00000030 ++#define AR5312_CLOCKCTL1_PREDIVIDE_SHIFT 4 ++#define AR5312_CLOCKCTL1_MULTIPLIER_MASK 0x00001f00 ++#define AR5312_CLOCKCTL1_MULTIPLIER_SHIFT 8 ++#define AR5312_CLOCKCTL1_DOUBLER_MASK 0x00010000 ++ ++/* Valid for AR5312 and AR2312 */ ++#define AR5312_CLOCKCTL1_PREDIVIDE_MASK 0x00000030 ++#define AR5312_CLOCKCTL1_PREDIVIDE_SHIFT 4 ++#define AR5312_CLOCKCTL1_MULTIPLIER_MASK 0x00001f00 ++#define AR5312_CLOCKCTL1_MULTIPLIER_SHIFT 8 ++#define AR5312_CLOCKCTL1_DOUBLER_MASK 0x00010000 ++ ++/* Valid for AR2313 */ ++#define AR2313_CLOCKCTL1_PREDIVIDE_MASK 0x00003000 ++#define AR2313_CLOCKCTL1_PREDIVIDE_SHIFT 12 ++#define AR2313_CLOCKCTL1_MULTIPLIER_MASK 0x001f0000 ++#define AR2313_CLOCKCTL1_MULTIPLIER_SHIFT 16 ++#define AR2313_CLOCKCTL1_DOUBLER_MASK 0x00000000 ++ ++ ++/* AR531X_ENABLE register bit field definitions */ ++#define AR531X_ENABLE_WLAN0 0x0001 ++#define AR531X_ENABLE_ENET0 0x0002 ++#define AR531X_ENABLE_ENET1 0x0004 ++#define AR531X_ENABLE_UART_AND_WLAN1_PIO 0x0008 /* UART, and WLAN1 PIOs */ ++#define AR531X_ENABLE_WLAN1_DMA 0x0010 /* WLAN1 DMAs */ ++#define AR531X_ENABLE_WLAN1 \ ++ (AR531X_ENABLE_UART_AND_WLAN1_PIO | AR531X_ENABLE_WLAN1_DMA) ++ ++/* AR531X_REV register bit field definitions */ ++#define AR531X_REV_WMAC_MAJ 0xf000 ++#define AR531X_REV_WMAC_MAJ_S 12 ++#define AR531X_REV_WMAC_MIN 0x0f00 ++#define AR531X_REV_WMAC_MIN_S 8 ++#define AR531X_REV_MAJ 0x00f0 ++#define AR531X_REV_MAJ_S 4 ++#define AR531X_REV_MIN 0x000f ++#define AR531X_REV_MIN_S 0 ++#define AR531X_REV_CHIP (AR531X_REV_MAJ|AR531X_REV_MIN) ++ ++/* Major revision numbers, bits 7..4 of Revision ID register */ ++#define AR531X_REV_MAJ_AR5312 0x4 ++#define AR531X_REV_MAJ_AR2313 0x5 ++ ++/* Minor revision numbers, bits 3..0 of Revision ID register */ ++#define AR5312_REV_MIN_DUAL 0x0 /* Dual WLAN version */ ++#define AR5312_REV_MIN_SINGLE 0x1 /* Single WLAN version */ ++ ++/* AR531X_FLASHCTL register bit field definitions */ ++#define FLASHCTL_IDCY 0x0000000f /* Idle cycle turn around time */ ++#define FLASHCTL_IDCY_S 0 ++#define FLASHCTL_WST1 0x000003e0 /* Wait state 1 */ ++#define FLASHCTL_WST1_S 5 ++#define FLASHCTL_RBLE 0x00000400 /* Read byte lane enable */ ++#define FLASHCTL_WST2 0x0000f800 /* Wait state 2 */ ++#define FLASHCTL_WST2_S 11 ++#define FLASHCTL_AC 0x00070000 /* Flash address check (added) */ ++#define FLASHCTL_AC_S 16 ++#define FLASHCTL_AC_128K 0x00000000 ++#define FLASHCTL_AC_256K 0x00010000 ++#define FLASHCTL_AC_512K 0x00020000 ++#define FLASHCTL_AC_1M 0x00030000 ++#define FLASHCTL_AC_2M 0x00040000 ++#define FLASHCTL_AC_4M 0x00050000 ++#define FLASHCTL_AC_8M 0x00060000 ++#define FLASHCTL_AC_RES 0x00070000 /* 16MB is not supported */ ++#define FLASHCTL_E 0x00080000 /* Flash bank enable (added) */ ++#define FLASHCTL_BUSERR 0x01000000 /* Bus transfer error status flag */ ++#define FLASHCTL_WPERR 0x02000000 /* Write protect error status flag */ ++#define FLASHCTL_WP 0x04000000 /* Write protect */ ++#define FLASHCTL_BM 0x08000000 /* Burst mode */ ++#define FLASHCTL_MW 0x30000000 /* Memory width */ ++#define FLASHCTL_MWx8 0x00000000 /* Memory width x8 */ ++#define FLASHCTL_MWx16 0x10000000 /* Memory width x16 */ ++#define FLASHCTL_MWx32 0x20000000 /* Memory width x32 (not supported) */ ++#define FLASHCTL_ATNR 0x00000000 /* Access type == no retry */ ++#define FLASHCTL_ATR 0x80000000 /* Access type == retry every */ ++#define FLASHCTL_ATR4 0xc0000000 /* Access type == retry every 4 */ ++ ++/* ARM Flash Controller -- 3 flash banks with either x8 or x16 devices. */ ++#define AR531X_FLASHCTL0 (AR531X_FLASHCTL + 0x00) ++#define AR531X_FLASHCTL1 (AR531X_FLASHCTL + 0x04) ++#define AR531X_FLASHCTL2 (AR531X_FLASHCTL + 0x08) ++ ++/* ARM SDRAM Controller -- just enough to determine memory size */ ++#define AR531X_MEM_CFG1 (AR531X_SDRAMCTL + 0x04) ++#define MEM_CFG1_AC0 0x00000700 /* bank 0: SDRAM addr check (added) */ ++#define MEM_CFG1_AC0_S 8 ++#define MEM_CFG1_AC1 0x00007000 /* bank 1: SDRAM addr check (added) */ ++#define MEM_CFG1_AC1_S 12 ++ ++/* GPIO Address Map */ ++#define AR531X_GPIO (AR531X_APBBASE + 0x2000) ++#define AR531X_GPIO_DO (AR531X_GPIO + 0x00) /* output register */ ++#define AR531X_GPIO_DI (AR531X_GPIO + 0x04) /* intput register */ ++#define AR531X_GPIO_CR (AR531X_GPIO + 0x08) /* control register */ ++ ++/* GPIO Control Register bit field definitions */ ++#define AR531X_GPIO_CR_M(x) (1 << (x)) /* mask for i/o */ ++#define AR531X_GPIO_CR_O(x) (0 << (x)) /* mask for output */ ++#define AR531X_GPIO_CR_I(x) (1 << (x)) /* mask for input */ ++#define AR531X_GPIO_CR_INT(x) (1 << ((x)+8)) /* mask for interrupt */ ++#define AR531X_GPIO_CR_UART(x) (1 << ((x)+16)) /* uart multiplex */ ++#define AR531X_NUM_GPIO 8 ++ ++ ++#endif ++ +Index: linux-2.6.32.7/arch/mips/ar231x/ar5312.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/ar5312.c 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,547 @@ ++/* ++ * 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) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006-2009 Felix Fietkau ++ */ ++ ++/* ++ * Platform devices for Atheros SoCs ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include "devices.h" ++#include "ar5312.h" ++ ++static void ++ar5312_misc_irq_dispatch(void) ++{ ++ unsigned int ar231x_misc_intrs = ar231x_read_reg(AR531X_ISR) & ar231x_read_reg(AR531X_IMR); ++ ++ if (ar231x_misc_intrs & AR531X_ISR_TIMER) { ++ do_IRQ(AR531X_MISC_IRQ_TIMER); ++ (void)ar231x_read_reg(AR531X_TIMER); ++ } else if (ar231x_misc_intrs & AR531X_ISR_AHBPROC) ++ do_IRQ(AR531X_MISC_IRQ_AHB_PROC); ++ else if ((ar231x_misc_intrs & AR531X_ISR_UART0)) ++ do_IRQ(AR531X_MISC_IRQ_UART0); ++ else if (ar231x_misc_intrs & AR531X_ISR_WD) ++ do_IRQ(AR531X_MISC_IRQ_WATCHDOG); ++ else ++ do_IRQ(AR531X_MISC_IRQ_NONE); ++} ++ ++static asmlinkage void ++ar5312_irq_dispatch(void) ++{ ++ int pending = read_c0_status() & read_c0_cause(); ++ ++ if (pending & CAUSEF_IP2) ++ do_IRQ(AR5312_IRQ_WLAN0_INTRS); ++ else if (pending & CAUSEF_IP3) ++ do_IRQ(AR5312_IRQ_ENET0_INTRS); ++ else if (pending & CAUSEF_IP4) ++ do_IRQ(AR5312_IRQ_ENET1_INTRS); ++ else if (pending & CAUSEF_IP5) ++ do_IRQ(AR5312_IRQ_WLAN1_INTRS); ++ else if (pending & CAUSEF_IP6) ++ ar5312_misc_irq_dispatch(); ++ else if (pending & CAUSEF_IP7) ++ do_IRQ(AR531X_IRQ_CPU_CLOCK); ++} ++ ++ ++/* Enable the specified AR531X_MISC_IRQ interrupt */ ++static void ++ar5312_misc_intr_enable(unsigned int irq) ++{ ++ unsigned int imr; ++ ++ imr = ar231x_read_reg(AR531X_IMR); ++ imr |= (1 << (irq - AR531X_MISC_IRQ_BASE - 1)); ++ ar231x_write_reg(AR531X_IMR, imr); ++} ++ ++/* Disable the specified AR531X_MISC_IRQ interrupt */ ++static void ++ar5312_misc_intr_disable(unsigned int irq) ++{ ++ unsigned int imr; ++ ++ imr = ar231x_read_reg(AR531X_IMR); ++ imr &= ~(1 << (irq - AR531X_MISC_IRQ_BASE - 1)); ++ ar231x_write_reg(AR531X_IMR, imr); ++ ar231x_read_reg(AR531X_IMR); /* flush write buffer */ ++} ++ ++static void ++ar5312_misc_intr_end(unsigned int irq) ++{ ++ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) ++ ar5312_misc_intr_enable(irq); ++} ++ ++static struct irq_chip ar5312_misc_intr_controller = { ++ .name = "AR5312-MISC", ++ .disable = ar5312_misc_intr_disable, ++ .ack = ar5312_misc_intr_disable, ++ .mask_ack = ar5312_misc_intr_disable, ++ .mask = ar5312_misc_intr_disable, ++ .unmask = ar5312_misc_intr_enable, ++ .end = ar5312_misc_intr_end, ++}; ++ ++ ++static irqreturn_t ar5312_ahb_proc_handler(int cpl, void *dev_id) ++{ ++ u32 proc1 = ar231x_read_reg(AR531X_PROC1); ++ u32 procAddr = ar231x_read_reg(AR531X_PROCADDR); /* clears error state */ ++ u32 dma1 = ar231x_read_reg(AR531X_DMA1); ++ u32 dmaAddr = ar231x_read_reg(AR531X_DMAADDR); /* clears error state */ ++ ++ printk("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n", ++ procAddr, proc1, dmaAddr, dma1); ++ ++ machine_restart("AHB error"); /* Catastrophic failure */ ++ return IRQ_HANDLED; ++} ++ ++ ++static struct irqaction ar5312_ahb_proc_interrupt = { ++ .handler = ar5312_ahb_proc_handler, ++ .flags = IRQF_DISABLED, ++ .name = "ar5312_ahb_proc_interrupt", ++}; ++ ++ ++static struct irqaction cascade = { ++ .handler = no_action, ++ .flags = IRQF_DISABLED, ++ .name = "cascade", ++}; ++ ++void __init ar5312_irq_init(void) ++{ ++ int i; ++ ++ if (!is_5312()) ++ return; ++ ++ ar231x_irq_dispatch = ar5312_irq_dispatch; ++ for (i = 0; i < AR531X_MISC_IRQ_COUNT; i++) { ++ int irq = AR531X_MISC_IRQ_BASE + i; ++ set_irq_chip_and_handler(irq, &ar5312_misc_intr_controller, ++ handle_level_irq); ++ } ++ setup_irq(AR531X_MISC_IRQ_AHB_PROC, &ar5312_ahb_proc_interrupt); ++ setup_irq(AR5312_IRQ_MISC_INTRS, &cascade); ++} ++ ++const struct ar231x_gpiodev ar5312_gpiodev; ++ ++static u32 ++ar5312_gpio_get_output(void) ++{ ++ u32 reg; ++ reg = ~(ar231x_read_reg(AR531X_GPIO_CR)); ++ reg &= ar5312_gpiodev.valid_mask; ++ return reg; ++} ++ ++static u32 ++ar5312_gpio_set_output(u32 mask, u32 val) ++{ ++ u32 reg; ++ ++ reg = ar231x_read_reg(AR531X_GPIO_CR); ++ reg |= mask; ++ reg &= ~val; ++ ar231x_write_reg(AR531X_GPIO_CR, reg); ++ return reg; ++} ++ ++static u32 ++ar5312_gpio_get(void) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR531X_GPIO_DI); ++ reg &= ar5312_gpiodev.valid_mask; ++ return reg; ++} ++ ++static u32 ++ar5312_gpio_set(u32 mask, u32 value) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR531X_GPIO_DO); ++ reg &= ~mask; ++ reg |= value; ++ ar231x_write_reg(AR531X_GPIO_DO, reg); ++ return reg; ++} ++ ++const struct ar231x_gpiodev ar5312_gpiodev = { ++ .valid_mask = (1 << 8) - 1, ++ .get_output = ar5312_gpio_get_output, ++ .set_output = ar5312_gpio_set_output, ++ .get = ar5312_gpio_get, ++ .set = ar5312_gpio_set, ++}; ++ ++static struct physmap_flash_data ar5312_flash_data = { ++ .width = 2, ++}; ++ ++static struct resource ar5312_flash_resource = { ++ .start = AR531X_FLASH, ++ .end = AR531X_FLASH + 0x800000 - 1, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct ar231x_eth ar5312_eth0_data = { ++ .reset_base = AR531X_RESET, ++ .reset_mac = AR531X_RESET_ENET0, ++ .reset_phy = AR531X_RESET_EPHY0, ++ .phy_base = KSEG1ADDR(AR531X_ENET0), ++ .config = &ar231x_board, ++}; ++ ++static struct ar231x_eth ar5312_eth1_data = { ++ .reset_base = AR531X_RESET, ++ .reset_mac = AR531X_RESET_ENET1, ++ .reset_phy = AR531X_RESET_EPHY1, ++ .phy_base = KSEG1ADDR(AR531X_ENET1), ++ .config = &ar231x_board, ++}; ++ ++static struct platform_device ar5312_physmap_flash = { ++ .name = "physmap-flash", ++ .id = 0, ++ .dev.platform_data = &ar5312_flash_data, ++ .resource = &ar5312_flash_resource, ++ .num_resources = 1, ++}; ++ ++#ifdef CONFIG_LEDS_GPIO ++static struct gpio_led ar5312_leds[] = { ++ { .name = "wlan", .gpio = 0, .active_low = 1, }, ++}; ++ ++static const struct gpio_led_platform_data ar5312_led_data = { ++ .num_leds = ARRAY_SIZE(ar5312_leds), ++ .leds = (void *) ar5312_leds, ++}; ++ ++static struct platform_device ar5312_gpio_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = (void *) &ar5312_led_data, ++}; ++#endif ++ ++/* ++ * NB: This mapping size is larger than the actual flash size, ++ * but this shouldn't be a problem here, because the flash ++ * will simply be mapped multiple times. ++ */ ++static char __init *ar5312_flash_limit(void) ++{ ++ u32 ctl; ++ /* ++ * Configure flash bank 0. ++ * Assume 8M window size. Flash will be aliased if it's smaller ++ */ ++ ctl = FLASHCTL_E | ++ FLASHCTL_AC_8M | ++ FLASHCTL_RBLE | ++ (0x01 << FLASHCTL_IDCY_S) | ++ (0x07 << FLASHCTL_WST1_S) | ++ (0x07 << FLASHCTL_WST2_S) | ++ (ar231x_read_reg(AR531X_FLASHCTL0) & FLASHCTL_MW); ++ ++ ar231x_write_reg(AR531X_FLASHCTL0, ctl); ++ ++ /* Disable other flash banks */ ++ ar231x_write_reg(AR531X_FLASHCTL1, ++ ar231x_read_reg(AR531X_FLASHCTL1) & ~(FLASHCTL_E | FLASHCTL_AC)); ++ ++ ar231x_write_reg(AR531X_FLASHCTL2, ++ ar231x_read_reg(AR531X_FLASHCTL2) & ~(FLASHCTL_E | FLASHCTL_AC)); ++ ++ return (char *) KSEG1ADDR(AR531X_FLASH + 0x800000); ++} ++ ++int __init ar5312_init_devices(void) ++{ ++ struct ar231x_boarddata *config; ++ u32 fctl = 0; ++ const u8 *radio; ++ u8 *c; ++ ++ if (!is_5312()) ++ return 0; ++ ++ /* Locate board/radio config data */ ++ ar231x_find_config(ar5312_flash_limit()); ++ config = ar231x_board.config; ++ ++ ++ /* ++ * Chip IDs and hardware detection for some Atheros ++ * models are really broken! ++ * ++ * Atheros uses a disabled WMAC0 and Silicon ID of AR5312 ++ * as indication for AR2312, which is otherwise ++ * indistinguishable from the real AR5312. ++ */ ++ if (ar231x_board.radio) { ++ radio = ar231x_board.radio + AR531X_RADIO_MASK_OFF; ++ if ((*((const u32 *) radio) & AR531X_RADIO0_MASK) == 0) ++ config->flags |= BD_ISCASPER; ++ } else ++ radio = NULL; ++ ++ /* AR2313 has CPU minor rev. 10 */ ++ if ((current_cpu_data.processor_id & 0xff) == 0x0a) ++ ar231x_devtype = DEV_TYPE_AR2313; ++ ++ /* AR2312 shares the same Silicon ID as AR5312 */ ++ else if (config->flags & BD_ISCASPER) ++ ar231x_devtype = DEV_TYPE_AR2312; ++ ++ /* Everything else is probably AR5312 or compatible */ ++ else ++ ar231x_devtype = DEV_TYPE_AR5312; ++ ++ /* fixup flash width */ ++ fctl = ar231x_read_reg(AR531X_FLASHCTL) & FLASHCTL_MW; ++ switch (fctl) { ++ case FLASHCTL_MWx16: ++ ar5312_flash_data.width = 2; ++ break; ++ case FLASHCTL_MWx8: ++ default: ++ ar5312_flash_data.width = 1; ++ break; ++ } ++ ++ platform_device_register(&ar5312_physmap_flash); ++ ++#ifdef CONFIG_LEDS_GPIO ++ ar5312_leds[0].gpio = config->sysLedGpio; ++ platform_device_register(&ar5312_gpio_leds); ++#endif ++ ++ /* Fix up MAC addresses if necessary */ ++ if (!memcmp(config->enet0_mac, "\xff\xff\xff\xff\xff\xff", 6)) ++ memcpy(config->enet0_mac, config->enet1_mac, 6); ++ ++ /* If ENET0 and ENET1 have the same mac address, ++ * increment the one from ENET1 */ ++ if (memcmp(config->enet0_mac, config->enet1_mac, 6) == 0) { ++ c = config->enet1_mac + 5; ++ while ((c >= config->enet1_mac) && !(++(*c))) ++ c--; ++ } ++ ++ switch(ar231x_devtype) { ++ case DEV_TYPE_AR5312: ++ ar5312_eth0_data.macaddr = config->enet0_mac; ++ ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET0), ++ AR5312_IRQ_ENET0_INTRS, &ar5312_eth0_data); ++ ++ ar5312_eth1_data.macaddr = config->enet1_mac; ++ ar231x_add_ethernet(1, KSEG1ADDR(AR531X_ENET1), ++ AR5312_IRQ_ENET1_INTRS, &ar5312_eth1_data); ++ ++ if (!ar231x_board.radio) ++ return 0; ++ ++ if (*((u32 *) radio) & AR531X_RADIO0_MASK) ++ ar231x_add_wmac(0, AR531X_WLAN0, ++ AR5312_IRQ_WLAN0_INTRS); ++ ++ break; ++ /* ++ * AR2312/3 ethernet uses the PHY of ENET0, but the MAC ++ * of ENET1. Atheros calls it 'twisted' for a reason :) ++ */ ++ case DEV_TYPE_AR2312: ++ case DEV_TYPE_AR2313: ++ ar5312_eth1_data.phy_base = ar5312_eth0_data.phy_base; ++ ar5312_eth1_data.reset_phy = ar5312_eth0_data.reset_phy; ++ ar5312_eth1_data.macaddr = config->enet0_mac; ++ ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET1), ++ AR5312_IRQ_ENET1_INTRS, &ar5312_eth1_data); ++ ++ if (!ar231x_board.radio) ++ return 0; ++ break; ++ default: ++ break; ++ } ++ ++ if (*((u32 *) radio) & AR531X_RADIO1_MASK) ++ ar231x_add_wmac(1, AR531X_WLAN1, ++ AR5312_IRQ_WLAN1_INTRS); ++ ++ return 0; ++} ++ ++ ++static void ar5312_restart(char *command) ++{ ++ /* reset the system */ ++ local_irq_disable(); ++ while(1) { ++ ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM); ++ } ++} ++ ++ ++/* ++ * This table is indexed by bits 5..4 of the CLOCKCTL1 register ++ * to determine the predevisor value. ++ */ ++static int __initdata CLOCKCTL1_PREDIVIDE_TABLE[4] = { 1, 2, 4, 5 }; ++ ++ ++static int __init ++ar5312_cpu_frequency(void) ++{ ++ unsigned int result; ++ unsigned int predivide_mask, predivide_shift; ++ unsigned int multiplier_mask, multiplier_shift; ++ unsigned int clockCtl1, preDivideSelect, preDivisor, multiplier; ++ unsigned int doubler_mask; ++ u16 devid; ++ ++ /* Trust the bootrom's idea of cpu frequency. */ ++ if ((result = ar231x_read_reg(AR5312_SCRATCH))) ++ return result; ++ ++ devid = ar231x_read_reg(AR531X_REV); ++ devid &= AR531X_REV_MAJ; ++ devid >>= AR531X_REV_MAJ_S; ++ if (devid == AR531X_REV_MAJ_AR2313) { ++ predivide_mask = AR2313_CLOCKCTL1_PREDIVIDE_MASK; ++ predivide_shift = AR2313_CLOCKCTL1_PREDIVIDE_SHIFT; ++ multiplier_mask = AR2313_CLOCKCTL1_MULTIPLIER_MASK; ++ multiplier_shift = AR2313_CLOCKCTL1_MULTIPLIER_SHIFT; ++ doubler_mask = AR2313_CLOCKCTL1_DOUBLER_MASK; ++ } else { /* AR5312 and AR2312 */ ++ predivide_mask = AR5312_CLOCKCTL1_PREDIVIDE_MASK; ++ predivide_shift = AR5312_CLOCKCTL1_PREDIVIDE_SHIFT; ++ multiplier_mask = AR5312_CLOCKCTL1_MULTIPLIER_MASK; ++ multiplier_shift = AR5312_CLOCKCTL1_MULTIPLIER_SHIFT; ++ doubler_mask = AR5312_CLOCKCTL1_DOUBLER_MASK; ++ } ++ ++ /* ++ * Clocking is derived from a fixed 40MHz input clock. ++ * ++ * cpuFreq = InputClock * MULT (where MULT is PLL multiplier) ++ * sysFreq = cpuFreq / 4 (used for APB clock, serial, ++ * flash, Timer, Watchdog Timer) ++ * ++ * cntFreq = cpuFreq / 2 (use for CPU count/compare) ++ * ++ * So, for example, with a PLL multiplier of 5, we have ++ * ++ * cpuFreq = 200MHz ++ * sysFreq = 50MHz ++ * cntFreq = 100MHz ++ * ++ * We compute the CPU frequency, based on PLL settings. ++ */ ++ ++ clockCtl1 = ar231x_read_reg(AR5312_CLOCKCTL1); ++ preDivideSelect = (clockCtl1 & predivide_mask) >> predivide_shift; ++ preDivisor = CLOCKCTL1_PREDIVIDE_TABLE[preDivideSelect]; ++ multiplier = (clockCtl1 & multiplier_mask) >> multiplier_shift; ++ ++ if (clockCtl1 & doubler_mask) { ++ multiplier = multiplier << 1; ++ } ++ return (40000000 / preDivisor) * multiplier; ++} ++ ++static inline int ++ar5312_sys_frequency(void) ++{ ++ return ar5312_cpu_frequency() / 4; ++} ++ ++void __init ++ar5312_time_init(void) ++{ ++ if (!is_5312()) ++ return; ++ ++ mips_hpt_frequency = ar5312_cpu_frequency() / 2; ++} ++ ++ ++void __init ++ar5312_prom_init(void) ++{ ++ u32 memsize, memcfg, bank0AC, bank1AC; ++ u32 devid; ++ ++ if (!is_5312()) ++ return; ++ ++ /* Detect memory size */ ++ memcfg = ar231x_read_reg(AR531X_MEM_CFG1); ++ bank0AC = (memcfg & MEM_CFG1_AC0) >> MEM_CFG1_AC0_S; ++ bank1AC = (memcfg & MEM_CFG1_AC1) >> MEM_CFG1_AC1_S; ++ memsize = (bank0AC ? (1 << (bank0AC+1)) : 0) ++ + (bank1AC ? (1 << (bank1AC+1)) : 0); ++ memsize <<= 20; ++ add_memory_region(0, memsize, BOOT_MEM_RAM); ++ ++ devid = ar231x_read_reg(AR531X_REV); ++ devid >>= AR531X_REV_WMAC_MIN_S; ++ devid &= AR531X_REV_CHIP; ++ ar231x_board.devid = (u16) devid; ++ ar231x_gpiodev = &ar5312_gpiodev; ++} ++ ++void __init ++ar5312_plat_setup(void) ++{ ++ if (!is_5312()) ++ return; ++ ++ /* Clear any lingering AHB errors */ ++ ar231x_read_reg(AR531X_PROCADDR); ++ ar231x_read_reg(AR531X_DMAADDR); ++ ar231x_write_reg(AR531X_WD_CTRL, AR531X_WD_CTRL_IGNORE_EXPIRATION); ++ ++ _machine_restart = ar5312_restart; ++ ar231x_serial_setup(KSEG1ADDR(AR531X_UART0), ar5312_sys_frequency()); ++} ++ +Index: linux-2.6.32.7/arch/mips/ar231x/ar2315.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/ar2315.c 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,658 @@ ++/* ++ * 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) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006 Felix Fietkau ++ */ ++ ++/* ++ * Platform devices for Atheros SoCs ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include "devices.h" ++#include "ar2315.h" ++ ++static u32 gpiointmask = 0, gpiointval = 0; ++ ++static inline void ar2315_gpio_irq(void) ++{ ++ u32 pend; ++ int bit = -1; ++ ++ /* only do one gpio interrupt at a time */ ++ pend = (ar231x_read_reg(AR2315_GPIO_DI) ^ gpiointval) & gpiointmask; ++ ++ if (pend) { ++ bit = fls(pend) - 1; ++ pend &= ~(1 << bit); ++ gpiointval ^= (1 << bit); ++ } ++ ++ if (!pend) ++ ar231x_write_reg(AR2315_ISR, AR2315_ISR_GPIO); ++ ++ /* Enable interrupt with edge detection */ ++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(bit)) != AR2315_GPIO_CR_I(bit)) ++ return; ++ ++ if (bit >= 0) ++ do_IRQ(AR531X_GPIO_IRQ_BASE + bit); ++} ++ ++ ++/* ++ * Called when an interrupt is received, this function ++ * determines exactly which interrupt it was, and it ++ * invokes the appropriate handler. ++ * ++ * Implicitly, we also define interrupt priority by ++ * choosing which to dispatch first. ++ */ ++static asmlinkage void ++ar2315_irq_dispatch(void) ++{ ++ int pending = read_c0_status() & read_c0_cause(); ++ ++ if (pending & CAUSEF_IP3) ++ do_IRQ(AR2315_IRQ_WLAN0_INTRS); ++ else if (pending & CAUSEF_IP4) ++ do_IRQ(AR2315_IRQ_ENET0_INTRS); ++ else if (pending & CAUSEF_IP2) { ++ unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) & ar231x_read_reg(AR2315_IMR); ++ ++ if (misc_intr & AR2315_ISR_SPI) ++ do_IRQ(AR531X_MISC_IRQ_SPI); ++ else if (misc_intr & AR2315_ISR_TIMER) ++ do_IRQ(AR531X_MISC_IRQ_TIMER); ++ else if (misc_intr & AR2315_ISR_AHB) ++ do_IRQ(AR531X_MISC_IRQ_AHB_PROC); ++ else if (misc_intr & AR2315_ISR_GPIO) ++ ar2315_gpio_irq(); ++ else if (misc_intr & AR2315_ISR_UART0) ++ do_IRQ(AR531X_MISC_IRQ_UART0); ++ else if (misc_intr & AR2315_ISR_WD) ++ do_IRQ(AR531X_MISC_IRQ_WATCHDOG); ++ else ++ do_IRQ(AR531X_MISC_IRQ_NONE); ++ } else if (pending & CAUSEF_IP7) ++ do_IRQ(AR531X_IRQ_CPU_CLOCK); ++} ++ ++static void ar2315_set_gpiointmask(int gpio, int level) ++{ ++ u32 reg; ++ ++ reg = ar231x_read_reg(AR2315_GPIO_INT); ++ reg &= ~(AR2315_GPIO_INT_M | AR2315_GPIO_INT_LVL_M); ++ reg |= gpio | AR2315_GPIO_INT_LVL(level); ++ ar231x_write_reg(AR2315_GPIO_INT, reg); ++} ++ ++static void ar2315_gpio_intr_enable(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* Enable interrupt with edge detection */ ++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(gpio)) != AR2315_GPIO_CR_I(gpio)) ++ return; ++ ++ gpiointmask |= (1 << gpio); ++ ar2315_set_gpiointmask(gpio, 3); ++} ++ ++static unsigned int ar2315_gpio_intr_startup(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* reconfigure GPIO line as input */ ++ ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio)); ++ ar2315_gpio_intr_enable(irq); ++ return 0; ++} ++ ++static void ar2315_gpio_intr_disable(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* Disable interrupt */ ++ gpiointmask &= ~(1 << gpio); ++ ar2315_set_gpiointmask(gpio, 0); ++} ++ ++static void ++ar2315_gpio_intr_end(unsigned int irq) ++{ ++ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) ++ ar2315_gpio_intr_enable(irq); ++} ++ ++static struct irq_chip ar2315_gpio_intr_controller = { ++ .typename = "AR2315-GPIO", ++ .startup = ar2315_gpio_intr_startup, ++ .ack = ar2315_gpio_intr_disable, ++ .mask_ack = ar2315_gpio_intr_disable, ++ .mask = ar2315_gpio_intr_disable, ++ .unmask = ar2315_gpio_intr_enable, ++ .end = ar2315_gpio_intr_end, ++}; ++ ++static void ++ar2315_misc_intr_enable(unsigned int irq) ++{ ++ unsigned int imr; ++ ++ imr = ar231x_read_reg(AR2315_IMR); ++ switch(irq) { ++ case AR531X_MISC_IRQ_SPI: ++ imr |= AR2315_ISR_SPI; ++ break; ++ case AR531X_MISC_IRQ_TIMER: ++ imr |= AR2315_ISR_TIMER; ++ break; ++ case AR531X_MISC_IRQ_AHB_PROC: ++ imr |= AR2315_ISR_AHB; ++ break; ++ case AR531X_MISC_IRQ_GPIO: ++ imr |= AR2315_ISR_GPIO; ++ break; ++ case AR531X_MISC_IRQ_UART0: ++ imr |= AR2315_ISR_UART0; ++ break; ++ case AR531X_MISC_IRQ_WATCHDOG: ++ imr |= AR2315_ISR_WD; ++ break; ++ default: ++ break; ++ } ++ ar231x_write_reg(AR2315_IMR, imr); ++} ++ ++static void ++ar2315_misc_intr_disable(unsigned int irq) ++{ ++ unsigned int imr; ++ ++ imr = ar231x_read_reg(AR2315_IMR); ++ switch(irq) { ++ case AR531X_MISC_IRQ_SPI: ++ imr &= ~AR2315_ISR_SPI; ++ break; ++ case AR531X_MISC_IRQ_TIMER: ++ imr &= ~AR2315_ISR_TIMER; ++ break; ++ case AR531X_MISC_IRQ_AHB_PROC: ++ imr &= ~AR2315_ISR_AHB; ++ break; ++ case AR531X_MISC_IRQ_GPIO: ++ imr &= ~AR2315_ISR_GPIO; ++ break; ++ case AR531X_MISC_IRQ_UART0: ++ imr &= ~AR2315_ISR_UART0; ++ break; ++ case AR531X_MISC_IRQ_WATCHDOG: ++ imr &= ~AR2315_ISR_WD; ++ break; ++ default: ++ break; ++ } ++ ar231x_write_reg(AR2315_IMR, imr); ++} ++ ++static void ++ar2315_misc_intr_end(unsigned int irq) ++{ ++ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) ++ ar2315_misc_intr_enable(irq); ++} ++ ++ ++static struct irq_chip ar2315_misc_intr_controller = { ++ .typename = "AR2315-MISC", ++ .ack = ar2315_misc_intr_disable, ++ .mask_ack = ar2315_misc_intr_disable, ++ .mask = ar2315_misc_intr_disable, ++ .unmask = ar2315_misc_intr_enable, ++ .end = ar2315_misc_intr_end, ++}; ++ ++static irqreturn_t ar2315_ahb_proc_handler(int cpl, void *dev_id) ++{ ++ ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET); ++ ar231x_read_reg(AR2315_AHB_ERR1); ++ ++ printk(KERN_ERR "AHB fatal error\n"); ++ machine_restart("AHB error"); /* Catastrophic failure */ ++ ++ return IRQ_HANDLED; ++} ++ ++static struct irqaction ar2315_ahb_proc_interrupt = { ++ .handler = ar2315_ahb_proc_handler, ++ .flags = IRQF_DISABLED, ++ .name = "ar2315_ahb_proc_interrupt", ++}; ++ ++static struct irqaction cascade = { ++ .handler = no_action, ++ .flags = IRQF_DISABLED, ++ .name = "cascade", ++}; ++ ++void ++ar2315_irq_init(void) ++{ ++ int i; ++ ++ if (!is_2315()) ++ return; ++ ++ ar231x_irq_dispatch = ar2315_irq_dispatch; ++ gpiointval = ar231x_read_reg(AR2315_GPIO_DI); ++ for (i = 0; i < AR531X_MISC_IRQ_COUNT; i++) { ++ int irq = AR531X_MISC_IRQ_BASE + i; ++ set_irq_chip_and_handler(irq, &ar2315_misc_intr_controller, ++ handle_level_irq); ++ } ++ for (i = 0; i < AR531X_GPIO_IRQ_COUNT; i++) { ++ int irq = AR531X_GPIO_IRQ_BASE + i; ++ set_irq_chip_and_handler(irq, &ar2315_gpio_intr_controller, ++ handle_level_irq); ++ } ++ setup_irq(AR531X_MISC_IRQ_GPIO, &cascade); ++ setup_irq(AR531X_MISC_IRQ_AHB_PROC, &ar2315_ahb_proc_interrupt); ++ setup_irq(AR2315_IRQ_MISC_INTRS, &cascade); ++} ++ ++const struct ar231x_gpiodev ar2315_gpiodev; ++ ++static u32 ++ar2315_gpio_get_output(void) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR2315_GPIO_CR); ++ reg &= ar2315_gpiodev.valid_mask; ++ return reg; ++} ++ ++static u32 ++ar2315_gpio_set_output(u32 mask, u32 val) ++{ ++ u32 reg; ++ ++ reg = ar231x_read_reg(AR2315_GPIO_CR); ++ reg &= ~mask; ++ reg |= val; ++ ar231x_write_reg(AR2315_GPIO_CR, reg); ++ return reg; ++} ++ ++static u32 ++ar2315_gpio_get(void) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR2315_GPIO_DI); ++ reg &= ar2315_gpiodev.valid_mask; ++ return reg; ++} ++ ++static u32 ++ar2315_gpio_set(u32 mask, u32 value) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR2315_GPIO_DO); ++ reg &= ~mask; ++ reg |= value; ++ ar231x_write_reg(AR2315_GPIO_DO, reg); ++ return reg; ++} ++ ++const struct ar231x_gpiodev ar2315_gpiodev = { ++ .valid_mask = (1 << 22) - 1, ++ .get_output = ar2315_gpio_get_output, ++ .set_output = ar2315_gpio_set_output, ++ .get = ar2315_gpio_get, ++ .set = ar2315_gpio_set, ++}; ++ ++static struct ar231x_eth ar2315_eth_data = { ++ .reset_base = AR2315_RESET, ++ .reset_mac = AR2315_RESET_ENET0, ++ .reset_phy = AR2315_RESET_EPHY0, ++ .phy_base = AR2315_ENET0, ++ .config = &ar231x_board, ++}; ++ ++static struct resource ar2315_spiflash_res[] = { ++ { ++ .name = "flash_base", ++ .flags = IORESOURCE_MEM, ++ .start = KSEG1ADDR(AR2315_SPI_READ), ++ .end = KSEG1ADDR(AR2315_SPI_READ) + 0x1000000 - 1, ++ }, ++ { ++ .name = "flash_regs", ++ .flags = IORESOURCE_MEM, ++ .start = 0x11300000, ++ .end = 0x11300012, ++ }, ++}; ++ ++static struct platform_device ar2315_spiflash = { ++ .id = 0, ++ .name = "spiflash", ++ .resource = ar2315_spiflash_res, ++ .num_resources = ARRAY_SIZE(ar2315_spiflash_res) ++}; ++ ++static struct platform_device ar2315_wdt = { ++ .id = 0, ++ .name = "ar2315_wdt", ++}; ++ ++#define SPI_FLASH_CTL 0x00 ++#define SPI_FLASH_OPCODE 0x04 ++#define SPI_FLASH_DATA 0x08 ++ ++static inline u32 ++spiflash_read_reg(int reg) ++{ ++ return ar231x_read_reg(KSEG1ADDR(AR2315_SPI) + reg); ++} ++ ++static inline void ++spiflash_write_reg(int reg, u32 data) ++{ ++ ar231x_write_reg(KSEG1ADDR(AR2315_SPI) + reg, data); ++} ++ ++static u32 ++spiflash_wait_status(void) ++{ ++ u32 reg; ++ ++ do { ++ reg = spiflash_read_reg(SPI_FLASH_CTL); ++ } while (reg & SPI_CTL_BUSY); ++ ++ return reg; ++} ++ ++static u8 ++spiflash_probe(void) ++{ ++ u32 reg; ++ ++ reg = spiflash_wait_status(); ++ reg &= ~SPI_CTL_TX_RX_CNT_MASK; ++ reg |= (1 << 4) | 4 | SPI_CTL_START; ++ ++ spiflash_write_reg(SPI_FLASH_OPCODE, 0xab); ++ spiflash_write_reg(SPI_FLASH_CTL, reg); ++ ++ reg = spiflash_wait_status(); ++ reg = spiflash_read_reg(SPI_FLASH_DATA); ++ reg &= 0xff; ++ ++ return (u8) reg; ++} ++ ++ ++#define STM_8MBIT_SIGNATURE 0x13 ++#define STM_16MBIT_SIGNATURE 0x14 ++#define STM_32MBIT_SIGNATURE 0x15 ++#define STM_64MBIT_SIGNATURE 0x16 ++#define STM_128MBIT_SIGNATURE 0x17 ++ ++static u8 __init * ++ar2315_flash_limit(void) ++{ ++ u32 flash_size = 0; ++ ++ /* probe the flash chip size */ ++ switch(spiflash_probe()) { ++ case STM_8MBIT_SIGNATURE: ++ flash_size = 0x00100000; ++ break; ++ case STM_16MBIT_SIGNATURE: ++ flash_size = 0x00200000; ++ break; ++ case STM_32MBIT_SIGNATURE: ++ flash_size = 0x00400000; ++ break; ++ case STM_64MBIT_SIGNATURE: ++ flash_size = 0x00800000; ++ break; ++ case STM_128MBIT_SIGNATURE: ++ flash_size = 0x01000000; ++ break; ++ } ++ ++ ar2315_spiflash_res[0].end = ar2315_spiflash_res[0].start + ++ flash_size - 1; ++ return (u8 *) ar2315_spiflash_res[0].end + 1; ++} ++ ++#ifdef CONFIG_LEDS_GPIO ++static struct gpio_led ar2315_leds[6]; ++static struct gpio_led_platform_data ar2315_led_data = { ++ .leds = (void *) ar2315_leds, ++}; ++ ++static struct platform_device ar2315_gpio_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = (void *) &ar2315_led_data, ++ } ++}; ++ ++static void __init ++ar2315_init_gpio(void) ++{ ++ static char led_names[6][6]; ++ int i, led = 0; ++ ++ ar2315_led_data.num_leds = 0; ++ for(i = 1; i < 8; i++) ++ { ++ if((i == AR2315_RESET_GPIO) || ++ (i == ar231x_board.config->resetConfigGpio)) ++ continue; ++ ++ if(i == ar231x_board.config->sysLedGpio) ++ strcpy(led_names[led], "wlan"); ++ else ++ sprintf(led_names[led], "gpio%d", i); ++ ++ ar2315_leds[led].name = led_names[led]; ++ ar2315_leds[led].gpio = i; ++ ar2315_leds[led].active_low = 0; ++ led++; ++ } ++ ar2315_led_data.num_leds = led; ++ platform_device_register(&ar2315_gpio_leds); ++} ++#else ++static inline void ar2315_init_gpio(void) ++{ ++} ++#endif ++ ++int __init ++ar2315_init_devices(void) ++{ ++ if (!is_2315()) ++ return 0; ++ ++ /* Find board configuration */ ++ ar231x_find_config(ar2315_flash_limit()); ++ ar2315_eth_data.macaddr = ar231x_board.config->enet0_mac; ++ ++ ar2315_init_gpio(); ++ platform_device_register(&ar2315_wdt); ++ platform_device_register(&ar2315_spiflash); ++ ar231x_add_ethernet(0, AR2315_ENET0, AR2315_IRQ_ENET0_INTRS, ++ &ar2315_eth_data); ++ ar231x_add_wmac(0, AR2315_WLAN0, AR2315_IRQ_WLAN0_INTRS); ++ ++ return 0; ++} ++ ++static void ++ar2315_restart(char *command) ++{ ++ void (*mips_reset_vec)(void) = (void *) 0xbfc00000; ++ ++ local_irq_disable(); ++ ++ /* try reset the system via reset control */ ++ ar231x_write_reg(AR2315_COLD_RESET,AR2317_RESET_SYSTEM); ++ ++ /* Cold reset does not work on the AR2315/6, use the GPIO reset bits a workaround. ++ * give it some time to attempt a gpio based hardware reset ++ * (atheros reference design workaround) */ ++ gpio_direction_output(AR2315_RESET_GPIO, 0); ++ mdelay(100); ++ ++ /* Some boards (e.g. Senao EOC-2610) don't implement the reset logic ++ * workaround. Attempt to jump to the mips reset location - ++ * the boot loader itself might be able to recover the system */ ++ mips_reset_vec(); ++} ++ ++ ++/* ++ * This table is indexed by bits 5..4 of the CLOCKCTL1 register ++ * to determine the predevisor value. ++ */ ++static int __initdata CLOCKCTL1_PREDIVIDE_TABLE[4] = { 1, 2, 4, 5 }; ++static int __initdata PLLC_DIVIDE_TABLE[5] = { 2, 3, 4, 6, 3 }; ++ ++static unsigned int __init ++ar2315_sys_clk(unsigned int clockCtl) ++{ ++ unsigned int pllcCtrl,cpuDiv; ++ unsigned int pllcOut,refdiv,fdiv,divby2; ++ unsigned int clkDiv; ++ ++ pllcCtrl = ar231x_read_reg(AR2315_PLLC_CTL); ++ refdiv = (pllcCtrl & PLLC_REF_DIV_M) >> PLLC_REF_DIV_S; ++ refdiv = CLOCKCTL1_PREDIVIDE_TABLE[refdiv]; ++ fdiv = (pllcCtrl & PLLC_FDBACK_DIV_M) >> PLLC_FDBACK_DIV_S; ++ divby2 = (pllcCtrl & PLLC_ADD_FDBACK_DIV_M) >> PLLC_ADD_FDBACK_DIV_S; ++ divby2 += 1; ++ pllcOut = (40000000/refdiv)*(2*divby2)*fdiv; ++ ++ ++ /* clkm input selected */ ++ switch(clockCtl & CPUCLK_CLK_SEL_M) { ++ case 0: ++ case 1: ++ clkDiv = PLLC_DIVIDE_TABLE[(pllcCtrl & PLLC_CLKM_DIV_M) >> PLLC_CLKM_DIV_S]; ++ break; ++ case 2: ++ clkDiv = PLLC_DIVIDE_TABLE[(pllcCtrl & PLLC_CLKC_DIV_M) >> PLLC_CLKC_DIV_S]; ++ break; ++ default: ++ pllcOut = 40000000; ++ clkDiv = 1; ++ break; ++ } ++ cpuDiv = (clockCtl & CPUCLK_CLK_DIV_M) >> CPUCLK_CLK_DIV_S; ++ cpuDiv = cpuDiv * 2 ?: 1; ++ return (pllcOut/(clkDiv * cpuDiv)); ++} ++ ++static inline unsigned int ++ar2315_cpu_frequency(void) ++{ ++ return ar2315_sys_clk(ar231x_read_reg(AR2315_CPUCLK)); ++} ++ ++static inline unsigned int ++ar2315_apb_frequency(void) ++{ ++ return ar2315_sys_clk(ar231x_read_reg(AR2315_AMBACLK)); ++} ++ ++void __init ++ar2315_time_init(void) ++{ ++ if (!is_2315()) ++ return; ++ ++ mips_hpt_frequency = ar2315_cpu_frequency() / 2; ++} ++ ++void __init ++ar2315_prom_init(void) ++{ ++ u32 memsize, memcfg, devid; ++ ++ if (!is_2315()) ++ return; ++ ++ memcfg = ar231x_read_reg(AR2315_MEM_CFG); ++ memsize = 1 + ((memcfg & SDRAM_DATA_WIDTH_M) >> SDRAM_DATA_WIDTH_S); ++ memsize <<= 1 + ((memcfg & SDRAM_COL_WIDTH_M) >> SDRAM_COL_WIDTH_S); ++ memsize <<= 1 + ((memcfg & SDRAM_ROW_WIDTH_M) >> SDRAM_ROW_WIDTH_S); ++ memsize <<= 3; ++ add_memory_region(0, memsize, BOOT_MEM_RAM); ++ ++ /* Detect the hardware based on the device ID */ ++ devid = ar231x_read_reg(AR2315_SREV) & AR2315_REV_CHIP; ++ switch(devid) { ++ case 0x90: ++ case 0x91: ++ ar231x_devtype = DEV_TYPE_AR2317; ++ break; ++ default: ++ ar231x_devtype = DEV_TYPE_AR2315; ++ break; ++ } ++ ar231x_gpiodev = &ar2315_gpiodev; ++ ar231x_board.devid = devid; ++} ++ ++void __init ++ar2315_plat_setup(void) ++{ ++ u32 config; ++ ++ if (!is_2315()) ++ return; ++ ++ /* Clear any lingering AHB errors */ ++ config = read_c0_config(); ++ write_c0_config(config & ~0x3); ++ ar231x_write_reg(AR2315_AHB_ERR0,AHB_ERROR_DET); ++ ar231x_read_reg(AR2315_AHB_ERR1); ++ ar231x_write_reg(AR2315_WDC, AR2315_WDC_IGNORE_EXPIRATION); ++ ++ _machine_restart = ar2315_restart; ++ ar231x_serial_setup(KSEG1ADDR(AR2315_UART0), ar2315_apb_frequency()); ++} +Index: linux-2.6.32.7/arch/mips/ar231x/ar2315.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/ar2315.h 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,37 @@ ++#ifndef __AR2315_H ++#define __AR2315_H ++ ++#ifdef CONFIG_ATHEROS_AR2315 ++ ++extern void ar2315_irq_init(void); ++extern int ar2315_init_devices(void); ++extern void ar2315_prom_init(void); ++extern void ar2315_plat_setup(void); ++extern void ar2315_time_init(void); ++ ++#else ++ ++static inline void ar2315_irq_init(void) ++{ ++} ++ ++static inline int ar2315_init_devices(void) ++{ ++ return 0; ++} ++ ++static inline void ar2315_prom_init(void) ++{ ++} ++ ++static inline void ar2315_plat_setup(void) ++{ ++} ++ ++static inline void ar2315_time_init(void) ++{ ++} ++ ++#endif ++ ++#endif +Index: linux-2.6.32.7/arch/mips/ar231x/ar5312.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/ar5312.h 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,38 @@ ++#ifndef __AR5312_H ++#define __AR5312_H ++ ++#ifdef CONFIG_ATHEROS_AR5312 ++ ++extern void ar5312_irq_init(void); ++extern int ar5312_init_devices(void); ++extern void ar5312_prom_init(void); ++extern void ar5312_plat_setup(void); ++extern void ar5312_time_init(void); ++extern void ar5312_time_init(void); ++ ++#else ++ ++static inline void ar5312_irq_init(void) ++{ ++} ++ ++static inline int ar5312_init_devices(void) ++{ ++ return 0; ++} ++ ++static inline void ar5312_prom_init(void) ++{ ++} ++ ++static inline void ar5312_plat_setup(void) ++{ ++} ++ ++static inline void ar5312_time_init(void) ++{ ++} ++ ++#endif ++ ++#endif +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar231x.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar231x.h 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,54 @@ ++#ifndef __AR531X_H ++#define __AR531X_H ++ ++#define AR531X_MISC_IRQ_BASE 0x20 ++#define AR531X_GPIO_IRQ_BASE 0x30 ++ ++/* Software's idea of interrupts handled by "CPU Interrupt Controller" */ ++#define AR531X_IRQ_NONE MIPS_CPU_IRQ_BASE+0 ++#define AR531X_IRQ_CPU_CLOCK MIPS_CPU_IRQ_BASE+7 /* C0_CAUSE: 0x8000 */ ++ ++/* Miscellaneous interrupts, which share IP6 */ ++#define AR531X_MISC_IRQ_NONE AR531X_MISC_IRQ_BASE+0 ++#define AR531X_MISC_IRQ_TIMER AR531X_MISC_IRQ_BASE+1 ++#define AR531X_MISC_IRQ_AHB_PROC AR531X_MISC_IRQ_BASE+2 ++#define AR531X_MISC_IRQ_AHB_DMA AR531X_MISC_IRQ_BASE+3 ++#define AR531X_MISC_IRQ_GPIO AR531X_MISC_IRQ_BASE+4 ++#define AR531X_MISC_IRQ_UART0 AR531X_MISC_IRQ_BASE+5 ++#define AR531X_MISC_IRQ_UART0_DMA AR531X_MISC_IRQ_BASE+6 ++#define AR531X_MISC_IRQ_WATCHDOG AR531X_MISC_IRQ_BASE+7 ++#define AR531X_MISC_IRQ_LOCAL AR531X_MISC_IRQ_BASE+8 ++#define AR531X_MISC_IRQ_SPI AR531X_MISC_IRQ_BASE+9 ++#define AR531X_MISC_IRQ_COUNT 10 ++ ++/* GPIO Interrupts [0..7], share AR531X_MISC_IRQ_GPIO */ ++#define AR531X_GPIO_IRQ_NONE AR531X_GPIO_IRQ_BASE+0 ++#define AR531X_GPIO_IRQ(n) AR531X_GPIO_IRQ_BASE+n ++#define AR531X_GPIO_IRQ_COUNT 22 ++ ++static inline u32 ++ar231x_read_reg(u32 reg) ++{ ++ return __raw_readl((u32 *) KSEG1ADDR(reg)); ++} ++ ++static inline void ++ar231x_write_reg(u32 reg, u32 val) ++{ ++ __raw_writel(val, (u32 *) KSEG1ADDR(reg)); ++} ++ ++static inline u32 ++ar231x_mask_reg(u32 reg, u32 mask, u32 val) ++{ ++ u32 ret; ++ ++ ret = ar231x_read_reg(reg); ++ ret &= ~mask; ++ ret |= val; ++ ar231x_write_reg(reg, ret); ++ ++ return ret; ++} ++ ++#endif +Index: linux-2.6.32.7/arch/mips/ar231x/devices.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/devices.h 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,37 @@ ++#ifndef __AR231X_DEVICES_H ++#define __AR231X_DEVICES_H ++ ++enum { ++ /* handled by ar5312.c */ ++ DEV_TYPE_AR2312, ++ DEV_TYPE_AR2313, ++ DEV_TYPE_AR5312, ++ ++ /* handled by ar2315.c */ ++ DEV_TYPE_AR2315, ++ DEV_TYPE_AR2316, ++ DEV_TYPE_AR2317, ++ ++ DEV_TYPE_UNKNOWN ++}; ++ ++extern int ar231x_devtype; ++extern struct ar231x_board_config ar231x_board; ++extern asmlinkage void (*ar231x_irq_dispatch)(void); ++ ++extern int ar231x_find_config(u8 *flash_limit); ++extern void ar231x_serial_setup(u32 mapbase, unsigned int uartclk); ++extern int ar231x_add_wmac(int nr, u32 base, int irq); ++extern int ar231x_add_ethernet(int nr, u32 base, int irq, void *pdata); ++ ++static inline bool is_2315(void) ++{ ++ return (current_cpu_data.cputype == CPU_4KEC); ++} ++ ++static inline bool is_5312(void) ++{ ++ return !is_2315(); ++} ++ ++#endif +Index: linux-2.6.32.7/arch/mips/ar231x/devices.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/devices.c 2010-02-03 17:00:08.818431986 +0100 +@@ -0,0 +1,175 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "devices.h" ++#include "ar5312.h" ++#include "ar2315.h" ++ ++struct ar231x_board_config ar231x_board; ++int ar231x_devtype = DEV_TYPE_UNKNOWN; ++const struct ar231x_gpiodev *ar231x_gpiodev; ++EXPORT_SYMBOL(ar231x_gpiodev); ++ ++static struct resource ar231x_eth0_res[] = { ++ { ++ .name = "eth0_membase", ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "eth0_irq", ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++static struct resource ar231x_eth1_res[] = { ++ { ++ .name = "eth1_membase", ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "eth1_irq", ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++static struct platform_device ar231x_eth[] = { ++ { ++ .id = 0, ++ .name = "ar231x-eth", ++ .resource = ar231x_eth0_res, ++ .num_resources = ARRAY_SIZE(ar231x_eth0_res) ++ }, ++ { ++ .id = 1, ++ .name = "ar231x-eth", ++ .resource = ar231x_eth1_res, ++ .num_resources = ARRAY_SIZE(ar231x_eth1_res) ++ } ++}; ++ ++static struct resource ar231x_wmac0_res[] = { ++ { ++ .name = "wmac0_membase", ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "wmac0_irq", ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++static struct resource ar231x_wmac1_res[] = { ++ { ++ .name = "wmac1_membase", ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "wmac1_irq", ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++ ++static struct platform_device ar231x_wmac[] = { ++ { ++ .id = 0, ++ .name = "ar231x-wmac", ++ .resource = ar231x_wmac0_res, ++ .num_resources = ARRAY_SIZE(ar231x_wmac0_res), ++ .dev.platform_data = &ar231x_board, ++ }, ++ { ++ .id = 1, ++ .name = "ar231x-wmac", ++ .resource = ar231x_wmac1_res, ++ .num_resources = ARRAY_SIZE(ar231x_wmac1_res), ++ .dev.platform_data = &ar231x_board, ++ }, ++}; ++ ++static const char *devtype_strings[] = { ++ [DEV_TYPE_AR5312] = "Atheros AR5312", ++ [DEV_TYPE_AR2312] = "Atheros AR2312", ++ [DEV_TYPE_AR2313] = "Atheros AR2313", ++ [DEV_TYPE_AR2315] = "Atheros AR2315", ++ [DEV_TYPE_AR2316] = "Atheros AR2316", ++ [DEV_TYPE_AR2317] = "Atheros AR2317", ++ [DEV_TYPE_UNKNOWN] = "Atheros (unknown)", ++}; ++ ++const char *get_system_type(void) ++{ ++ if ((ar231x_devtype >= ARRAY_SIZE(devtype_strings)) || ++ !devtype_strings[ar231x_devtype]) ++ return devtype_strings[DEV_TYPE_UNKNOWN]; ++ return devtype_strings[ar231x_devtype]; ++} ++ ++ ++int __init ++ar231x_add_ethernet(int nr, u32 base, int irq, void *pdata) ++{ ++ struct resource *res; ++ ++ ar231x_eth[nr].dev.platform_data = pdata; ++ res = &ar231x_eth[nr].resource[0]; ++ res->start = base; ++ res->end = base + 0x2000 - 1; ++ res++; ++ res->start = irq; ++ res->end = irq; ++ return platform_device_register(&ar231x_eth[nr]); ++} ++ ++void __init ++ar231x_serial_setup(u32 mapbase, unsigned int uartclk) ++{ ++ struct uart_port s; ++ ++ memset(&s, 0, sizeof(s)); ++ ++ s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; ++ s.iotype = UPIO_MEM; ++ s.irq = AR531X_MISC_IRQ_UART0; ++ s.regshift = 2; ++ s.mapbase = mapbase; ++ s.uartclk = uartclk; ++ s.membase = (void __iomem *)s.mapbase; ++ ++ early_serial_setup(&s); ++} ++ ++int __init ++ar231x_add_wmac(int nr, u32 base, int irq) ++{ ++ struct resource *res; ++ ++ ar231x_wmac[nr].dev.platform_data = &ar231x_board; ++ res = &ar231x_wmac[nr].resource[0]; ++ res->start = base; ++ res->end = base + 0x10000 - 1; ++ res++; ++ res->start = irq; ++ res->end = irq; ++ return platform_device_register(&ar231x_wmac[nr]); ++} ++ ++static int __init ar231x_register_devices(void) ++{ ++ static struct resource res = { ++ .start = 0xFFFFFFFF, ++ }; ++ ++ platform_device_register_simple("GPIODEV", 0, &res, 1); ++ ar5312_init_devices(); ++ ar2315_init_devices(); ++ ++ return 0; ++} ++ ++device_initcall(ar231x_register_devices); diff --git a/target/linux/atheros/patches-2.6.32/105-ar2315_pci.patch b/target/linux/atheros/patches-2.6.32/105-ar2315_pci.patch new file mode 100644 index 000000000..2c80e9397 --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/105-ar2315_pci.patch @@ -0,0 +1,305 @@ +Index: linux-2.6.32.7/arch/mips/ar231x/Makefile +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/ar231x/Makefile 2010-02-03 17:00:08.814429898 +0100 ++++ linux-2.6.32.7/arch/mips/ar231x/Makefile 2010-02-03 17:00:21.031428952 +0100 +@@ -11,3 +11,4 @@ + obj-y += board.o prom.o devices.o + obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o + obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o ++obj-$(CONFIG_ATHEROS_AR2315_PCI) += pci.o +Index: linux-2.6.32.7/arch/mips/ar231x/pci.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/pci.c 2010-02-03 17:00:21.031428952 +0100 +@@ -0,0 +1,230 @@ ++/* ++ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "devices.h" ++ ++#define AR531X_MEM_BASE 0x80800000UL ++#define AR531X_MEM_SIZE 0x00ffffffUL ++#define AR531X_IO_SIZE 0x00007fffUL ++ ++static unsigned long configspace; ++ ++static int config_access(int devfn, int where, int size, u32 *ptr, bool write) ++{ ++ unsigned long flags; ++ int func = PCI_FUNC(devfn); ++ int dev = PCI_SLOT(devfn); ++ u32 value = 0; ++ int err = 0; ++ u32 addr; ++ ++ if (((dev != 0) && (dev != 3)) || (func > 2)) ++ return PCIBIOS_DEVICE_NOT_FOUND; ++ ++ /* Select Configuration access */ ++ local_irq_save(flags); ++ ar231x_mask_reg(AR2315_PCI_MISC_CONFIG, 0, AR2315_PCIMISC_CFG_SEL); ++ mb(); ++ ++ addr = (u32) configspace + (1 << (13 + dev)) + (func << 8) + where; ++ if (size == 1) ++ addr ^= 0x3; ++ else if (size == 2) ++ addr ^= 0x2; ++ ++ if (write) { ++ value = *ptr; ++ if (size == 1) ++ err = put_dbe(value, (u8 *) addr); ++ else if (size == 2) ++ err = put_dbe(value, (u16 *) addr); ++ else if (size == 4) ++ err = put_dbe(value, (u32 *) addr); ++ } else { ++ if (size == 1) ++ err = get_dbe(value, (u8 *) addr); ++ else if (size == 2) ++ err = get_dbe(value, (u16 *) addr); ++ else if (size == 4) ++ err = get_dbe(value, (u32 *) addr); ++ if (err) ++ *ptr = 0xffffffff; ++ else ++ *ptr = value; ++ } ++ ++ /* Select Memory access */ ++ ar231x_mask_reg(AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_CFG_SEL, 0); ++ local_irq_restore(flags); ++ ++ return (err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL); ++} ++ ++static int ar231x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * value) ++{ ++ return config_access(devfn, where, size, value, 0); ++} ++ ++static int ar231x_pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) ++{ ++ return config_access(devfn, where, size, &value, 1); ++} ++ ++struct pci_ops ar231x_pci_ops = { ++ .read = ar231x_pci_read, ++ .write = ar231x_pci_write, ++}; ++ ++static struct resource ar231x_mem_resource = { ++ .name = "AR531x PCI MEM", ++ .start = AR531X_MEM_BASE, ++ .end = AR531X_MEM_BASE + AR531X_MEM_SIZE - AR531X_IO_SIZE - 1 + 0x4000000, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct resource ar231x_io_resource = { ++ .name = "AR531x PCI I/O", ++ .start = AR531X_MEM_BASE + AR531X_MEM_SIZE - AR531X_IO_SIZE, ++ .end = AR531X_MEM_BASE + AR531X_MEM_SIZE - 1, ++ .flags = IORESOURCE_IO, ++}; ++ ++struct pci_controller ar231x_pci_controller = { ++ .pci_ops = &ar231x_pci_ops, ++ .mem_resource = &ar231x_mem_resource, ++ .io_resource = &ar231x_io_resource, ++ .mem_offset = 0x00000000UL, ++ .io_offset = 0x00000000UL, ++}; ++ ++int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ return AR2315_IRQ_LCBUS_PCI; ++} ++ ++int pcibios_plat_dev_init(struct pci_dev *dev) ++{ ++ pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 5); ++ pci_write_config_word(dev, 0x40, 0); ++ ++ /* Clear any pending Abort or external Interrupts ++ * and enable interrupt processing */ ++ ar231x_mask_reg(AR2315_PCI_INTEN_REG, AR2315_PCI_INT_ENABLE, 0); ++ ar231x_write_reg(AR2315_PCI_INT_STATUS, (AR2315_PCI_ABORT_INT | AR2315_PCI_EXT_INT)); ++ ar231x_write_reg(AR2315_PCI_INT_MASK, (AR2315_PCI_ABORT_INT | AR2315_PCI_EXT_INT)); ++ ar231x_mask_reg(AR2315_PCI_INTEN_REG, 0, AR2315_PCI_INT_ENABLE); ++ ++ return 0; ++} ++ ++static void ++ar2315_pci_fixup(struct pci_dev *dev) ++{ ++ unsigned int devfn = dev->devfn; ++ ++ if (dev->bus->number != 0) ++ return; ++ ++ /* Only fix up the PCI host settings */ ++ if ((PCI_SLOT(devfn) != 3) || (PCI_FUNC(devfn) != 0)) ++ return; ++ ++ /* Fix up MBARs */ ++ pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, HOST_PCI_MBAR0); ++ pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, HOST_PCI_MBAR1); ++ pci_write_config_dword(dev, PCI_BASE_ADDRESS_2, HOST_PCI_MBAR2); ++ pci_write_config_dword(dev, PCI_COMMAND, ++ PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_SPECIAL | ++ PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR | ++ PCI_COMMAND_FAST_BACK); ++} ++DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, ar2315_pci_fixup); ++ ++static int __init ++ar2315_pci_init(void) ++{ ++ u32 reg; ++ ++ if (ar231x_devtype != DEV_TYPE_AR2315) ++ return -ENODEV; ++ ++ configspace = (unsigned long) ioremap_nocache(0x80000000, 1*1024*1024); /* Remap PCI config space */ ++ ar231x_pci_controller.io_map_base = ++ (unsigned long) ioremap_nocache(AR531X_MEM_BASE + AR531X_MEM_SIZE, AR531X_IO_SIZE); ++ set_io_port_base(ar231x_pci_controller.io_map_base); /* PCI I/O space */ ++ ++ reg = ar231x_mask_reg(AR2315_RESET, 0, AR2315_RESET_PCIDMA); ++ msleep(10); ++ ++ reg &= ~AR2315_RESET_PCIDMA; ++ ar231x_write_reg(AR2315_RESET, reg); ++ msleep(10); ++ ++ ar231x_mask_reg(AR2315_ENDIAN_CTL, 0, ++ AR2315_CONFIG_PCIAHB | AR2315_CONFIG_PCIAHB_BRIDGE); ++ ++ ar231x_write_reg(AR2315_PCICLK, AR2315_PCICLK_PLLC_CLKM | ++ (AR2315_PCICLK_IN_FREQ_DIV_6 << AR2315_PCICLK_DIV_S)); ++ ar231x_mask_reg(AR2315_AHB_ARB_CTL, 0, AR2315_ARB_PCI); ++ ar231x_mask_reg(AR2315_IF_CTL, AR2315_IF_PCI_CLK_MASK | AR2315_IF_MASK, ++ AR2315_IF_PCI | AR2315_IF_PCI_HOST | AR2315_IF_PCI_INTR | ++ (AR2315_IF_PCI_CLK_OUTPUT_CLK << AR2315_IF_PCI_CLK_SHIFT)); ++ ++ /* Reset the PCI bus by setting bits 5-4 in PCI_MCFG */ ++ ar231x_mask_reg(AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_RST_MODE, ++ AR2315_PCIRST_LOW); ++ msleep(100); ++ ++ /* Bring the PCI out of reset */ ++ ar231x_mask_reg(AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_RST_MODE, ++ AR2315_PCIRST_HIGH | AR2315_PCICACHE_DIS | 0x8); ++ ++ ar231x_write_reg(AR2315_PCI_UNCACHE_CFG, ++ 0x1E | /* 1GB uncached */ ++ (1 << 5) | /* Enable uncached */ ++ (0x2 << 30) /* Base: 0x80000000 */ ++ ); ++ ar231x_read_reg(AR2315_PCI_UNCACHE_CFG); ++ ++ msleep(500); ++ ++ /* dirty hack - anyone with a datasheet that knows the memory map ? */ ++ ioport_resource.start = 0x10000000; ++ ioport_resource.end = 0xffffffff; ++ iomem_resource.start = 0x10000000; ++ iomem_resource.end = 0xffffffff; ++ ++ register_pci_controller(&ar231x_pci_controller); ++ ++ return 0; ++} ++ ++arch_initcall(ar2315_pci_init); +Index: linux-2.6.32.7/arch/mips/ar231x/Kconfig +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/ar231x/Kconfig 2010-02-03 17:00:08.814429898 +0100 ++++ linux-2.6.32.7/arch/mips/ar231x/Kconfig 2010-02-03 17:00:21.031428952 +0100 +@@ -15,3 +15,13 @@ + select SYS_SUPPORTS_BIG_ENDIAN + select GENERIC_GPIO + default y ++ ++config ATHEROS_AR2315_PCI ++ bool "PCI support" ++ depends on ATHEROS_AR2315 ++ select HW_HAS_PCI ++ select PCI ++ select USB_ARCH_HAS_HCD ++ select USB_ARCH_HAS_OHCI ++ select USB_ARCH_HAS_EHCI ++ default y +Index: linux-2.6.32.7/arch/mips/ar231x/ar2315.c +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/ar231x/ar2315.c 2010-02-03 17:00:08.818431986 +0100 ++++ linux-2.6.32.7/arch/mips/ar231x/ar2315.c 2010-02-03 17:00:21.031428952 +0100 +@@ -63,6 +63,27 @@ + do_IRQ(AR531X_GPIO_IRQ_BASE + bit); + } + ++#ifdef CONFIG_ATHEROS_AR2315_PCI ++static inline void pci_abort_irq(void) ++{ ++ ar231x_write_reg(AR2315_PCI_INT_STATUS, AR2315_PCI_ABORT_INT); ++} ++ ++static inline void pci_ack_irq(void) ++{ ++ ar231x_write_reg(AR2315_PCI_INT_STATUS, AR2315_PCI_EXT_INT); ++} ++ ++void ar2315_pci_irq(int irq) ++{ ++ if (ar231x_read_reg(AR2315_PCI_INT_STATUS) == AR2315_PCI_ABORT_INT) ++ pci_abort_irq(); ++ else { ++ do_IRQ(irq); ++ pci_ack_irq(); ++ } ++} ++#endif /* CONFIG_ATHEROS_AR2315_PCI */ + + /* + * Called when an interrupt is received, this function +@@ -81,6 +102,10 @@ + do_IRQ(AR2315_IRQ_WLAN0_INTRS); + else if (pending & CAUSEF_IP4) + do_IRQ(AR2315_IRQ_ENET0_INTRS); ++#ifdef CONFIG_ATHEROS_AR2315_PCI ++ else if (pending & CAUSEF_IP5) ++ ar2315_pci_irq(AR2315_IRQ_LCBUS_PCI); ++#endif + else if (pending & CAUSEF_IP2) { + unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) & ar231x_read_reg(AR2315_IMR); + diff --git a/target/linux/atheros/patches-2.6.32/110-ar2313_ethernet.patch b/target/linux/atheros/patches-2.6.32/110-ar2313_ethernet.patch new file mode 100644 index 000000000..d5c1a83a6 --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/110-ar2313_ethernet.patch @@ -0,0 +1,1604 @@ +Index: linux-2.6.32.7/drivers/net/Kconfig +=================================================================== +--- linux-2.6.32.7.orig/drivers/net/Kconfig 2010-02-03 16:57:31.714431054 +0100 ++++ linux-2.6.32.7/drivers/net/Kconfig 2010-02-03 17:00:35.870429264 +0100 +@@ -359,6 +359,12 @@ + help + Select this if your platform comes with an external 93CX6 eeprom. + ++config AR231X_ETHERNET ++ tristate "AR231x Ethernet support" ++ depends on ATHEROS_AR231X ++ help ++ Support for the AR231x/531x ethernet controller ++ + config MACE + tristate "MACE (Power Mac ethernet) support" + depends on PPC_PMAC && PPC32 +Index: linux-2.6.32.7/drivers/net/Makefile +=================================================================== +--- linux-2.6.32.7.orig/drivers/net/Makefile 2010-02-03 16:57:31.714431054 +0100 ++++ linux-2.6.32.7/drivers/net/Makefile 2010-02-03 17:00:35.870429264 +0100 +@@ -216,6 +216,7 @@ + obj-$(CONFIG_KORINA) += korina.o + obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o + obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o ++obj-$(CONFIG_AR231X_ETHERNET) += ar231x.o + obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o + obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o + obj-$(CONFIG_DECLANCE) += declance.o +Index: linux-2.6.32.7/drivers/net/ar231x.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/drivers/net/ar231x.c 2010-02-03 17:00:35.874430230 +0100 +@@ -0,0 +1,1263 @@ ++/* ++ * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. ++ * ++ * Copyright (C) 2004 by Sameer Dekate ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006-2009 Felix Fietkau ++ * ++ * Thanks to Atheros for providing hardware and documentation ++ * enabling me to write this driver. ++ * ++ * 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. ++ * ++ * Additional credits: ++ * This code is taken from John Taylor's Sibyte driver and then ++ * modified for the AR2313. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define AR2313_MTU 1692 ++#define AR2313_PRIOS 1 ++#define AR2313_QUEUES (2*AR2313_PRIOS) ++#define AR2313_DESCR_ENTRIES 64 ++ ++ ++#ifndef min ++#define min(a,b) (((a)<(b))?(a):(b)) ++#endif ++ ++#ifndef SMP_CACHE_BYTES ++#define SMP_CACHE_BYTES L1_CACHE_BYTES ++#endif ++ ++#define AR2313_MBOX_SET_BIT 0x8 ++ ++#include "ar231x.h" ++ ++/* ++ * New interrupt handler strategy: ++ * ++ * An old interrupt handler worked using the traditional method of ++ * replacing an skbuff with a new one when a packet arrives. However ++ * the rx rings do not need to contain a static number of buffer ++ * descriptors, thus it makes sense to move the memory allocation out ++ * of the main interrupt handler and do it in a bottom half handler ++ * and only allocate new buffers when the number of buffers in the ++ * ring is below a certain threshold. In order to avoid starving the ++ * NIC under heavy load it is however necessary to force allocation ++ * when hitting a minimum threshold. The strategy for alloction is as ++ * follows: ++ * ++ * RX_LOW_BUF_THRES - allocate buffers in the bottom half ++ * RX_PANIC_LOW_THRES - we are very low on buffers, allocate ++ * the buffers in the interrupt handler ++ * RX_RING_THRES - maximum number of buffers in the rx ring ++ * ++ * One advantagous side effect of this allocation approach is that the ++ * entire rx processing can be done without holding any spin lock ++ * since the rx rings and registers are totally independent of the tx ++ * ring and its registers. This of course includes the kmalloc's of ++ * new skb's. Thus start_xmit can run in parallel with rx processing ++ * and the memory allocation on SMP systems. ++ * ++ * Note that running the skb reallocation in a bottom half opens up ++ * another can of races which needs to be handled properly. In ++ * particular it can happen that the interrupt handler tries to run ++ * the reallocation while the bottom half is either running on another ++ * CPU or was interrupted on the same CPU. To get around this the ++ * driver uses bitops to prevent the reallocation routines from being ++ * reentered. ++ * ++ * TX handling can also be done without holding any spin lock, wheee ++ * this is fun! since tx_csm is only written to by the interrupt ++ * handler. ++ */ ++ ++/* ++ * Threshold values for RX buffer allocation - the low water marks for ++ * when to start refilling the rings are set to 75% of the ring ++ * sizes. It seems to make sense to refill the rings entirely from the ++ * intrrupt handler once it gets below the panic threshold, that way ++ * we don't risk that the refilling is moved to another CPU when the ++ * one running the interrupt handler just got the slab code hot in its ++ * cache. ++ */ ++#define RX_RING_SIZE AR2313_DESCR_ENTRIES ++#define RX_PANIC_THRES (RX_RING_SIZE/4) ++#define RX_LOW_THRES ((3*RX_RING_SIZE)/4) ++#define CRC_LEN 4 ++#define RX_OFFSET 2 ++ ++#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) ++#define VLAN_HDR 4 ++#else ++#define VLAN_HDR 0 ++#endif ++ ++#define AR2313_BUFSIZE (AR2313_MTU + VLAN_HDR + ETH_HLEN + CRC_LEN + RX_OFFSET) ++ ++#ifdef MODULE ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Sameer Dekate , Imre Kaloz , Felix Fietkau "); ++MODULE_DESCRIPTION("AR231x Ethernet driver"); ++#endif ++ ++#define virt_to_phys(x) ((u32)(x) & 0x1fffffff) ++ ++// prototypes ++static void ar231x_halt(struct net_device *dev); ++static void rx_tasklet_func(unsigned long data); ++static void rx_tasklet_cleanup(struct net_device *dev); ++static void ar231x_multicast_list(struct net_device *dev); ++ ++static int ar231x_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum); ++static int ar231x_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, u16 value); ++static int ar231x_mdiobus_reset(struct mii_bus *bus); ++static int ar231x_mdiobus_probe (struct net_device *dev); ++static void ar231x_adjust_link(struct net_device *dev); ++ ++#ifndef ERR ++#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args) ++#endif ++ ++static const struct net_device_ops ar231x_ops = { ++ .ndo_open = ar231x_open, ++ .ndo_stop = ar231x_close, ++ .ndo_start_xmit = ar231x_start_xmit, ++ .ndo_set_multicast_list = ar231x_multicast_list, ++ .ndo_do_ioctl = ar231x_ioctl, ++}; ++ ++int __init ar231x_probe(struct platform_device *pdev) ++{ ++ struct net_device *dev; ++ struct ar231x_private *sp; ++ struct resource *res; ++ unsigned long ar_eth_base; ++ char buf[64]; ++ ++ dev = alloc_etherdev(sizeof(struct ar231x_private)); ++ ++ if (dev == NULL) { ++ printk(KERN_ERR ++ "ar231x: Unable to allocate net_device structure!\n"); ++ return -ENOMEM; ++ } ++ ++ platform_set_drvdata(pdev, dev); ++ ++ sp = netdev_priv(dev); ++ sp->dev = dev; ++ sp->cfg = pdev->dev.platform_data; ++ ++ sprintf(buf, "eth%d_membase", pdev->id); ++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, buf); ++ if (!res) ++ return -ENODEV; ++ ++ sp->link = 0; ++ ar_eth_base = res->start; ++ ++ sprintf(buf, "eth%d_irq", pdev->id); ++ dev->irq = platform_get_irq_byname(pdev, buf); ++ ++ spin_lock_init(&sp->lock); ++ ++ dev->features |= NETIF_F_HIGHDMA; ++ dev->netdev_ops = &ar231x_ops; ++ ++ tasklet_init(&sp->rx_tasklet, rx_tasklet_func, (unsigned long) dev); ++ tasklet_disable(&sp->rx_tasklet); ++ ++ sp->eth_regs = ++ ioremap_nocache(virt_to_phys(ar_eth_base), sizeof(*sp->eth_regs)); ++ if (!sp->eth_regs) { ++ printk("Can't remap eth registers\n"); ++ return (-ENXIO); ++ } ++ ++ /* ++ * When there's only one MAC, PHY regs are typically on ENET0, ++ * even though the MAC might be on ENET1. ++ * Needto remap PHY regs separately in this case ++ */ ++ if (virt_to_phys(ar_eth_base) == virt_to_phys(sp->phy_regs)) ++ sp->phy_regs = sp->eth_regs; ++ else { ++ sp->phy_regs = ++ ioremap_nocache(virt_to_phys(sp->cfg->phy_base), ++ sizeof(*sp->phy_regs)); ++ if (!sp->phy_regs) { ++ printk("Can't remap phy registers\n"); ++ return (-ENXIO); ++ } ++ } ++ ++ sp->dma_regs = ++ ioremap_nocache(virt_to_phys(ar_eth_base + 0x1000), ++ sizeof(*sp->dma_regs)); ++ dev->base_addr = (unsigned int) sp->dma_regs; ++ if (!sp->dma_regs) { ++ printk("Can't remap DMA registers\n"); ++ return (-ENXIO); ++ } ++ ++ sp->int_regs = ioremap_nocache(virt_to_phys(sp->cfg->reset_base), 4); ++ if (!sp->int_regs) { ++ printk("Can't remap INTERRUPT registers\n"); ++ return (-ENXIO); ++ } ++ ++ strncpy(sp->name, "Atheros AR231x", sizeof(sp->name) - 1); ++ sp->name[sizeof(sp->name) - 1] = '\0'; ++ memcpy(dev->dev_addr, sp->cfg->macaddr, 6); ++ ++ if (ar231x_init(dev)) { ++ /* ++ * ar231x_init() calls ar231x_init_cleanup() on error. ++ */ ++ kfree(dev); ++ return -ENODEV; ++ } ++ ++ if (register_netdev(dev)) { ++ printk("%s: register_netdev failed\n", __func__); ++ return -1; ++ } ++ ++ printk("%s: %s: %02x:%02x:%02x:%02x:%02x:%02x, irq %d\n", ++ dev->name, sp->name, ++ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], ++ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], dev->irq); ++ ++ sp->mii_bus = mdiobus_alloc(); ++ if (sp->mii_bus == NULL) ++ return -1; ++ ++ sp->mii_bus->priv = dev; ++ sp->mii_bus->read = ar231x_mdiobus_read; ++ sp->mii_bus->write = ar231x_mdiobus_write; ++ sp->mii_bus->reset = ar231x_mdiobus_reset; ++ sp->mii_bus->name = "ar231x_eth_mii"; ++ snprintf(sp->mii_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id); ++ sp->mii_bus->irq = kmalloc(sizeof(int), GFP_KERNEL); ++ *sp->mii_bus->irq = PHY_POLL; ++ ++ mdiobus_register(sp->mii_bus); ++ ++ if (ar231x_mdiobus_probe(dev) != 0) { ++ printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name); ++ rx_tasklet_cleanup(dev); ++ ar231x_init_cleanup(dev); ++ unregister_netdev(dev); ++ kfree(dev); ++ return -ENODEV; ++ } ++ ++ /* start link poll timer */ ++ ar231x_setup_timer(dev); ++ ++ return 0; ++} ++ ++ ++static void ar231x_multicast_list(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ unsigned int filter; ++ ++ filter = sp->eth_regs->mac_control; ++ ++ if (dev->flags & IFF_PROMISC) ++ filter |= MAC_CONTROL_PR; ++ else ++ filter &= ~MAC_CONTROL_PR; ++ if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 0)) ++ filter |= MAC_CONTROL_PM; ++ else ++ filter &= ~MAC_CONTROL_PM; ++ ++ sp->eth_regs->mac_control = filter; ++} ++ ++static void rx_tasklet_cleanup(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ ++ /* ++ * Tasklet may be scheduled. Need to get it removed from the list ++ * since we're about to free the struct. ++ */ ++ ++ sp->unloading = 1; ++ tasklet_enable(&sp->rx_tasklet); ++ tasklet_kill(&sp->rx_tasklet); ++} ++ ++static int __exit ar231x_remove(struct platform_device *pdev) ++{ ++ struct net_device *dev = platform_get_drvdata(pdev); ++ struct ar231x_private *sp = netdev_priv(dev); ++ rx_tasklet_cleanup(dev); ++ ar231x_init_cleanup(dev); ++ unregister_netdev(dev); ++ mdiobus_unregister(sp->mii_bus); ++ mdiobus_free(sp->mii_bus); ++ kfree(dev); ++ return 0; ++} ++ ++ ++/* ++ * Restart the AR2313 ethernet controller. ++ */ ++static int ar231x_restart(struct net_device *dev) ++{ ++ /* disable interrupts */ ++ disable_irq(dev->irq); ++ ++ /* stop mac */ ++ ar231x_halt(dev); ++ ++ /* initialize */ ++ ar231x_init(dev); ++ ++ /* enable interrupts */ ++ enable_irq(dev->irq); ++ ++ return 0; ++} ++ ++static struct platform_driver ar231x_driver = { ++ .driver.name = "ar231x-eth", ++ .probe = ar231x_probe, ++ .remove = ar231x_remove, ++}; ++ ++int __init ar231x_module_init(void) ++{ ++ return platform_driver_register(&ar231x_driver); ++} ++ ++void __exit ar231x_module_cleanup(void) ++{ ++ platform_driver_unregister(&ar231x_driver); ++} ++ ++module_init(ar231x_module_init); ++module_exit(ar231x_module_cleanup); ++ ++ ++static void ar231x_free_descriptors(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ if (sp->rx_ring != NULL) { ++ kfree((void *) KSEG0ADDR(sp->rx_ring)); ++ sp->rx_ring = NULL; ++ sp->tx_ring = NULL; ++ } ++} ++ ++ ++static int ar231x_allocate_descriptors(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ int size; ++ int j; ++ ar231x_descr_t *space; ++ ++ if (sp->rx_ring != NULL) { ++ printk("%s: already done.\n", __FUNCTION__); ++ return 0; ++ } ++ ++ size = ++ (sizeof(ar231x_descr_t) * (AR2313_DESCR_ENTRIES * AR2313_QUEUES)); ++ space = kmalloc(size, GFP_KERNEL); ++ if (space == NULL) ++ return 1; ++ ++ /* invalidate caches */ ++ dma_cache_inv((unsigned int) space, size); ++ ++ /* now convert pointer to KSEG1 */ ++ space = (ar231x_descr_t *) KSEG1ADDR(space); ++ ++ memset((void *) space, 0, size); ++ ++ sp->rx_ring = space; ++ space += AR2313_DESCR_ENTRIES; ++ ++ sp->tx_ring = space; ++ space += AR2313_DESCR_ENTRIES; ++ ++ /* Initialize the transmit Descriptors */ ++ for (j = 0; j < AR2313_DESCR_ENTRIES; j++) { ++ ar231x_descr_t *td = &sp->tx_ring[j]; ++ td->status = 0; ++ td->devcs = DMA_TX1_CHAINED; ++ td->addr = 0; ++ td->descr = ++ virt_to_phys(&sp-> ++ tx_ring[(j + 1) & (AR2313_DESCR_ENTRIES - 1)]); ++ } ++ ++ return 0; ++} ++ ++ ++/* ++ * Generic cleanup handling data allocated during init. Used when the ++ * module is unloaded or if an error occurs during initialization ++ */ ++static void ar231x_init_cleanup(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ struct sk_buff *skb; ++ int j; ++ ++ ar231x_free_descriptors(dev); ++ ++ if (sp->eth_regs) ++ iounmap((void *) sp->eth_regs); ++ if (sp->dma_regs) ++ iounmap((void *) sp->dma_regs); ++ ++ if (sp->rx_skb) { ++ for (j = 0; j < AR2313_DESCR_ENTRIES; j++) { ++ skb = sp->rx_skb[j]; ++ if (skb) { ++ sp->rx_skb[j] = NULL; ++ dev_kfree_skb(skb); ++ } ++ } ++ kfree(sp->rx_skb); ++ sp->rx_skb = NULL; ++ } ++ ++ if (sp->tx_skb) { ++ for (j = 0; j < AR2313_DESCR_ENTRIES; j++) { ++ skb = sp->tx_skb[j]; ++ if (skb) { ++ sp->tx_skb[j] = NULL; ++ dev_kfree_skb(skb); ++ } ++ } ++ kfree(sp->tx_skb); ++ sp->tx_skb = NULL; ++ } ++} ++ ++static int ar231x_setup_timer(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ ++ init_timer(&sp->link_timer); ++ ++ sp->link_timer.function = ar231x_link_timer_fn; ++ sp->link_timer.data = (int) dev; ++ sp->link_timer.expires = jiffies + HZ; ++ ++ add_timer(&sp->link_timer); ++ return 0; ++ ++} ++ ++static void ar231x_link_timer_fn(unsigned long data) ++{ ++ struct net_device *dev = (struct net_device *) data; ++ struct ar231x_private *sp = netdev_priv(dev); ++ ++ // see if the link status changed ++ // This was needed to make sure we set the PHY to the ++ // autonegotiated value of half or full duplex. ++ ar231x_check_link(dev); ++ ++ // Loop faster when we don't have link. ++ // This was needed to speed up the AP bootstrap time. ++ if (sp->link == 0) { ++ mod_timer(&sp->link_timer, jiffies + HZ / 2); ++ } else { ++ mod_timer(&sp->link_timer, jiffies + LINK_TIMER); ++ } ++} ++ ++static void ar231x_check_link(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ u16 phyData; ++ ++ phyData = ar231x_mdiobus_read(sp->mii_bus, sp->phy, MII_BMSR); ++ if (sp->phyData != phyData) { ++ if (phyData & BMSR_LSTATUS) { ++ /* link is present, ready link partner ability to deterine ++ duplexity */ ++ int duplex = 0; ++ u16 reg; ++ ++ sp->link = 1; ++ reg = ar231x_mdiobus_read(sp->mii_bus, sp->phy, MII_BMCR); ++ if (reg & BMCR_ANENABLE) { ++ /* auto neg enabled */ ++ reg = ar231x_mdiobus_read(sp->mii_bus, sp->phy, MII_LPA); ++ duplex = (reg & (LPA_100FULL | LPA_10FULL)) ? 1 : 0; ++ } else { ++ /* no auto neg, just read duplex config */ ++ duplex = (reg & BMCR_FULLDPLX) ? 1 : 0; ++ } ++ ++ printk(KERN_INFO "%s: Configuring MAC for %s duplex\n", ++ dev->name, (duplex) ? "full" : "half"); ++ ++ if (duplex) { ++ /* full duplex */ ++ sp->eth_regs->mac_control = ++ ((sp->eth_regs-> ++ mac_control | MAC_CONTROL_F) & ~MAC_CONTROL_DRO); ++ } else { ++ /* half duplex */ ++ sp->eth_regs->mac_control = ++ ((sp->eth_regs-> ++ mac_control | MAC_CONTROL_DRO) & ~MAC_CONTROL_F); ++ } ++ } else { ++ /* no link */ ++ sp->link = 0; ++ } ++ sp->phyData = phyData; ++ } ++} ++ ++static int ar231x_reset_reg(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ unsigned int ethsal, ethsah; ++ unsigned int flags; ++ ++ *sp->int_regs |= sp->cfg->reset_mac; ++ mdelay(10); ++ *sp->int_regs &= ~sp->cfg->reset_mac; ++ mdelay(10); ++ *sp->int_regs |= sp->cfg->reset_phy; ++ mdelay(10); ++ *sp->int_regs &= ~sp->cfg->reset_phy; ++ mdelay(10); ++ ++ sp->dma_regs->bus_mode = (DMA_BUS_MODE_SWR); ++ mdelay(10); ++ sp->dma_regs->bus_mode = ++ ((32 << DMA_BUS_MODE_PBL_SHIFT) | DMA_BUS_MODE_BLE); ++ ++ /* enable interrupts */ ++ sp->dma_regs->intr_ena = (DMA_STATUS_AIS | ++ DMA_STATUS_NIS | ++ DMA_STATUS_RI | ++ DMA_STATUS_TI | DMA_STATUS_FBE); ++ sp->dma_regs->xmt_base = virt_to_phys(sp->tx_ring); ++ sp->dma_regs->rcv_base = virt_to_phys(sp->rx_ring); ++ sp->dma_regs->control = ++ (DMA_CONTROL_SR | DMA_CONTROL_ST | DMA_CONTROL_SF); ++ ++ sp->eth_regs->flow_control = (FLOW_CONTROL_FCE); ++ sp->eth_regs->vlan_tag = (0x8100); ++ ++ /* Enable Ethernet Interface */ ++ flags = (MAC_CONTROL_TE | /* transmit enable */ ++ MAC_CONTROL_PM | /* pass mcast */ ++ MAC_CONTROL_F | /* full duplex */ ++ MAC_CONTROL_HBD); /* heart beat disabled */ ++ ++ if (dev->flags & IFF_PROMISC) { /* set promiscuous mode */ ++ flags |= MAC_CONTROL_PR; ++ } ++ sp->eth_regs->mac_control = flags; ++ ++ /* Set all Ethernet station address registers to their initial values */ ++ ethsah = ((((u_int) (dev->dev_addr[5]) << 8) & (u_int) 0x0000FF00) | ++ (((u_int) (dev->dev_addr[4]) << 0) & (u_int) 0x000000FF)); ++ ++ ethsal = ((((u_int) (dev->dev_addr[3]) << 24) & (u_int) 0xFF000000) | ++ (((u_int) (dev->dev_addr[2]) << 16) & (u_int) 0x00FF0000) | ++ (((u_int) (dev->dev_addr[1]) << 8) & (u_int) 0x0000FF00) | ++ (((u_int) (dev->dev_addr[0]) << 0) & (u_int) 0x000000FF)); ++ ++ sp->eth_regs->mac_addr[0] = ethsah; ++ sp->eth_regs->mac_addr[1] = ethsal; ++ ++ mdelay(10); ++ ++ return (0); ++} ++ ++ ++static int ar231x_init(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ int ecode = 0; ++ ++ /* ++ * Allocate descriptors ++ */ ++ if (ar231x_allocate_descriptors(dev)) { ++ printk("%s: %s: ar231x_allocate_descriptors failed\n", ++ dev->name, __FUNCTION__); ++ ecode = -EAGAIN; ++ goto init_error; ++ } ++ ++ /* ++ * Get the memory for the skb rings. ++ */ ++ if (sp->rx_skb == NULL) { ++ sp->rx_skb = ++ kmalloc(sizeof(struct sk_buff *) * AR2313_DESCR_ENTRIES, ++ GFP_KERNEL); ++ if (!(sp->rx_skb)) { ++ printk("%s: %s: rx_skb kmalloc failed\n", ++ dev->name, __FUNCTION__); ++ ecode = -EAGAIN; ++ goto init_error; ++ } ++ } ++ memset(sp->rx_skb, 0, sizeof(struct sk_buff *) * AR2313_DESCR_ENTRIES); ++ ++ if (sp->tx_skb == NULL) { ++ sp->tx_skb = ++ kmalloc(sizeof(struct sk_buff *) * AR2313_DESCR_ENTRIES, ++ GFP_KERNEL); ++ if (!(sp->tx_skb)) { ++ printk("%s: %s: tx_skb kmalloc failed\n", ++ dev->name, __FUNCTION__); ++ ecode = -EAGAIN; ++ goto init_error; ++ } ++ } ++ memset(sp->tx_skb, 0, sizeof(struct sk_buff *) * AR2313_DESCR_ENTRIES); ++ ++ /* ++ * Set tx_csm before we start receiving interrupts, otherwise ++ * the interrupt handler might think it is supposed to process ++ * tx ints before we are up and running, which may cause a null ++ * pointer access in the int handler. ++ */ ++ sp->rx_skbprd = 0; ++ sp->cur_rx = 0; ++ sp->tx_prd = 0; ++ sp->tx_csm = 0; ++ ++ /* ++ * Zero the stats before starting the interface ++ */ ++ memset(&dev->stats, 0, sizeof(dev->stats)); ++ ++ /* ++ * We load the ring here as there seem to be no way to tell the ++ * firmware to wipe the ring without re-initializing it. ++ */ ++ ar231x_load_rx_ring(dev, RX_RING_SIZE); ++ ++ /* ++ * Init hardware ++ */ ++ ar231x_reset_reg(dev); ++ ++ /* ++ * Get the IRQ ++ */ ++ ecode = ++ request_irq(dev->irq, &ar231x_interrupt, ++ IRQF_DISABLED | IRQF_SAMPLE_RANDOM, ++ dev->name, dev); ++ if (ecode) { ++ printk(KERN_WARNING "%s: %s: Requested IRQ %d is busy\n", ++ dev->name, __FUNCTION__, dev->irq); ++ goto init_error; ++ } ++ ++ ++ tasklet_enable(&sp->rx_tasklet); ++ ++ return 0; ++ ++ init_error: ++ ar231x_init_cleanup(dev); ++ return ecode; ++} ++ ++/* ++ * Load the rx ring. ++ * ++ * Loading rings is safe without holding the spin lock since this is ++ * done only before the device is enabled, thus no interrupts are ++ * generated and by the interrupt handler/tasklet handler. ++ */ ++static void ar231x_load_rx_ring(struct net_device *dev, int nr_bufs) ++{ ++ ++ struct ar231x_private *sp = netdev_priv(dev); ++ short i, idx; ++ ++ idx = sp->rx_skbprd; ++ ++ for (i = 0; i < nr_bufs; i++) { ++ struct sk_buff *skb; ++ ar231x_descr_t *rd; ++ ++ if (sp->rx_skb[idx]) ++ break; ++ ++ skb = netdev_alloc_skb(dev, AR2313_BUFSIZE); ++ if (!skb) { ++ printk("\n\n\n\n %s: No memory in system\n\n\n\n", ++ __FUNCTION__); ++ break; ++ } ++ ++ /* ++ * Make sure IP header starts on a fresh cache line. ++ */ ++ skb->dev = dev; ++ skb_reserve(skb, RX_OFFSET); ++ sp->rx_skb[idx] = skb; ++ ++ rd = (ar231x_descr_t *) & sp->rx_ring[idx]; ++ ++ /* initialize dma descriptor */ ++ rd->devcs = ((AR2313_BUFSIZE << DMA_RX1_BSIZE_SHIFT) | ++ DMA_RX1_CHAINED); ++ rd->addr = virt_to_phys(skb->data); ++ rd->descr = ++ virt_to_phys(&sp-> ++ rx_ring[(idx + 1) & (AR2313_DESCR_ENTRIES - 1)]); ++ rd->status = DMA_RX_OWN; ++ ++ idx = DSC_NEXT(idx); ++ } ++ ++ if (i) ++ sp->rx_skbprd = idx; ++ ++ return; ++} ++ ++#define AR2313_MAX_PKTS_PER_CALL 64 ++ ++static int ar231x_rx_int(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ struct sk_buff *skb, *skb_new; ++ ar231x_descr_t *rxdesc; ++ unsigned int status; ++ u32 idx; ++ int pkts = 0; ++ int rval; ++ ++ idx = sp->cur_rx; ++ ++ /* process at most the entire ring and then wait for another interrupt ++ */ ++ while (1) { ++ ++ rxdesc = &sp->rx_ring[idx]; ++ status = rxdesc->status; ++ if (status & DMA_RX_OWN) { ++ /* SiByte owns descriptor or descr not yet filled in */ ++ rval = 0; ++ break; ++ } ++ ++ if (++pkts > AR2313_MAX_PKTS_PER_CALL) { ++ rval = 1; ++ break; ++ } ++ ++ if ((status & DMA_RX_ERROR) && !(status & DMA_RX_LONG)) { ++ dev->stats.rx_errors++; ++ dev->stats.rx_dropped++; ++ ++ /* add statistics counters */ ++ if (status & DMA_RX_ERR_CRC) ++ dev->stats.rx_crc_errors++; ++ if (status & DMA_RX_ERR_COL) ++ dev->stats.rx_over_errors++; ++ if (status & DMA_RX_ERR_LENGTH) ++ dev->stats.rx_length_errors++; ++ if (status & DMA_RX_ERR_RUNT) ++ dev->stats.rx_over_errors++; ++ if (status & DMA_RX_ERR_DESC) ++ dev->stats.rx_over_errors++; ++ ++ } else { ++ /* alloc new buffer. */ ++ skb_new = netdev_alloc_skb(dev, AR2313_BUFSIZE + RX_OFFSET); ++ if (skb_new != NULL) { ++ ++ skb = sp->rx_skb[idx]; ++ /* set skb */ ++ skb_put(skb, ++ ((status >> DMA_RX_LEN_SHIFT) & 0x3fff) - CRC_LEN); ++ ++ dev->stats.rx_bytes += skb->len; ++ skb->protocol = eth_type_trans(skb, dev); ++ /* pass the packet to upper layers */ ++ netif_rx(skb); ++ ++ skb_new->dev = dev; ++ /* 16 bit align */ ++ skb_reserve(skb_new, RX_OFFSET); ++ /* reset descriptor's curr_addr */ ++ rxdesc->addr = virt_to_phys(skb_new->data); ++ ++ dev->stats.rx_packets++; ++ sp->rx_skb[idx] = skb_new; ++ } else { ++ dev->stats.rx_dropped++; ++ } ++ } ++ ++ rxdesc->devcs = ((AR2313_BUFSIZE << DMA_RX1_BSIZE_SHIFT) | ++ DMA_RX1_CHAINED); ++ rxdesc->status = DMA_RX_OWN; ++ ++ idx = DSC_NEXT(idx); ++ } ++ ++ sp->cur_rx = idx; ++ ++ return rval; ++} ++ ++ ++static void ar231x_tx_int(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ u32 idx; ++ struct sk_buff *skb; ++ ar231x_descr_t *txdesc; ++ unsigned int status = 0; ++ ++ idx = sp->tx_csm; ++ ++ while (idx != sp->tx_prd) { ++ txdesc = &sp->tx_ring[idx]; ++ ++ if ((status = txdesc->status) & DMA_TX_OWN) { ++ /* ar231x dma still owns descr */ ++ break; ++ } ++ /* done with this descriptor */ ++ dma_unmap_single(NULL, txdesc->addr, ++ txdesc->devcs & DMA_TX1_BSIZE_MASK, ++ DMA_TO_DEVICE); ++ txdesc->status = 0; ++ ++ if (status & DMA_TX_ERROR) { ++ dev->stats.tx_errors++; ++ dev->stats.tx_dropped++; ++ if (status & DMA_TX_ERR_UNDER) ++ dev->stats.tx_fifo_errors++; ++ if (status & DMA_TX_ERR_HB) ++ dev->stats.tx_heartbeat_errors++; ++ if (status & (DMA_TX_ERR_LOSS | DMA_TX_ERR_LINK)) ++ dev->stats.tx_carrier_errors++; ++ if (status & (DMA_TX_ERR_LATE | ++ DMA_TX_ERR_COL | ++ DMA_TX_ERR_JABBER | DMA_TX_ERR_DEFER)) ++ dev->stats.tx_aborted_errors++; ++ } else { ++ /* transmit OK */ ++ dev->stats.tx_packets++; ++ } ++ ++ skb = sp->tx_skb[idx]; ++ sp->tx_skb[idx] = NULL; ++ idx = DSC_NEXT(idx); ++ dev->stats.tx_bytes += skb->len; ++ dev_kfree_skb_irq(skb); ++ } ++ ++ sp->tx_csm = idx; ++ ++ return; ++} ++ ++ ++static void rx_tasklet_func(unsigned long data) ++{ ++ struct net_device *dev = (struct net_device *) data; ++ struct ar231x_private *sp = netdev_priv(dev); ++ ++ if (sp->unloading) { ++ return; ++ } ++ ++ if (ar231x_rx_int(dev)) { ++ tasklet_hi_schedule(&sp->rx_tasklet); ++ } else { ++ unsigned long flags; ++ spin_lock_irqsave(&sp->lock, flags); ++ sp->dma_regs->intr_ena |= DMA_STATUS_RI; ++ spin_unlock_irqrestore(&sp->lock, flags); ++ } ++} ++ ++static void rx_schedule(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ ++ sp->dma_regs->intr_ena &= ~DMA_STATUS_RI; ++ ++ tasklet_hi_schedule(&sp->rx_tasklet); ++} ++ ++static irqreturn_t ar231x_interrupt(int irq, void *dev_id) ++{ ++ struct net_device *dev = (struct net_device *) dev_id; ++ struct ar231x_private *sp = netdev_priv(dev); ++ unsigned int status, enabled; ++ ++ /* clear interrupt */ ++ /* ++ * Don't clear RI bit if currently disabled. ++ */ ++ status = sp->dma_regs->status; ++ enabled = sp->dma_regs->intr_ena; ++ sp->dma_regs->status = status & enabled; ++ ++ if (status & DMA_STATUS_NIS) { ++ /* normal status */ ++ /* ++ * Don't schedule rx processing if interrupt ++ * is already disabled. ++ */ ++ if (status & enabled & DMA_STATUS_RI) { ++ /* receive interrupt */ ++ rx_schedule(dev); ++ } ++ if (status & DMA_STATUS_TI) { ++ /* transmit interrupt */ ++ ar231x_tx_int(dev); ++ } ++ } ++ ++ /* abnormal status */ ++ if (status & (DMA_STATUS_FBE | DMA_STATUS_TPS)) { ++ ar231x_restart(dev); ++ } ++ return IRQ_HANDLED; ++} ++ ++ ++static int ar231x_open(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ unsigned int ethsal, ethsah; ++ ++ /* reset the hardware, in case the MAC address changed */ ++ ethsah = ((((u_int) (dev->dev_addr[5]) << 8) & (u_int) 0x0000FF00) | ++ (((u_int) (dev->dev_addr[4]) << 0) & (u_int) 0x000000FF)); ++ ++ ethsal = ((((u_int) (dev->dev_addr[3]) << 24) & (u_int) 0xFF000000) | ++ (((u_int) (dev->dev_addr[2]) << 16) & (u_int) 0x00FF0000) | ++ (((u_int) (dev->dev_addr[1]) << 8) & (u_int) 0x0000FF00) | ++ (((u_int) (dev->dev_addr[0]) << 0) & (u_int) 0x000000FF)); ++ ++ sp->eth_regs->mac_addr[0] = ethsah; ++ sp->eth_regs->mac_addr[1] = ethsal; ++ ++ mdelay(10); ++ ++ dev->mtu = 1500; ++ netif_start_queue(dev); ++ ++ sp->eth_regs->mac_control |= MAC_CONTROL_RE; ++ ++ return 0; ++} ++ ++static void ar231x_halt(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ int j; ++ ++ tasklet_disable(&sp->rx_tasklet); ++ ++ /* kill the MAC */ ++ sp->eth_regs->mac_control &= ~(MAC_CONTROL_RE | /* disable Receives */ ++ MAC_CONTROL_TE); /* disable Transmits */ ++ /* stop dma */ ++ sp->dma_regs->control = 0; ++ sp->dma_regs->bus_mode = DMA_BUS_MODE_SWR; ++ ++ /* place phy and MAC in reset */ ++ *sp->int_regs |= (sp->cfg->reset_mac | sp->cfg->reset_phy); ++ ++ /* free buffers on tx ring */ ++ for (j = 0; j < AR2313_DESCR_ENTRIES; j++) { ++ struct sk_buff *skb; ++ ar231x_descr_t *txdesc; ++ ++ txdesc = &sp->tx_ring[j]; ++ txdesc->descr = 0; ++ ++ skb = sp->tx_skb[j]; ++ if (skb) { ++ dev_kfree_skb(skb); ++ sp->tx_skb[j] = NULL; ++ } ++ } ++} ++ ++/* ++ * close should do nothing. Here's why. It's called when ++ * 'ifconfig bond0 down' is run. If it calls free_irq then ++ * the irq is gone forever ! When bond0 is made 'up' again, ++ * the ar231x_open () does not call request_irq (). Worse, ++ * the call to ar231x_halt() generates a WDOG reset due to ++ * the write to 'sp->int_regs' and the box reboots. ++ * Commenting this out is good since it allows the ++ * system to resume when bond0 is made up again. ++ */ ++static int ar231x_close(struct net_device *dev) ++{ ++#if 0 ++ /* ++ * Disable interrupts ++ */ ++ disable_irq(dev->irq); ++ ++ /* ++ * Without (or before) releasing irq and stopping hardware, this ++ * is an absolute non-sense, by the way. It will be reset instantly ++ * by the first irq. ++ */ ++ netif_stop_queue(dev); ++ ++ /* stop the MAC and DMA engines */ ++ ar231x_halt(dev); ++ ++ /* release the interrupt */ ++ free_irq(dev->irq, dev); ++ ++#endif ++ return 0; ++} ++ ++static int ar231x_start_xmit(struct sk_buff *skb, struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ ar231x_descr_t *td; ++ u32 idx; ++ ++ idx = sp->tx_prd; ++ td = &sp->tx_ring[idx]; ++ ++ if (td->status & DMA_TX_OWN) { ++ /* free skbuf and lie to the caller that we sent it out */ ++ dev->stats.tx_dropped++; ++ dev_kfree_skb(skb); ++ ++ /* restart transmitter in case locked */ ++ sp->dma_regs->xmt_poll = 0; ++ return 0; ++ } ++ ++ /* Setup the transmit descriptor. */ ++ td->devcs = ((skb->len << DMA_TX1_BSIZE_SHIFT) | ++ (DMA_TX1_LS | DMA_TX1_IC | DMA_TX1_CHAINED)); ++ td->addr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE); ++ td->status = DMA_TX_OWN; ++ ++ /* kick transmitter last */ ++ sp->dma_regs->xmt_poll = 0; ++ ++ sp->tx_skb[idx] = skb; ++ idx = DSC_NEXT(idx); ++ sp->tx_prd = idx; ++ ++ return 0; ++} ++ ++static int ar231x_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ++{ ++ struct mii_ioctl_data *data = (struct mii_ioctl_data *) &ifr->ifr_data; ++ struct ar231x_private *sp = netdev_priv(dev); ++ int ret; ++ ++ switch (cmd) { ++ ++ case SIOCETHTOOL: ++ spin_lock_irq(&sp->lock); ++ ret = phy_ethtool_ioctl(sp->phy_dev, (void *) ifr->ifr_data); ++ spin_unlock_irq(&sp->lock); ++ return ret; ++ ++ case SIOCSIFHWADDR: ++ if (copy_from_user ++ (dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr))) ++ return -EFAULT; ++ return 0; ++ ++ case SIOCGIFHWADDR: ++ if (copy_to_user ++ (ifr->ifr_data, dev->dev_addr, sizeof(dev->dev_addr))) ++ return -EFAULT; ++ return 0; ++ ++ case SIOCGMIIPHY: ++ case SIOCGMIIREG: ++ case SIOCSMIIREG: ++ return phy_mii_ioctl(sp->phy_dev, data, cmd); ++ ++ default: ++ break; ++ } ++ ++ return -EOPNOTSUPP; ++} ++ ++static void ar231x_adjust_link(struct net_device *dev) ++{ ++ struct ar231x_private *sp = netdev_priv(dev); ++ unsigned int mc; ++ ++ if (!sp->phy_dev->link) ++ return; ++ ++ if (sp->phy_dev->duplex != sp->oldduplex) { ++ mc = readl(&sp->eth_regs->mac_control); ++ mc &= ~(MAC_CONTROL_F | MAC_CONTROL_DRO); ++ if (sp->phy_dev->duplex) ++ mc |= MAC_CONTROL_F; ++ else ++ mc |= MAC_CONTROL_DRO; ++ writel(mc, &sp->eth_regs->mac_control); ++ sp->oldduplex = sp->phy_dev->duplex; ++ } ++} ++ ++#define MII_ADDR(phy, reg) \ ++ ((reg << MII_ADDR_REG_SHIFT) | (phy << MII_ADDR_PHY_SHIFT)) ++ ++static int ++ar231x_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) ++{ ++ struct net_device *const dev = bus->priv; ++ struct ar231x_private *sp = netdev_priv(dev); ++ volatile ETHERNET_STRUCT *ethernet = sp->phy_regs; ++ ++ ethernet->mii_addr = MII_ADDR(phy_addr, regnum); ++ while (ethernet->mii_addr & MII_ADDR_BUSY); ++ return (ethernet->mii_data >> MII_DATA_SHIFT); ++} ++ ++static int ++ar231x_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, ++ u16 value) ++{ ++ struct net_device *const dev = bus->priv; ++ struct ar231x_private *sp = netdev_priv(dev); ++ volatile ETHERNET_STRUCT *ethernet = sp->phy_regs; ++ ++ while (ethernet->mii_addr & MII_ADDR_BUSY); ++ ethernet->mii_data = value << MII_DATA_SHIFT; ++ ethernet->mii_addr = MII_ADDR(phy_addr, regnum) | MII_ADDR_WRITE; ++ ++ return 0; ++} ++ ++static int ar231x_mdiobus_reset(struct mii_bus *bus) ++{ ++ struct net_device *const dev = bus->priv; ++ ++ ar231x_reset_reg(dev); ++ ++ return 0; ++} ++ ++static int ar231x_mdiobus_probe (struct net_device *dev) ++{ ++ struct ar231x_private *const sp = netdev_priv(dev); ++ struct phy_device *phydev = NULL; ++ int phy_addr; ++ ++ /* find the first (lowest address) PHY on the current MAC's MII bus */ ++ for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) ++ if (sp->mii_bus->phy_map[phy_addr]) { ++ phydev = sp->mii_bus->phy_map[phy_addr]; ++ sp->phy = phy_addr; ++ break; /* break out with first one found */ ++ } ++ ++ if (!phydev) { ++ printk (KERN_ERR "ar231x: %s: no PHY found\n", dev->name); ++ return -1; ++ } ++ ++ /* now we are supposed to have a proper phydev, to attach to... */ ++ BUG_ON(!phydev); ++ BUG_ON(phydev->attached_dev); ++ ++ phydev = phy_connect(dev, dev_name(&phydev->dev), &ar231x_adjust_link, 0, ++ PHY_INTERFACE_MODE_MII); ++ ++ if (IS_ERR(phydev)) { ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ return PTR_ERR(phydev); ++ } ++ ++ /* mask with MAC supported features */ ++ phydev->supported &= (SUPPORTED_10baseT_Half ++ | SUPPORTED_10baseT_Full ++ | SUPPORTED_100baseT_Half ++ | SUPPORTED_100baseT_Full ++ | SUPPORTED_Autoneg ++ /* | SUPPORTED_Pause | SUPPORTED_Asym_Pause */ ++ | SUPPORTED_MII ++ | SUPPORTED_TP); ++ ++ phydev->advertising = phydev->supported; ++ ++ sp->oldduplex = -1; ++ sp->phy_dev = phydev; ++ ++ printk(KERN_INFO "%s: attached PHY driver [%s] " ++ "(mii_bus:phy_addr=%s)\n", ++ dev->name, phydev->drv->name, dev_name(&phydev->dev)); ++ ++ return 0; ++} ++ +Index: linux-2.6.32.7/drivers/net/ar231x.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/drivers/net/ar231x.h 2010-02-03 17:00:35.874430230 +0100 +@@ -0,0 +1,302 @@ ++/* ++ * ar231x.h: Linux driver for the Atheros AR231x Ethernet device. ++ * ++ * Copyright (C) 2004 by Sameer Dekate ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006-2009 Felix Fietkau ++ * ++ * Thanks to Atheros for providing hardware and documentation ++ * enabling me to write this driver. ++ * ++ * 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. ++ */ ++ ++#ifndef _AR2313_H_ ++#define _AR2313_H_ ++ ++#include ++#include ++#include ++#include ++ ++/* ++ * probe link timer - 5 secs ++ */ ++#define LINK_TIMER (5*HZ) ++ ++#define IS_DMA_TX_INT(X) (((X) & (DMA_STATUS_TI)) != 0) ++#define IS_DMA_RX_INT(X) (((X) & (DMA_STATUS_RI)) != 0) ++#define IS_DRIVER_OWNED(X) (((X) & (DMA_TX_OWN)) == 0) ++ ++#define AR2313_TX_TIMEOUT (HZ/4) ++ ++/* ++ * Rings ++ */ ++#define DSC_RING_ENTRIES_SIZE (AR2313_DESCR_ENTRIES * sizeof(struct desc)) ++#define DSC_NEXT(idx) ((idx + 1) & (AR2313_DESCR_ENTRIES - 1)) ++ ++#define AR2313_MBGET 2 ++#define AR2313_MBSET 3 ++#define AR2313_PCI_RECONFIG 4 ++#define AR2313_PCI_DUMP 5 ++#define AR2313_TEST_PANIC 6 ++#define AR2313_TEST_NULLPTR 7 ++#define AR2313_READ_DATA 8 ++#define AR2313_WRITE_DATA 9 ++#define AR2313_GET_VERSION 10 ++#define AR2313_TEST_HANG 11 ++#define AR2313_SYNC 12 ++ ++#define DMA_RX_ERR_CRC BIT(1) ++#define DMA_RX_ERR_DRIB BIT(2) ++#define DMA_RX_ERR_MII BIT(3) ++#define DMA_RX_EV2 BIT(5) ++#define DMA_RX_ERR_COL BIT(6) ++#define DMA_RX_LONG BIT(7) ++#define DMA_RX_LS BIT(8) /* last descriptor */ ++#define DMA_RX_FS BIT(9) /* first descriptor */ ++#define DMA_RX_MF BIT(10) /* multicast frame */ ++#define DMA_RX_ERR_RUNT BIT(11) /* runt frame */ ++#define DMA_RX_ERR_LENGTH BIT(12) /* length error */ ++#define DMA_RX_ERR_DESC BIT(14) /* descriptor error */ ++#define DMA_RX_ERROR BIT(15) /* error summary */ ++#define DMA_RX_LEN_MASK 0x3fff0000 ++#define DMA_RX_LEN_SHIFT 16 ++#define DMA_RX_FILT BIT(30) ++#define DMA_RX_OWN BIT(31) /* desc owned by DMA controller */ ++ ++#define DMA_RX1_BSIZE_MASK 0x000007ff ++#define DMA_RX1_BSIZE_SHIFT 0 ++#define DMA_RX1_CHAINED BIT(24) ++#define DMA_RX1_RER BIT(25) ++ ++#define DMA_TX_ERR_UNDER BIT(1) /* underflow error */ ++#define DMA_TX_ERR_DEFER BIT(2) /* excessive deferral */ ++#define DMA_TX_COL_MASK 0x78 ++#define DMA_TX_COL_SHIFT 3 ++#define DMA_TX_ERR_HB BIT(7) /* hearbeat failure */ ++#define DMA_TX_ERR_COL BIT(8) /* excessive collisions */ ++#define DMA_TX_ERR_LATE BIT(9) /* late collision */ ++#define DMA_TX_ERR_LINK BIT(10) /* no carrier */ ++#define DMA_TX_ERR_LOSS BIT(11) /* loss of carrier */ ++#define DMA_TX_ERR_JABBER BIT(14) /* transmit jabber timeout */ ++#define DMA_TX_ERROR BIT(15) /* frame aborted */ ++#define DMA_TX_OWN BIT(31) /* descr owned by DMA controller */ ++ ++#define DMA_TX1_BSIZE_MASK 0x000007ff ++#define DMA_TX1_BSIZE_SHIFT 0 ++#define DMA_TX1_CHAINED BIT(24) /* chained descriptors */ ++#define DMA_TX1_TER BIT(25) /* transmit end of ring */ ++#define DMA_TX1_FS BIT(29) /* first segment */ ++#define DMA_TX1_LS BIT(30) /* last segment */ ++#define DMA_TX1_IC BIT(31) /* interrupt on completion */ ++ ++#define RCVPKT_LENGTH(X) (X >> 16) /* Received pkt Length */ ++ ++#define MAC_CONTROL_RE BIT(2) /* receive enable */ ++#define MAC_CONTROL_TE BIT(3) /* transmit enable */ ++#define MAC_CONTROL_DC BIT(5) /* Deferral check */ ++#define MAC_CONTROL_ASTP BIT(8) /* Auto pad strip */ ++#define MAC_CONTROL_DRTY BIT(10) /* Disable retry */ ++#define MAC_CONTROL_DBF BIT(11) /* Disable bcast frames */ ++#define MAC_CONTROL_LCC BIT(12) /* late collision ctrl */ ++#define MAC_CONTROL_HP BIT(13) /* Hash Perfect filtering */ ++#define MAC_CONTROL_HASH BIT(14) /* Unicast hash filtering */ ++#define MAC_CONTROL_HO BIT(15) /* Hash only filtering */ ++#define MAC_CONTROL_PB BIT(16) /* Pass Bad frames */ ++#define MAC_CONTROL_IF BIT(17) /* Inverse filtering */ ++#define MAC_CONTROL_PR BIT(18) /* promiscuous mode (valid frames only) */ ++#define MAC_CONTROL_PM BIT(19) /* pass multicast */ ++#define MAC_CONTROL_F BIT(20) /* full-duplex */ ++#define MAC_CONTROL_DRO BIT(23) /* Disable Receive Own */ ++#define MAC_CONTROL_HBD BIT(28) /* heart-beat disabled (MUST BE SET) */ ++#define MAC_CONTROL_BLE BIT(30) /* big endian mode */ ++#define MAC_CONTROL_RA BIT(31) /* receive all (valid and invalid frames) */ ++ ++#define MII_ADDR_BUSY BIT(0) ++#define MII_ADDR_WRITE BIT(1) ++#define MII_ADDR_REG_SHIFT 6 ++#define MII_ADDR_PHY_SHIFT 11 ++#define MII_DATA_SHIFT 0 ++ ++#define FLOW_CONTROL_FCE BIT(1) ++ ++#define DMA_BUS_MODE_SWR BIT(0) /* software reset */ ++#define DMA_BUS_MODE_BLE BIT(7) /* big endian mode */ ++#define DMA_BUS_MODE_PBL_SHIFT 8 /* programmable burst length 32 */ ++#define DMA_BUS_MODE_DBO BIT(20) /* big-endian descriptors */ ++ ++#define DMA_STATUS_TI BIT(0) /* transmit interrupt */ ++#define DMA_STATUS_TPS BIT(1) /* transmit process stopped */ ++#define DMA_STATUS_TU BIT(2) /* transmit buffer unavailable */ ++#define DMA_STATUS_TJT BIT(3) /* transmit buffer timeout */ ++#define DMA_STATUS_UNF BIT(5) /* transmit underflow */ ++#define DMA_STATUS_RI BIT(6) /* receive interrupt */ ++#define DMA_STATUS_RU BIT(7) /* receive buffer unavailable */ ++#define DMA_STATUS_RPS BIT(8) /* receive process stopped */ ++#define DMA_STATUS_ETI BIT(10) /* early transmit interrupt */ ++#define DMA_STATUS_FBE BIT(13) /* fatal bus interrupt */ ++#define DMA_STATUS_ERI BIT(14) /* early receive interrupt */ ++#define DMA_STATUS_AIS BIT(15) /* abnormal interrupt summary */ ++#define DMA_STATUS_NIS BIT(16) /* normal interrupt summary */ ++#define DMA_STATUS_RS_SHIFT 17 /* receive process state */ ++#define DMA_STATUS_TS_SHIFT 20 /* transmit process state */ ++#define DMA_STATUS_EB_SHIFT 23 /* error bits */ ++ ++#define DMA_CONTROL_SR BIT(1) /* start receive */ ++#define DMA_CONTROL_ST BIT(13) /* start transmit */ ++#define DMA_CONTROL_SF BIT(21) /* store and forward */ ++ ++ ++typedef struct { ++ volatile unsigned int status; // OWN, Device control and status. ++ volatile unsigned int devcs; // pkt Control bits + Length ++ volatile unsigned int addr; // Current Address. ++ volatile unsigned int descr; // Next descriptor in chain. ++} ar231x_descr_t; ++ ++ ++ ++// ++// New Combo structure for Both Eth0 AND eth1 ++// ++typedef struct { ++ volatile unsigned int mac_control; /* 0x00 */ ++ volatile unsigned int mac_addr[2]; /* 0x04 - 0x08 */ ++ volatile unsigned int mcast_table[2]; /* 0x0c - 0x10 */ ++ volatile unsigned int mii_addr; /* 0x14 */ ++ volatile unsigned int mii_data; /* 0x18 */ ++ volatile unsigned int flow_control; /* 0x1c */ ++ volatile unsigned int vlan_tag; /* 0x20 */ ++ volatile unsigned int pad[7]; /* 0x24 - 0x3c */ ++ volatile unsigned int ucast_table[8]; /* 0x40-0x5c */ ++ ++} ETHERNET_STRUCT; ++ ++/******************************************************************** ++ * Interrupt controller ++ ********************************************************************/ ++ ++typedef struct { ++ volatile unsigned int wdog_control; /* 0x08 */ ++ volatile unsigned int wdog_timer; /* 0x0c */ ++ volatile unsigned int misc_status; /* 0x10 */ ++ volatile unsigned int misc_mask; /* 0x14 */ ++ volatile unsigned int global_status; /* 0x18 */ ++ volatile unsigned int reserved; /* 0x1c */ ++ volatile unsigned int reset_control; /* 0x20 */ ++} INTERRUPT; ++ ++/******************************************************************** ++ * DMA controller ++ ********************************************************************/ ++typedef struct { ++ volatile unsigned int bus_mode; /* 0x00 (CSR0) */ ++ volatile unsigned int xmt_poll; /* 0x04 (CSR1) */ ++ volatile unsigned int rcv_poll; /* 0x08 (CSR2) */ ++ volatile unsigned int rcv_base; /* 0x0c (CSR3) */ ++ volatile unsigned int xmt_base; /* 0x10 (CSR4) */ ++ volatile unsigned int status; /* 0x14 (CSR5) */ ++ volatile unsigned int control; /* 0x18 (CSR6) */ ++ volatile unsigned int intr_ena; /* 0x1c (CSR7) */ ++ volatile unsigned int rcv_missed; /* 0x20 (CSR8) */ ++ volatile unsigned int reserved[11]; /* 0x24-0x4c (CSR9-19) */ ++ volatile unsigned int cur_tx_buf_addr; /* 0x50 (CSR20) */ ++ volatile unsigned int cur_rx_buf_addr; /* 0x50 (CSR21) */ ++} DMA; ++ ++/* ++ * Struct private for the Sibyte. ++ * ++ * Elements are grouped so variables used by the tx handling goes ++ * together, and will go into the same cache lines etc. in order to ++ * avoid cache line contention between the rx and tx handling on SMP. ++ * ++ * Frequently accessed variables are put at the beginning of the ++ * struct to help the compiler generate better/shorter code. ++ */ ++struct ar231x_private { ++ struct net_device *dev; ++ int version; ++ u32 mb[2]; ++ ++ volatile ETHERNET_STRUCT *phy_regs; ++ volatile ETHERNET_STRUCT *eth_regs; ++ volatile DMA *dma_regs; ++ volatile u32 *int_regs; ++ struct ar231x_eth *cfg; ++ ++ spinlock_t lock; /* Serialise access to device */ ++ ++ /* ++ * RX and TX descriptors, must be adjacent ++ */ ++ ar231x_descr_t *rx_ring; ++ ar231x_descr_t *tx_ring; ++ ++ ++ struct sk_buff **rx_skb; ++ struct sk_buff **tx_skb; ++ ++ /* ++ * RX elements ++ */ ++ u32 rx_skbprd; ++ u32 cur_rx; ++ ++ /* ++ * TX elements ++ */ ++ u32 tx_prd; ++ u32 tx_csm; ++ ++ /* ++ * Misc elements ++ */ ++ char name[48]; ++ struct { ++ u32 address; ++ u32 length; ++ char *mapping; ++ } desc; ++ ++ ++ struct timer_list link_timer; ++ unsigned short phy; /* merlot phy = 1, samsung phy = 0x1f */ ++ unsigned short mac; ++ unsigned short link; /* 0 - link down, 1 - link up */ ++ u16 phyData; ++ ++ struct tasklet_struct rx_tasklet; ++ int unloading; ++ ++ struct phy_device *phy_dev; ++ struct mii_bus *mii_bus; ++ int oldduplex; ++}; ++ ++ ++/* ++ * Prototypes ++ */ ++static int ar231x_init(struct net_device *dev); ++#ifdef TX_TIMEOUT ++static void ar231x_tx_timeout(struct net_device *dev); ++#endif ++static int ar231x_restart(struct net_device *dev); ++static void ar231x_load_rx_ring(struct net_device *dev, int bufs); ++static irqreturn_t ar231x_interrupt(int irq, void *dev_id); ++static int ar231x_open(struct net_device *dev); ++static int ar231x_start_xmit(struct sk_buff *skb, struct net_device *dev); ++static int ar231x_close(struct net_device *dev); ++static int ar231x_ioctl(struct net_device *dev, struct ifreq *ifr, ++ int cmd); ++static void ar231x_init_cleanup(struct net_device *dev); ++static int ar231x_setup_timer(struct net_device *dev); ++static void ar231x_link_timer_fn(unsigned long data); ++static void ar231x_check_link(struct net_device *dev); ++#endif /* _AR2313_H_ */ diff --git a/target/linux/atheros/patches-2.6.32/120-spiflash.patch b/target/linux/atheros/patches-2.6.32/120-spiflash.patch new file mode 100644 index 000000000..7b6dc658d --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/120-spiflash.patch @@ -0,0 +1,667 @@ +Index: linux-2.6.32.7/drivers/mtd/devices/Kconfig +=================================================================== +--- linux-2.6.32.7.orig/drivers/mtd/devices/Kconfig 2010-01-29 00:06:20.000000000 +0100 ++++ linux-2.6.32.7/drivers/mtd/devices/Kconfig 2010-02-03 17:01:08.858429535 +0100 +@@ -114,6 +114,10 @@ + Set up your spi devices with the right board-specific platform data, + if you want to specify device partitioning. + ++config MTD_AR2315 ++ tristate "Atheros AR2315+ SPI Flash support" ++ depends on ATHEROS_AR2315 ++ + config MTD_SLRAM + tristate "Uncached system RAM" + help +Index: linux-2.6.32.7/drivers/mtd/devices/Makefile +=================================================================== +--- linux-2.6.32.7.orig/drivers/mtd/devices/Makefile 2010-01-29 00:06:20.000000000 +0100 ++++ linux-2.6.32.7/drivers/mtd/devices/Makefile 2010-02-03 17:01:30.282430590 +0100 +@@ -17,3 +17,4 @@ + obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataflash.o + obj-$(CONFIG_MTD_M25P80) += m25p80.o + obj-$(CONFIG_MTD_SST25L) += sst25l.o ++obj-$(CONFIG_MTD_AR2315) += ar2315.o +Index: linux-2.6.32.7/drivers/mtd/devices/ar2315.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/drivers/mtd/devices/ar2315.c 2010-02-03 17:01:08.858429535 +0100 +@@ -0,0 +1,517 @@ ++ ++/* ++ * MTD driver for the SPI Flash Memory support on Atheros AR2315 ++ * ++ * Copyright (c) 2005-2006 Atheros Communications Inc. ++ * Copyright (C) 2006-2007 FON Technology, SL. ++ * Copyright (C) 2006-2007 Imre Kaloz ++ * Copyright (C) 2006-2009 Felix Fietkau ++ * ++ * This code is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++ ++#define SPIFLASH "spiflash: " ++#define busy_wait(_priv, _condition, _wait) do { \ ++ while (_condition) { \ ++ spin_unlock_bh(&_priv->lock); \ ++ if (_wait > 1) \ ++ msleep(_wait); \ ++ else if ((_wait == 1) && need_resched()) \ ++ schedule(); \ ++ else \ ++ udelay(1); \ ++ spin_lock_bh(&_priv->lock); \ ++ } \ ++} while (0) ++ ++enum { ++ FLASH_NONE, ++ FLASH_1MB, ++ FLASH_2MB, ++ FLASH_4MB, ++ FLASH_8MB, ++ FLASH_16MB, ++}; ++ ++/* Flash configuration table */ ++struct flashconfig { ++ u32 byte_cnt; ++ u32 sector_cnt; ++ u32 sector_size; ++}; ++ ++const struct flashconfig flashconfig_tbl[] = { ++ [FLASH_NONE] = { 0, 0, 0}, ++ [FLASH_1MB] = { STM_1MB_BYTE_COUNT, STM_1MB_SECTOR_COUNT, STM_1MB_SECTOR_SIZE}, ++ [FLASH_2MB] = { STM_2MB_BYTE_COUNT, STM_2MB_SECTOR_COUNT, STM_2MB_SECTOR_SIZE}, ++ [FLASH_4MB] = { STM_4MB_BYTE_COUNT, STM_4MB_SECTOR_COUNT, STM_4MB_SECTOR_SIZE}, ++ [FLASH_8MB] = { STM_8MB_BYTE_COUNT, STM_8MB_SECTOR_COUNT, STM_8MB_SECTOR_SIZE}, ++ [FLASH_16MB] = { STM_16MB_BYTE_COUNT, STM_16MB_SECTOR_COUNT, STM_16MB_SECTOR_SIZE} ++}; ++ ++/* Mapping of generic opcodes to STM serial flash opcodes */ ++enum { ++ SPI_WRITE_ENABLE, ++ SPI_WRITE_DISABLE, ++ SPI_RD_STATUS, ++ SPI_WR_STATUS, ++ SPI_RD_DATA, ++ SPI_FAST_RD_DATA, ++ SPI_PAGE_PROGRAM, ++ SPI_SECTOR_ERASE, ++ SPI_BULK_ERASE, ++ SPI_DEEP_PWRDOWN, ++ SPI_RD_SIG, ++}; ++ ++struct opcodes { ++ __u16 code; ++ __s8 tx_cnt; ++ __s8 rx_cnt; ++}; ++const struct opcodes stm_opcodes[] = { ++ [SPI_WRITE_ENABLE] = {STM_OP_WR_ENABLE, 1, 0}, ++ [SPI_WRITE_DISABLE] = {STM_OP_WR_DISABLE, 1, 0}, ++ [SPI_RD_STATUS] = {STM_OP_RD_STATUS, 1, 1}, ++ [SPI_WR_STATUS] = {STM_OP_WR_STATUS, 1, 0}, ++ [SPI_RD_DATA] = {STM_OP_RD_DATA, 4, 4}, ++ [SPI_FAST_RD_DATA] = {STM_OP_FAST_RD_DATA, 5, 0}, ++ [SPI_PAGE_PROGRAM] = {STM_OP_PAGE_PGRM, 8, 0}, ++ [SPI_SECTOR_ERASE] = {STM_OP_SECTOR_ERASE, 4, 0}, ++ [SPI_BULK_ERASE] = {STM_OP_BULK_ERASE, 1, 0}, ++ [SPI_DEEP_PWRDOWN] = {STM_OP_DEEP_PWRDOWN, 1, 0}, ++ [SPI_RD_SIG] = {STM_OP_RD_SIG, 4, 1}, ++}; ++ ++/* Driver private data structure */ ++struct spiflash_priv { ++ struct mtd_info mtd; ++ void *readaddr; /* memory mapped data for read */ ++ void *mmraddr; /* memory mapped register space */ ++ wait_queue_head_t wq; ++ spinlock_t lock; ++ int state; ++}; ++ ++#define to_spiflash(_mtd) container_of(_mtd, struct spiflash_priv, mtd) ++ ++enum { ++ FL_READY, ++ FL_READING, ++ FL_ERASING, ++ FL_WRITING ++}; ++ ++/***************************************************************************************************/ ++ ++static u32 ++spiflash_read_reg(struct spiflash_priv *priv, int reg) ++{ ++ return ar231x_read_reg((u32) priv->mmraddr + reg); ++} ++ ++static void ++spiflash_write_reg(struct spiflash_priv *priv, int reg, u32 data) ++{ ++ ar231x_write_reg((u32) priv->mmraddr + reg, data); ++} ++ ++static u32 ++spiflash_wait_busy(struct spiflash_priv *priv) ++{ ++ u32 reg; ++ ++ busy_wait(priv, (reg = spiflash_read_reg(priv, SPI_FLASH_CTL)) & ++ SPI_CTL_BUSY, 0); ++ return reg; ++} ++ ++static u32 ++spiflash_sendcmd (struct spiflash_priv *priv, int opcode, u32 addr) ++{ ++ const struct opcodes *op; ++ u32 reg, mask; ++ ++ op = &stm_opcodes[opcode]; ++ reg = spiflash_wait_busy(priv); ++ spiflash_write_reg(priv, SPI_FLASH_OPCODE, ++ ((u32) op->code) | (addr << 8)); ++ ++ reg &= ~SPI_CTL_TX_RX_CNT_MASK; ++ reg |= SPI_CTL_START | op->tx_cnt | (op->rx_cnt << 4); ++ ++ spiflash_write_reg(priv, SPI_FLASH_CTL, reg); ++ spiflash_wait_busy(priv); ++ ++ if (!op->rx_cnt) ++ return 0; ++ ++ reg = spiflash_read_reg(priv, SPI_FLASH_DATA); ++ ++ switch (op->rx_cnt) { ++ case 1: ++ mask = 0x000000ff; ++ break; ++ case 2: ++ mask = 0x0000ffff; ++ break; ++ case 3: ++ mask = 0x00ffffff; ++ break; ++ default: ++ mask = 0xffffffff; ++ break; ++ } ++ reg &= mask; ++ ++ return reg; ++} ++ ++ ++/* ++ * Probe SPI flash device ++ * Function returns 0 for failure. ++ * and flashconfig_tbl array index for success. ++ */ ++static int ++spiflash_probe_chip (struct spiflash_priv *priv) ++{ ++ u32 sig; ++ int flash_size; ++ ++ /* Read the signature on the flash device */ ++ spin_lock_bh(&priv->lock); ++ sig = spiflash_sendcmd(priv, SPI_RD_SIG, 0); ++ spin_unlock_bh(&priv->lock); ++ ++ switch (sig) { ++ case STM_8MBIT_SIGNATURE: ++ flash_size = FLASH_1MB; ++ break; ++ case STM_16MBIT_SIGNATURE: ++ flash_size = FLASH_2MB; ++ break; ++ case STM_32MBIT_SIGNATURE: ++ flash_size = FLASH_4MB; ++ break; ++ case STM_64MBIT_SIGNATURE: ++ flash_size = FLASH_8MB; ++ break; ++ case STM_128MBIT_SIGNATURE: ++ flash_size = FLASH_16MB; ++ break; ++ default: ++ printk (KERN_WARNING SPIFLASH "Read of flash device signature failed!\n"); ++ return 0; ++ } ++ ++ return flash_size; ++} ++ ++ ++/* wait until the flash chip is ready and grab a lock */ ++static int spiflash_wait_ready(struct spiflash_priv *priv, int state) ++{ ++ DECLARE_WAITQUEUE(wait, current); ++ ++retry: ++ spin_lock_bh(&priv->lock); ++ if (priv->state != FL_READY) { ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ add_wait_queue(&priv->wq, &wait); ++ spin_unlock_bh(&priv->lock); ++ schedule(); ++ remove_wait_queue(&priv->wq, &wait); ++ ++ if(signal_pending(current)) ++ return 0; ++ ++ goto retry; ++ } ++ priv->state = state; ++ ++ return 1; ++} ++ ++static inline void spiflash_done(struct spiflash_priv *priv) ++{ ++ priv->state = FL_READY; ++ spin_unlock_bh(&priv->lock); ++ wake_up(&priv->wq); ++} ++ ++static void ++spiflash_wait_complete(struct spiflash_priv *priv, unsigned int timeout) ++{ ++ busy_wait(priv, spiflash_sendcmd(priv, SPI_RD_STATUS, 0) & ++ SPI_STATUS_WIP, timeout); ++ spiflash_done(priv); ++} ++ ++ ++ ++static int ++spiflash_erase (struct mtd_info *mtd, struct erase_info *instr) ++{ ++ struct spiflash_priv *priv = to_spiflash(mtd); ++ const struct opcodes *op; ++ u32 temp, reg; ++ ++ if (instr->addr + instr->len > mtd->size) ++ return -EINVAL; ++ ++ if (!spiflash_wait_ready(priv, FL_ERASING)) ++ return -EINTR; ++ ++ spiflash_sendcmd(priv, SPI_WRITE_ENABLE, 0); ++ reg = spiflash_wait_busy(priv); ++ ++ op = &stm_opcodes[SPI_SECTOR_ERASE]; ++ temp = ((u32)instr->addr << 8) | (u32)(op->code); ++ spiflash_write_reg(priv, SPI_FLASH_OPCODE, temp); ++ ++ reg &= ~SPI_CTL_TX_RX_CNT_MASK; ++ reg |= op->tx_cnt | SPI_CTL_START; ++ spiflash_write_reg(priv, SPI_FLASH_CTL, reg); ++ ++ spiflash_wait_complete(priv, 20); ++ ++ instr->state = MTD_ERASE_DONE; ++ mtd_erase_callback(instr); ++ ++ return 0; ++} ++ ++static int ++spiflash_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) ++{ ++ struct spiflash_priv *priv = to_spiflash(mtd); ++ u8 *read_addr; ++ ++ if (!len) ++ return 0; ++ ++ if (from + len > mtd->size) ++ return -EINVAL; ++ ++ *retlen = len; ++ ++ if (!spiflash_wait_ready(priv, FL_READING)) ++ return -EINTR; ++ ++ read_addr = (u8 *)(priv->readaddr + from); ++ memcpy_fromio(buf, read_addr, len); ++ spiflash_done(priv); ++ ++ return 0; ++} ++ ++static int ++spiflash_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u8 *buf) ++{ ++ struct spiflash_priv *priv = to_spiflash(mtd); ++ u32 opcode, bytes_left; ++ ++ *retlen = 0; ++ ++ if (!len) ++ return 0; ++ ++ if (to + len > mtd->size) ++ return -EINVAL; ++ ++ bytes_left = len; ++ ++ do { ++ u32 read_len, reg, page_offset, spi_data = 0; ++ ++ read_len = min(bytes_left, sizeof(u32)); ++ ++ /* 32-bit writes cannot span across a page boundary ++ * (256 bytes). This types of writes require two page ++ * program operations to handle it correctly. The STM part ++ * will write the overflow data to the beginning of the ++ * current page as opposed to the subsequent page. ++ */ ++ page_offset = (to & (STM_PAGE_SIZE - 1)) + read_len; ++ ++ if (page_offset > STM_PAGE_SIZE) ++ read_len -= (page_offset - STM_PAGE_SIZE); ++ ++ if (!spiflash_wait_ready(priv, FL_WRITING)) ++ return -EINTR; ++ ++ spiflash_sendcmd(priv, SPI_WRITE_ENABLE, 0); ++ spi_data = 0; ++ switch (read_len) { ++ case 4: ++ spi_data |= buf[3] << 24; ++ /* fall through */ ++ case 3: ++ spi_data |= buf[2] << 16; ++ /* fall through */ ++ case 2: ++ spi_data |= buf[1] << 8; ++ /* fall through */ ++ case 1: ++ spi_data |= buf[0] & 0xff; ++ break; ++ default: ++ break; ++ } ++ ++ spiflash_write_reg(priv, SPI_FLASH_DATA, spi_data); ++ opcode = stm_opcodes[SPI_PAGE_PROGRAM].code | ++ (to & 0x00ffffff) << 8; ++ spiflash_write_reg(priv, SPI_FLASH_OPCODE, opcode); ++ ++ reg = spiflash_read_reg(priv, SPI_FLASH_CTL); ++ reg &= ~SPI_CTL_TX_RX_CNT_MASK; ++ reg |= (read_len + 4) | SPI_CTL_START; ++ spiflash_write_reg(priv, SPI_FLASH_CTL, reg); ++ ++ spiflash_wait_complete(priv, 1); ++ ++ bytes_left -= read_len; ++ to += read_len; ++ buf += read_len; ++ ++ *retlen += read_len; ++ } while (bytes_left != 0); ++ ++ return 0; ++} ++ ++ ++#ifdef CONFIG_MTD_PARTITIONS ++static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "MyLoader", NULL }; ++#endif ++ ++ ++static int ++spiflash_probe(struct platform_device *pdev) ++{ ++ struct spiflash_priv *priv; ++ struct mtd_partition *parts; ++ struct mtd_info *mtd; ++ int index, num_parts; ++ int result = 0; ++ ++ priv = kzalloc(sizeof(struct spiflash_priv), GFP_KERNEL); ++ spin_lock_init(&priv->lock); ++ init_waitqueue_head(&priv->wq); ++ priv->state = FL_READY; ++ mtd = &priv->mtd; ++ ++ priv->mmraddr = ioremap_nocache(SPI_FLASH_MMR, SPI_FLASH_MMR_SIZE); ++ if (!priv->mmraddr) { ++ printk(KERN_WARNING SPIFLASH "Failed to map flash device\n"); ++ goto error; ++ } ++ ++ index = spiflash_probe_chip(priv); ++ if (!index) { ++ printk (KERN_WARNING SPIFLASH "Found no serial flash device\n"); ++ goto error; ++ } ++ ++ priv->readaddr = ioremap_nocache(SPI_FLASH_READ, flashconfig_tbl[index].byte_cnt); ++ if (!priv->readaddr) { ++ printk (KERN_WARNING SPIFLASH "Failed to map flash device\n"); ++ goto error; ++ } ++ ++ platform_set_drvdata(pdev, priv); ++ mtd->name = "spiflash"; ++ mtd->type = MTD_NORFLASH; ++ mtd->flags = (MTD_CAP_NORFLASH|MTD_WRITEABLE); ++ mtd->size = flashconfig_tbl[index].byte_cnt; ++ mtd->erasesize = flashconfig_tbl[index].sector_size; ++ mtd->writesize = 1; ++ mtd->numeraseregions = 0; ++ mtd->eraseregions = NULL; ++ mtd->erase = spiflash_erase; ++ mtd->read = spiflash_read; ++ mtd->write = spiflash_write; ++ mtd->owner = THIS_MODULE; ++ ++#ifdef CONFIG_MTD_PARTITIONS ++ /* parse redboot partitions */ ++ num_parts = parse_mtd_partitions(mtd, part_probe_types, &parts, 0); ++ if (!num_parts) ++ goto error; ++ ++ result = add_mtd_partitions(mtd, parts, num_parts); ++#endif ++ ++ return result; ++ ++error: ++ if (priv->mmraddr) ++ iounmap(priv->mmraddr); ++ kfree(priv); ++ return -ENXIO; ++} ++ ++static int ++spiflash_remove (struct platform_device *pdev) ++{ ++ struct spiflash_priv *priv = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = &priv->mtd; ++ ++ del_mtd_partitions(mtd); ++ iounmap(priv->mmraddr); ++ iounmap(priv->readaddr); ++ kfree(priv); ++ ++ return 0; ++} ++ ++struct platform_driver spiflash_driver = { ++ .driver.name = "spiflash", ++ .probe = spiflash_probe, ++ .remove = spiflash_remove, ++}; ++ ++int __init ++spiflash_init (void) ++{ ++ return platform_driver_register(&spiflash_driver); ++} ++ ++void __exit ++spiflash_exit (void) ++{ ++ return platform_driver_unregister(&spiflash_driver); ++} ++ ++module_init (spiflash_init); ++module_exit (spiflash_exit); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("OpenWrt.org, Atheros Communications Inc"); ++MODULE_DESCRIPTION("MTD driver for SPI Flash on Atheros SOC"); ++ +Index: linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar2315_spiflash.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/include/asm/mach-ar231x/ar2315_spiflash.h 2010-02-03 17:01:08.858429535 +0100 +@@ -0,0 +1,116 @@ ++/* ++ * SPI Flash Memory support header file. ++ * ++ * Copyright (c) 2005, Atheros Communications Inc. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz ++ * Copyright (C) 2006-2009 Felix Fietkau ++ * ++ * This code is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++#ifndef __AR2315_SPIFLASH_H ++#define __AR2315_SPIFLASH_H ++ ++#define STM_PAGE_SIZE 256 ++ ++#define SFI_WRITE_BUFFER_SIZE 4 ++#define SFI_FLASH_ADDR_MASK 0x00ffffff ++ ++#define STM_8MBIT_SIGNATURE 0x13 ++#define STM_M25P80_BYTE_COUNT 1048576 ++#define STM_M25P80_SECTOR_COUNT 16 ++#define STM_M25P80_SECTOR_SIZE 0x10000 ++ ++#define STM_16MBIT_SIGNATURE 0x14 ++#define STM_M25P16_BYTE_COUNT 2097152 ++#define STM_M25P16_SECTOR_COUNT 32 ++#define STM_M25P16_SECTOR_SIZE 0x10000 ++ ++#define STM_32MBIT_SIGNATURE 0x15 ++#define STM_M25P32_BYTE_COUNT 4194304 ++#define STM_M25P32_SECTOR_COUNT 64 ++#define STM_M25P32_SECTOR_SIZE 0x10000 ++ ++#define STM_64MBIT_SIGNATURE 0x16 ++#define STM_M25P64_BYTE_COUNT 8388608 ++#define STM_M25P64_SECTOR_COUNT 128 ++#define STM_M25P64_SECTOR_SIZE 0x10000 ++ ++#define STM_128MBIT_SIGNATURE 0x17 ++#define STM_M25P128_BYTE_COUNT 16777216 ++#define STM_M25P128_SECTOR_COUNT 256 ++#define STM_M25P128_SECTOR_SIZE 0x10000 ++ ++#define STM_1MB_BYTE_COUNT STM_M25P80_BYTE_COUNT ++#define STM_1MB_SECTOR_COUNT STM_M25P80_SECTOR_COUNT ++#define STM_1MB_SECTOR_SIZE STM_M25P80_SECTOR_SIZE ++#define STM_2MB_BYTE_COUNT STM_M25P16_BYTE_COUNT ++#define STM_2MB_SECTOR_COUNT STM_M25P16_SECTOR_COUNT ++#define STM_2MB_SECTOR_SIZE STM_M25P16_SECTOR_SIZE ++#define STM_4MB_BYTE_COUNT STM_M25P32_BYTE_COUNT ++#define STM_4MB_SECTOR_COUNT STM_M25P32_SECTOR_COUNT ++#define STM_4MB_SECTOR_SIZE STM_M25P32_SECTOR_SIZE ++#define STM_8MB_BYTE_COUNT STM_M25P64_BYTE_COUNT ++#define STM_8MB_SECTOR_COUNT STM_M25P64_SECTOR_COUNT ++#define STM_8MB_SECTOR_SIZE STM_M25P64_SECTOR_SIZE ++#define STM_16MB_BYTE_COUNT STM_M25P128_BYTE_COUNT ++#define STM_16MB_SECTOR_COUNT STM_M25P128_SECTOR_COUNT ++#define STM_16MB_SECTOR_SIZE STM_M25P128_SECTOR_SIZE ++ ++/* ++ * ST Microelectronics Opcodes for Serial Flash ++ */ ++ ++#define STM_OP_WR_ENABLE 0x06 /* Write Enable */ ++#define STM_OP_WR_DISABLE 0x04 /* Write Disable */ ++#define STM_OP_RD_STATUS 0x05 /* Read Status */ ++#define STM_OP_WR_STATUS 0x01 /* Write Status */ ++#define STM_OP_RD_DATA 0x03 /* Read Data */ ++#define STM_OP_FAST_RD_DATA 0x0b /* Fast Read Data */ ++#define STM_OP_PAGE_PGRM 0x02 /* Page Program */ ++#define STM_OP_SECTOR_ERASE 0xd8 /* Sector Erase */ ++#define STM_OP_BULK_ERASE 0xc7 /* Bulk Erase */ ++#define STM_OP_DEEP_PWRDOWN 0xb9 /* Deep Power-Down Mode */ ++#define STM_OP_RD_SIG 0xab /* Read Electronic Signature */ ++ ++#define STM_STATUS_WIP 0x01 /* Write-In-Progress */ ++#define STM_STATUS_WEL 0x02 /* Write Enable Latch */ ++#define STM_STATUS_BP0 0x04 /* Block Protect 0 */ ++#define STM_STATUS_BP1 0x08 /* Block Protect 1 */ ++#define STM_STATUS_BP2 0x10 /* Block Protect 2 */ ++#define STM_STATUS_SRWD 0x80 /* Status Register Write Disable */ ++ ++/* ++ * SPI Flash Interface Registers ++ */ ++#define AR531XPLUS_SPI_READ 0x08000000 ++#define AR531XPLUS_SPI_MMR 0x11300000 ++#define AR531XPLUS_SPI_MMR_SIZE 12 ++ ++#define AR531XPLUS_SPI_CTL 0x00 ++#define AR531XPLUS_SPI_OPCODE 0x04 ++#define AR531XPLUS_SPI_DATA 0x08 ++ ++#define SPI_FLASH_READ AR531XPLUS_SPI_READ ++#define SPI_FLASH_MMR AR531XPLUS_SPI_MMR ++#define SPI_FLASH_MMR_SIZE AR531XPLUS_SPI_MMR_SIZE ++#define SPI_FLASH_CTL AR531XPLUS_SPI_CTL ++#define SPI_FLASH_OPCODE AR531XPLUS_SPI_OPCODE ++#define SPI_FLASH_DATA AR531XPLUS_SPI_DATA ++ ++#define SPI_CTL_START 0x00000100 ++#define SPI_CTL_BUSY 0x00010000 ++#define SPI_CTL_TXCNT_MASK 0x0000000f ++#define SPI_CTL_RXCNT_MASK 0x000000f0 ++#define SPI_CTL_TX_RX_CNT_MASK 0x000000ff ++#define SPI_CTL_SIZE_MASK 0x00060000 ++ ++#define SPI_CTL_CLK_SEL_MASK 0x03000000 ++#define SPI_OPCODE_MASK 0x000000ff ++ ++#define SPI_STATUS_WIP STM_STATUS_WIP ++ ++#endif diff --git a/target/linux/atheros/patches-2.6.32/130-watchdog.patch b/target/linux/atheros/patches-2.6.32/130-watchdog.patch new file mode 100644 index 000000000..0b917dd52 --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/130-watchdog.patch @@ -0,0 +1,234 @@ +Index: linux-2.6.32.7/drivers/watchdog/ar2315-wtd.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/drivers/watchdog/ar2315-wtd.c 2010-02-03 17:01:46.074429108 +0100 +@@ -0,0 +1,200 @@ ++/* ++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Copyright (C) 2008 John Crispin ++ * Based on EP93xx and ifxmips wdt driver ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define CLOCK_RATE 40000000 ++#define HEARTBEAT(x) (x < 1 || x > 90)?(20):(x) ++ ++static int wdt_timeout = 20; ++static int started = 0; ++static int in_use = 0; ++ ++static void ++ar2315_wdt_enable(void) ++{ ++ ar231x_write_reg(AR2315_WD, wdt_timeout * CLOCK_RATE); ++ ar231x_write_reg(AR2315_ISR, 0x80); ++} ++ ++static ssize_t ++ar2315_wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) ++{ ++ if(len) ++ ar2315_wdt_enable(); ++ return len; ++} ++ ++static int ++ar2315_wdt_open(struct inode *inode, struct file *file) ++{ ++ if(in_use) ++ return -EBUSY; ++ ar2315_wdt_enable(); ++ in_use = started = 1; ++ return nonseekable_open(inode, file); ++} ++ ++static int ++ar2315_wdt_release(struct inode *inode, struct file *file) ++{ ++ in_use = 0; ++ return 0; ++} ++ ++static irqreturn_t ++ar2315_wdt_interrupt(int irq, void *dev_id) ++{ ++ if(started) ++ { ++ printk(KERN_CRIT "watchdog expired, rebooting system\n"); ++ emergency_restart(); ++ } else { ++ ar231x_write_reg(AR2315_WDC, 0); ++ ar231x_write_reg(AR2315_WD, 0); ++ ar231x_write_reg(AR2315_ISR, 0x80); ++ } ++ return IRQ_HANDLED; ++} ++ ++static struct watchdog_info ident = { ++ .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, ++ .identity = "ar2315 Watchdog", ++}; ++ ++static int ++ar2315_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int new_wdt_timeout; ++ int ret = -ENOIOCTLCMD; ++ ++ switch(cmd) ++ { ++ case WDIOC_GETSUPPORT: ++ ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0; ++ break; ++ ++ case WDIOC_KEEPALIVE: ++ ar2315_wdt_enable(); ++ ret = 0; ++ break; ++ ++ case WDIOC_SETTIMEOUT: ++ if((ret = get_user(new_wdt_timeout, (int __user *)arg))) ++ break; ++ wdt_timeout = HEARTBEAT(new_wdt_timeout); ++ ar2315_wdt_enable(); ++ break; ++ ++ case WDIOC_GETTIMEOUT: ++ ret = put_user(wdt_timeout, (int __user *)arg); ++ break; ++ } ++ return ret; ++} ++ ++static struct file_operations ar2315_wdt_fops = { ++ .owner = THIS_MODULE, ++ .llseek = no_llseek, ++ .write = ar2315_wdt_write, ++ .ioctl = ar2315_wdt_ioctl, ++ .open = ar2315_wdt_open, ++ .release = ar2315_wdt_release, ++}; ++ ++static struct miscdevice ar2315_wdt_miscdev = { ++ .minor = WATCHDOG_MINOR, ++ .name = "watchdog", ++ .fops = &ar2315_wdt_fops, ++}; ++ ++static int ++ar2315_wdt_probe(struct platform_device *dev) ++{ ++ int ret = 0; ++ ++ ar2315_wdt_enable(); ++ ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, IRQF_DISABLED, "ar2315_wdt", NULL); ++ if(ret) ++ { ++ printk(KERN_ERR "ar2315wdt: failed to register inetrrupt\n"); ++ goto out; ++ } ++ ++ ret = misc_register(&ar2315_wdt_miscdev); ++ if(ret) ++ printk(KERN_ERR "ar2315wdt: failed to register miscdev\n"); ++ ++out: ++ return ret; ++} ++ ++static int ++ar2315_wdt_remove(struct platform_device *dev) ++{ ++ misc_deregister(&ar2315_wdt_miscdev); ++ free_irq(AR531X_MISC_IRQ_WATCHDOG, NULL); ++ return 0; ++} ++ ++static struct platform_driver ar2315_wdt_driver = { ++ .probe = ar2315_wdt_probe, ++ .remove = ar2315_wdt_remove, ++ .driver = { ++ .name = "ar2315_wdt", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init ++init_ar2315_wdt(void) ++{ ++ int ret = platform_driver_register(&ar2315_wdt_driver); ++ if(ret) ++ printk(KERN_INFO "ar2315_wdt: error registering platfom driver!"); ++ return ret; ++} ++ ++static void __exit ++exit_ar2315_wdt(void) ++{ ++ platform_driver_unregister(&ar2315_wdt_driver); ++} ++ ++module_init(init_ar2315_wdt); ++module_exit(exit_ar2315_wdt); +Index: linux-2.6.32.7/drivers/watchdog/Kconfig +=================================================================== +--- linux-2.6.32.7.orig/drivers/watchdog/Kconfig 2010-01-29 00:06:20.000000000 +0100 ++++ linux-2.6.32.7/drivers/watchdog/Kconfig 2010-02-03 17:01:46.078429135 +0100 +@@ -850,6 +850,12 @@ + help + Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs. + ++config ATHEROS_WDT ++ tristate "Atheros wisoc Watchdog Timer" ++ depends on ATHEROS_AR231X ++ help ++ Hardware driver for the Atheros wisoc Watchdog Timer. ++ + # PARISC Architecture + + # POWERPC Architecture +Index: linux-2.6.32.7/drivers/watchdog/Makefile +=================================================================== +--- linux-2.6.32.7.orig/drivers/watchdog/Makefile 2010-01-29 00:06:20.000000000 +0100 ++++ linux-2.6.32.7/drivers/watchdog/Makefile 2010-02-03 17:01:46.078429135 +0100 +@@ -113,6 +113,7 @@ + obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o + obj-$(CONFIG_AR7_WDT) += ar7_wdt.o + obj-$(CONFIG_TXX9_WDT) += txx9wdt.o ++obj-$(CONFIG_ATHEROS_WDT) += ar2315-wtd.o + + # PARISC Architecture + diff --git a/target/linux/ar71xx/patches-2.6.31/140-redboot_partition_scan.patch b/target/linux/atheros/patches-2.6.32/140-redboot_partition_scan.patch similarity index 80% rename from target/linux/ar71xx/patches-2.6.31/140-redboot_partition_scan.patch rename to target/linux/atheros/patches-2.6.32/140-redboot_partition_scan.patch index 289d4eb99..f42e64880 100644 --- a/target/linux/ar71xx/patches-2.6.31/140-redboot_partition_scan.patch +++ b/target/linux/atheros/patches-2.6.32/140-redboot_partition_scan.patch @@ -1,6 +1,8 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -60,31 +60,32 @@ static int parse_redboot_partitions(stru +Index: linux-2.6.32.7/drivers/mtd/redboot.c +=================================================================== +--- linux-2.6.32.7.orig/drivers/mtd/redboot.c 2010-02-03 16:57:31.582429139 +0100 ++++ linux-2.6.32.7/drivers/mtd/redboot.c 2010-02-03 17:01:57.067429178 +0100 +@@ -60,31 +60,32 @@ static char nullstring[] = "unallocated"; #endif @@ -40,7 +42,7 @@ printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n", master->name, offset); -@@ -156,6 +157,11 @@ static int parse_redboot_partitions(stru +@@ -156,6 +157,11 @@ } if (i == numslots) { /* Didn't find it */ diff --git a/target/linux/atheros/patches-2.6.32/200-ar2313_enable_mvswitch.patch b/target/linux/atheros/patches-2.6.32/200-ar2313_enable_mvswitch.patch new file mode 100644 index 000000000..ef7dd1ed6 --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/200-ar2313_enable_mvswitch.patch @@ -0,0 +1,74 @@ +Index: linux-2.6.32.7/drivers/net/ar231x.c +=================================================================== +--- linux-2.6.32.7.orig/drivers/net/ar231x.c 2010-02-03 17:00:35.874430230 +0100 ++++ linux-2.6.32.7/drivers/net/ar231x.c 2010-02-03 17:02:28.998430523 +0100 +@@ -735,6 +735,7 @@ + for (i = 0; i < nr_bufs; i++) { + struct sk_buff *skb; + ar231x_descr_t *rd; ++ int offset = RX_OFFSET; + + if (sp->rx_skb[idx]) + break; +@@ -750,7 +751,9 @@ + * Make sure IP header starts on a fresh cache line. + */ + skb->dev = dev; +- skb_reserve(skb, RX_OFFSET); ++ if (sp->phy_dev) ++ offset += sp->phy_dev->pkt_align; ++ skb_reserve(skb, offset); + sp->rx_skb[idx] = skb; + + rd = (ar231x_descr_t *) & sp->rx_ring[idx]; +@@ -824,20 +827,23 @@ + /* alloc new buffer. */ + skb_new = netdev_alloc_skb(dev, AR2313_BUFSIZE + RX_OFFSET); + if (skb_new != NULL) { ++ int offset; + + skb = sp->rx_skb[idx]; + /* set skb */ + skb_put(skb, + ((status >> DMA_RX_LEN_SHIFT) & 0x3fff) - CRC_LEN); +- + dev->stats.rx_bytes += skb->len; +- skb->protocol = eth_type_trans(skb, dev); +- /* pass the packet to upper layers */ +- netif_rx(skb); + ++ /* pass the packet to upper layers */ ++ sp->rx(skb); + skb_new->dev = dev; ++ + /* 16 bit align */ +- skb_reserve(skb_new, RX_OFFSET); ++ offset = RX_OFFSET; ++ if (sp->phy_dev) ++ offset += sp->phy_dev->pkt_align; ++ skb_reserve(skb_new, offset); + /* reset descriptor's curr_addr */ + rxdesc->addr = virt_to_phys(skb_new->data); + +@@ -1239,6 +1245,8 @@ + return PTR_ERR(phydev); + } + ++ sp->rx = phydev->netif_rx; ++ + /* mask with MAC supported features */ + phydev->supported &= (SUPPORTED_10baseT_Half + | SUPPORTED_10baseT_Full +Index: linux-2.6.32.7/drivers/net/ar231x.h +=================================================================== +--- linux-2.6.32.7.orig/drivers/net/ar231x.h 2010-02-03 17:00:35.874430230 +0100 ++++ linux-2.6.32.7/drivers/net/ar231x.h 2010-02-03 17:02:28.998430523 +0100 +@@ -221,6 +221,8 @@ + */ + struct ar231x_private { + struct net_device *dev; ++ int (*rx)(struct sk_buff *skb); ++ + int version; + u32 mb[2]; + diff --git a/target/linux/atheros/patches-2.6.32/210-reset_button.patch b/target/linux/atheros/patches-2.6.32/210-reset_button.patch new file mode 100644 index 000000000..f76cde6ec --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/210-reset_button.patch @@ -0,0 +1,178 @@ +Index: linux-2.6.32.7/arch/mips/ar231x/Makefile +=================================================================== +--- linux-2.6.32.7.orig/arch/mips/ar231x/Makefile 2010-02-03 17:00:21.031428952 +0100 ++++ linux-2.6.32.7/arch/mips/ar231x/Makefile 2010-02-03 17:02:36.795429223 +0100 +@@ -8,7 +8,7 @@ + # Copyright (C) 2006-2009 Felix Fietkau + # + +-obj-y += board.o prom.o devices.o ++obj-y += board.o prom.o devices.o reset.o + obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o + obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o + obj-$(CONFIG_ATHEROS_AR2315_PCI) += pci.o +Index: linux-2.6.32.7/arch/mips/ar231x/reset.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.32.7/arch/mips/ar231x/reset.c 2010-02-03 17:02:36.795429223 +0100 +@@ -0,0 +1,160 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "devices.h" ++ ++#define AR531X_RESET_GPIO_IRQ (AR531X_GPIO_IRQ(ar231x_board.config->resetConfigGpio)) ++ ++struct event_t { ++ struct work_struct wq; ++ int set; ++ unsigned long jiffies; ++}; ++ ++static struct timer_list rst_button_timer; ++static unsigned long seen; ++ ++extern struct sock *uevent_sock; ++extern u64 uevent_next_seqnum(void); ++ ++static int no_release_workaround = 1; ++module_param(no_release_workaround, int, 0); ++ ++static inline void ++add_msg(struct sk_buff *skb, char *msg) ++{ ++ char *scratch; ++ scratch = skb_put(skb, strlen(msg) + 1); ++ sprintf(scratch, msg); ++} ++ ++static void ++hotplug_button(struct work_struct *wq) ++{ ++ struct sk_buff *skb; ++ struct event_t *event; ++ size_t len; ++ char *scratch, *s; ++ char buf[128]; ++ ++ event = container_of(wq, struct event_t, wq); ++ if (!uevent_sock) ++ goto done; ++ ++ /* allocate message with the maximum possible size */ ++ s = event->set ? "pressed" : "released"; ++ len = strlen(s) + 2; ++ skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); ++ if (!skb) ++ goto done; ++ ++ /* add header */ ++ scratch = skb_put(skb, len); ++ sprintf(scratch, "%s@",s); ++ ++ /* copy keys to our continuous event payload buffer */ ++ add_msg(skb, "HOME=/"); ++ add_msg(skb, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); ++ add_msg(skb, "SUBSYSTEM=button"); ++ add_msg(skb, "BUTTON=reset"); ++ add_msg(skb, (event->set ? "ACTION=pressed" : "ACTION=released")); ++ sprintf(buf, "SEEN=%ld", (event->jiffies - seen)/HZ); ++ add_msg(skb, buf); ++ snprintf(buf, 128, "SEQNUM=%llu", uevent_next_seqnum()); ++ add_msg(skb, buf); ++ ++ NETLINK_CB(skb).dst_group = 1; ++ netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); ++ ++done: ++ kfree(event); ++} ++ ++static void ++reset_button_poll(unsigned long unused) ++{ ++ struct event_t *event; ++ int gpio = ~0; ++ ++ if(!no_release_workaround) ++ return; ++ ++ gpio = ar231x_gpiodev->get(); ++ gpio &= (1 << (AR531X_RESET_GPIO_IRQ - AR531X_GPIO_IRQ_BASE)); ++ if(gpio) { ++ rst_button_timer.expires = jiffies + (HZ / 4); ++ add_timer(&rst_button_timer); ++ return; ++ } ++ ++ event = (struct event_t *) kzalloc(sizeof(struct event_t), GFP_ATOMIC); ++ if (!event) ++ return; ++ ++ event->set = 0; ++ event->jiffies = jiffies; ++ INIT_WORK(&event->wq, hotplug_button); ++ schedule_work(&event->wq); ++} ++ ++static irqreturn_t ++button_handler(int irq, void *dev_id) ++{ ++ static int pressed = 0; ++ struct event_t *event; ++ u32 gpio = ~0; ++ ++ event = (struct event_t *) kzalloc(sizeof(struct event_t), GFP_ATOMIC); ++ if (!event) ++ return IRQ_NONE; ++ ++ pressed = !pressed; ++ ++ gpio = ar231x_gpiodev->get() & (1 << (irq - AR531X_GPIO_IRQ_BASE)); ++ ++ event->set = gpio; ++ if(!event->set) ++ no_release_workaround = 0; ++ ++ event->jiffies = jiffies; ++ ++ INIT_WORK(&event->wq, hotplug_button); ++ schedule_work(&event->wq); ++ ++ seen = jiffies; ++ if(event->set && no_release_workaround) ++ mod_timer(&rst_button_timer, jiffies + (HZ / 4)); ++ ++ return IRQ_HANDLED; ++} ++ ++ ++static int __init ++ar231x_init_reset(void) ++{ ++ seen = jiffies; ++ ++ if (ar231x_board.config->resetConfigGpio == 0xffff) ++ return -ENODEV; ++ ++ init_timer(&rst_button_timer); ++ rst_button_timer.function = reset_button_poll; ++ rst_button_timer.expires = jiffies + HZ / 50; ++ add_timer(&rst_button_timer); ++ ++ request_irq(AR531X_RESET_GPIO_IRQ, &button_handler, IRQF_SAMPLE_RANDOM, "ar231x_reset", NULL); ++ ++ return 0; ++} ++ ++module_init(ar231x_init_reset); diff --git a/target/linux/atheros/patches-2.6.32/220-enet_micrel_workaround.patch b/target/linux/atheros/patches-2.6.32/220-enet_micrel_workaround.patch new file mode 100644 index 000000000..f179c2189 --- /dev/null +++ b/target/linux/atheros/patches-2.6.32/220-enet_micrel_workaround.patch @@ -0,0 +1,71 @@ +Index: linux-2.6.32.7/drivers/net/ar231x.c +=================================================================== +--- linux-2.6.32.7.orig/drivers/net/ar231x.c 2010-02-03 17:02:28.998430523 +0100 ++++ linux-2.6.32.7/drivers/net/ar231x.c 2010-02-03 17:03:01.346429245 +0100 +@@ -148,6 +148,7 @@ + static int ar231x_mdiobus_reset(struct mii_bus *bus); + static int ar231x_mdiobus_probe (struct net_device *dev); + static void ar231x_adjust_link(struct net_device *dev); ++static bool no_phy = false; + + #ifndef ERR + #define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args) +@@ -278,6 +279,21 @@ + + mdiobus_register(sp->mii_bus); + ++ /* Workaround for Micrel switch, which is only available on ++ * one PHY and cannot be configured through MDIO */ ++ if (!no_phy) { ++ u32 phy_id = 0; ++ get_phy_id(sp->mii_bus, 1, &phy_id); ++ if (phy_id == 0x00221450) ++ no_phy = true; ++ } ++ if (no_phy) { ++ sp->link = 1; ++ netif_carrier_on(dev); ++ return 0; ++ } ++ no_phy = true; ++ + if (ar231x_mdiobus_probe(dev) != 0) { + printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name); + rx_tasklet_cleanup(dev); +@@ -334,8 +350,10 @@ + rx_tasklet_cleanup(dev); + ar231x_init_cleanup(dev); + unregister_netdev(dev); +- mdiobus_unregister(sp->mii_bus); +- mdiobus_free(sp->mii_bus); ++ if (sp->mii_bus) { ++ mdiobus_unregister(sp->mii_bus); ++ mdiobus_free(sp->mii_bus); ++ } + kfree(dev); + return 0; + } +@@ -836,7 +854,12 @@ + dev->stats.rx_bytes += skb->len; + + /* pass the packet to upper layers */ +- sp->rx(skb); ++ if (sp->rx) { ++ sp->rx(skb); ++ } else { ++ skb->protocol = eth_type_trans(skb, skb->dev); ++ netif_rx(skb); ++ } + skb_new->dev = dev; + + /* 16 bit align */ +@@ -1123,6 +1146,9 @@ + struct ar231x_private *sp = netdev_priv(dev); + int ret; + ++ if (!sp->phy_dev) ++ return -ENODEV; ++ + switch (cmd) { + + case SIOCETHTOOL: diff --git a/target/linux/au1000/au1500/config-default b/target/linux/au1000/au1500/config-2.6.30 similarity index 100% rename from target/linux/au1000/au1500/config-default rename to target/linux/au1000/au1500/config-2.6.30 diff --git a/target/linux/au1000/au1500/config-2.6.32 b/target/linux/au1000/au1500/config-2.6.32 new file mode 100644 index 000000000..85924115e --- /dev/null +++ b/target/linux/au1000/au1500/config-2.6.32 @@ -0,0 +1,183 @@ +CONFIG_32BIT=y +# CONFIG_64BIT is not set +CONFIG_64BIT_PHYS_ADDR=y +CONFIG_ALCHEMY_GPIO_AU1000=y +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +# CONFIG_AR7 is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BITREVERSE=y +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +CONFIG_CEVT_R4K_LIB=y +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 +CONFIG_CMDLINE="root=/dev/mtdblock0 rootfstype=squashfs,jffs2" +# CONFIG_CPU_BIG_ENDIAN is not set +# CONFIG_CPU_CAVIUM_OCTEON is not set +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_LITTLE_ENDIAN=y +# CONFIG_CPU_LOONGSON2E is not set +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPS32_R1=y +# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +CONFIG_CPU_MIPSR1=y +# CONFIG_CPU_NEVADA is not set +# CONFIG_CPU_R10000 is not set +# CONFIG_CPU_R3000 is not set +# CONFIG_CPU_R4300 is not set +# CONFIG_CPU_R4X00 is not set +# CONFIG_CPU_R5000 is not set +# CONFIG_CPU_R5432 is not set +# CONFIG_CPU_R5500 is not set +# CONFIG_CPU_R6000 is not set +# CONFIG_CPU_R8000 is not set +# CONFIG_CPU_RM7000 is not set +# CONFIG_CPU_RM9000 is not set +# CONFIG_CPU_SB1 is not set +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +# CONFIG_CPU_TX39XX is not set +# CONFIG_CPU_TX49XX is not set +# CONFIG_CPU_VR41XX is not set +CONFIG_CRAMFS=m +CONFIG_CRC16=y +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CSRC_R4K_LIB=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DEVPORT=y +# CONFIG_DM9000 is not set +CONFIG_DMA_NEED_PCI_MAP_STATE=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DUMMY=m +CONFIG_ELF_CORE=y +# CONFIG_FSNOTIFY is not set +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_GPIOLIB=y +# CONFIG_HAMRADIO is not set +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +CONFIG_I2C=m +CONFIG_I2C_ALGOBIT=m +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQ_CPU=y +CONFIG_KEXEC=y +CONFIG_LEDS_GPIO=y +CONFIG_MACH_ALCHEMY=y +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MACH_VR41XX is not set +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MIKROTIK_RB532 is not set +CONFIG_MIPS=y +CONFIG_MIPS_AU1X00_ENET=y +# CONFIG_MIPS_BOSPORUS is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MIPS_DB1000 is not set +# CONFIG_MIPS_DB1100 is not set +# CONFIG_MIPS_DB1200 is not set +# CONFIG_MIPS_DB1500 is not set +# CONFIG_MIPS_DB1550 is not set +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_MIRAGE is not set +CONFIG_MIPS_MTX1=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_MIPS_MT_SMP is not set +# CONFIG_MIPS_MT_SMTC is not set +# CONFIG_MIPS_PB1000 is not set +# CONFIG_MIPS_PB1100 is not set +# CONFIG_MIPS_PB1200 is not set +# CONFIG_MIPS_PB1500 is not set +# CONFIG_MIPS_PB1550 is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_MIPS_XXS1500 is not set +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MTD_ALCHEMY is not set +# CONFIG_MTD_CFI_INTELEXT is not set +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_CONCAT=y +CONFIG_MTD_PHYSMAP=y +# CONFIG_NO_IOPORT is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PHYLIB=y +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_PROBE_INITRD_HEADER is not set +CONFIG_SCHED_OMIT_FRAME_POINTER=y +# CONFIG_SCSI_DMA is not set +CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250_EXTENDED is not set +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_PCI=m +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_SWARM is not set +CONFIG_SOC_AU1500=y +CONFIG_SOC_AU1X00=y +CONFIG_SOFT_WATCHDOG=m +# CONFIG_STANDALONE is not set +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +# CONFIG_TC35815 is not set +CONFIG_TRAD_SIGNALS=y +# CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y +CONFIG_USB_SUPPORT=y +CONFIG_WDT_MTX1=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/au1000/au1550/config-default b/target/linux/au1000/au1550/config-2.6.30 similarity index 100% rename from target/linux/au1000/au1550/config-default rename to target/linux/au1000/au1550/config-2.6.30 diff --git a/target/linux/au1000/au1550/config-2.6.32 b/target/linux/au1000/au1550/config-2.6.32 new file mode 100644 index 000000000..407a256d4 --- /dev/null +++ b/target/linux/au1000/au1550/config-2.6.32 @@ -0,0 +1,276 @@ +CONFIG_32BIT=y +# CONFIG_64BIT is not set +CONFIG_64BIT_PHYS_ADDR=y +# CONFIG_8139TOO is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_POPULATES_NODE_MAP=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ATMEL=m +# CONFIG_BCM47XX is not set +CONFIG_BITREVERSE=y +CONFIG_CEVT_R4K=y +# CONFIG_CFG80211 is not set +CONFIG_CLASSIC_RCU=y +CONFIG_CMDLINE="root=/dev/mtdblock0 rootfstype=squashfs,jffs2" +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_HAS_LLSC=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_LITTLE_ENDIAN=y +# CONFIG_CPU_LOONGSON2 is not set +CONFIG_CPU_MIPS32_R1=y +# CONFIG_CPU_MIPS32_R2 is not set +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +CONFIG_CPU_MIPSR1=y +# CONFIG_CPU_NEVADA is not set +# CONFIG_CPU_R10000 is not set +# CONFIG_CPU_R3000 is not set +# CONFIG_CPU_R4300 is not set +# CONFIG_CPU_R4X00 is not set +# CONFIG_CPU_R5000 is not set +# CONFIG_CPU_R5432 is not set +# CONFIG_CPU_R6000 is not set +# CONFIG_CPU_R8000 is not set +# CONFIG_CPU_RM7000 is not set +# CONFIG_CPU_RM9000 is not set +# CONFIG_CPU_SB1 is not set +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +# CONFIG_CPU_TX39XX is not set +# CONFIG_CPU_TX49XX is not set +# CONFIG_CPU_VR41XX is not set +CONFIG_CRAMFS=m +CONFIG_CRC16=y +CONFIG_CRC_CCITT=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_HASH=m +CONFIG_CRYPTO_HMAC=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CSRC_R4K=y +CONFIG_DEVPORT=y +# CONFIG_DM9000 is not set +CONFIG_DMA_NEED_PCI_MAP_STATE=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DUMMY=m +CONFIG_ELF_CORE=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +# CONFIG_GENERIC_FIND_FIRST_BIT is not set +CONFIG_GENERIC_FIND_NEXT_BIT=y +# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set +# CONFIG_HAMRADIO is not set +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_HAVE_ARCH_TRACEHOOK is not set +# CONFIG_HAVE_CLK is not set +# CONFIG_HAVE_DMA_ATTRS is not set +# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_IDE=y +# CONFIG_HAVE_IOREMAP_PROT is not set +# CONFIG_HAVE_KPROBES is not set +# CONFIG_HAVE_KRETPROBES is not set +CONFIG_HAVE_OPROFILE=y +CONFIG_HOSTAP_CS=m +CONFIG_HOSTAP=m +CONFIG_HOSTAP_PCI=m +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y +# CONFIG_HZ_100 is not set +CONFIG_HZ=250 +CONFIG_HZ_250=y +# CONFIG_IDE is not set +CONFIG_IEEE80211_CRYPT_CCMP=m +CONFIG_IEEE80211_CRYPT_TKIP=m +CONFIG_IEEE80211_CRYPT_WEP=m +CONFIG_IEEE80211=m +CONFIG_IFB=m +CONFIG_INET_DIAG=m +CONFIG_INET_TCP_DIAG=m +CONFIG_INITRAMFS_ROOT_GID=1000 +CONFIG_INITRAMFS_ROOT_UID=1000 +CONFIG_INITRAMFS_SOURCE="/home/philippe/linux/openwrt/trunk/build_dir/target-mipsel_uClibc-0.9.29/root-au1000 /home/philippe/linux/openwrt/trunk/target/linux/generic-2.6/image/initramfs-base-files.txt" +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IRQ_CPU=y +CONFIG_KEXEC=y +CONFIG_KMOD=y +# CONFIG_LEDS_TRIGGERS is not set +# CONFIG_LEMOTE_FULONG is not set +CONFIG_LIBCRC32C=m +CONFIG_LLC2=m +# CONFIG_MAC80211 is not set +CONFIG_MACH_ALCHEMY=y +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MACH_VR41XX is not set +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MIKROTIK_RB532 is not set +CONFIG_MIPS_AU1X00_ENET=y +# CONFIG_MIPS_BOSPORUS is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MIPS_DB1000 is not set +# CONFIG_MIPS_DB1100 is not set +# CONFIG_MIPS_DB1200 is not set +# CONFIG_MIPS_DB1500 is not set +CONFIG_MIPS_DB1550=y +CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_MIRAGE is not set +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_MIPS_MT_SMP is not set +# CONFIG_MIPS_MT_SMTC is not set +# CONFIG_MIPS_MTX1 is not set +# CONFIG_MIPS_PB1000 is not set +# CONFIG_MIPS_PB1100 is not set +# CONFIG_MIPS_PB1200 is not set +# CONFIG_MIPS_PB1500 is not set +# CONFIG_MIPS_PB1550 is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_MIPS_XXS1500 is not set +CONFIG_MIPS=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MTD_ALCHEMY is not set +# CONFIG_MTD_CFI_INTELEXT is not set +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_CONCAT=y +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +CONFIG_MTD_PHYSMAP_LEN=0 +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PHYSMAP=y +CONFIG_NET_ACT_GACT=m +CONFIG_NET_ACT_IPT=m +CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_FLOW=m +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_RSVP6=m +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_U32=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NETFILTER_XT_MATCH_RATEEST=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_RATEEST=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m +CONFIG_NET_SCH_CBQ=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_TFTP=m +# CONFIG_NO_IOPORT is not set +CONFIG_PAGEFLAGS_EXTENDED=y +# CONFIG_PAGE_SIZE_16KB is not set +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_64KB is not set +# CONFIG_PAGE_SIZE_8KB is not set +CONFIG_PCCARD=m +CONFIG_PCCARD_NONSTATIC=m +CONFIG_PCI_DOMAINS=y +CONFIG_PCMCIA_AU1X00=m +CONFIG_PCMCIA_IOCTL=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA=m +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PHYLIB=y +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +CONFIG_PPP_ASYNC=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP=m +CONFIG_PPPOE=m +CONFIG_PPPOL2TP=m +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_PROBE_INITRD_HEADER is not set +# CONFIG_R6040 is not set +CONFIG_RESOURCES_64BIT=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +# CONFIG_SCSI_DMA is not set +CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250_EXTENDED is not set +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_PCI=m +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_SWARM is not set +CONFIG_SLHC=m +CONFIG_SOC_AU1550=y +CONFIG_SOC_AU1X00=y +# CONFIG_STANDALONE is not set +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +# CONFIG_TC35815 is not set +CONFIG_TCP_CONG_BIC=m +CONFIG_TCP_CONG_CUBIC=m +CONFIG_TCP_CONG_HSTCP=m +CONFIG_TCP_CONG_HTCP=m +CONFIG_TCP_CONG_HYBLA=m +CONFIG_TCP_CONG_ILLINOIS=m +CONFIG_TCP_CONG_LP=m +CONFIG_TCP_CONG_SCALABLE=m +CONFIG_TCP_CONG_VENO=m +CONFIG_TCP_CONG_WESTWOOD=m +CONFIG_TCP_CONG_YEAH=m +CONFIG_TRAD_SIGNALS=y +CONFIG_USB_SUPPORT=y +# CONFIG_VGASTATE is not set +# CONFIG_VIA_RHINE is not set +CONFIG_YENTA=m +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/au1000/patches-2.6.32/001-mtx1_cmdline.patch b/target/linux/au1000/patches-2.6.32/001-mtx1_cmdline.patch new file mode 100644 index 000000000..a45832765 --- /dev/null +++ b/target/linux/au1000/patches-2.6.32/001-mtx1_cmdline.patch @@ -0,0 +1,11 @@ +--- a/arch/mips/alchemy/mtx-1/init.c ++++ b/arch/mips/alchemy/mtx-1/init.c +@@ -49,7 +49,7 @@ void __init prom_init(void) + prom_argv = (char **)fw_arg1; + prom_envp = (char **)fw_arg2; + +- prom_init_cmdline(); ++ strcpy(arcs_cmdline, CONFIG_CMDLINE); + + memsize_str = prom_getenv("memsize"); + if (!memsize_str) diff --git a/target/linux/au1000/patches-2.6.32/002-openwrt_rootfs.patch b/target/linux/au1000/patches-2.6.32/002-openwrt_rootfs.patch new file mode 100644 index 000000000..e1056e93d --- /dev/null +++ b/target/linux/au1000/patches-2.6.32/002-openwrt_rootfs.patch @@ -0,0 +1,11 @@ +--- a/arch/mips/alchemy/mtx-1/platform.c ++++ b/arch/mips/alchemy/mtx-1/platform.c +@@ -90,7 +90,7 @@ static struct platform_device mtx1_gpio_ + + static struct mtd_partition mtx1_mtd_partitions[] = { + { +- .name = "filesystem", ++ .name = "rootfs", + .size = 0x01C00000, + .offset = 0, + }, diff --git a/target/linux/au1000/patches-2.6.32/003-au1000_eth_ioctl.patch b/target/linux/au1000/patches-2.6.32/003-au1000_eth_ioctl.patch new file mode 100644 index 000000000..9bda9a3fe --- /dev/null +++ b/target/linux/au1000/patches-2.6.32/003-au1000_eth_ioctl.patch @@ -0,0 +1,17 @@ +--- a/drivers/net/au1000_eth.c ++++ b/drivers/net/au1000_eth.c +@@ -1036,10 +1036,14 @@ static void au1000_multicast_list(struct + } + } + ++#define AU1000_KNOWN_PHY_IOCTLS (SIOCGMIIPHY & 0xfff0) + static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) + { + struct au1000_private *aup = netdev_priv(dev); + ++ if((cmd & AU1000_KNOWN_PHY_IOCTLS) != AU1000_KNOWN_PHY_IOCTLS) ++ return -EINVAL; ++ + if (!netif_running(dev)) return -EINVAL; + + if (!aup->phy_dev) return -EINVAL; // PHY not controllable diff --git a/target/linux/au1000/patches-2.6.32/004-state_led_phy_fix.patch b/target/linux/au1000/patches-2.6.32/004-state_led_phy_fix.patch new file mode 100644 index 000000000..cfaea00e2 --- /dev/null +++ b/target/linux/au1000/patches-2.6.32/004-state_led_phy_fix.patch @@ -0,0 +1,31 @@ +--- a/drivers/net/au1000_eth.c ++++ b/drivers/net/au1000_eth.c +@@ -166,6 +166,15 @@ struct au1000_private *au_macs[NUM_ETH_I + # undef AU1XXX_PHY1_IRQ + #endif + ++#if defined(CONFIG_MIPS_MTX1) ++/* ++ * 4G MeshCube (MTX-1) board ++ * PHY is at address 31 on MAC0 ++ * autodetect fails if not searched for highest address ! ++ */ ++# define AU1XXX_PHY_SEARCH_HIGHEST_ADDR ++#endif ++ + #if defined(AU1XXX_PHY0_BUSID) && (AU1XXX_PHY0_BUSID > 0) + # error MAC0-associated PHY attached 2nd MACs MII bus not supported yet + #endif +@@ -483,6 +492,12 @@ static int mii_probe (struct net_device + aup->old_duplex = -1; + aup->phy_dev = phydev; + ++#ifdef CONFIG_MIPS_MTX1 ++ /* set up ethernet jack LEDs on the 4G MeshCube (MTX-1 board) */ ++ printk(KERN_INFO "MTX-1 PHY: updating LED settings\n"); ++ phy_write(phydev, 0x11, 0xff80); ++#endif ++ + printk(KERN_INFO "%s: attached PHY driver [%s] " + "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name, + phydev->drv->name, dev_name(&phydev->dev), phydev->irq); diff --git a/target/linux/au1000/patches-2.6.32/006-missing_string_header.patch b/target/linux/au1000/patches-2.6.32/006-missing_string_header.patch new file mode 100644 index 000000000..8aba20252 --- /dev/null +++ b/target/linux/au1000/patches-2.6.32/006-missing_string_header.patch @@ -0,0 +1,10 @@ +--- a/arch/mips/alchemy/mtx-1/init.c ++++ b/arch/mips/alchemy/mtx-1/init.c +@@ -32,6 +32,7 @@ + #include + + #include ++#include + + #include + diff --git a/target/linux/avr32/Makefile b/target/linux/avr32/Makefile index 0cffccb8e..caa8928e0 100644 --- a/target/linux/avr32/Makefile +++ b/target/linux/avr32/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -10,7 +10,7 @@ ARCH:=avr32 BOARD:=avr32 BOARDNAME:=Atmel AVR32 FEATURES:=squashfs -LINUX_VERSION:=2.6.30.10 +LINUX_VERSION:=2.6.32.7 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/avr32/config-default b/target/linux/avr32/config-default index 42215f9d6..2c88e7029 100644 --- a/target/linux/avr32/config-default +++ b/target/linux/avr32/config-default @@ -9,75 +9,75 @@ CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SPARSEMEM_ENABLE is not set # CONFIG_ARCH_SUPPORTS_MSI is not set CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ASYNC_TX_DMA is not set CONFIG_AT32AP700X_WDT=m # CONFIG_ATMEL_PWM is not set # CONFIG_ATMEL_SSC is not set -CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 CONFIG_ATMEL_TCB_CLKSRC=y +CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 CONFIG_ATMEL_TCLIB=y CONFIG_AVR32=y CONFIG_BITREVERSE=y -# CONFIG_BOARD_ATNGW100_EVKLCD10X is not set CONFIG_BOARD_ATNGW100=y +CONFIG_BOARD_ATNGW100_ADDON_NONE=y +# CONFIG_BOARD_ATNGW100_EVKLCD10X is not set +# CONFIG_BOARD_ATNGW100_MRMT is not set # CONFIG_BOARD_ATSTK1000 is not set # CONFIG_BOARD_FAVR_32 is not set # CONFIG_BOARD_HAMMERHEAD is not set # CONFIG_BOARD_MERISC is not set # CONFIG_BOARD_MIMC200 is not set -CONFIG_CLASSIC_RCU=y +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 CONFIG_CPU_AT32AP7000=y CONFIG_CPU_AT32AP700X=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DW_DMAC=y CONFIG_ENTRY_ADDRESS=0x90000000 +# CONFIG_FSNOTIFY is not set CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_GPIO=y CONFIG_GPIOLIB=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y -# CONFIG_HAVE_ARCH_BOOTMEM_NODE is not set +# CONFIG_HAVE_ARCH_BOOTMEM is not set CONFIG_HAVE_CLK=y # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set CONFIG_HAVE_KPROBES=y CONFIG_HAVE_OPROFILE=y # CONFIG_HW_RANDOM is not set -CONFIG_I2C_BOARDINFO=y CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_DESIGNWARE is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_LEDS_GPIO=y -CONFIG_LOAD_ADDRESS=0x10000000 CONFIG_LOADER_U_BOOT=y +CONFIG_LOAD_ADDRESS=0x10000000 CONFIG_MACB=y -# CONFIG_MMC_ATMELMCI_DMA is not set -CONFIG_MMC_ATMELMCI=m -CONFIG_MMC_BLOCK=m CONFIG_MMC=m +# CONFIG_MMC_AT91 is not set +CONFIG_MMC_ATMELMCI=m +# CONFIG_MMC_ATMELMCI_DMA is not set +CONFIG_MMC_BLOCK=m # CONFIG_MTD_CFI_INTELEXT is not set CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_DATAFLASH=y # CONFIG_MTD_DATAFLASH_OTP is not set # CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set -CONFIG_MTD_DATAFLASH=y -CONFIG_MTD_PHYSMAP_BANKWIDTH=2 -CONFIG_MTD_PHYSMAP_LEN=0x0 -CONFIG_MTD_PHYSMAP_START=0x80000000 CONFIG_MTD_PHYSMAP=y # CONFIG_NEED_NODE_MEMMAP_SIZE is not set # CONFIG_NET_DMA is not set -CONFIG_NF_CT_ACCT=y # CONFIG_NMI_DEBUGGING is not set CONFIG_NO_HZ=y CONFIG_NR_QUICK=2 # CONFIG_OWNERSHIP_TRACE is not set CONFIG_PAGEFLAGS_EXTENDED=y -# CONFIG_PCI is not set CONFIG_PERFORMANCE_COUNTERS=y CONFIG_PHYLIB=y CONFIG_PHYS_OFFSET=0x10000000 @@ -85,20 +85,22 @@ CONFIG_PLATFORM_AT32AP=y CONFIG_QUICKLIST=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AT32AP700X=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_SCHED_HRTICK=y # CONFIG_SCSI_DMA is not set # CONFIG_SDIO_UART is not set # CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL_CONSOLE=y CONFIG_SERIAL_ATMEL_PDC=y # CONFIG_SERIAL_ATMEL_TTYAT is not set -CONFIG_SERIAL_ATMEL=y +CONFIG_SPI=y CONFIG_SPI_ATMEL=y # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_GPIO is not set CONFIG_SPI_MASTER=y # CONFIG_SPI_SPIDEV is not set -CONFIG_SPI=y CONFIG_SUBARCH_AVR32B=y -# CONFIG_VGASTATE is not set +# CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/avr32/patches/001-fix_usart_clash.patch b/target/linux/avr32/patches/001-fix_usart_clash.patch deleted file mode 100644 index 54657fd54..000000000 --- a/target/linux/avr32/patches/001-fix_usart_clash.patch +++ /dev/null @@ -1,22 +0,0 @@ -Fix clash in ATMEL_USART_ flags - -At the moment ATMEL_USART_{RTS,CTS,CLK} have the values -1, 2 and 3 respectively. Given these are used in bitmasks, -trying to turn on the CLK line will in fact turn on the -RTS and CTS lines as well. - -Change the value of ATMEL_USART_CLK to 4. - -Signed-off-by: Ben Nizette ---- ---- a/arch/avr32/mach-at32ap/include/mach/board.h -+++ b/arch/avr32/mach-at32ap/include/mach/board.h -@@ -29,7 +29,7 @@ extern struct platform_device *atmel_def - /* Flags for selecting USART extra pins */ - #define ATMEL_USART_RTS 0x01 - #define ATMEL_USART_CTS 0x02 --#define ATMEL_USART_CLK 0x03 -+#define ATMEL_USART_CLK 0x04 - - struct atmel_uart_data { - short use_dma_tx; /* use transmit DMA? */ diff --git a/target/linux/brcm-2.4/base-files/lib/preinit/05_set_failsafe_switch_brcm b/target/linux/brcm-2.4/base-files/lib/preinit/05_set_failsafe_switch_brcm index 28e62e5b5..a93559f97 100644 --- a/target/linux/brcm-2.4/base-files/lib/preinit/05_set_failsafe_switch_brcm +++ b/target/linux/brcm-2.4/base-files/lib/preinit/05_set_failsafe_switch_brcm @@ -6,7 +6,7 @@ failsafe_ip() { echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports } - [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up } } diff --git a/target/linux/brcm-2.4/base-files/lib/preinit/15_set_preinit_interface_brcm b/target/linux/brcm-2.4/base-files/lib/preinit/15_set_preinit_interface_brcm index 9fd555caf..1bef26bf0 100644 --- a/target/linux/brcm-2.4/base-files/lib/preinit/15_set_preinit_interface_brcm +++ b/target/linux/brcm-2.4/base-files/lib/preinit/15_set_preinit_interface_brcm @@ -1,7 +1,7 @@ #!/bin/sh port_net_echo() { - [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { if [ "$pi_preinit_net_messages" = "y" ] || [ "$pi_failsafe_net_message" = "true" ] && [ "$pi_preinit_no_failsafe_netmsg" != "y" ]; then netmsg $pi_broadcast "$1" fi @@ -12,7 +12,7 @@ preinit_ip_deconfig() { if [ -z "$pi_ifname" ]; then ifconfig $ifname 0.0.0.0 down else - grep "$pi_ifname" /proc/net/dev >/dev/null && { + grep -q "$pi_ifname" /proc/net/dev && { ifconfig $pi_ifname 0.0.0.0 down } fi diff --git a/target/linux/brcm47xx/profiles/110-None.mk b/target/linux/brcm47xx/profiles/110-None.mk index 513366dd7..73df59bf7 100644 --- a/target/linux/brcm47xx/profiles/110-None.mk +++ b/target/linux/brcm47xx/profiles/110-None.mk @@ -7,7 +7,7 @@ define Profile/None NAME:=No WiFi - PACKAGES:=-hostapd-mini + PACKAGES:=-wpad-mini endef define Profile/None/Description diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/Kconfig b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/Kconfig similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/Kconfig rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/Kconfig diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/Makefile b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/Makefile similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/Makefile rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/Makefile diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/Kconfig b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/Kconfig similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/Kconfig rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/Kconfig diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/Makefile b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/Makefile similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/Makefile rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/Makefile diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/board_bcm963xx.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/board_bcm963xx.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_livebox.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/board_livebox.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_livebox.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/boards/board_livebox.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/clk.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/clk.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/cpu.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/cpu.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/cpu.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/cpu.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/cs.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/cs.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/cs.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/cs.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-dsp.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-dsp.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-enet.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-enet.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-enet.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-enet.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-pcmcia.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-pcmcia.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-pcmcia.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-pcmcia.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-spi.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-spi.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-spi.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-spi.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-uart.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-uart.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-uart.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-uart.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-usb-ehci.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-usb-ehci.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-usb-ehci.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-usb-ehci.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-usb-ohci.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-usb-ohci.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-usb-ohci.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-usb-ohci.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-usb-udc.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-usb-udc.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-usb-udc.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-usb-udc.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-wdt.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-wdt.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-wdt.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/dev-wdt.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/early_printk.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/early_printk.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/early_printk.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/early_printk.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/gpio.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/gpio.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/irq.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/irq.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/irq.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/irq.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/prom.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/prom.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/prom.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/prom.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/setup.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/setup.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/setup.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/setup.c diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/timer.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/timer.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/bcm63xx/timer.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/bcm63xx/timer.c diff --git a/target/linux/brcm63xx/files/arch/mips/configs/bcm63xx_defconfig b/target/linux/brcm63xx/files-2.6.30/arch/mips/configs/bcm63xx_defconfig similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/configs/bcm63xx_defconfig rename to target/linux/brcm63xx/files-2.6.30/arch/mips/configs/bcm63xx_defconfig diff --git a/target/linux/brcm63xx/files/arch/mips/include/asm/mach-bcm63xx b/target/linux/brcm63xx/files-2.6.30/arch/mips/include/asm/mach-bcm63xx similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/include/asm/mach-bcm63xx rename to target/linux/brcm63xx/files-2.6.30/arch/mips/include/asm/mach-bcm63xx diff --git a/target/linux/brcm63xx/files/arch/mips/pci/fixup-bcm63xx.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/pci/fixup-bcm63xx.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/pci/fixup-bcm63xx.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/pci/fixup-bcm63xx.c diff --git a/target/linux/brcm63xx/files/arch/mips/pci/ops-bcm63xx.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/pci/ops-bcm63xx.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/pci/ops-bcm63xx.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/pci/ops-bcm63xx.c diff --git a/target/linux/brcm63xx/files/arch/mips/pci/pci-bcm63xx.c b/target/linux/brcm63xx/files-2.6.30/arch/mips/pci/pci-bcm63xx.c similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/pci/pci-bcm63xx.c rename to target/linux/brcm63xx/files-2.6.30/arch/mips/pci/pci-bcm63xx.c diff --git a/target/linux/brcm63xx/files/arch/mips/pci/pci-bcm63xx.h b/target/linux/brcm63xx/files-2.6.30/arch/mips/pci/pci-bcm63xx.h similarity index 100% rename from target/linux/brcm63xx/files/arch/mips/pci/pci-bcm63xx.h rename to target/linux/brcm63xx/files-2.6.30/arch/mips/pci/pci-bcm63xx.h diff --git a/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c b/target/linux/brcm63xx/files-2.6.30/drivers/mtd/maps/bcm963xx-flash.c similarity index 98% rename from target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c rename to target/linux/brcm63xx/files-2.6.30/drivers/mtd/maps/bcm963xx-flash.c index e24a08110..abb20b61f 100644 --- a/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c +++ b/target/linux/brcm63xx/files-2.6.30/drivers/mtd/maps/bcm963xx-flash.c @@ -211,7 +211,7 @@ static int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition * } printk(KERN_INFO PFX "CFE boot tag found with version %s, board type %s, and tagid %s.\n",tagversion,boardid,tagid); - + rootfsaddr = rootfsaddr - EXTENDED_SIZE; kerneladdr = kerneladdr - EXTENDED_SIZE; spareaddr = roundup(totallen,master->erasesize) + master->erasesize; @@ -234,7 +234,7 @@ static int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition * vfree(buf); return -ENOMEM; }; - + /* Start building partition list */ parts[curpart].name = "CFE"; parts[curpart].offset = 0; @@ -256,7 +256,7 @@ static int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition * parts[curpart].size += sparelen; curpart++; }; - + parts[curpart].name = "nvram"; parts[curpart].offset = master->size - master->erasesize; parts[curpart].size = master->erasesize; @@ -266,9 +266,9 @@ static int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition * parts[curpart].name = "linux"; parts[curpart].offset = parts[0].size; parts[curpart].size = master->size - parts[0].size - parts[3].size; - + for (i = 0; i < nrparts; i++) - printk(KERN_INFO PFX "Partition %d is %s offset %llx and length %llx\n", i, parts[i].name, parts[i].offset, parts[i].size); + printk(KERN_INFO PFX "Partition %d is %s offset %lx and length %lx\n", i, parts[i].name, parts[i].offset, parts[i].size); printk(KERN_INFO PFX "Spare partition is %x offset and length %x\n", spareaddr, sparelen); *pparts = parts; @@ -288,7 +288,7 @@ static int bcm963xx_detect_cfe(struct mtd_info *master) ret = master->read(master, idoffset, 8, &retlen, (void *)buf); buf[retlen] = 0; printk(KERN_INFO PFX "Read Signature value of %s\n", buf); - + return strncmp(idstring, buf, 8); } @@ -334,7 +334,7 @@ static int bcm963xx_probe(struct platform_device *pdev) } else { printk(KERN_INFO PFX "assuming RedBoot bootloader\n"); if (bcm963xx_mtd_info->size > 0x00400000) { - printk(KERN_INFO PFX "Support for extended flash memory size : 0x%llx ; ONLY 64MBIT SUPPORT\n", bcm963xx_mtd_info->size); + printk(KERN_INFO PFX "Support for extended flash memory size : 0x%lx ; ONLY 64MBIT SUPPORT\n", bcm963xx_mtd_info->size); bcm963xx_map.virt = (u32)(EXTENDED_SIZE); } @@ -348,7 +348,7 @@ static int bcm963xx_probe(struct platform_device *pdev) } #endif } - + return add_mtd_partitions(bcm963xx_mtd_info, parsed_parts, parsed_nr_parts); err_probe: diff --git a/target/linux/brcm63xx/files/drivers/net/bcm63xx_enet.c b/target/linux/brcm63xx/files-2.6.30/drivers/net/bcm63xx_enet.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/net/bcm63xx_enet.c rename to target/linux/brcm63xx/files-2.6.30/drivers/net/bcm63xx_enet.c diff --git a/target/linux/brcm63xx/files/drivers/net/bcm63xx_enet.h b/target/linux/brcm63xx/files-2.6.30/drivers/net/bcm63xx_enet.h similarity index 100% rename from target/linux/brcm63xx/files/drivers/net/bcm63xx_enet.h rename to target/linux/brcm63xx/files-2.6.30/drivers/net/bcm63xx_enet.h diff --git a/target/linux/brcm63xx/files/drivers/net/phy/bcm63xx.c b/target/linux/brcm63xx/files-2.6.30/drivers/net/phy/bcm63xx.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/net/phy/bcm63xx.c rename to target/linux/brcm63xx/files-2.6.30/drivers/net/phy/bcm63xx.c diff --git a/target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c b/target/linux/brcm63xx/files-2.6.30/drivers/pcmcia/bcm63xx_pcmcia.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c rename to target/linux/brcm63xx/files-2.6.30/drivers/pcmcia/bcm63xx_pcmcia.c diff --git a/target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.h b/target/linux/brcm63xx/files-2.6.30/drivers/pcmcia/bcm63xx_pcmcia.h similarity index 100% rename from target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.h rename to target/linux/brcm63xx/files-2.6.30/drivers/pcmcia/bcm63xx_pcmcia.h diff --git a/target/linux/brcm63xx/files/drivers/serial/bcm63xx_uart.c b/target/linux/brcm63xx/files-2.6.30/drivers/serial/bcm63xx_uart.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/serial/bcm63xx_uart.c rename to target/linux/brcm63xx/files-2.6.30/drivers/serial/bcm63xx_uart.c diff --git a/target/linux/brcm63xx/files/drivers/spi/bcm63xx_spi.c b/target/linux/brcm63xx/files-2.6.30/drivers/spi/bcm63xx_spi.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/spi/bcm63xx_spi.c rename to target/linux/brcm63xx/files-2.6.30/drivers/spi/bcm63xx_spi.c diff --git a/target/linux/brcm63xx/files/drivers/usb/host/ehci-bcm63xx.c b/target/linux/brcm63xx/files-2.6.30/drivers/usb/host/ehci-bcm63xx.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/usb/host/ehci-bcm63xx.c rename to target/linux/brcm63xx/files-2.6.30/drivers/usb/host/ehci-bcm63xx.c diff --git a/target/linux/brcm63xx/files/drivers/usb/host/ohci-bcm63xx.c b/target/linux/brcm63xx/files-2.6.30/drivers/usb/host/ohci-bcm63xx.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/usb/host/ohci-bcm63xx.c rename to target/linux/brcm63xx/files-2.6.30/drivers/usb/host/ohci-bcm63xx.c diff --git a/target/linux/brcm63xx/files/drivers/watchdog/bcm63xx_wdt.c b/target/linux/brcm63xx/files-2.6.30/drivers/watchdog/bcm63xx_wdt.c similarity index 100% rename from target/linux/brcm63xx/files/drivers/watchdog/bcm63xx_wdt.c rename to target/linux/brcm63xx/files-2.6.30/drivers/watchdog/bcm63xx_wdt.c diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_board.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_board.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_board.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_board.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_clk.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_clk.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_clk.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_clk.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_cpu.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_cpu.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_cpu.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_cpu.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_cs.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_cs.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_cs.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_cs.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_dsp.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_dsp.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_dsp.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_dsp.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_enet.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_enet.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_enet.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_enet.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pci.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pci.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pci.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pci.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pcmcia.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pcmcia.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pcmcia.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_pcmcia.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_spi.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_spi.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_spi.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_spi.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_uart.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_uart.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_uart.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_uart.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ehci.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ehci.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ehci.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ehci.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ohci.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ohci.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ohci.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_ohci.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_udc.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_udc.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_udc.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_usb_udc.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_wdt.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_wdt.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_dev_wdt.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_dev_wdt.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_io.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_io.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_io.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_io.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_irq.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_irq.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_irq.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_irq.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_regs.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_regs.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_regs.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_regs.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_timer.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_timer.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_timer.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm63xx_timer.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm_tag.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm_tag.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm_tag.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/bcm_tag.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/board_bcm963xx.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/board_bcm963xx.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/board_bcm963xx.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/board_bcm963xx.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/cpu-feature-overrides.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/cpu-feature-overrides.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/cpu-feature-overrides.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/cpu-feature-overrides.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/gpio.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/gpio.h diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/war.h b/target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/war.h similarity index 100% rename from target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/war.h rename to target/linux/brcm63xx/files-2.6.30/include/asm-mips/mach-bcm63xx/war.h diff --git a/target/linux/cobalt/config-default b/target/linux/cobalt/config-2.6.30 similarity index 100% rename from target/linux/cobalt/config-default rename to target/linux/cobalt/config-2.6.30 diff --git a/target/linux/cobalt/patches/001-no_module_reloc.patch b/target/linux/cobalt/patches-2.6.30/001-no_module_reloc.patch similarity index 100% rename from target/linux/cobalt/patches/001-no_module_reloc.patch rename to target/linux/cobalt/patches-2.6.30/001-no_module_reloc.patch diff --git a/target/linux/octeon/config-default b/target/linux/config-2.6.30 similarity index 100% rename from target/linux/octeon/config-default rename to target/linux/config-2.6.30 diff --git a/target/linux/generic-2.4/config-default b/target/linux/generic-2.4/config-default index a087bb9dd..869e4f4cc 100644 --- a/target/linux/generic-2.4/config-default +++ b/target/linux/generic-2.4/config-default @@ -406,7 +406,7 @@ CONFIG_MTD_BLOCK=y # CONFIG_MTD_BOSPORUS is not set CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_B1 is not set +CONFIG_MTD_CFI_B1=y CONFIG_MTD_CFI_B2=y # CONFIG_MTD_CFI_B4 is not set # CONFIG_MTD_CFI_B8 is not set diff --git a/target/linux/generic-2.6/config-2.6.31 b/target/linux/generic-2.6/config-2.6.31 index afb387e89..9cebefe7a 100644 --- a/target/linux/generic-2.6/config-2.6.31 +++ b/target/linux/generic-2.6/config-2.6.31 @@ -1513,6 +1513,7 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_OCF_SAFE is not set # CONFIG_OCF_TALITOS is not set # CONFIG_OMFS_FS is not set +# CONFIG_OPROFILE is not set # CONFIG_OSF_PARTITION is not set # CONFIG_P54_COMMON is not set CONFIG_PACKET_MMAP=y diff --git a/target/linux/generic-2.6/config-2.6.32 b/target/linux/generic-2.6/config-2.6.32 index e24cc8a22..ab8f2ffbf 100644 --- a/target/linux/generic-2.6/config-2.6.32 +++ b/target/linux/generic-2.6/config-2.6.32 @@ -391,6 +391,7 @@ CONFIG_CRYPTO_ALGAPI=y # CONFIG_CRYPTO_LZO is not set # CONFIG_CRYPTO_MANAGER2 is not set # CONFIG_CRYPTO_MANAGER is not set +CONFIG_CRYPTO_MANAGER_NO_TESTS=y # CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD5 is not set # CONFIG_CRYPTO_MICHAEL_MIC is not set @@ -1055,7 +1056,9 @@ CONFIG_JOLIET=y CONFIG_KERNEL_LZMA=y # CONFIG_KERNEL_LZO is not set # CONFIG_KEXEC is not set +# CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_MAX7359 is not set # CONFIG_KEYBOARD_OPENCORES is not set # CONFIG_KEYS is not set # CONFIG_KMEMTRACE is not set @@ -1162,6 +1165,11 @@ CONFIG_MISC_FILESYSTEMS=y # CONFIG_MISDN_HFCPCI is not set # CONFIG_MISDN_HFCUSB is not set # CONFIG_MISDN is not set +# CONFIG_MISDN_AVMFRITZ is not set +# CONFIG_MISDN_INFINEON is not set +# CONFIG_MISDN_NETJET is not set +# CONFIG_MISDN_SPEEDFAX is not set +# CONFIG_MISDN_W6692 is not set # CONFIG_MKISS is not set # CONFIG_MMC_ARMMMCI is not set CONFIG_MMC_BLOCK_BOUNCE=y @@ -1685,6 +1693,7 @@ CONFIG_PROC_SYSCTL=y # CONFIG_QLA3XXX is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QSEMI_PHY is not set +# CONFIG_QT2160 is not set # CONFIG_QUOTA is not set # CONFIG_R3964 is not set # CONFIG_R6040 is not set diff --git a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366_smi.c index 70218fc6c..7091190b8 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366_smi.c @@ -91,10 +91,7 @@ static void rtl8366_smi_write_bits(struct rtl8366_smi *smi, u32 data, u32 len) rtl8366_smi_clk_delay(smi); /* prepare data */ - if ( data & ( 1 << (len - 1)) ) - gpio_set_value(sda, 1); - else - gpio_set_value(sda, 0); + gpio_set_value(sda, !!(data & ( 1 << (len - 1)))); rtl8366_smi_clk_delay(smi); /* clocking */ @@ -119,7 +116,7 @@ static void rtl8366_smi_read_bits(struct rtl8366_smi *smi, u32 len, u32 *data) /* clocking */ gpio_set_value(sck, 1); rtl8366_smi_clk_delay(smi); - u = gpio_get_value(sda); + u = !!gpio_get_value(sda); gpio_set_value(sck, 0); *data |= (u << (len - 1)); diff --git a/target/linux/generic-2.6/patches-2.6.32/150-netfilter_imq.patch b/target/linux/generic-2.6/patches-2.6.32/150-netfilter_imq.patch index 23636699d..9540ce0dd 100644 --- a/target/linux/generic-2.6/patches-2.6.32/150-netfilter_imq.patch +++ b/target/linux/generic-2.6/patches-2.6.32/150-netfilter_imq.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/drivers/net/imq.c -@@ -0,0 +1,571 @@ +@@ -0,0 +1,632 @@ +/* + * Pseudo-driver for the intermediate queue device. + * @@ -50,7 +50,7 @@ + * I didn't forget anybody). I apologize again for my lack of time. + * + * -+ * 2008/06/17 - 2.6.25 - Changed imq.c to use qdisc_run() instead ++ * 2008/06/17 - 2.6.25 - Changed imq.c to use qdisc_run() instead + * of qdisc_restart() and moved qdisc_run() to tasklet to avoid + * recursive locking. New initialization routines to fix 'rmmod' not + * working anymore. Used code from ifb.c. (Jussi Kivilinna) @@ -73,6 +73,15 @@ + * - Use netdevice feature flags to avoid extra packet handling + * by core networking layer and possibly increase performance. + * ++ * 2009/09/26 - (Jussi Kivilinna) ++ * - Add imq_nf_reinject_lockless to fix deadlock with ++ * imq_nf_queue/imq_nf_reinject. ++ * ++ * 2009/12/08 - (Jussi Kivilinna) ++ * - Port to 2.6.32 ++ * - Add check for skb->nf_queue_entry==NULL in imq_dev_xmit() ++ * - Also add better error checking for skb->nf_queue_entry usage ++ * + * Also, many thanks to pablo Sebastian Greco for making the initial + * patch and to those who helped the testing. + * @@ -170,6 +179,8 @@ +{ + struct nf_queue_entry *entry = skb->nf_queue_entry; + ++ skb->nf_queue_entry = NULL; ++ + if (entry) { + nf_queue_entry_release_refs(entry); + kfree(entry); @@ -178,6 +189,25 @@ + skb_restore_cb(skb); /* kfree backup */ +} + ++/* locking not needed when called from imq_nf_queue */ ++static void imq_nf_reinject_lockless(struct nf_queue_entry *entry, ++ unsigned int verdict) ++{ ++ int status; ++ ++ if (!entry->next_outfn) { ++ nf_reinject(entry, verdict); ++ return; ++ } ++ ++ status = entry->next_outfn(entry, entry->next_queuenum); ++ if (status < 0) { ++ nf_queue_entry_release_refs(entry); ++ kfree_skb(entry->skb); ++ kfree(entry); ++ } ++} ++ +static void imq_nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) +{ + int status; @@ -202,19 +232,48 @@ + rcu_read_unlock(); +} + -+static int imq_dev_xmit(struct sk_buff *skb, struct net_device *dev) ++static netdev_tx_t imq_dev_xmit(struct sk_buff *skb, struct net_device *dev) +{ ++ struct nf_queue_entry *entry = skb->nf_queue_entry; ++ ++ skb->nf_queue_entry = NULL; ++ dev->trans_start = jiffies; ++ + dev->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + ++ if (entry == NULL) { ++ /* We don't know what is going on here.. packet is queued for ++ * imq device, but (probably) not by us. ++ * ++ * If this packet was not send here by imq_nf_queue(), then ++ * skb_save_cb() was not used and skb_free() should not show: ++ * WARNING: IMQ: kfree_skb: skb->cb_next:.. ++ * and/or ++ * WARNING: IMQ: kfree_skb: skb->nf_queue_entry... ++ * ++ * However if this message is shown, then IMQ is somehow broken ++ * and you should report this to linuximq.net. ++ */ ++ ++ /* imq_dev_xmit is black hole that eats all packets, report that ++ * we eat this packet happily and increase dropped counters. ++ */ ++ ++ dev->stats.tx_dropped++; ++ dev_kfree_skb(skb); ++ ++ return NETDEV_TX_OK; ++ } ++ ++ skb_restore_cb(skb); /* restore skb->cb */ ++ + skb->imq_flags = 0; + skb->destructor = NULL; + -+ skb_restore_cb(skb); /* restore skb->cb */ ++ imq_nf_reinject(entry, NF_ACCEPT); + -+ dev->trans_start = jiffies; -+ imq_nf_reinject(skb->nf_queue_entry, NF_ACCEPT); -+ return 0; ++ return NETDEV_TX_OK; +} + +static int imq_nf_queue(struct nf_queue_entry *entry, unsigned queue_num) @@ -257,7 +316,7 @@ + + if (unlikely(!(dev->flags & IFF_UP))) { + entry->skb->imq_flags = 0; -+ imq_nf_reinject(entry, NF_ACCEPT); ++ imq_nf_reinject_lockless(entry, NF_ACCEPT); + retval = 0; + goto out; + } @@ -315,6 +374,7 @@ + goto out; + } else { + skb_restore_cb(skb_shared); /* restore skb->cb */ ++ skb->nf_queue_entry = NULL; + /* qdisc dropped packet and decreased skb reference count of + * skb, so we don't really want to and try refree as that would + * actually destroy the skb. */ @@ -378,6 +438,7 @@ + dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | + NETIF_F_GSO | NETIF_F_HW_CSUM | + NETIF_F_HIGHDMA; ++ dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; +} + +static int imq_validate(struct nlattr *tb[], struct nlattr *data[]) @@ -730,6 +791,28 @@ + +#endif /* _IMQ_H */ + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1114,6 +1114,7 @@ extern int dev_alloc_name(struct net_de + extern int dev_open(struct net_device *dev); + extern int dev_close(struct net_device *dev); + extern void dev_disable_lro(struct net_device *dev); ++extern struct netdev_queue *dev_pick_tx(struct net_device *dev, struct sk_buff *skb); + extern int dev_queue_xmit(struct sk_buff *skb); + extern int register_netdevice(struct net_device *dev); + extern void unregister_netdevice(struct net_device *dev); +--- /dev/null ++++ b/include/linux/netfilter/xt_IMQ.h +@@ -0,0 +1,9 @@ ++#ifndef _XT_IMQ_H ++#define _XT_IMQ_H ++ ++struct xt_imq_info { ++ unsigned int todev; /* target imq device */ ++}; ++ ++#endif /* _XT_IMQ_H */ ++ --- /dev/null +++ b/include/linux/netfilter_ipv4/ipt_IMQ.h @@ -0,0 +1,10 @@ @@ -788,17 +871,18 @@ #ifdef CONFIG_BRIDGE_NETFILTER struct nf_bridge_info *nf_bridge; #endif -@@ -382,6 +391,9 @@ struct sk_buff { - kmemcheck_bitfield_end(flags2); +@@ -383,6 +392,10 @@ struct sk_buff { /* 0/14 bit hole */ + +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) + __u8 imq_flags:IMQ_F_BITS; +#endif - ++ #ifdef CONFIG_NET_DMA dma_cookie_t dma_cookie; -@@ -437,6 +449,12 @@ static inline struct rtable *skb_rtable( + #endif +@@ -437,6 +450,12 @@ static inline struct rtable *skb_rtable( return (struct rtable *)skb_dst(skb); } @@ -811,7 +895,7 @@ extern void kfree_skb(struct sk_buff *skb); extern void consume_skb(struct sk_buff *skb); extern void __kfree_skb(struct sk_buff *skb); -@@ -1972,6 +1990,10 @@ static inline void __nf_copy(struct sk_b +@@ -1972,6 +1991,10 @@ static inline void __nf_copy(struct sk_b dst->nfct_reasm = src->nfct_reasm; nf_conntrack_get_reasm(src->nfct_reasm); #endif @@ -822,6 +906,33 @@ #ifdef CONFIG_BRIDGE_NETFILTER dst->nf_bridge = src->nf_bridge; nf_bridge_get(src->nf_bridge); +--- a/include/net/netfilter/nf_queue.h ++++ b/include/net/netfilter/nf_queue.h +@@ -13,6 +13,12 @@ struct nf_queue_entry { + struct net_device *indev; + struct net_device *outdev; + int (*okfn)(struct sk_buff *); ++ ++#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) ++ int (*next_outfn)(struct nf_queue_entry *entry, ++ unsigned int queuenum); ++ unsigned int next_queuenum; ++#endif + }; + + #define nf_queue_entry_reroute(x) ((void *)x + sizeof(struct nf_queue_entry)) +@@ -30,5 +36,11 @@ extern int nf_unregister_queue_handler(u + const struct nf_queue_handler *qh); + extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh); + extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); ++extern void nf_queue_entry_release_refs(struct nf_queue_entry *entry); ++ ++#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) ++extern void nf_register_queue_imq_handler(const struct nf_queue_handler *qh); ++extern void nf_unregister_queue_imq_handler(void); ++#endif + + #endif /* _NF_QUEUE_H */ --- a/net/core/dev.c +++ b/net/core/dev.c @@ -96,6 +96,9 @@ @@ -865,55 +976,6 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, struct net_device *dev, ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -1114,6 +1114,7 @@ extern int dev_alloc_name(struct net_de - extern int dev_open(struct net_device *dev); - extern int dev_close(struct net_device *dev); - extern void dev_disable_lro(struct net_device *dev); -+extern struct netdev_queue *dev_pick_tx(struct net_device *dev, struct sk_buff *skb); - extern int dev_queue_xmit(struct sk_buff *skb); - extern int register_netdevice(struct net_device *dev); - extern void unregister_netdevice(struct net_device *dev); ---- /dev/null -+++ b/include/linux/netfilter/xt_IMQ.h -@@ -0,0 +1,9 @@ -+#ifndef _XT_IMQ_H -+#define _XT_IMQ_H -+ -+struct xt_imq_info { -+ unsigned int todev; /* target imq device */ -+}; -+ -+#endif /* _XT_IMQ_H */ -+ ---- a/include/net/netfilter/nf_queue.h -+++ b/include/net/netfilter/nf_queue.h -@@ -13,6 +13,12 @@ struct nf_queue_entry { - struct net_device *indev; - struct net_device *outdev; - int (*okfn)(struct sk_buff *); -+ -+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+ int (*next_outfn)(struct nf_queue_entry *entry, -+ unsigned int queuenum); -+ unsigned int next_queuenum; -+#endif - }; - - #define nf_queue_entry_reroute(x) ((void *)x + sizeof(struct nf_queue_entry)) -@@ -30,5 +36,11 @@ extern int nf_unregister_queue_handler(u - const struct nf_queue_handler *qh); - extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh); - extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); -+extern void nf_queue_entry_release_refs(struct nf_queue_entry *entry); -+ -+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+extern void nf_register_queue_imq_handler(const struct nf_queue_handler *qh); -+extern void nf_unregister_queue_imq_handler(void); -+#endif - - #endif /* _NF_QUEUE_H */ --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -72,6 +72,9 @@ @@ -926,7 +988,7 @@ static void sock_pipe_buf_release(struct pipe_inode_info *pipe, struct pipe_buffer *buf) -@@ -91,6 +94,80 @@ static int sock_pipe_buf_steal(struct pi +@@ -91,6 +94,83 @@ static int sock_pipe_buf_steal(struct pi return 1; } @@ -986,17 +1048,20 @@ +} +EXPORT_SYMBOL(skb_restore_cb); + -+static void skb_copy_stored_cb(struct sk_buff *new, struct sk_buff *old) ++static void skb_copy_stored_cb(struct sk_buff *new, const struct sk_buff *__old) +{ + struct skb_cb_table *next; ++ struct sk_buff *old; + -+ if (!old->cb_next) { -+ new->cb_next = 0; ++ if (!__old->cb_next) { ++ new->cb_next = NULL; + return; + } + + spin_lock(&skb_cb_store_lock); + ++ old = (struct sk_buff *)__old; ++ + next = old->cb_next; + atomic_inc(&next->refcnt); + new->cb_next = next; @@ -1007,7 +1072,7 @@ /* Pipe buffer operations for a socket. */ static struct pipe_buf_operations sock_pipe_buf_ops = { -@@ -398,6 +475,15 @@ static void skb_release_head_state(struc +@@ -398,6 +478,26 @@ static void skb_release_head_state(struc WARN_ON(in_irq()); skb->destructor(skb); } @@ -1015,25 +1080,36 @@ + /* This should not happen. When it does, avoid memleak by restoring + the chain of cb-backups. */ + while(skb->cb_next != NULL) { -+ printk(KERN_WARNING "kfree_skb: skb->cb_next: %08x\n", -+ skb->cb_next); ++ if (net_ratelimit()) ++ printk(KERN_WARNING "IMQ: kfree_skb: skb->cb_next: " ++ "%08x\n", (unsigned int)skb->cb_next); ++ + skb_restore_cb(skb); + } ++ /* This should not happen either, nf_queue_entry is nullified in ++ * imq_dev_xmit(). If we have non-NULL nf_queue_entry then we are ++ * leaking entry pointers, maybe memory. We don't know if this is ++ * pointer to already freed memory, or should this be freed. ++ * If this happens we need to add refcounting, etc for nf_queue_entry. ++ */ ++ if (skb->nf_queue_entry && net_ratelimit()) ++ printk(KERN_WARNING ++ "IMQ: kfree_skb: skb->nf_queue_entry != NULL"); +#endif #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(skb->nfct); nf_conntrack_put_reasm(skb->nfct_reasm); -@@ -535,6 +621,9 @@ static void __copy_skb_header(struct sk_ +@@ -535,6 +635,9 @@ static void __copy_skb_header(struct sk_ new->sp = secpath_get(old->sp); #endif memcpy(new->cb, old->cb, sizeof(old->cb)); +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+ skb_copy_stored_cb(new, old); ++ skb_copy_stored_cb(new, old); +#endif new->csum = old->csum; new->local_df = old->local_df; new->pkt_type = old->pkt_type; -@@ -2776,6 +2865,13 @@ void __init skb_init(void) +@@ -2776,6 +2879,13 @@ void __init skb_init(void) 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); diff --git a/target/linux/generic-2.6/patches-2.6.32/205-skb_padding.patch b/target/linux/generic-2.6/patches-2.6.32/205-skb_padding.patch index 948c0b2d4..face44c0a 100644 --- a/target/linux/generic-2.6/patches-2.6.32/205-skb_padding.patch +++ b/target/linux/generic-2.6/patches-2.6.32/205-skb_padding.patch @@ -1,6 +1,6 @@ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -1383,11 +1383,18 @@ static inline int skb_network_offset(con +@@ -1384,11 +1384,18 @@ static inline int skb_network_offset(con * * Various parts of the networking layer expect at least 32 bytes of * headroom, you should not reduce this. @@ -19,7 +19,7 @@ extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); static inline void __skb_trim(struct sk_buff *skb, unsigned int len) -@@ -1477,9 +1484,9 @@ static inline void __skb_queue_purge(str +@@ -1478,9 +1485,9 @@ static inline void __skb_queue_purge(str static inline struct sk_buff *__dev_alloc_skb(unsigned int length, gfp_t gfp_mask) { @@ -31,7 +31,7 @@ return skb; } -@@ -1552,7 +1559,7 @@ static inline int __skb_cow(struct sk_bu +@@ -1553,7 +1560,7 @@ static inline int __skb_cow(struct sk_bu delta = headroom - skb_headroom(skb); if (delta || cloned) @@ -42,7 +42,7 @@ } --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -336,9 +336,9 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -339,9 +339,9 @@ struct sk_buff *__netdev_alloc_skb(struc int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1; struct sk_buff *skb; diff --git a/target/linux/generic-2.6/patches-2.6.32/260-crypto_optional_tests.patch b/target/linux/generic-2.6/patches-2.6.32/260-crypto_optional_tests.patch new file mode 100644 index 000000000..0808c778e --- /dev/null +++ b/target/linux/generic-2.6/patches-2.6.32/260-crypto_optional_tests.patch @@ -0,0 +1,63 @@ +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -96,6 +96,10 @@ config CRYPTO_MANAGER2 + select CRYPTO_BLKCIPHER2 + select CRYPTO_PCOMP + ++config CRYPTO_MANAGER_NO_TESTS ++ bool "Disable internal testsuite to save space" ++ depends on CRYPTO_MANAGER ++ + config CRYPTO_GF128MUL + tristate "GF(2^128) multiplication functions (EXPERIMENTAL)" + depends on EXPERIMENTAL +--- a/crypto/testmgr.c ++++ b/crypto/testmgr.c +@@ -47,6 +47,8 @@ + #define ENCRYPT 1 + #define DECRYPT 0 + ++#ifndef CONFIG_CRYPTO_MANAGER_NO_TESTS ++ + struct tcrypt_result { + struct completion completion; + int err; +@@ -2350,8 +2352,11 @@ static int alg_find_test(const char *alg + return -1; + } + ++#endif /* CONFIG_CRYPTO_MANAGER_NO_TESTS */ ++ + int alg_test(const char *driver, const char *alg, u32 type, u32 mask) + { ++#ifndef CONFIG_CRYPTO_MANAGER_NO_TESTS + int i; + int j; + int rc; +@@ -2406,5 +2411,8 @@ notest: + return 0; + non_fips_alg: + return -EINVAL; ++#else /* CONFIG_CRYPTO_MANAGER_NO_TESTS */ ++ return 0; ++#endif /* CONFIG_CRYPTO_MANAGER_NO_TESTS */ + } + EXPORT_SYMBOL_GPL(alg_test); +--- a/crypto/testmgr.h ++++ b/crypto/testmgr.h +@@ -20,6 +20,8 @@ + + #include + ++#ifndef CONFIG_CRYPTO_MANAGER_NO_TESTS ++ + #define MAX_DIGEST_SIZE 64 + #define MAX_TAP 8 + +@@ -9537,4 +9539,6 @@ static struct hash_testvec crc32c_tv_tem + }, + }; + ++#endif /* CONFIG_CRYPTO_MANAGER_NO_TESTS */ ++ + #endif /* _CRYPTO_TESTMGR_H */ diff --git a/target/linux/generic-2.6/patches-2.6.32/270-scci_sd_section_fix.patch b/target/linux/generic-2.6/patches-2.6.32/270-scci_sd_section_fix.patch new file mode 100644 index 000000000..2ca7e4898 --- /dev/null +++ b/target/linux/generic-2.6/patches-2.6.32/270-scci_sd_section_fix.patch @@ -0,0 +1,13 @@ +Index: linux-2.6.32.7/drivers/scsi/sd.c +=================================================================== +--- linux-2.6.32.7.orig/drivers/scsi/sd.c 2010-02-05 21:19:44.000000000 +0100 ++++ linux-2.6.32.7/drivers/scsi/sd.c 2010-02-05 21:19:52.000000000 +0100 +@@ -2394,7 +2394,7 @@ + * + * Note: this function unregisters this driver from the scsi mid-level. + **/ +-static void __exit exit_sd(void) ++static void exit_sd(void) + { + int i; + diff --git a/target/linux/generic-2.6/patches-2.6.32/970-ocf_kbuild_integration.patch b/target/linux/generic-2.6/patches-2.6.32/970-ocf_kbuild_integration.patch index 09ad25236..5a30d8227 100644 --- a/target/linux/generic-2.6/patches-2.6.32/970-ocf_kbuild_integration.patch +++ b/target/linux/generic-2.6/patches-2.6.32/970-ocf_kbuild_integration.patch @@ -1,6 +1,6 @@ --- a/crypto/Kconfig +++ b/crypto/Kconfig -@@ -810,6 +810,8 @@ config CRYPTO_ANSI_CPRNG +@@ -814,6 +814,8 @@ config CRYPTO_ANSI_CPRNG ANSI X9.31 A.2.4. Not this option must be enabled if CRYPTO_FIPS is selected diff --git a/target/linux/generic-2.6/patches-2.6.32/998-openwrt_lzma_options.patch b/target/linux/generic-2.6/patches-2.6.32/998-openwrt_lzma_options.patch index 08bb83a43..face9154d 100644 --- a/target/linux/generic-2.6/patches-2.6.32/998-openwrt_lzma_options.patch +++ b/target/linux/generic-2.6/patches-2.6.32/998-openwrt_lzma_options.patch @@ -5,7 +5,7 @@ quiet_cmd_lzma = LZMA $@ cmd_lzma = (cat $(filter-out FORCE,$^) | \ - lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ -+ lzma e -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ (rm -f $@ ; false) quiet_cmd_lzo = LZO $@ @@ -29,7 +29,7 @@ - echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" + echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f -" + echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f -" -+ echo "$output_file" | grep -q "\.lzma$" && compr="lzma e -lc1 -lp2 -pb2 -eos -si -so" ++ echo "$output_file" | grep -q "\.lzma$" && compr="lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so" echo "$output_file" | grep -q "\.cpio$" && compr="cat" shift ;; @@ -42,3 +42,13 @@ || (rm -f ${output_file} ; false) fi [ -z ${cpio_file} ] && rm ${cpio_tfile} +--- a/lib/decompress.c ++++ b/lib/decompress.c +@@ -36,6 +36,7 @@ static const struct compress_format { + { {037, 0236}, "gzip", gunzip }, + { {0x42, 0x5a}, "bzip2", bunzip2 }, + { {0x5d, 0x00}, "lzma", unlzma }, ++ { {0x6d, 0x00}, "lzma-openwrt", unlzma }, + { {0x89, 0x4c}, "lzo", unlzo }, + { {0, 0}, NULL, NULL } + }; diff --git a/target/linux/ifxmips/nfs/base-files/lib/preinit/01_init_nfs_ifxmips b/target/linux/ifxmips/nfs/base-files/lib/preinit/01_init_nfs_ifxmips index e2cf52dc4..700892820 100644 --- a/target/linux/ifxmips/nfs/base-files/lib/preinit/01_init_nfs_ifxmips +++ b/target/linux/ifxmips/nfs/base-files/lib/preinit/01_init_nfs_ifxmips @@ -2,7 +2,7 @@ init_nfs() { - grep "/dev/root" /proc/mounts |grep -q nfs && { + grep "/dev/root" /proc/mounts | grep -q nfs && { echo "- init nfs -" exec /sbin/init } diff --git a/target/linux/ifxmips/profiles/000-None.mk b/target/linux/ifxmips/profiles/000-None.mk index 18c5c0cd9..95b04eed9 100644 --- a/target/linux/ifxmips/profiles/000-None.mk +++ b/target/linux/ifxmips/profiles/000-None.mk @@ -7,7 +7,7 @@ define Profile/None NAME:=Generic, No WiFi - PACKAGES:=-hostapd-mini + PACKAGES:=-wpad-mini endef define Profile/None/Description diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile index 819309ed4..425185069 100644 --- a/target/linux/ixp4xx/Makefile +++ b/target/linux/ixp4xx/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2008 OpenWrt.org +# Copyright (C) 2006-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -12,7 +12,7 @@ BOARDNAME:=Intel IXP4xx FEATURES:=squashfs SUBTARGETS=generic harddisk -LINUX_VERSION:=2.6.30.10 +LINUX_VERSION:=2.6.32.7 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ixp4xx/config-2.6.30 b/target/linux/ixp4xx/config-2.6.30 deleted file mode 100644 index 982e9b7d2..000000000 --- a/target/linux/ixp4xx/config-2.6.30 +++ /dev/null @@ -1,161 +0,0 @@ -# CONFIG_AEABI is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_ARCH_ADI_COYOTE is not set -CONFIG_ARCH_FLATMEM_HAS_HOLES=y -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_ARCH_IXCDP1100=y -CONFIG_ARCH_IXDP425=y -CONFIG_ARCH_IXDP4XX=y -CONFIG_ARCH_IXP4XX=y -# CONFIG_ARCH_PRPMC1100 is not set -CONFIG_ARCH_REQUIRE_GPIOLIB=y -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ARM_THUMB is not set -CONFIG_ARM=y -# CONFIG_ARPD is not set -CONFIG_BITREVERSE=y -CONFIG_BOUNCE=y -CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" -CONFIG_CPU_32v5=y -CONFIG_CPU_32=y -CONFIG_CPU_ABRT_EV5T=y -CONFIG_CPU_BIG_ENDIAN=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_CP15=y -CONFIG_CPU_IXP43X=y -CONFIG_CPU_IXP46X=y -CONFIG_CPU_PABRT_NOIFAR=y -CONFIG_CPU_TLB_V4WBI=y -CONFIG_CPU_XSCALE=y -CONFIG_CRC16=y -# CONFIG_DCB is not set -# CONFIG_DEBUG_USER is not set -CONFIG_DEVPORT=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -# CONFIG_DM9000 is not set -CONFIG_DMABOUNCE=y -CONFIG_DNOTIFY=y -CONFIG_EEPROM_AT24=y -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_FPE_FASTFPE is not set -# CONFIG_FPE_NWFPE is not set -CONFIG_FRAME_POINTER=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_FIND_LAST_BIT=y -CONFIG_GENERIC_GPIO=y -CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y -CONFIG_GPIO_DEVICE=y -CONFIG_GPIO_GW_I2C_PLD=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y -# CONFIG_HAMRADIO is not set -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAVE_AOUT=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y -CONFIG_HAVE_MTD_OTP=y -CONFIG_HAVE_OPROFILE=y -# CONFIG_HWMON_DEBUG_CHIP is not set -CONFIG_HWMON_VID=y -CONFIG_HWMON=y -CONFIG_HW_RANDOM_IXP4XX=y -CONFIG_HW_RANDOM=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_GPIO=y -# CONFIG_I2C_IOP3XX is not set -CONFIG_I2C=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_INPUT_IXP4XX_BEEPER is not set -CONFIG_IP_MROUTE=y -CONFIG_IP_PIMSM_V1=y -CONFIG_IP_PIMSM_V2=y -# CONFIG_ISDN is not set -# CONFIG_IWMMXT is not set -CONFIG_IXP4XX_ETH=y -# CONFIG_IXP4XX_INDIRECT_PCI is not set -CONFIG_IXP4XX_LEGACY_DMABOUNCE=y -CONFIG_IXP4XX_NPE=y -CONFIG_IXP4XX_QMGR=y -CONFIG_IXP4XX_WATCHDOG=y -# CONFIG_IXP4XX_ZONE_DMA is not set -CONFIG_LEDS_FSG=y -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_LATCH=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LEGACY_PTYS=y -# CONFIG_LIB80211 is not set -CONFIG_MACH_AP1000=y -CONFIG_MACH_AVILA=y -CONFIG_MACH_CAMBRIA=y -CONFIG_MACH_COMPEX=y -CONFIG_MACH_DSMG600=y -CONFIG_MACH_FSG=y -CONFIG_MACH_GATEWAY7001=y -# CONFIG_MACH_GTWX5715 is not set -# CONFIG_MACH_IXDP465 is not set -CONFIG_MACH_IXDPG425=y -# CONFIG_MACH_KIXRP435 is not set -CONFIG_MACH_LOFT=y -CONFIG_MACH_MI424WR=y -CONFIG_MACH_NAS100D=y -CONFIG_MACH_NSLU2=y -CONFIG_MACH_PRONGHORNMETRO=y -CONFIG_MACH_PRONGHORN=y -CONFIG_MACH_SIDEWINDER=y -CONFIG_MACH_TW5334=y -CONFIG_MACH_USR8200=y -CONFIG_MACH_WG302V1=y -CONFIG_MACH_WG302V2=y -CONFIG_MACH_WRT300NV2=y -CONFIG_MISC_FILESYSTEMS=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -# CONFIG_MTD_CFI_GEOMETRY is not set -CONFIG_MTD_IXP4XX=y -CONFIG_MTD_OTP=y -CONFIG_MTD_REDBOOT_PARTS=y -# CONFIG_NET_SCH_DRR is not set -# CONFIG_NO_IOPORT is not set -# CONFIG_OUTER_CACHE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PCI_STUB is not set -CONFIG_PHYLIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_DS1672=y -CONFIG_RTC_DRV_ISL1208=y -CONFIG_RTC_DRV_PCF8563=y -CONFIG_RTC_DRV_X1205=y -# CONFIG_SCSI_DMA is not set -CONFIG_SENSORS_AD7418=y -CONFIG_SENSORS_MAX6650=y -CONFIG_SENSORS_W83781D=y -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SPLIT_PTLOCK_CPUS=4096 -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_UID16=y -CONFIG_USB_SUPPORT=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_WATCHDOG_NOWAYOUT=y -CONFIG_XSCALE_PMU=y -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/config-2.6.31 b/target/linux/ixp4xx/config-2.6.31 deleted file mode 100644 index db9d9f88c..000000000 --- a/target/linux/ixp4xx/config-2.6.31 +++ /dev/null @@ -1,150 +0,0 @@ -# CONFIG_AEABI is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_ARCH_ADI_COYOTE is not set -CONFIG_ARCH_IXCDP1100=y -CONFIG_ARCH_IXDP425=y -CONFIG_ARCH_IXDP4XX=y -CONFIG_ARCH_IXP4XX=y -# CONFIG_ARCH_PRPMC1100 is not set -CONFIG_ARCH_REQUIRE_GPIOLIB=y -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ARM_THUMB is not set -CONFIG_ARM=y -# CONFIG_ARPD is not set -CONFIG_BITREVERSE=y -CONFIG_BOUNCE=y -CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" -CONFIG_CPU_32v5=y -CONFIG_CPU_32=y -CONFIG_CPU_ABRT_EV5T=y -CONFIG_CPU_BIG_ENDIAN=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_CP15=y -CONFIG_CPU_ENDIAN_BE32=y -# CONFIG_CPU_ENDIAN_BE8 is not set -CONFIG_CPU_IXP43X=y -CONFIG_CPU_IXP46X=y -CONFIG_CPU_PABRT_NOIFAR=y -CONFIG_CPU_TLB_V4WBI=y -CONFIG_CPU_XSCALE=y -CONFIG_CRC16=y -# CONFIG_DEBUG_USER is not set -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DEVPORT=y -# CONFIG_DM9000 is not set -CONFIG_DMABOUNCE=y -CONFIG_DNOTIFY=y -CONFIG_EEPROM_AT24=y -# CONFIG_FPE_FASTFPE is not set -# CONFIG_FPE_NWFPE is not set -CONFIG_FRAME_POINTER=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_FIND_LAST_BIT=y -CONFIG_GENERIC_GPIO=y -CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y -CONFIG_GPIO_DEVICE=y -CONFIG_GPIO_GW_I2C_PLD=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y -# CONFIG_HAMRADIO is not set -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAVE_AOUT=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y -CONFIG_HAVE_MTD_OTP=y -CONFIG_HAVE_OPROFILE=y -# CONFIG_HWMON_DEBUG_CHIP is not set -CONFIG_HWMON_VID=y -CONFIG_HWMON=y -CONFIG_HW_RANDOM_IXP4XX=y -CONFIG_HW_RANDOM=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_GPIO=y -# CONFIG_I2C_IOP3XX is not set -CONFIG_I2C=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IP_PIMSM_V1=y -CONFIG_IP_PIMSM_V2=y -# CONFIG_ISDN is not set -# CONFIG_IWMMXT is not set -CONFIG_IXP4XX_ETH=y -# CONFIG_IXP4XX_INDIRECT_PCI is not set -CONFIG_IXP4XX_LEGACY_DMABOUNCE=y -CONFIG_IXP4XX_NPE=y -CONFIG_IXP4XX_QMGR=y -CONFIG_IXP4XX_WATCHDOG=y -CONFIG_LEDS_FSG=y -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_LATCH=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LEGACY_PTYS=y -CONFIG_MACH_AP1000=y -CONFIG_MACH_AVILA=y -CONFIG_MACH_CAMBRIA=y -CONFIG_MACH_COMPEX=y -CONFIG_MACH_DSMG600=y -CONFIG_MACH_FSG=y -CONFIG_MACH_GATEWAY7001=y -# CONFIG_MACH_GORAMO_MLR is not set -# CONFIG_MACH_GTWX5715 is not set -# CONFIG_MACH_IXDP465 is not set -CONFIG_MACH_IXDPG425=y -# CONFIG_MACH_KIXRP435 is not set -CONFIG_MACH_LOFT=y -CONFIG_MACH_MI424WR=y -CONFIG_MACH_NAS100D=y -CONFIG_MACH_NSLU2=y -CONFIG_MACH_PRONGHORNMETRO=y -CONFIG_MACH_PRONGHORN=y -CONFIG_MACH_SIDEWINDER=y -CONFIG_MACH_TW5334=y -CONFIG_MACH_USR8200=y -CONFIG_MACH_WG302V1=y -CONFIG_MACH_WG302V2=y -CONFIG_MACH_WRT300NV2=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -# CONFIG_MTD_CFI_GEOMETRY is not set -CONFIG_MTD_IXP4XX=y -CONFIG_MTD_OTP=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PAGE_OFFSET=0xC0000000 -CONFIG_PHYLIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_DS1672=y -CONFIG_RTC_DRV_ISL1208=y -CONFIG_RTC_DRV_PCF8563=y -CONFIG_RTC_DRV_X1205=y -# CONFIG_SCSI_DMA is not set -CONFIG_SENSORS_AD7418=y -CONFIG_SENSORS_MAX6650=y -CONFIG_SENSORS_W83781D=y -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SPLIT_PTLOCK_CPUS=4096 -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_UID16=y -CONFIG_USB_SUPPORT=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_WATCHDOG_NOWAYOUT=y -CONFIG_XSCALE_PMU=y -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/config-default b/target/linux/ixp4xx/config-default deleted file mode 100644 index 46dab9d90..000000000 --- a/target/linux/ixp4xx/config-default +++ /dev/null @@ -1,244 +0,0 @@ -# CONFIG_8139TOO is not set -# CONFIG_AEABI is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_ARCH_ADI_COYOTE is not set -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_ARCH_IXCDP1100=y -CONFIG_ARCH_IXDP425=y -CONFIG_ARCH_IXDP4XX=y -CONFIG_ARCH_IXP4XX=y -# CONFIG_ARCH_PRPMC1100 is not set -CONFIG_ARCH_SUPPORTS_AOUT=y -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ARM_THUMB is not set -CONFIG_ARM=y -# CONFIG_ARPD is not set -# CONFIG_ARTHUR is not set -CONFIG_ATA=m -# CONFIG_ATMEL is not set -# CONFIG_ATM is not set -# CONFIG_BINFMT_AOUT is not set -CONFIG_BITREVERSE=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BONDING is not set -CONFIG_BOUNCE=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_CIFS_STATS is not set -CONFIG_CLASSIC_RCU=y -CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" -CONFIG_CPU_32v5=y -CONFIG_CPU_32=y -CONFIG_CPU_ABRT_EV5T=y -CONFIG_CPU_BIG_ENDIAN=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_CP15=y -# CONFIG_CPU_DCACHE_DISABLE is not set -CONFIG_CPU_IXP43X=y -CONFIG_CPU_IXP46X=y -CONFIG_CPU_PABRT_NOIFAR=y -CONFIG_CPU_TLB_V4WBI=y -CONFIG_CPU_XSCALE=y -CONFIG_CRC16=y -# CONFIG_DEBUG_USER is not set -CONFIG_DEVPORT=y -CONFIG_DLCI=m -CONFIG_DLCI_MAX=8 -# CONFIG_DM9000 is not set -CONFIG_DMABOUNCE_DEBUG=y -CONFIG_DMABOUNCE=y -CONFIG_DNOTIFY=y -# CONFIG_DSCC4 is not set -# CONFIG_E1000E_ENABLED is not set -# CONFIG_E100 is not set -# CONFIG_FARSYNC is not set -# CONFIG_FPE_FASTFPE is not set -# CONFIG_FPE_NWFPE is not set -CONFIG_FRAME_POINTER=y -CONFIG_FS_POSIX_ACL=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CLOCKEVENTS=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_GENERIC_FIND_NEXT_BIT is not set -CONFIG_GENERIC_GPIO=y -CONFIG_GPIO_DEVICE=y -# CONFIG_HAMRADIO is not set -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -# CONFIG_HAVE_DMA_ATTRS is not set -CONFIG_HAVE_IDE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HDLC_CISCO=m -CONFIG_HDLC_FR=m -CONFIG_HDLC=m -CONFIG_HDLC_PPP=m -# CONFIG_HDLC_RAW_ETH is not set -CONFIG_HDLC_RAW=m -# CONFIG_HERMES is not set -CONFIG_HID=m -CONFIG_HID_SUPPORT=y -# CONFIG_HWMON_DEBUG_CHIP is not set -CONFIG_HWMON_VID=y -CONFIG_HWMON=y -CONFIG_HW_RANDOM_IXP4XX=y -CONFIG_HW_RANDOM=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_GPIO=y -# CONFIG_I2C_IOP3XX is not set -CONFIG_I2C=y -# CONFIG_IDE is not set -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_INPUT_IXP4XX_BEEPER is not set -CONFIG_INPUT=m -# CONFIG_IP6_NF_MANGLE is not set -# CONFIG_IP6_NF_MATCH_EUI64 is not set -# CONFIG_IP6_NF_MATCH_FRAG is not set -# CONFIG_IP6_NF_MATCH_HL is not set -# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set -# CONFIG_IP6_NF_MATCH_OPTS is not set -# CONFIG_IP6_NF_MATCH_RT is not set -# CONFIG_IP6_NF_TARGET_LOG is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_MROUTE=y -# CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_MATCH_ADDRTYPE is not set -# CONFIG_IP_NF_MATCH_ECN is not set -# CONFIG_IP_NF_MATCH_RECENT is not set -# CONFIG_IP_NF_MATCH_TIME is not set -# CONFIG_IP_NF_SET is not set -# CONFIG_IP_NF_TARGET_ECN is not set -# CONFIG_IP_NF_TARGET_LOG is not set -# CONFIG_IP_NF_TARGET_NETMAP is not set -# CONFIG_IP_NF_TARGET_TTL is not set -# CONFIG_IP_NF_TARGET_ULOG is not set -CONFIG_IP_PIMSM_V1=y -CONFIG_IP_PIMSM_V2=y -CONFIG_IPV6_NDISC_NODETYPE=y -# CONFIG_IPV6_ROUTER_PREF is not set -# CONFIG_IWLWIFI_LEDS is not set -# CONFIG_IWMMXT is not set -CONFIG_IXP4XX_ETH=y -# CONFIG_IXP4XX_HSS is not set -# CONFIG_IXP4XX_INDIRECT_PCI is not set -CONFIG_IXP4XX_NPE=y -CONFIG_IXP4XX_QMGR=y -CONFIG_IXP4XX_WATCHDOG=y -# CONFIG_LANMEDIA is not set -CONFIG_LEDS_FSG=y -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_LATCH=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LEGACY_PTYS=y -# CONFIG_LLC2 is not set -CONFIG_MACH_AP1000=y -CONFIG_MACH_AVILA=y -CONFIG_MACH_CAMBRIA=y -CONFIG_MACH_COMPEX=y -CONFIG_MACH_DSMG600=y -CONFIG_MACH_FSG=y -CONFIG_MACH_GATEWAY7001=y -# CONFIG_MACH_GTWX5715 is not set -# CONFIG_MACH_IXDP465 is not set -CONFIG_MACH_IXDPG425=y -# CONFIG_MACH_KIXRP435 is not set -CONFIG_MACH_LOFT=y -CONFIG_MACH_NAS100D=y -CONFIG_MACH_NSLU2=y -CONFIG_MACH_PRONGHORNMETRO=y -CONFIG_MACH_PRONGHORN=y -CONFIG_MACH_SIDEWINDER=y -CONFIG_MACH_TW5334=y -CONFIG_MACH_USR8200=y -CONFIG_MACH_WG302V1=y -CONFIG_MACH_WG302V2=y -CONFIG_MACH_WRT300NV2=y -CONFIG_MEDIA_TUNER=m -CONFIG_MEDIA_TUNER_MT20XX=m -CONFIG_MEDIA_TUNER_SIMPLE=m -CONFIG_MEDIA_TUNER_TDA8290=m -CONFIG_MEDIA_TUNER_TDA9887=m -CONFIG_MEDIA_TUNER_TEA5761=m -CONFIG_MEDIA_TUNER_TEA5767=m -CONFIG_MEDIA_TUNER_XC2028=m -CONFIG_MEDIA_TUNER_XC5000=m -# CONFIG_MINIX_FS is not set -CONFIG_MTD_CFI_ADV_OPTIONS=y -# CONFIG_MTD_CFI_GEOMETRY is not set -CONFIG_MTD_IXP4XX=y -CONFIG_MTD_OTP=y -CONFIG_MTD_REDBOOT_PARTS=y -# CONFIG_NE2K_PCI is not set -# CONFIG_NET_EMATCH is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_SCH_NETEM is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NO_IOPORT is not set -# CONFIG_OUTER_CACHE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PATA_ARTOP=m -CONFIG_PATA_IXP4XX_CF=m -# CONFIG_PC300 is not set -# CONFIG_PCI200SYN is not set -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_PRISM54 is not set -# CONFIG_R6040 is not set -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_DS1672=y -CONFIG_RTC_DRV_ISL1208=y -CONFIG_RTC_DRV_PCF8563=y -CONFIG_RTC_DRV_X1205=y -# CONFIG_SCSI_MULTI_LUN is not set -CONFIG_SENSORS_AD7418=y -CONFIG_SENSORS_EEPROM=y -CONFIG_SENSORS_MAX6650=y -# CONFIG_SENSORS_PC87360 is not set -CONFIG_SENSORS_W83781D=y -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SMC91X is not set -CONFIG_SPLIT_PTLOCK_CPUS=4096 -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_UID16=y -CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y -CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y -CONFIG_USB_EHCI_HCD=m -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -CONFIG_USB=m -# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set -# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set -CONFIG_USB_OHCI_HCD=m -# CONFIG_USB_SERIAL_MOTOROLA is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_UHCI_HCD=m -CONFIG_VECTORS_BASE=0xffff0000 -# CONFIG_VGASTATE is not set -# CONFIG_VIA_RHINE is not set -CONFIG_VIA_VELOCITY=m -CONFIG_VIDEO_MEDIA=m -CONFIG_VM_EVENT_COUNTERS=y -# CONFIG_WANXL is not set -CONFIG_WAN=y -# CONFIG_XFS_FS is not set -# CONFIG_XIP_KERNEL is not set -CONFIG_XSCALE_PMU=y -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/patches-2.6.30/010-ixp43x_pci_fixup.patch b/target/linux/ixp4xx/patches-2.6.30/010-ixp43x_pci_fixup.patch deleted file mode 100644 index 35af7f4fa..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/010-ixp43x_pci_fixup.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/include/mach/hardware.h -+++ b/arch/arm/mach-ixp4xx/include/mach/hardware.h -@@ -18,7 +18,7 @@ - #define __ASM_ARCH_HARDWARE_H__ - - #define PCIBIOS_MIN_IO 0x00001000 --#define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x40000000 : 0x48000000) -+#define PCIBIOS_MIN_MEM 0x48000000 - - /* - * We override the standard dma-mask routines for bouncing. diff --git a/target/linux/ixp4xx/patches-2.6.30/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-2.6.30/020-gateworks_i2c_pld.patch deleted file mode 100644 index 60f27833b..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/020-gateworks_i2c_pld.patch +++ /dev/null @@ -1,421 +0,0 @@ ---- /dev/null -+++ b/drivers/gpio/gw_i2c_pld.c -@@ -0,0 +1,371 @@ -+/* -+ * Gateworks I2C PLD GPIO expander -+ * -+ * Copyright (C) 2009 Gateworks Corporation -+ * -+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static const struct i2c_device_id gw_i2c_pld_id[] = { -+ { "gw_i2c_pld", 8 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(i2c, gw_i2c_pld_id); -+ -+/* -+ * The Gateworks I2C PLD chip only expose one read and one -+ * write register. Writing a "one" bit (to match the reset state) lets -+ * that pin be used as an input. It is an open-drain model. -+ */ -+ -+struct gw_i2c_pld { -+ struct gpio_chip chip; -+ struct i2c_client *client; -+ unsigned out; /* software latch */ -+}; -+ -+/*-------------------------------------------------------------------------*/ -+ -+/* -+ * The Gateworks I2C PLD chip does not properly send the acknowledge bit -+ * thus we cannot use standard i2c_smbus functions. We have recreated -+ * our own here, but we still use the mutex_lock to lock the i2c_bus -+ * as the device still exists on the I2C bus. -+*/ -+ -+#define PLD_SCL_GPIO 6 -+#define PLD_SDA_GPIO 7 -+ -+#define SCL_LO() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_LOW) -+#define SCL_HI() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_HIGH) -+#define SCL_EN() gpio_line_config(PLD_SCL_GPIO, IXP4XX_GPIO_OUT) -+#define SDA_LO() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_LOW) -+#define SDA_HI() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_HIGH) -+#define SDA_EN() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_OUT) -+#define SDA_DIS() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_IN) -+#define SDA_IN(x) gpio_line_get(PLD_SDA_GPIO, &x); -+ -+static int i2c_pld_write_byte(int address, int byte) -+{ -+ int i; -+ -+ address = (address << 1) & ~0x1; -+ -+ SDA_HI(); -+ SDA_EN(); -+ SCL_EN(); -+ SCL_HI(); -+ SDA_LO(); -+ SCL_LO(); -+ -+ for (i = 7; i >= 0; i--) -+ { -+ if (address & (1 << i)) -+ SDA_HI(); -+ else -+ SDA_LO(); -+ -+ SCL_HI(); -+ SCL_LO(); -+ } -+ -+ SDA_DIS(); -+ SCL_HI(); -+ SDA_IN(i); -+ SCL_LO(); -+ SDA_EN(); -+ -+ for (i = 7; i >= 0; i--) -+ { -+ if (byte & (1 << i)) -+ SDA_HI(); -+ else -+ SDA_LO(); -+ SCL_HI(); -+ SCL_LO(); -+ } -+ -+ SDA_DIS(); -+ SCL_HI(); -+ SDA_IN(i); -+ SCL_LO(); -+ -+ SDA_HI(); -+ SDA_EN(); -+ -+ SDA_LO(); -+ SCL_HI(); -+ SDA_HI(); -+ SCL_LO(); -+ SCL_HI(); -+ -+ return 0; -+} -+ -+static unsigned int i2c_pld_read_byte(int address) -+{ -+ int i = 0, byte = 0; -+ int bit; -+ -+ address = (address << 1) | 0x1; -+ -+ SDA_HI(); -+ SDA_EN(); -+ SCL_EN(); -+ SCL_HI(); -+ SDA_LO(); -+ SCL_LO(); -+ -+ for (i = 7; i >= 0; i--) -+ { -+ if (address & (1 << i)) -+ SDA_HI(); -+ else -+ SDA_LO(); -+ -+ SCL_HI(); -+ SCL_LO(); -+ } -+ -+ SDA_DIS(); -+ SCL_HI(); -+ SDA_IN(i); -+ SCL_LO(); -+ SDA_EN(); -+ -+ SDA_DIS(); -+ for (i = 7; i >= 0; i--) -+ { -+ SCL_HI(); -+ SDA_IN(bit); -+ byte |= bit << i; -+ SCL_LO(); -+ } -+ -+ SDA_LO(); -+ SCL_HI(); -+ SDA_HI(); -+ SCL_LO(); -+ SCL_HI(); -+ -+ return byte; -+} -+ -+ -+static int gw_i2c_pld_input8(struct gpio_chip *chip, unsigned offset) -+{ -+ int ret; -+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); -+ struct i2c_adapter *adap = gpio->client->adapter; -+ -+ if (in_atomic() || irqs_disabled()) { -+ ret = mutex_trylock(&adap->bus_lock); -+ if (!ret) -+ /* I2C activity is ongoing. */ -+ return -EAGAIN; -+ } else { -+ mutex_lock_nested(&adap->bus_lock, adap->level); -+ } -+ -+ gpio->out |= (1 << offset); -+ -+ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); -+ -+ mutex_unlock(&adap->bus_lock); -+ -+ return ret; -+} -+ -+static int gw_i2c_pld_get8(struct gpio_chip *chip, unsigned offset) -+{ -+ int ret; -+ s32 value; -+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); -+ struct i2c_adapter *adap = gpio->client->adapter; -+ -+ if (in_atomic() || irqs_disabled()) { -+ ret = mutex_trylock(&adap->bus_lock); -+ if (!ret) -+ /* I2C activity is ongoing. */ -+ return -EAGAIN; -+ } else { -+ mutex_lock_nested(&adap->bus_lock, adap->level); -+ } -+ -+ value = i2c_pld_read_byte(gpio->client->addr); -+ -+ mutex_unlock(&adap->bus_lock); -+ -+ return (value < 0) ? 0 : (value & (1 << offset)); -+} -+ -+static int gw_i2c_pld_output8(struct gpio_chip *chip, unsigned offset, int value) -+{ -+ int ret; -+ -+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); -+ struct i2c_adapter *adap = gpio->client->adapter; -+ -+ unsigned bit = 1 << offset; -+ -+ if (in_atomic() || irqs_disabled()) { -+ ret = mutex_trylock(&adap->bus_lock); -+ if (!ret) -+ /* I2C activity is ongoing. */ -+ return -EAGAIN; -+ } else { -+ mutex_lock_nested(&adap->bus_lock, adap->level); -+ } -+ -+ -+ if (value) -+ gpio->out |= bit; -+ else -+ gpio->out &= ~bit; -+ -+ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); -+ -+ mutex_unlock(&adap->bus_lock); -+ -+ return ret; -+} -+ -+static void gw_i2c_pld_set8(struct gpio_chip *chip, unsigned offset, int value) -+{ -+ gw_i2c_pld_output8(chip, offset, value); -+} -+ -+/*-------------------------------------------------------------------------*/ -+ -+static int gw_i2c_pld_probe(struct i2c_client *client, -+ const struct i2c_device_id *id) -+{ -+ struct gw_i2c_pld_platform_data *pdata; -+ struct gw_i2c_pld *gpio; -+ int status; -+ -+ pdata = client->dev.platform_data; -+ if (!pdata) -+ return -ENODEV; -+ -+ /* Allocate, initialize, and register this gpio_chip. */ -+ gpio = kzalloc(sizeof *gpio, GFP_KERNEL); -+ if (!gpio) -+ return -ENOMEM; -+ -+ gpio->chip.base = pdata->gpio_base; -+ gpio->chip.can_sleep = 1; -+ gpio->chip.dev = &client->dev; -+ gpio->chip.owner = THIS_MODULE; -+ -+ gpio->chip.ngpio = pdata->nr_gpio; -+ gpio->chip.direction_input = gw_i2c_pld_input8; -+ gpio->chip.get = gw_i2c_pld_get8; -+ gpio->chip.direction_output = gw_i2c_pld_output8; -+ gpio->chip.set = gw_i2c_pld_set8; -+ -+ gpio->chip.label = client->name; -+ -+ gpio->client = client; -+ i2c_set_clientdata(client, gpio); -+ -+ gpio->out = 0xFF; -+ -+ status = gpiochip_add(&gpio->chip); -+ if (status < 0) -+ goto fail; -+ -+ dev_info(&client->dev, "gpios %d..%d on a %s%s\n", -+ gpio->chip.base, -+ gpio->chip.base + gpio->chip.ngpio - 1, -+ client->name, -+ client->irq ? " (irq ignored)" : ""); -+ -+ /* Let platform code set up the GPIOs and their users. -+ * Now is the first time anyone could use them. -+ */ -+ if (pdata->setup) { -+ status = pdata->setup(client, -+ gpio->chip.base, gpio->chip.ngpio, -+ pdata->context); -+ if (status < 0) -+ dev_warn(&client->dev, "setup --> %d\n", status); -+ } -+ -+ return 0; -+ -+fail: -+ dev_dbg(&client->dev, "probe error %d for '%s'\n", -+ status, client->name); -+ kfree(gpio); -+ return status; -+} -+ -+static int gw_i2c_pld_remove(struct i2c_client *client) -+{ -+ struct gw_i2c_pld_platform_data *pdata = client->dev.platform_data; -+ struct gw_i2c_pld *gpio = i2c_get_clientdata(client); -+ int status = 0; -+ -+ if (pdata->teardown) { -+ status = pdata->teardown(client, -+ gpio->chip.base, gpio->chip.ngpio, -+ pdata->context); -+ if (status < 0) { -+ dev_err(&client->dev, "%s --> %d\n", -+ "teardown", status); -+ return status; -+ } -+ } -+ -+ status = gpiochip_remove(&gpio->chip); -+ if (status == 0) -+ kfree(gpio); -+ else -+ dev_err(&client->dev, "%s --> %d\n", "remove", status); -+ return status; -+} -+ -+static struct i2c_driver gw_i2c_pld_driver = { -+ .driver = { -+ .name = "gw_i2c_pld", -+ .owner = THIS_MODULE, -+ }, -+ .probe = gw_i2c_pld_probe, -+ .remove = gw_i2c_pld_remove, -+ .id_table = gw_i2c_pld_id, -+}; -+ -+static int __init gw_i2c_pld_init(void) -+{ -+ return i2c_add_driver(&gw_i2c_pld_driver); -+} -+module_init(gw_i2c_pld_init); -+ -+static void __exit gw_i2c_pld_exit(void) -+{ -+ i2c_del_driver(&gw_i2c_pld_driver); -+} -+module_exit(gw_i2c_pld_exit); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Chris Lang"); ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -161,6 +161,14 @@ config GPIO_BT8XX - - If unsure, say N. - -+config GPIO_GW_I2C_PLD -+ tristate "Gateworks I2C PLD GPIO Expander" -+ depends on I2C -+ help -+ Say yes here to provide access to the Gateworks I2C PLD GPIO -+ Expander. This is used at least on the GW2358-4. -+ -+ - comment "SPI GPIO expanders:" - - config GPIO_MAX7301 ---- a/drivers/gpio/Makefile -+++ b/drivers/gpio/Makefile -@@ -12,3 +12,4 @@ obj-$(CONFIG_GPIO_PCF857X) += pcf857x.o - obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o - obj-$(CONFIG_GPIO_XILINX) += xilinx_gpio.o - obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o -+obj-$(CONFIG_GPIO_GW_I2C_PLD) += gw_i2c_pld.o ---- /dev/null -+++ b/include/linux/i2c/gw_i2c_pld.h -@@ -0,0 +1,20 @@ -+#ifndef __LINUX_GW_I2C_PLD_H -+#define __LINUX_GW_I2C_PLD_H -+ -+/** -+ * The Gateworks I2C PLD Implements an additional 8 bits of GPIO through the PLD -+ */ -+ -+struct gw_i2c_pld_platform_data { -+ unsigned gpio_base; -+ unsigned nr_gpio; -+ int (*setup)(struct i2c_client *client, -+ int gpio, unsigned ngpio, -+ void *context); -+ int (*teardown)(struct i2c_client *client, -+ int gpio, unsigned ngpio, -+ void *context); -+ void *context; -+}; -+ -+#endif /* __LINUX_GW_I2C_PLD_H */ diff --git a/target/linux/ixp4xx/patches-2.6.30/050-disable_dmabounce.patch b/target/linux/ixp4xx/patches-2.6.30/050-disable_dmabounce.patch deleted file mode 100644 index eb36eb1c9..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/050-disable_dmabounce.patch +++ /dev/null @@ -1,164 +0,0 @@ ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -375,7 +375,6 @@ config ARCH_IXP4XX - select GENERIC_GPIO - select GENERIC_TIME - select GENERIC_CLOCKEVENTS -- select DMABOUNCE if PCI - help - Support for Intel's IXP4XX (XScale) family of processors. - ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -193,6 +193,45 @@ config IXP4XX_INDIRECT_PCI - need to use the indirect method instead. If you don't know - what you need, leave this option unselected. - -+config IXP4XX_LEGACY_DMABOUNCE -+ bool "legacy PCI DMA bounce support" -+ depends on PCI -+ default n -+ select DMABOUNCE -+ help -+ The IXP4xx is limited to a 64MB window for PCI DMA, which -+ requires that PCI accesses above 64MB are bounced via buffers -+ below 64MB. Furthermore the IXP4xx has an erratum where PCI -+ read prefetches just below the 64MB limit can trigger lockups. -+ -+ The kernel has traditionally handled these two issue by using -+ ARM specific DMA bounce support code for all accesses >= 64MB. -+ That code causes problems of its own, so it is desirable to -+ disable it. As the kernel now has a workaround for the PCI read -+ prefetch erratum, it no longer requires the ARM bounce code. -+ -+ Enabling this option makes IXP4xx continue to use the problematic -+ ARM DMA bounce code. Disabling this option makes IXP4xx use the -+ kernel's generic bounce code. -+ -+ Say 'N'. -+ -+config IXP4XX_ZONE_DMA -+ bool "Support > 64MB RAM" -+ depends on !IXP4XX_LEGACY_DMABOUNCE -+ default y -+ select ZONE_DMA -+ help -+ The IXP4xx is limited to a 64MB window for PCI DMA, which -+ requires that PCI accesses above 64MB are bounced via buffers -+ below 64MB. -+ -+ Disabling this option allows you to omit the support code for -+ DMA-able memory allocations and DMA bouncing, but the kernel -+ will then not work properly if more than 64MB of RAM is present. -+ -+ Say 'Y' unless your platform is limited to <= 64MB of RAM. -+ - config IXP4XX_QMGR - tristate "IXP4xx Queue Manager support" - help ---- a/arch/arm/mach-ixp4xx/common-pci.c -+++ b/arch/arm/mach-ixp4xx/common-pci.c -@@ -321,27 +321,38 @@ static int abort_handler(unsigned long a - */ - static int ixp4xx_pci_platform_notify(struct device *dev) - { -- if(dev->bus == &pci_bus_type) { -- *dev->dma_mask = SZ_64M - 1; -+ if (dev->bus == &pci_bus_type) { -+ *dev->dma_mask = SZ_64M - 1; - dev->coherent_dma_mask = SZ_64M - 1; -+#ifdef CONFIG_DMABOUNCE - dmabounce_register_dev(dev, 2048, 4096); -+#endif - } - return 0; - } - - static int ixp4xx_pci_platform_notify_remove(struct device *dev) - { -- if(dev->bus == &pci_bus_type) { -+#ifdef CONFIG_DMABOUNCE -+ if (dev->bus == &pci_bus_type) - dmabounce_unregister_dev(dev); -- } -+#endif - return 0; - } - -+#ifdef CONFIG_DMABOUNCE - int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) - { -+ /* Note that this returns true for the last page below 64M due to -+ * IXP4xx erratum 15 (SCR 1289), which states that PCI prefetches -+ * can cross the boundary between valid memory and a reserved region -+ * causing AHB bus errors and a lock-up. -+ */ - return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M); - } -+#endif - -+#ifdef CONFIG_ZONE_DMA - /* - * Only first 64MB of memory can be accessed via PCI. - * We use GFP_DMA to allocate safe buffers to do map/unmap. -@@ -364,6 +375,7 @@ void __init ixp4xx_adjust_zones(int node - zhole_size[1] = zhole_size[0]; - zhole_size[0] = 0; - } -+#endif - - void __init ixp4xx_pci_preinit(void) - { -@@ -517,19 +529,35 @@ struct pci_bus * __devinit ixp4xx_scan_b - int - pci_set_dma_mask(struct pci_dev *dev, u64 mask) - { -- if (mask >= SZ_64M - 1 ) -+#ifdef CONFIG_DMABOUNCE -+ if (mask >= SZ_64M - 1) - return 0; - - return -EIO; -+#else -+ /* Only honour masks < SZ_64M. Silently ignore masks >= SZ_64M -+ as generic drivers do not know about IXP4xx PCI DMA quirks. */ -+ if (mask < SZ_64M) -+ dev->dma_mask = mask; -+ return 0; -+#endif - } - - int - pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) - { -- if (mask >= SZ_64M - 1 ) -+#ifdef CONFIG_DMABOUNCE -+ if (mask >= SZ_64M - 1) - return 0; - - return -EIO; -+#else -+ /* Only honour masks < SZ_64M. Silently ignore masks >= SZ_64M -+ as generic drivers do not know about IXP4xx PCI DMA quirks. */ -+ if (mask < SZ_64M) -+ dev->dev.coherent_dma_mask = mask; -+ return 0; -+#endif - } - - EXPORT_SYMBOL(ixp4xx_pci_read); ---- a/arch/arm/mach-ixp4xx/include/mach/memory.h -+++ b/arch/arm/mach-ixp4xx/include/mach/memory.h -@@ -16,10 +16,12 @@ - - #if !defined(__ASSEMBLY__) && defined(CONFIG_PCI) - -+#ifdef CONFIG_ZONE_DMA - void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes); - - #define arch_adjust_zones(node, size, holes) \ - ixp4xx_adjust_zones(node, size, holes) -+#endif - - #define ISA_DMA_THRESHOLD (SZ_64M - 1) - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) diff --git a/target/linux/ixp4xx/patches-2.6.30/090-increase_entropy_pools.patch b/target/linux/ixp4xx/patches-2.6.30/090-increase_entropy_pools.patch deleted file mode 100644 index bb168fa84..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/090-increase_entropy_pools.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/drivers/char/random.c -+++ b/drivers/char/random.c -@@ -263,9 +263,9 @@ - /* - * Configuration information - */ --#define INPUT_POOL_WORDS 128 --#define OUTPUT_POOL_WORDS 32 --#define SEC_XFER_SIZE 512 -+#define INPUT_POOL_WORDS 256 -+#define OUTPUT_POOL_WORDS 64 -+#define SEC_XFER_SIZE 1024 - - /* - * The minimum number of bits of entropy before we wake up a read on diff --git a/target/linux/ixp4xx/patches-2.6.30/100-wg302v2_gateway7001_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.30/100-wg302v2_gateway7001_mac_plat_info.patch deleted file mode 100644 index a19a4085a..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/100-wg302v2_gateway7001_mac_plat_info.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/gateway7001-setup.c -+++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c -@@ -76,9 +76,35 @@ static struct platform_device gateway700 - .resource = &gateway7001_uart_resource, - }; - -+static struct eth_plat_info gateway7001_plat_eth[] = { -+ { -+ .phy = 1, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 2, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device gateway7001_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = gateway7001_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = gateway7001_plat_eth + 1, -+ } -+}; -+ - static struct platform_device *gateway7001_devices[] __initdata = { - &gateway7001_flash, -- &gateway7001_uart -+ &gateway7001_uart, -+ &gateway7001_eth[0], -+ &gateway7001_eth[1], - }; - - static void __init gateway7001_init(void) ---- a/arch/arm/mach-ixp4xx/wg302v2-setup.c -+++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c -@@ -77,9 +77,26 @@ static struct platform_device wg302v2_ua - .resource = &wg302v2_uart_resource, - }; - -+static struct eth_plat_info wg302v2_plat_eth[] = { -+ { -+ .phy = 8, -+ .rxq = 3, -+ .txreadyq = 20, -+ } -+}; -+ -+static struct platform_device wg302v2_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = wg302v2_plat_eth, -+ } -+}; -+ - static struct platform_device *wg302v2_devices[] __initdata = { - &wg302v2_flash, - &wg302v2_uart, -+ &wg302v2_eth[0], - }; - - static void __init wg302v2_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.30/105-wg302v1_support.patch b/target/linux/ixp4xx/patches-2.6.30/105-wg302v1_support.patch deleted file mode 100644 index 600813f17..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/105-wg302v1_support.patch +++ /dev/null @@ -1,257 +0,0 @@ ---- a/arch/arm/configs/ixp4xx_defconfig -+++ b/arch/arm/configs/ixp4xx_defconfig -@@ -155,6 +155,7 @@ CONFIG_MACH_AVILA=y - CONFIG_MACH_LOFT=y - CONFIG_ARCH_ADI_COYOTE=y - CONFIG_MACH_GATEWAY7001=y -+CONFIG_MACH_WG302V1=y - CONFIG_MACH_WG302V2=y - CONFIG_ARCH_IXDP425=y - CONFIG_MACH_IXDPG425=y ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -49,6 +49,14 @@ config MACH_GATEWAY7001 - 7001 Access Point. For more information on this platform, - see http://openwrt.org - -+config MACH_WG302V1 -+ bool "Netgear WG302 v1 / WAG302 v1" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Netgear's -+ WG302 v1 or WAG302 v1 Access Points. For more information -+ on this platform, see http://openwrt.org -+ - config MACH_WG302V2 - bool "Netgear WG302 v2 / WAG302 v2" - select PCI ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -14,6 +14,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p - obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o - obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o - obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o -+obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o - obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - -@@ -28,6 +29,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup. - obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o - obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o - obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o -+obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o - obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o - obj-$(CONFIG_MACH_FSG) += fsg-setup.o - ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wg302v1-pci.c -@@ -0,0 +1,64 @@ -+/* -+ * arch/arch/mach-ixp4xx/wg302v1-pci.c -+ * -+ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Software, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init wg302v1_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO8; -+ else if (slot == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else -+ return -1; -+} -+ -+struct hw_pci wg302v1_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = wg302v1_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = wg302v1_map_irq, -+}; -+ -+int __init wg302v1_pci_init(void) -+{ -+ if (machine_is_wg302v1()) -+ pci_common_init(&wg302v1_pci); -+ return 0; -+} -+ -+subsys_initcall(wg302v1_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c -@@ -0,0 +1,142 @@ -+/* -+ * arch/arm/mach-ixp4xx/wg302v1-setup.c -+ * -+ * Board setup for the Netgear WG302 v1 and WAG302 v1 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data wg302v1_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource wg302v1_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device wg302v1_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &wg302v1_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &wg302v1_flash_resource, -+}; -+ -+static struct resource wg302v1_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+static struct plat_serial8250_port wg302v1_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device wg302v1_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = wg302v1_uart_data, -+ }, -+ .num_resources = 2, -+ .resource = wg302v1_uart_resources, -+}; -+ -+static struct eth_plat_info wg302v1_plat_eth[] = { -+ { -+ .phy = 30, -+ .rxq = 3, -+ .txreadyq = 20, -+ } -+}; -+ -+static struct platform_device wg302v1_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = wg302v1_plat_eth, -+ } -+}; -+ -+static struct platform_device *wg302v1_devices[] __initdata = { -+ &wg302v1_flash, -+ &wg302v1_uart, -+ &wg302v1_eth[0], -+}; -+ -+static void __init wg302v1_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices)); -+} -+ -+#ifdef CONFIG_MACH_WG302V1 -+MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = wg302v1_init, -+MACHINE_END -+#endif diff --git a/target/linux/ixp4xx/patches-2.6.30/110-pronghorn_series_support.patch b/target/linux/ixp4xx/patches-2.6.30/110-pronghorn_series_support.patch deleted file mode 100644 index 9b81e2eee..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/110-pronghorn_series_support.patch +++ /dev/null @@ -1,387 +0,0 @@ ---- a/arch/arm/configs/ixp4xx_defconfig -+++ b/arch/arm/configs/ixp4xx_defconfig -@@ -157,6 +157,8 @@ CONFIG_ARCH_ADI_COYOTE=y - CONFIG_MACH_GATEWAY7001=y - CONFIG_MACH_WG302V1=y - CONFIG_MACH_WG302V2=y -+CONFIG_MACH_PRONGHORN=y -+CONFIG_MACH_PRONGHORNMETRO=y - CONFIG_ARCH_IXDP425=y - CONFIG_MACH_IXDPG425=y - CONFIG_MACH_IXDP465=y ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -65,6 +65,22 @@ config MACH_WG302V2 - WG302 v2 or WAG302 v2 Access Points. For more information - on this platform, see http://openwrt.org - -+config MACH_PRONGHORN -+ bool "ADI Pronghorn series" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the ADI -+ Engineering Pronghorn series. For more -+ information on this platform, see http://www.adiengineering.com -+ -+# -+# There're only minimal differences kernel-wise between the Pronghorn and -+# Pronghorn Metro boards - they use different chip selects to drive the -+# CF slot connected to the expansion bus, so we just enable them together. -+# -+config MACH_PRONGHORNMETRO -+ def_bool MACH_PRONGHORN -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -17,6 +17,7 @@ obj-pci-$(CONFIG_MACH_GATEWAY7001) += ga - obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o - obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o -+obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o - - obj-y += common.o - -@@ -32,6 +33,7 @@ obj-$(CONFIG_MACH_GATEWAY7001) += gatewa - obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o - obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o - obj-$(CONFIG_MACH_FSG) += fsg-setup.o -+obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/pronghorn-pci.c -@@ -0,0 +1,70 @@ -+/* -+ * arch/arch/mach-ixp4xx/pronghorn-pci.c -+ * -+ * PCI setup routines for ADI Engineering Pronghorn series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init pronghorn_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init pronghorn_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 13) -+ return IRQ_IXP4XX_GPIO4; -+ else if (slot == 14) -+ return IRQ_IXP4XX_GPIO6; -+ else if (slot == 15) -+ return IRQ_IXP4XX_GPIO11; -+ else if (slot == 16) -+ return IRQ_IXP4XX_GPIO1; -+ else -+ return -1; -+} -+ -+struct hw_pci pronghorn_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = pronghorn_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = pronghorn_map_irq, -+}; -+ -+int __init pronghorn_pci_init(void) -+{ -+ if (machine_is_pronghorn() || machine_is_pronghorn_metro()) -+ pci_common_init(&pronghorn_pci); -+ return 0; -+} -+ -+subsys_initcall(pronghorn_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c -@@ -0,0 +1,245 @@ -+/* -+ * arch/arm/mach-ixp4xx/pronghorn-setup.c -+ * -+ * Board setup for the ADI Engineering Pronghorn series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data pronghorn_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource pronghorn_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device pronghorn_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &pronghorn_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &pronghorn_flash_resource, -+}; -+ -+static struct resource pronghorn_uart_resources [] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port pronghorn_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device pronghorn_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = pronghorn_uart_data, -+ }, -+ .num_resources = 2, -+ .resource = pronghorn_uart_resources, -+}; -+ -+static struct i2c_gpio_platform_data pronghorn_i2c_gpio_data = { -+ .sda_pin = 9, -+ .scl_pin = 10, -+}; -+ -+static struct platform_device pronghorn_i2c_gpio = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &pronghorn_i2c_gpio_data, -+ }, -+}; -+ -+static struct gpio_led pronghorn_led_pin[] = { -+ { -+ .name = "pronghorn:green:status", -+ .gpio = 7, -+ } -+}; -+ -+static struct gpio_led_platform_data pronghorn_led_data = { -+ .num_leds = 1, -+ .leds = pronghorn_led_pin, -+}; -+ -+static struct platform_device pronghorn_led = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &pronghorn_led_data, -+}; -+ -+static struct resource pronghorn_pata_resources[] = { -+ { -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .name = "intrq", -+ .start = IRQ_IXP4XX_GPIO0, -+ .end = IRQ_IXP4XX_GPIO0, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct ixp4xx_pata_data pronghorn_pata_data = { -+ .cs0_bits = 0xbfff0043, -+ .cs1_bits = 0xbfff0043, -+}; -+ -+static struct platform_device pronghorn_pata = { -+ .name = "pata_ixp4xx_cf", -+ .id = 0, -+ .dev.platform_data = &pronghorn_pata_data, -+ .num_resources = ARRAY_SIZE(pronghorn_pata_resources), -+ .resource = pronghorn_pata_resources, -+}; -+ -+static struct eth_plat_info pronghorn_plat_eth[] = { -+ { -+ .phy = 0, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device pronghorn_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = pronghorn_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = pronghorn_plat_eth + 1, -+ } -+}; -+ -+static struct platform_device *pronghorn_devices[] __initdata = { -+ &pronghorn_flash, -+ &pronghorn_uart, -+ &pronghorn_led, -+ &pronghorn_eth[0], -+ &pronghorn_eth[1], -+}; -+ -+static void __init pronghorn_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ pronghorn_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ pronghorn_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(pronghorn_devices, ARRAY_SIZE(pronghorn_devices)); -+ -+ if (machine_is_pronghorn()) { -+ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); -+ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); -+ -+ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); -+ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); -+ -+ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS2; -+ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS3; -+ } else { -+ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(3); -+ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(3); -+ -+ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(4); -+ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(4); -+ -+ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS3; -+ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS4; -+ -+ platform_device_register(&pronghorn_i2c_gpio); -+ } -+ -+ platform_device_register(&pronghorn_pata); -+} -+ -+MACHINE_START(PRONGHORN, "ADI Engineering Pronghorn") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = pronghorn_init, -+MACHINE_END -+ -+MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = pronghorn_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -41,7 +41,8 @@ static __inline__ void __arch_decomp_set - * Some boards are using UART2 as console - */ - if (machine_is_adi_coyote() || machine_is_gtwx5715() || -- machine_is_gateway7001() || machine_is_wg302v2()) -+ machine_is_gateway7001() || machine_is_wg302v2() || -+ machine_is_pronghorn() || machine_is_pronghorn_metro()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.30/111-pronghorn_swap_uarts.patch b/target/linux/ixp4xx/patches-2.6.30/111-pronghorn_swap_uarts.patch deleted file mode 100644 index b9fa50768..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/111-pronghorn_swap_uarts.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/pronghorn-setup.c -+++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c -@@ -51,31 +51,31 @@ static struct platform_device pronghorn_ - - static struct resource pronghorn_uart_resources [] = { - { -- .start = IXP4XX_UART1_BASE_PHYS, -- .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - }, - { -- .start = IXP4XX_UART2_BASE_PHYS, -- .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - } - }; - - static struct plat_serial8250_port pronghorn_uart_data[] = { - { -- .mapbase = IXP4XX_UART1_BASE_PHYS, -- .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -- .irq = IRQ_IXP4XX_UART1, -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { -- .mapbase = IXP4XX_UART2_BASE_PHYS, -- .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -- .irq = IRQ_IXP4XX_UART2, -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, diff --git a/target/linux/ixp4xx/patches-2.6.30/115-sidewinder_support.patch b/target/linux/ixp4xx/patches-2.6.30/115-sidewinder_support.patch deleted file mode 100644 index af03d33a6..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/115-sidewinder_support.patch +++ /dev/null @@ -1,282 +0,0 @@ -From 60bdaaaf3446b4237566c6e04855186fc7bd766b Mon Sep 17 00:00:00 2001 -From: Imre Kaloz -Date: Sun, 13 Jul 2008 22:46:45 +0200 -Subject: [PATCH] Add support for the ADI Sidewinder - -Signed-off-by: Imre Kaloz ---- - arch/arm/mach-ixp4xx/Kconfig | 10 ++- - arch/arm/mach-ixp4xx/Makefile | 2 + - arch/arm/mach-ixp4xx/sidewinder-pci.c | 68 ++++++++++++++ - arch/arm/mach-ixp4xx/sidewinder-setup.c | 151 +++++++++++++++++++++++++++++++ - 4 files changed, 230 insertions(+), 1 deletions(-) - create mode 100644 arch/arm/mach-ixp4xx/sidewinder-pci.c - create mode 100644 arch/arm/mach-ixp4xx/sidewinder-setup.c - ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -81,6 +81,14 @@ config MACH_PRONGHORN - config MACH_PRONGHORNMETRO - def_bool MACH_PRONGHORN - -+config MACH_SIDEWINDER -+ bool "ADI Sidewinder" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the ADI -+ Engineering Sidewinder board. For more information on this -+ platform, see http://www.adiengineering.com -+ - config ARCH_IXDP425 - bool "IXDP425" - help -@@ -163,7 +171,7 @@ config MACH_FSG - # - config CPU_IXP46X - bool -- depends on MACH_IXDP465 -+ depends on MACH_IXDP465 || MACH_SIDEWINDER - default y - - config CPU_IXP43X ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -18,6 +18,7 @@ obj-pci-$(CONFIG_MACH_WG302V1) += wg302 - obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o -+obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o - - obj-y += common.o - -@@ -34,6 +35,7 @@ obj-$(CONFIG_MACH_WG302V1) += wg302v1-se - obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o - obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o -+obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/sidewinder-pci.c -@@ -0,0 +1,68 @@ -+/* -+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c -+ * -+ * PCI setup routines for ADI Engineering Sidewinder -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+ -+void __init sidewinder_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO11; -+ else if (slot == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else if (slot == 3) -+ return IRQ_IXP4XX_GPIO9; -+ else -+ return -1; -+} -+ -+struct hw_pci sidewinder_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = sidewinder_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = sidewinder_map_irq, -+}; -+ -+int __init sidewinder_pci_init(void) -+{ -+ if (machine_is_sidewinder()) -+ pci_common_init(&sidewinder_pci); -+ return 0; -+} -+ -+subsys_initcall(sidewinder_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/sidewinder-setup.c -@@ -0,0 +1,149 @@ -+/* -+ * arch/arm/mach-ixp4xx/sidewinder-setup.c -+ * -+ * Board setup for the ADI Engineering Sidewinder -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+static struct flash_platform_data sidewinder_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource sidewinder_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device sidewinder_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &sidewinder_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &sidewinder_flash_resource, -+}; -+ -+static struct resource sidewinder_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+static struct plat_serial8250_port sidewinder_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device sidewinder_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = sidewinder_uart_data, -+ }, -+ .num_resources = ARRAY_SIZE(sidewinder_uart_resources), -+ .resource = sidewinder_uart_resources, -+}; -+ -+static struct eth_plat_info sidewinder_plat_eth[] = { -+ { -+ .phy = 5, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, -+ .rxq = 4, -+ .txreadyq = 21, -+ }, { -+ .phy = 31, -+ .rxq = 2, -+ .txreadyq = 19, -+ } -+}; -+ -+static struct platform_device sidewinder_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = sidewinder_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = sidewinder_plat_eth + 1, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEA, -+ .dev.platform_data = sidewinder_plat_eth + 2, -+ } -+}; -+ -+static struct platform_device *sidewinder_devices[] __initdata = { -+ &sidewinder_flash, -+ &sidewinder_uart, -+ &sidewinder_eth[0], -+ &sidewinder_eth[1], -+ &sidewinder_eth[2], -+}; -+ -+static void __init sidewinder_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices)); -+} -+ -+MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = sidewinder_init, -+MACHINE_END diff --git a/target/linux/ixp4xx/patches-2.6.30/116-sidewinder_fis_location.patch b/target/linux/ixp4xx/patches-2.6.30/116-sidewinder_fis_location.patch deleted file mode 100644 index 1d0a98398..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/116-sidewinder_fis_location.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -13,6 +13,8 @@ - - #define BOARD_CONFIG_PART "boardconfig" - -+#include -+ - struct fis_image_desc { - unsigned char name[16]; // Null terminated name - uint32_t flash_base; // Address within FLASH of image -@@ -30,7 +32,8 @@ struct fis_list { - struct fis_list *next; - }; - --static int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; -+int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; -+ - module_param(directory, int, 0); - - static inline int redboot_checksum(struct fis_image_desc *img) -@@ -59,6 +62,8 @@ static int parse_redboot_partitions(stru - #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED - static char nullstring[] = "unallocated"; - #endif -+ if (machine_is_sidewinder()) -+ directory = -5; - - if ( directory < 0 ) { - offset = master->size + directory * master->erasesize; diff --git a/target/linux/ixp4xx/patches-2.6.30/120-compex_support.patch b/target/linux/ixp4xx/patches-2.6.30/120-compex_support.patch deleted file mode 100644 index 571a480ff..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/120-compex_support.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 24025a2dcf1248079dd3019fac6ed955252d277f Mon Sep 17 00:00:00 2001 -From: Imre Kaloz -Date: Mon, 14 Jul 2008 21:56:34 +0200 -Subject: [PATCH] Add support for the Compex WP18 / NP18A boards - -Signed-off-by: Imre Kaloz ---- - arch/arm/mach-ixp4xx/Kconfig | 8 ++ - arch/arm/mach-ixp4xx/Makefile | 2 + - arch/arm/mach-ixp4xx/compex-setup.c | 136 +++++++++++++++++++++++++++++++++++ - arch/arm/mach-ixp4xx/ixdp425-pci.c | 3 +- - arch/arm/tools/mach-types | 2 +- - 5 files changed, 149 insertions(+), 2 deletions(-) - create mode 100644 arch/arm/mach-ixp4xx/compex-setup.c - ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -89,6 +89,14 @@ config MACH_SIDEWINDER - Engineering Sidewinder board. For more information on this - platform, see http://www.adiengineering.com - -+config MACH_COMPEX -+ bool "Compex WP18 / NP18A" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Compex' -+ WP18 or NP18A boards. For more information on this -+ platform, see http://www.compex.com.sg/home/OEM/product_ap.htm -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302 - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o - obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o -+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o - - obj-y += common.o - -@@ -36,6 +37,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se - obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o - obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o -+obj-$(CONFIG_MACH_COMPEX) += compex-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/compex-setup.c -@@ -0,0 +1,136 @@ -+/* -+ * arch/arm/mach-ixp4xx/compex-setup.c -+ * -+ * Compex WP18 / NP18A board-setup -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+static struct flash_platform_data compex_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource compex_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device compex_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &compex_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &compex_flash_resource, -+}; -+ -+static struct resource compex_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port compex_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device compex_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = compex_uart_data, -+ .num_resources = 2, -+ .resource = compex_uart_resources, -+}; -+ -+static struct eth_plat_info compex_plat_eth[] = { -+ { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0xf0000, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 3, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device compex_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = compex_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = compex_plat_eth + 1, -+ } -+}; -+ -+static struct platform_device *compex_devices[] __initdata = { -+ &compex_flash, -+ &compex_uart, -+ &compex_eth[0], -+ &compex_eth[1], -+}; -+ -+static void __init compex_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ compex_flash_resource.end = -+ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices)); -+} -+ -+MACHINE_START(COMPEX, "Compex WP18 / NP18A") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = compex_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/ixdp425-pci.c -+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c -@@ -66,7 +66,8 @@ struct hw_pci ixdp425_pci __initdata = { - int __init ixdp425_pci_init(void) - { - if (machine_is_ixdp425() || machine_is_ixcdp1100() || -- machine_is_ixdp465() || machine_is_kixrp435()) -+ machine_is_ixdp465() || machine_is_kixrp435() || -+ machine_is_compex()) - pci_common_init(&ixdp425_pci); - return 0; - } ---- a/arch/arm/tools/mach-types -+++ b/arch/arm/tools/mach-types -@@ -1273,7 +1273,7 @@ oiab MACH_OIAB OIAB 1269 - smdk6400 MACH_SMDK6400 SMDK6400 1270 - nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271 - greenphone MACH_GREENPHONE GREENPHONE 1272 --compex42x MACH_COMPEXWP18 COMPEXWP18 1273 -+compex MACH_COMPEX COMPEX 1273 - xmate MACH_XMATE XMATE 1274 - energizer MACH_ENERGIZER ENERGIZER 1275 - ime1 MACH_IME1 IME1 1276 diff --git a/target/linux/ixp4xx/patches-2.6.30/130-wrt300nv2_support.patch b/target/linux/ixp4xx/patches-2.6.30/130-wrt300nv2_support.patch deleted file mode 100644 index 48d5ee291..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/130-wrt300nv2_support.patch +++ /dev/null @@ -1,225 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -97,6 +97,14 @@ config MACH_COMPEX - WP18 or NP18A boards. For more information on this - platform, see http://www.compex.com.sg/home/OEM/product_ap.htm - -+config MACH_WRT300NV2 -+ bool "Linksys WRT300N v2" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Linksys' -+ WRT300N v2 router. For more information on this -+ platform, see http://openwrt.org -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o - obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o - obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o -+obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o - - obj-y += common.o - -@@ -38,6 +39,7 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o - obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o - obj-$(CONFIG_MACH_COMPEX) += compex-setup.o -+obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c -@@ -0,0 +1,65 @@ -+/* -+ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c -+ * -+ * PCI setup routines for Linksys WRT300N v2 -+ * -+ * Copyright (C) 2007 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+ -+extern void ixp4xx_pci_preinit(void); -+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); -+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); -+ -+void __init wrt300nv2_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO8; -+ else return -1; -+} -+ -+struct hw_pci wrt300nv2_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = wrt300nv2_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = wrt300nv2_map_irq, -+}; -+ -+int __init wrt300nv2_pci_init(void) -+{ -+ if (machine_is_wrt300nv2()) -+ pci_common_init(&wrt300nv2_pci); -+ return 0; -+} -+ -+subsys_initcall(wrt300nv2_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c -@@ -0,0 +1,108 @@ -+/* -+ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c -+ * -+ * Board setup for the Linksys WRT300N v2 -+ * -+ * Copyright (C) 2007 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data wrt300nv2_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource wrt300nv2_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device wrt300nv2_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &wrt300nv2_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &wrt300nv2_flash_resource, -+}; -+ -+static struct resource wrt300nv2_uart_resource = { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct plat_serial8250_port wrt300nv2_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device wrt300nv2_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = wrt300nv2_uart_data, -+ }, -+ .num_resources = 1, -+ .resource = &wrt300nv2_uart_resource, -+}; -+ -+static struct platform_device *wrt300nv2_devices[] __initdata = { -+ &wrt300nv2_flash, -+ &wrt300nv2_uart -+}; -+ -+static void __init wrt300nv2_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); -+} -+ -+#ifdef CONFIG_MACH_WRT300NV2 -+MACHINE_START(WRT300NV2, "Linksys WRT300N v2") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = wrt300nv2_init, -+MACHINE_END -+#endif ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -42,7 +42,7 @@ static __inline__ void __arch_decomp_set - */ - if (machine_is_adi_coyote() || machine_is_gtwx5715() || - machine_is_gateway7001() || machine_is_wg302v2() || -- machine_is_pronghorn() || machine_is_pronghorn_metro()) -+ machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.30/131-wrt300nv2_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.30/131-wrt300nv2_mac_plat_info.patch deleted file mode 100644 index 3ab68c4f3..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/131-wrt300nv2_mac_plat_info.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c -+++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c -@@ -76,9 +76,36 @@ static struct platform_device wrt300nv2_ - .resource = &wrt300nv2_uart_resource, - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info wrt300nv2_plat_eth[] = { -+ { -+ .phy = -1, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device wrt300nv2_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = wrt300nv2_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = wrt300nv2_plat_eth + 1, -+ } -+}; -+ - static struct platform_device *wrt300nv2_devices[] __initdata = { - &wrt300nv2_flash, -- &wrt300nv2_uart -+ &wrt300nv2_uart, -+ &wrt300nv2_eth[0], -+ &wrt300nv2_eth[1], - }; - - static void __init wrt300nv2_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.30/150-lanready_ap1000_support.patch b/target/linux/ixp4xx/patches-2.6.30/150-lanready_ap1000_support.patch deleted file mode 100644 index 283bbf836..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/150-lanready_ap1000_support.patch +++ /dev/null @@ -1,200 +0,0 @@ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/ap1000-setup.c -@@ -0,0 +1,151 @@ -+/* -+ * arch/arm/mach-ixp4xx/ap1000-setup.c -+ * -+ * Lanready AP-1000 -+ * -+ * Copyright (C) 2007 Imre Kaloz -+ * -+ * based on ixdp425-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data ap1000_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource ap1000_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device ap1000_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &ap1000_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &ap1000_flash_resource, -+}; -+ -+static struct resource ap1000_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port ap1000_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device ap1000_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = ap1000_uart_data, -+ .num_resources = 2, -+ .resource = ap1000_uart_resources -+}; -+ -+static struct platform_device *ap1000_devices[] __initdata = { -+ &ap1000_flash, -+ &ap1000_uart -+}; -+ -+static char ap1000_mem_fixup[] __initdata = "mem=64M "; -+ -+static void __init ap1000_fixup(struct machine_desc *desc, -+ struct tag *tags, char **cmdline, struct meminfo *mi) -+ -+{ -+ struct tag *t = tags; -+ char *p = *cmdline; -+ -+ /* Find the end of the tags table, taking note of any cmdline tag. */ -+ for (; t->hdr.size; t = tag_next(t)) { -+ if (t->hdr.tag == ATAG_CMDLINE) { -+ p = t->u.cmdline.cmdline; -+ } -+ } -+ -+ /* Overwrite the end of the table with a new cmdline tag. */ -+ t->hdr.tag = ATAG_CMDLINE; -+ t->hdr.size = (sizeof (struct tag_header) + -+ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2; -+ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE); -+ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p, -+ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup)); -+ -+ /* Terminate the table. */ -+ t = tag_next(t); -+ t->hdr.tag = ATAG_NONE; -+ t->hdr.size = 0; -+} -+ -+static void __init ap1000_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ ap1000_flash_resource.end = -+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; -+ -+ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices)); -+} -+ -+#ifdef CONFIG_MACH_AP1000 -+MACHINE_START(AP1000, "Lanready AP-1000") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .fixup = ap1000_fixup, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = ap1000_init, -+MACHINE_END -+#endif ---- a/arch/arm/mach-ixp4xx/ixdp425-pci.c -+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c -@@ -67,7 +67,7 @@ int __init ixdp425_pci_init(void) - { - if (machine_is_ixdp425() || machine_is_ixcdp1100() || - machine_is_ixdp465() || machine_is_kixrp435() || -- machine_is_compex()) -+ machine_is_compex() || machine_is_ap1000()) - pci_common_init(&ixdp425_pci); - return 0; - } ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -105,6 +105,14 @@ config MACH_WRT300NV2 - WRT300N v2 router. For more information on this - platform, see http://openwrt.org - -+config MACH_AP1000 -+ bool "Lanready AP-1000" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Lanready's -+ AP1000 board. For more information on this -+ platform, see http://openwrt.org -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -21,6 +21,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORN) += pron - obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o - obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o -+obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o - - obj-y += common.o - -@@ -40,6 +41,7 @@ obj-$(CONFIG_MACH_PRONGHORN) += pronghor - obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o - obj-$(CONFIG_MACH_COMPEX) += compex-setup.o - obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o -+obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o diff --git a/target/linux/ixp4xx/patches-2.6.30/151-lanready_ap1000_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.30/151-lanready_ap1000_mac_plat_info.patch deleted file mode 100644 index a1214d567..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/151-lanready_ap1000_mac_plat_info.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/ap1000-setup.c -+++ b/arch/arm/mach-ixp4xx/ap1000-setup.c -@@ -90,9 +90,37 @@ static struct platform_device ap1000_uar - .resource = ap1000_uart_resources - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info ap1000_plat_eth[] = { -+ { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 5, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device ap1000_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = ap1000_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = ap1000_plat_eth + 1, -+ } -+}; -+ - static struct platform_device *ap1000_devices[] __initdata = { - &ap1000_flash, -- &ap1000_uart -+ &ap1000_uart, -+ &ap1000_eth[0], -+ &ap1000_eth[1], - }; - - static char ap1000_mem_fixup[] __initdata = "mem=64M "; diff --git a/target/linux/ixp4xx/patches-2.6.30/162-wg302v1_mem_fixup.patch b/target/linux/ixp4xx/patches-2.6.30/162-wg302v1_mem_fixup.patch deleted file mode 100644 index 684db4475..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/162-wg302v1_mem_fixup.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/wg302v1-setup.c -+++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c -@@ -115,6 +115,36 @@ static struct platform_device *wg302v1_d - &wg302v1_eth[0], - }; - -+static char wg302v1_mem_fixup[] __initdata = "mem=32M "; -+ -+static void __init wg302v1_fixup(struct machine_desc *desc, -+ struct tag *tags, char **cmdline, struct meminfo *mi) -+ -+{ -+ struct tag *t = tags; -+ char *p = *cmdline; -+ -+ /* Find the end of the tags table, taking note of any cmdline tag. */ -+ for (; t->hdr.size; t = tag_next(t)) { -+ if (t->hdr.tag == ATAG_CMDLINE) { -+ p = t->u.cmdline.cmdline; -+ } -+ } -+ -+ /* Overwrite the end of the table with a new cmdline tag. */ -+ t->hdr.tag = ATAG_CMDLINE; -+ t->hdr.size = (sizeof (struct tag_header) + -+ strlen(wg302v1_mem_fixup) + strlen(p) + 1 + 4) >> 2; -+ strlcpy(t->u.cmdline.cmdline, wg302v1_mem_fixup, COMMAND_LINE_SIZE); -+ strlcpy(t->u.cmdline.cmdline + strlen(wg302v1_mem_fixup), p, -+ COMMAND_LINE_SIZE - strlen(wg302v1_mem_fixup)); -+ -+ /* Terminate the table. */ -+ t = tag_next(t); -+ t->hdr.tag = ATAG_NONE; -+ t->hdr.size = 0; -+} -+ - static void __init wg302v1_init(void) - { - ixp4xx_sys_init(); -@@ -133,6 +163,7 @@ MACHINE_START(WG302V1, "Netgear WG302 v1 - /* Maintainer: Imre Kaloz */ - .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, - .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .fixup = wg302v1_fixup, - .map_io = ixp4xx_map_io, - .init_irq = ixp4xx_init_irq, - .timer = &ixp4xx_timer, diff --git a/target/linux/ixp4xx/patches-2.6.30/170-ixdpg425_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.30/170-ixdpg425_mac_plat_info.patch deleted file mode 100644 index 772b697aa..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/170-ixdpg425_mac_plat_info.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/coyote-setup.c -+++ b/arch/arm/mach-ixp4xx/coyote-setup.c -@@ -73,9 +73,37 @@ static struct platform_device coyote_uar - .resource = &coyote_uart_resource, - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info ixdpg425_plat_eth[] = { -+ { -+ .phy = 5, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 4, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device ixdpg425_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = ixdpg425_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = ixdpg425_plat_eth + 1, -+ } -+}; -+ -+ - static struct platform_device *coyote_devices[] __initdata = { - &coyote_flash, -- &coyote_uart -+ &coyote_uart, -+ &ixdpg425_eth[0], -+ &ixdpg425_eth[1], - }; - - static void __init coyote_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.30/180-tw5334_support.patch b/target/linux/ixp4xx/patches-2.6.30/180-tw5334_support.patch deleted file mode 100644 index 81010f9e8..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/180-tw5334_support.patch +++ /dev/null @@ -1,284 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -158,6 +158,14 @@ config ARCH_PRPMC1100 - PrPCM1100 Processor Mezanine Module. For more information on - this platform, see . - -+config MACH_TW5334 -+ bool "Titan Wireless TW-533-4" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the Titan -+ Wireless TW533-4. For more information on this platform, -+ see http://openwrt.org -+ - config MACH_NAS100D - bool - prompt "NAS100D" ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid - obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o - obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o -+obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o - - obj-y += common.o - -@@ -42,6 +43,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin - obj-$(CONFIG_MACH_COMPEX) += compex-setup.o - obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o - obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o -+obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/tw5334-setup.c -@@ -0,0 +1,162 @@ -+/* -+ * arch/arm/mach-ixp4xx/tw5334-setup.c -+ * -+ * Board setup for the Titan Wireless TW-533-4 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data tw5334_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource tw5334_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device tw5334_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &tw5334_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &tw5334_flash_resource, -+}; -+ -+static struct resource tw5334_uart_resource = { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct plat_serial8250_port tw5334_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device tw5334_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = tw5334_uart_data, -+ }, -+ .num_resources = 1, -+ .resource = &tw5334_uart_resource, -+}; -+ -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info tw5334_plat_eth[] = { -+ { -+ .phy = 0, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device tw5334_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = tw5334_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = tw5334_plat_eth + 1, -+ } -+}; -+ -+static struct platform_device *tw5334_devices[] __initdata = { -+ &tw5334_flash, -+ &tw5334_uart, -+ &tw5334_eth[0], -+ &tw5334_eth[1], -+}; -+ -+static void __init tw5334_init(void) -+{ -+ DECLARE_MAC_BUF(mac_buf); -+ uint8_t __iomem *f; -+ int i; -+ -+ ixp4xx_sys_init(); -+ -+ tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices)); -+ -+ /* -+ * Map in a portion of the flash and read the MAC addresses. -+ * Since it is stored in BE in the flash itself, we need to -+ * byteswap it if we're in LE mode. -+ */ -+ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000); -+ if (f) { -+ for (i = 0; i < 6; i++) -+#ifdef __ARMEB__ -+ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i); -+ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i); -+#else -+ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3)); -+ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3)); -+#endif -+ iounmap(f); -+ } -+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 0\n", -+ print_mac(mac_buf, tw5334_plat_eth[0].hwaddr)); -+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 1\n", -+ print_mac(mac_buf, tw5334_plat_eth[1].hwaddr)); -+} -+ -+#ifdef CONFIG_MACH_TW5334 -+MACHINE_START(TW5334, "Titan Wireless TW-533-4") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = tw5334_init, -+MACHINE_END -+#endif ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/tw5334-pci.c -@@ -0,0 +1,69 @@ -+/* -+ * arch/arch/mach-ixp4xx/tw5334-pci.c -+ * -+ * PCI setup routines for the Titan Wireless TW-533-4 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init tw5334_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init tw5334_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 12) -+ return IRQ_IXP4XX_GPIO6; -+ else if (slot == 13) -+ return IRQ_IXP4XX_GPIO2; -+ else if (slot == 14) -+ return IRQ_IXP4XX_GPIO1; -+ else if (slot == 15) -+ return IRQ_IXP4XX_GPIO0; -+ else return -1; -+} -+ -+struct hw_pci tw5334_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = tw5334_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = tw5334_map_irq, -+}; -+ -+int __init tw5334_pci_init(void) -+{ -+ if (machine_is_tw5334()) -+ pci_common_init(&tw5334_pci); -+ return 0; -+} -+ -+subsys_initcall(tw5334_pci_init); ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set - */ - if (machine_is_adi_coyote() || machine_is_gtwx5715() || - machine_is_gateway7001() || machine_is_wg302v2() || -- machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2()) -+ machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2() || -+ machine_is_tw5334()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.30/185-mi424wr_support.patch b/target/linux/ixp4xx/patches-2.6.30/185-mi424wr_support.patch deleted file mode 100644 index 1836130f5..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/185-mi424wr_support.patch +++ /dev/null @@ -1,465 +0,0 @@ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/mi424wr-pci.c -@@ -0,0 +1,71 @@ -+/* -+ * arch/arm/mach-ixp4xx/mi424wr-pci.c -+ * -+ * Actiontec MI424WR board-level PCI initialization -+ * -+ * Copyright (C) 2008 Jose Vasconcellos -+ * -+ * Maintainer: Jose Vasconcellos -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+/* PCI controller GPIO to IRQ pin mappings -+ * This information was obtained from Actiontec's GPL release. -+ * -+ * INTA INTB -+ * SLOT 13 8 6 -+ * SLOT 14 7 8 -+ * SLOT 15 6 7 -+ */ -+ -+void __init mi424wr_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init mi424wr_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 13) -+ return IRQ_IXP4XX_GPIO8; -+ if (slot == 14) -+ return IRQ_IXP4XX_GPIO7; -+ if (slot == 15) -+ return IRQ_IXP4XX_GPIO6; -+ -+ return -1; -+} -+ -+struct hw_pci mi424wr_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = mi424wr_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = mi424wr_map_irq, -+}; -+ -+int __init mi424wr_pci_init(void) -+{ -+ if (machine_is_mi424wr()) -+ pci_common_init(&mi424wr_pci); -+ return 0; -+} -+ -+subsys_initcall(mi424wr_pci_init); -+ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/mi424wr-setup.c -@@ -0,0 +1,344 @@ -+/* -+ * arch/arm/mach-ixp4xx/mi424wr-setup.c -+ * -+ * Actiontec MI424-WR board setup -+ * Copyright (c) 2008 Jose Vasconcellos -+ * -+ * Based on Gemtek GTWX5715 by -+ * Copyright (C) 2004 George T. Joseph -+ * Derived from Coyote -+ * -+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * GPIO 2,3,4 and 9 are hard wired to the Micrel/Kendin KS8995M Switch -+ * and operate as an SPI type interface. The details of the interface -+ * are available on Kendin/Micrel's web site. -+ */ -+ -+#define MI424WR_KSSPI_SELECT 9 -+#define MI424WR_KSSPI_TXD 4 -+#define MI424WR_KSSPI_CLOCK 2 -+#define MI424WR_KSSPI_RXD 3 -+ -+/* -+ * The "reset" button is wired to GPIO 10. -+ * The GPIO is brought "low" when the button is pushed. -+ */ -+ -+#define MI424WR_BUTTON_GPIO 10 -+#define MI424WR_BUTTON_IRQ IRQ_IXP4XX_GPIO10 -+ -+#define MI424WR_MOCA_WAN_LED 11 -+ -+/* Latch on CS1 - taken from Actiontec's 2.4 source code -+ * -+ * default latch value -+ * 0 - power alarm led (red) 0 (off) -+ * 1 - power led (green) 0 (off) -+ * 2 - wireless led (green) 1 (off) -+ * 3 - no internet led (red) 0 (off) -+ * 4 - internet ok led (green) 0 (off) -+ * 5 - moca LAN 0 (off) -+ * 6 - WAN alarm led (red) 0 (off) -+ * 7 - PCI reset 1 (not reset) -+ * 8 - IP phone 1 led (green) 1 (off) -+ * 9 - IP phone 2 led (green) 1 (off) -+ * 10 - VOIP ready led (green) 1 (off) -+ * 11 - PSTN relay 1 control 0 (PSTN) -+ * 12 - PSTN relay 1 control 0 (PSTN) -+ * 13 - N/A -+ * 14 - N/A -+ * 15 - N/A -+ */ -+ -+#define MI424WR_LATCH_MASK 0x04 -+#define MI424WR_LATCH_DEFAULT 0x1f86 -+ -+#define MI424WR_LATCH_ALARM_LED 0x00 -+#define MI424WR_LATCH_POWER_LED 0x01 -+#define MI424WR_LATCH_WIRELESS_LED 0x02 -+#define MI424WR_LATCH_INET_DOWN_LED 0x03 -+#define MI424WR_LATCH_INET_OK_LED 0x04 -+#define MI424WR_LATCH_MOCA_LAN_LED 0x05 -+#define MI424WR_LATCH_WAN_ALARM_LED 0x06 -+#define MI424WR_LATCH_PCI_RESET 0x07 -+#define MI424WR_LATCH_PHONE1_LED 0x08 -+#define MI424WR_LATCH_PHONE2_LED 0x09 -+#define MI424WR_LATCH_VOIP_LED 0x10 -+#define MI424WR_LATCH_PSTN_RELAY1 0x11 -+#define MI424WR_LATCH_PSTN_RELAY2 0x12 -+ -+/* initialize CS1 to default timings, Intel style, 16-bit bus */ -+#define MI424WR_CS1_CONFIG 0x80000002 -+ -+/* Define both UARTs but they are not easily accessible. -+ */ -+ -+static struct resource mi424wr_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+ -+static struct plat_serial8250_port mi424wr_uart_platform_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device mi424wr_uart_device = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = mi424wr_uart_platform_data, -+ .num_resources = ARRAY_SIZE(mi424wr_uart_resources), -+ .resource = mi424wr_uart_resources, -+}; -+ -+static struct flash_platform_data mi424wr_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource mi424wr_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device mi424wr_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev.platform_data = &mi424wr_flash_data, -+ .num_resources = 1, -+ .resource = &mi424wr_flash_resource, -+}; -+ -+static int mi424wr_spi_boardinfo_setup(struct spi_board_info *bi, -+ struct spi_master *master, void *data) -+{ -+ -+ strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias)); -+ -+ bi->max_speed_hz = 5000000 /* Hz */; -+ bi->bus_num = master->bus_num; -+ bi->mode = SPI_MODE_0; -+ -+ return 0; -+} -+ -+static struct spi_gpio_platform_data mi424wr_spi_bus_data = { -+ .pin_cs = MI424WR_KSSPI_SELECT, -+ .pin_clk = MI424WR_KSSPI_CLOCK, -+ .pin_miso = MI424WR_KSSPI_RXD, -+ .pin_mosi = MI424WR_KSSPI_TXD, -+ .cs_activelow = 1, -+ .no_spi_delay = 1, -+ .boardinfo_setup = mi424wr_spi_boardinfo_setup, -+}; -+ -+static struct gpio_led mi424wr_gpio_led[] = { -+ { -+ .name = "moca-wan", /* green led */ -+ .gpio = MI424WR_MOCA_WAN_LED, -+ .active_low = 0, -+ } -+}; -+ -+static struct gpio_led_platform_data mi424wr_gpio_leds_data = { -+ .num_leds = 1, -+ .leds = mi424wr_gpio_led, -+}; -+ -+static struct platform_device mi424wr_gpio_leds = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &mi424wr_gpio_leds_data, -+}; -+ -+static uint16_t latch_value = MI424WR_LATCH_DEFAULT; -+static uint16_t __iomem *iobase; -+ -+static void mi424wr_latch_set_led(u8 bit, enum led_brightness value) -+{ -+ -+ if (((MI424WR_LATCH_MASK >> bit) & 1) ^ (value == LED_OFF)) -+ latch_value &= ~(0x1 << bit); -+ else -+ latch_value |= (0x1 << bit); -+ -+ __raw_writew(latch_value, iobase); -+ -+} -+ -+static struct latch_led mi424wr_latch_led[] = { -+ { -+ .name = "power-alarm", -+ .bit = MI424WR_LATCH_ALARM_LED, -+ }, -+ { -+ .name = "power-ok", -+ .bit = MI424WR_LATCH_POWER_LED, -+ }, -+ { -+ .name = "wireless", /* green led */ -+ .bit = MI424WR_LATCH_WIRELESS_LED, -+ }, -+ { -+ .name = "inet-down", /* red led */ -+ .bit = MI424WR_LATCH_INET_DOWN_LED, -+ }, -+ { -+ .name = "inet-up", /* green led */ -+ .bit = MI424WR_LATCH_INET_OK_LED, -+ }, -+ { -+ .name = "moca-lan", /* green led */ -+ .bit = MI424WR_LATCH_MOCA_LAN_LED, -+ }, -+ { -+ .name = "wan-alarm", /* red led */ -+ .bit = MI424WR_LATCH_WAN_ALARM_LED, -+ } -+}; -+ -+static struct latch_led_platform_data mi424wr_latch_leds_data = { -+ .num_leds = ARRAY_SIZE(mi424wr_latch_led), -+ .mem = 0x51000000, -+ .leds = mi424wr_latch_led, -+ .set_led = mi424wr_latch_set_led, -+}; -+ -+static struct platform_device mi424wr_latch_leds = { -+ .name = "leds-latch", -+ .id = -1, -+ .dev.platform_data = &mi424wr_latch_leds_data, -+}; -+ -+static struct platform_device mi424wr_spi_bus = { -+ .name = "spi-gpio", -+ .id = 0, -+ .dev.platform_data = &mi424wr_spi_bus_data, -+}; -+ -+static struct eth_plat_info mi424wr_npeb_data = { -+ .phy = 17, /* KS8721 */ -+ .rxq = 3, -+ .txreadyq = 20, -+}; -+ -+static struct eth_plat_info mi424wr_npec_data = { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct platform_device mi424wr_npe_devices[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = &mi424wr_npec_data, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = &mi424wr_npeb_data, -+ } -+}; -+ -+static struct platform_device *mi424wr_devices[] __initdata = { -+ &mi424wr_uart_device, -+ &mi424wr_flash, -+ &mi424wr_gpio_leds, -+ &mi424wr_latch_leds, -+ &mi424wr_spi_bus, -+ &mi424wr_npe_devices[0], -+ &mi424wr_npe_devices[1], -+}; -+ -+static void __init mi424wr_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ mi424wr_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ mi424wr_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = MI424WR_CS1_CONFIG; -+ -+ /* configure button as input -+ */ -+ gpio_line_config(MI424WR_BUTTON_GPIO, IXP4XX_GPIO_IN); -+ -+ /* Initialize LEDs and enables PCI bus. -+ */ -+ iobase = ioremap_nocache(IXP4XX_EXP_BUS_BASE(1), 0x1000); -+ __raw_writew(latch_value, iobase); -+ -+ platform_add_devices(mi424wr_devices, ARRAY_SIZE(mi424wr_devices)); -+} -+ -+ -+MACHINE_START(MI424WR, "Actiontec MI424WR") -+ /* Maintainer: Jose Vasconcellos */ -+ .phys_io = IXP4XX_UART2_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = mi424wr_init, -+MACHINE_END -+ ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -23,6 +23,7 @@ obj-pci-$(CONFIG_MACH_COMPEX) += ixdp42 - obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o - obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o -+obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o - - obj-y += common.o - -@@ -44,6 +45,7 @@ obj-$(CONFIG_MACH_COMPEX) += compex-setu - obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o - obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o - obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o -+obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -229,6 +229,13 @@ config MACH_GTWX5715 - "High Speed" UART is n/c (as far as I can tell) - 20 Pin ARM/Xscale JTAG interface on J2 - -+config MACH_MI424WR -+ bool "Actiontec MI424WR" -+ depends on ARCH_IXP4XX -+ select PCI -+ help -+ Add support for the Actiontec MI424-WR. -+ - comment "IXP4xx Options" - - config IXP4XX_INDIRECT_PCI ---- a/arch/arm/configs/ixp4xx_defconfig -+++ b/arch/arm/configs/ixp4xx_defconfig -@@ -172,6 +172,7 @@ CONFIG_MACH_FSG=y - CONFIG_CPU_IXP46X=y - CONFIG_CPU_IXP43X=y - CONFIG_MACH_GTWX5715=y -+CONFIG_MACH_MI424WR=y - - # - # IXP4xx Options diff --git a/target/linux/ixp4xx/patches-2.6.30/190-cambria_support.patch b/target/linux/ixp4xx/patches-2.6.30/190-cambria_support.patch deleted file mode 100644 index 0327368d2..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/190-cambria_support.patch +++ /dev/null @@ -1,553 +0,0 @@ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/cambria-pci.c -@@ -0,0 +1,74 @@ -+/* -+ * arch/arch/mach-ixp4xx/cambria-pci.c -+ * -+ * PCI setup routines for Gateworks Cambria series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+ -+extern void ixp4xx_pci_preinit(void); -+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); -+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); -+ -+void __init cambria_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init cambria_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO11; -+ else if (slot == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else if (slot == 3) -+ return IRQ_IXP4XX_GPIO9; -+ else if (slot == 4) -+ return IRQ_IXP4XX_GPIO8; -+ else return -1; -+} -+ -+struct hw_pci cambria_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = cambria_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = cambria_map_irq, -+}; -+ -+int __init cambria_pci_init(void) -+{ -+ if (machine_is_cambria()) -+ pci_common_init(&cambria_pci); -+ return 0; -+} -+ -+subsys_initcall(cambria_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -0,0 +1,429 @@ -+/* -+ * arch/arm/mach-ixp4xx/cambria-setup.c -+ * -+ * Board setup for the Gateworks Cambria series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct cambria_board_info { -+ unsigned char *model; -+ void (*setup)(void); -+}; -+ -+static struct cambria_board_info *cambria_info __initdata; -+ -+static struct flash_platform_data cambria_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource cambria_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device cambria_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &cambria_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &cambria_flash_resource, -+}; -+ -+static struct i2c_gpio_platform_data cambria_i2c_gpio_data = { -+ .sda_pin = 7, -+ .scl_pin = 6, -+}; -+ -+static struct platform_device cambria_i2c_gpio = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &cambria_i2c_gpio_data, -+ }, -+}; -+ -+static struct eth_plat_info cambria_npec_data = { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct eth_plat_info cambria_npea_data = { -+ .phy = 2, -+ .rxq = 2, -+ .txreadyq = 19, -+}; -+ -+static struct platform_device cambria_npec_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = &cambria_npec_data, -+}; -+ -+static struct platform_device cambria_npea_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEA, -+ .dev.platform_data = &cambria_npea_data, -+}; -+ -+static struct resource cambria_uart_resource = { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct plat_serial8250_port cambria_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device cambria_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = cambria_uart_data, -+ }, -+ .num_resources = 1, -+ .resource = &cambria_uart_resource, -+}; -+ -+static struct resource cambria_pata_resources[] = { -+ { -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .name = "intrq", -+ .start = IRQ_IXP4XX_GPIO12, -+ .end = IRQ_IXP4XX_GPIO12, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct ixp4xx_pata_data cambria_pata_data = { -+ .cs0_bits = 0xbfff3c03, -+ .cs1_bits = 0xbfff3c03, -+}; -+ -+static struct platform_device cambria_pata = { -+ .name = "pata_ixp4xx_cf", -+ .id = 0, -+ .dev.platform_data = &cambria_pata_data, -+ .num_resources = ARRAY_SIZE(cambria_pata_resources), -+ .resource = cambria_pata_resources, -+}; -+ -+static struct gpio_led cambria_gpio_leds[] = { -+ { -+ .name = "user", /* green led */ -+ .gpio = 5, -+ .active_low = 1, -+ } -+}; -+ -+static struct gpio_led_platform_data cambria_gpio_leds_data = { -+ .num_leds = 1, -+ .leds = cambria_gpio_leds, -+}; -+ -+static struct platform_device cambria_gpio_leds_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &cambria_gpio_leds_data, -+}; -+ -+static struct latch_led cambria_latch_leds[] = { -+ { -+ .name = "ledA", /* green led */ -+ .bit = 0, -+ }, -+ { -+ .name = "ledB", /* green led */ -+ .bit = 1, -+ }, -+ { -+ .name = "ledC", /* green led */ -+ .bit = 2, -+ }, -+ { -+ .name = "ledD", /* green led */ -+ .bit = 3, -+ }, -+ { -+ .name = "ledE", /* green led */ -+ .bit = 4, -+ }, -+ { -+ .name = "ledF", /* green led */ -+ .bit = 5, -+ }, -+ { -+ .name = "ledG", /* green led */ -+ .bit = 6, -+ }, -+ { -+ .name = "ledH", /* green led */ -+ .bit = 7, -+ } -+}; -+ -+static struct latch_led_platform_data cambria_latch_leds_data = { -+ .num_leds = 8, -+ .leds = cambria_latch_leds, -+ .mem = 0x53F40000, -+}; -+ -+static struct platform_device cambria_latch_leds_device = { -+ .name = "leds-latch", -+ .id = -1, -+ .dev.platform_data = &cambria_latch_leds_data, -+}; -+ -+static struct resource cambria_usb0_resources[] = { -+ { -+ .start = 0xCD000000, -+ .end = 0xCD000300, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = 32, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct resource cambria_usb1_resources[] = { -+ { -+ .start = 0xCE000000, -+ .end = 0xCE000300, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = 33, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static u64 ehci_dma_mask = ~(u32)0; -+ -+static struct platform_device cambria_usb0_device = { -+ .name = "ixp4xx-ehci", -+ .id = 0, -+ .resource = cambria_usb0_resources, -+ .num_resources = ARRAY_SIZE(cambria_usb0_resources), -+ .dev = { -+ .dma_mask = &ehci_dma_mask, -+ .coherent_dma_mask = 0xffffffff, -+ }, -+}; -+ -+static struct platform_device cambria_usb1_device = { -+ .name = "ixp4xx-ehci", -+ .id = 1, -+ .resource = cambria_usb1_resources, -+ .num_resources = ARRAY_SIZE(cambria_usb1_resources), -+ .dev = { -+ .dma_mask = &ehci_dma_mask, -+ .coherent_dma_mask = 0xffffffff, -+ }, -+}; -+ -+static struct platform_device *cambria_devices[] __initdata = { -+ &cambria_i2c_gpio, -+ &cambria_flash, -+ &cambria_uart, -+}; -+ -+static void __init cambria_gw23xx_setup(void) -+{ -+ platform_device_register(&cambria_npec_device); -+ platform_device_register(&cambria_npea_device); -+} -+ -+static void __init cambria_gw2350_setup(void) -+{ -+ platform_device_register(&cambria_npec_device); -+ platform_device_register(&cambria_npea_device); -+ -+ platform_device_register(&cambria_usb0_device); -+ platform_device_register(&cambria_usb1_device); -+ -+ platform_device_register(&cambria_gpio_leds_device); -+} -+ -+static void __init cambria_gw2358_setup(void) -+{ -+ platform_device_register(&cambria_npec_device); -+ platform_device_register(&cambria_npea_device); -+ -+ platform_device_register(&cambria_usb0_device); -+ platform_device_register(&cambria_usb1_device); -+ -+ platform_device_register(&cambria_pata); -+ -+ platform_device_register(&cambria_latch_leds_device); -+} -+ -+static struct cambria_board_info cambria_boards[] __initdata = { -+ { -+ .model = "GW2350", -+ .setup = cambria_gw2350_setup, -+ }, { -+ .model = "GW2358", -+ .setup = cambria_gw2358_setup, -+ } -+}; -+ -+static struct cambria_board_info * __init cambria_find_board_info(char *model) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) { -+ struct cambria_board_info *info = &cambria_boards[i]; -+ if (strcmp(info->model, model) == 0) -+ return info; -+ } -+ -+ return NULL; -+} -+ -+static struct memory_accessor *at24_mem_acc; -+ -+static int at24_setup(struct memory_accessor *mem_acc, void *context) -+{ -+ char mac_addr[ETH_ALEN]; -+ char model[6]; -+ -+ at24_mem_acc = mem_acc; -+ -+ /* Read MAC addresses */ -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x0, 6) == 6) { -+ memcpy(&cambria_npec_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x6, 6) == 6) { -+ memcpy(&cambria_npea_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ -+ /* Read the first 6 bytes of the model number */ -+ if (at24_mem_acc->read(at24_mem_acc, model, 0x20, 6) == 6) { -+ cambria_info = cambria_find_board_info(model); -+ } -+ -+ return 0; -+} -+ -+static struct at24_platform_data cambria_eeprom_info = { -+ .byte_len = 1024, -+ .page_size = 16, -+ .flags = AT24_FLAG_READONLY, -+ .setup = at24_setup, -+}; -+ -+static struct i2c_board_info __initdata cambria_i2c_board_info[] = { -+ { -+ I2C_BOARD_INFO("ds1672", 0x68), -+ }, -+ { -+ I2C_BOARD_INFO("ad7418", 0x28), -+ }, -+ { -+ I2C_BOARD_INFO("24c08", 0x51), -+ .platform_data = &cambria_eeprom_info -+ }, -+}; -+ -+static void __init cambria_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ cambria_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ cambria_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(cambria_devices, ARRAY_SIZE(cambria_devices)); -+ -+ cambria_pata_resources[0].start = 0x53e00000; -+ cambria_pata_resources[0].end = 0x53e3ffff; -+ -+ cambria_pata_resources[1].start = 0x53e40000; -+ cambria_pata_resources[1].end = 0x53e7ffff; -+ -+ cambria_pata_data.cs0_cfg = IXP4XX_EXP_CS3; -+ cambria_pata_data.cs1_cfg = IXP4XX_EXP_CS3; -+ -+ i2c_register_board_info(0, cambria_i2c_board_info, -+ ARRAY_SIZE(cambria_i2c_board_info)); -+} -+ -+static int __init cambria_model_setup(void) -+{ -+ if (!machine_is_cambria()) -+ return 0; -+ -+ if (cambria_info) { -+ printk(KERN_DEBUG "Running on Gateworks Cambria %s\n", -+ cambria_info->model); -+ cambria_info->setup(); -+ } else { -+ printk(KERN_INFO "Unknown/missing Cambria model number" -+ " -- defaults will be used\n"); -+ cambria_gw23xx_setup(); -+ } -+ -+ return 0; -+} -+late_initcall(cambria_model_setup); -+ -+MACHINE_START(CAMBRIA, "Gateworks Cambria series") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = cambria_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -25,6 +25,14 @@ config MACH_AVILA - Avila Network Platform. For more information on this platform, - see . - -+config MACH_CAMBRIA -+ bool "Cambria" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the Gateworks -+ Cambria series. For more information on this platform, -+ see . -+ - config MACH_LOFT - bool "Loft" - depends on MACH_AVILA -@@ -208,7 +216,7 @@ config CPU_IXP46X - - config CPU_IXP43X - bool -- depends on MACH_KIXRP435 -+ depends on MACH_KIXRP435 || MACH_CAMBRIA - default y - - config MACH_GTWX5715 ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -7,6 +7,7 @@ obj-pci-n := - - obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o -+obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o - obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o - obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o - obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o -@@ -29,6 +30,7 @@ obj-y += common.o - - obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o - obj-$(CONFIG_MACH_AVILA) += avila-setup.o -+obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o - obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o - obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o - obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o diff --git a/target/linux/ixp4xx/patches-2.6.30/191-cambria_optional_uart.patch b/target/linux/ixp4xx/patches-2.6.30/191-cambria_optional_uart.patch deleted file mode 100644 index f4ce53a40..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/191-cambria_optional_uart.patch +++ /dev/null @@ -1,217 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/cambria-setup.c -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - - struct cambria_board_info { - unsigned char *model; -@@ -127,6 +128,45 @@ static struct platform_device cambria_ua - .resource = &cambria_uart_resource, - }; - -+static struct resource cambria_optional_uart_resources[] = { -+ { -+ .start = 0x52000000, -+ .end = 0x52000fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = 0x53000000, -+ .end = 0x53000fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port cambria_optional_uart_data[] = { -+ { -+ .flags = UPF_BOOT_AUTOCONF, -+ .iotype = UPIO_MEM_DELAY, -+ .regshift = 0, -+ .uartclk = 1843200, -+ .rw_delay = 2, -+ }, -+ { -+ .flags = UPF_BOOT_AUTOCONF, -+ .iotype = UPIO_MEM_DELAY, -+ .regshift = 0, -+ .uartclk = 1843200, -+ .rw_delay = 2, -+ }, -+ { }, -+}; -+ -+static struct platform_device cambria_optional_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM1, -+ .dev.platform_data = cambria_optional_uart_data, -+ .num_resources = 2, -+ .resource = cambria_optional_uart_resources, -+}; -+ - static struct resource cambria_pata_resources[] = { - { - .flags = IORESOURCE_MEM -@@ -283,6 +323,19 @@ static void __init cambria_gw23xx_setup( - - static void __init cambria_gw2350_setup(void) - { -+ *IXP4XX_EXP_CS2 = 0xBFFF3C43; -+ set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[0].mapbase = 0x52FF0000; -+ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52FF0000, 0x0fff); -+ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; -+ -+ *IXP4XX_EXP_CS3 = 0xBFFF3C43; -+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[1].mapbase = 0x53FF0000; -+ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); -+ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; -+ -+ platform_device_register(&cambria_optional_uart); - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); - -@@ -294,6 +347,19 @@ static void __init cambria_gw2350_setup( - - static void __init cambria_gw2358_setup(void) - { -+ *IXP4XX_EXP_CS3 = 0xBFFF3C43; -+ set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[0].mapbase = 0x53FC0000; -+ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x53FC0000, 0x0fff); -+ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; -+ -+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[1].mapbase = 0x53F80000; -+ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); -+ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; -+ -+ platform_device_register(&cambria_optional_uart); -+ - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); - ---- a/include/linux/serial_8250.h -+++ b/include/linux/serial_8250.h -@@ -26,6 +26,7 @@ struct plat_serial8250_port { - void *private_data; - unsigned char regshift; /* register shift */ - unsigned char iotype; /* UPIO_* */ -+ unsigned int rw_delay; /* udelay for slower busses IXP4XX Expansion Bus */ - unsigned char hub6; - upf_t flags; /* UPF_* flags */ - unsigned int type; /* If UPF_FIXED_TYPE */ ---- a/include/linux/serial_core.h -+++ b/include/linux/serial_core.h -@@ -273,6 +273,7 @@ struct uart_port { - #define UPIO_TSI (5) /* Tsi108/109 type IO */ - #define UPIO_DWAPB (6) /* DesignWare APB UART */ - #define UPIO_RM9000 (7) /* RM9000 type IO */ -+#define UPIO_MEM_DELAY (8) - - unsigned int read_status_mask; /* driver specific */ - unsigned int ignore_status_mask; /* driver specific */ -@@ -315,6 +316,7 @@ struct uart_port { - - unsigned int mctrl; /* current modem ctrl settings */ - unsigned int timeout; /* character-based timeout */ -+ unsigned int rw_delay; /* udelay for slow busses, IXP4XX Expansion Bus */ - unsigned int type; /* port type */ - const struct uart_ops *ops; - unsigned int custom_divisor; ---- a/drivers/serial/8250.c -+++ b/drivers/serial/8250.c -@@ -397,6 +397,20 @@ static void mem_serial_out(struct uart_p - writeb(value, p->membase + offset); - } - -+static unsigned int memdelay_serial_in(struct uart_port *p, int offset) -+{ -+ struct uart_8250_port *up = (struct uart_8250_port *)p; -+ udelay(up->port.rw_delay); -+ return mem_serial_in(p, offset); -+} -+ -+static void memdelay_serial_out(struct uart_port *p, int offset, int value) -+{ -+ struct uart_8250_port *up = (struct uart_8250_port *)p; -+ udelay(up->port.rw_delay); -+ mem_serial_out(p, offset, value); -+} -+ - static void mem32_serial_out(struct uart_port *p, int offset, int value) - { - offset = map_8250_out_reg(p, offset) << p->regshift; -@@ -490,6 +504,11 @@ static void set_io_from_upio(struct uart - p->serial_out = mem32_serial_out; - break; - -+ case UPIO_MEM_DELAY: -+ p->serial_in = memdelay_serial_in; -+ p->serial_out = memdelay_serial_out; -+ break; -+ - #ifdef CONFIG_SERIAL_8250_AU1X00 - case UPIO_AU: - p->serial_in = au_serial_in; -@@ -522,6 +541,7 @@ serial_out_sync(struct uart_8250_port *u - switch (p->iotype) { - case UPIO_MEM: - case UPIO_MEM32: -+ case UPIO_MEM_DELAY: - #ifdef CONFIG_SERIAL_8250_AU1X00 - case UPIO_AU: - #endif -@@ -2440,6 +2460,7 @@ static int serial8250_request_std_resour - case UPIO_MEM32: - case UPIO_MEM: - case UPIO_DWAPB: -+ case UPIO_MEM_DELAY: - if (!up->port.mapbase) - break; - -@@ -2477,6 +2498,7 @@ static void serial8250_release_std_resou - case UPIO_MEM32: - case UPIO_MEM: - case UPIO_DWAPB: -+ case UPIO_MEM_DELAY: - if (!up->port.mapbase) - break; - -@@ -2946,6 +2968,7 @@ static int __devinit serial8250_probe(st - port.serial_in = p->serial_in; - port.serial_out = p->serial_out; - port.dev = &dev->dev; -+ port.rw_delay = p->rw_delay; - if (share_irqs) - port.flags |= UPF_SHARE_IRQ; - ret = serial8250_register_port(&port); -@@ -3095,6 +3118,7 @@ int serial8250_register_port(struct uart - uart->port.iotype = port->iotype; - uart->port.flags = port->flags | UPF_BOOT_AUTOCONF; - uart->port.mapbase = port->mapbase; -+ uart->port.rw_delay = port->rw_delay; - uart->port.private_data = port->private_data; - if (port->dev) - uart->port.dev = port->dev; ---- a/drivers/serial/serial_core.c -+++ b/drivers/serial/serial_core.c -@@ -2138,6 +2138,7 @@ uart_report_port(struct uart_driver *drv - snprintf(address, sizeof(address), - "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); - break; -+ case UPIO_MEM_DELAY: - case UPIO_MEM: - case UPIO_MEM32: - case UPIO_AU: -@@ -2552,6 +2553,7 @@ int uart_match_port(struct uart_port *po - case UPIO_HUB6: - return (port1->iobase == port2->iobase) && - (port1->hub6 == port2->hub6); -+ case UPIO_MEM_DELAY: - case UPIO_MEM: - case UPIO_MEM32: - case UPIO_AU: diff --git a/target/linux/ixp4xx/patches-2.6.30/192-cambria_gpio_device.patch b/target/linux/ixp4xx/patches-2.6.30/192-cambria_gpio_device.patch deleted file mode 100644 index d785c3a8c..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/192-cambria_gpio_device.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/cambria-setup.c -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -214,6 +214,20 @@ static struct platform_device cambria_gp - .dev.platform_data = &cambria_gpio_leds_data, - }; - -+static struct resource cambria_gpio_resources[] = { -+ { -+ .name = "gpio", -+ .flags = 0, -+ }, -+}; -+ -+static struct platform_device cambria_gpio = { -+ .name = "GPIODEV", -+ .id = -1, -+ .num_resources = ARRAY_SIZE(cambria_gpio_resources), -+ .resource = cambria_gpio_resources, -+}; -+ - static struct latch_led cambria_latch_leds[] = { - { - .name = "ledA", /* green led */ -@@ -335,6 +349,11 @@ static void __init cambria_gw2350_setup( - cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); - cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; - -+ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ -+ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); -+ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; -+ -+ platform_device_register(&cambria_gpio); - platform_device_register(&cambria_optional_uart); - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); -@@ -358,6 +377,10 @@ static void __init cambria_gw2358_setup( - cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); - cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; - -+ cambria_gpio_resources[0].start = (1 << 14); -+ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; -+ -+ platform_device_register(&cambria_gpio); - platform_device_register(&cambria_optional_uart); - - platform_device_register(&cambria_npec_device); diff --git a/target/linux/ixp4xx/patches-2.6.30/193-cambria_pld_gpio.patch b/target/linux/ixp4xx/patches-2.6.30/193-cambria_pld_gpio.patch deleted file mode 100644 index 299630f17..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/193-cambria_pld_gpio.patch +++ /dev/null @@ -1,107 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/cambria-setup.c -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -12,11 +12,14 @@ - */ - - #include -+#include - #include - #include - #include -+#include - #include - #include -+#include - #include - #include - #include -@@ -323,6 +326,39 @@ static struct platform_device cambria_us - }, - }; - -+static struct gw_i2c_pld_platform_data gw_i2c_pld_data0 = { -+ .gpio_base = 16, -+ .nr_gpio = 8, -+}; -+ -+static struct gw_i2c_pld_platform_data gw_i2c_pld_data1 = { -+ .gpio_base = 24, -+ .nr_gpio = 2, -+}; -+ -+ -+static struct gpio_button cambria_gpio_buttons[] = { -+ { -+ .desc = "user", -+ .type = EV_KEY, -+ .code = BTN_0, -+ .threshold = 2, -+ .gpio = 25, -+ } -+}; -+ -+static struct gpio_buttons_platform_data cambria_gpio_buttons_data = { -+ .poll_interval = 500, -+ .nbuttons = 1, -+ .buttons = cambria_gpio_buttons, -+}; -+ -+static struct platform_device cambria_gpio_buttons_device = { -+ .name = "gpio-buttons", -+ .id = -1, -+ .dev.platform_data = &cambria_gpio_buttons_data, -+}; -+ - static struct platform_device *cambria_devices[] __initdata = { - &cambria_i2c_gpio, - &cambria_flash, -@@ -331,6 +367,11 @@ static struct platform_device *cambria_d - - static void __init cambria_gw23xx_setup(void) - { -+ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ -+ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); -+ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; -+ -+ platform_device_register(&cambria_gpio); - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); - } -@@ -377,7 +418,8 @@ static void __init cambria_gw2358_setup( - cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); - cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; - -- cambria_gpio_resources[0].start = (1 << 14); -+ cambria_gpio_resources[0].start = (1 << 14) | (1 << 16) | (1 << 17) | (1 << 18) |\ -+ (1 << 19) | (1 << 20) | (1 << 24) | (1 << 25); - cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; - - platform_device_register(&cambria_gpio); -@@ -391,7 +433,12 @@ static void __init cambria_gw2358_setup( - - platform_device_register(&cambria_pata); - -+ cambria_gpio_leds[0].gpio = 24; -+ platform_device_register(&cambria_gpio_leds_device); -+ - platform_device_register(&cambria_latch_leds_device); -+ -+ platform_device_register(&cambria_gpio_buttons_device); - } - - static struct cambria_board_info cambria_boards[] __initdata = { -@@ -460,6 +507,14 @@ static struct i2c_board_info __initdata - I2C_BOARD_INFO("24c08", 0x51), - .platform_data = &cambria_eeprom_info - }, -+ { -+ I2C_BOARD_INFO("gw_i2c_pld", 0x56), -+ .platform_data = &gw_i2c_pld_data0, -+ }, -+ { -+ I2C_BOARD_INFO("gw_i2c_pld", 0x57), -+ .platform_data = &gw_i2c_pld_data1, -+ }, - }; - - static void __init cambria_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.30/201-npe_driver_print_license_location.patch b/target/linux/ixp4xx/patches-2.6.30/201-npe_driver_print_license_location.patch deleted file mode 100644 index 64c179845..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/201-npe_driver_print_license_location.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c -+++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c -@@ -592,6 +592,8 @@ int npe_load_firmware(struct npe *npe, c - npe_reset(npe); - #endif - -+ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n"); -+ - print_npe(KERN_INFO, npe, "firmware functionality 0x%X, " - "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, - (image->id >> 8) & 0xFF, image->id & 0xFF); diff --git a/target/linux/ixp4xx/patches-2.6.30/203-npe_driver_mask_phy_features.patch b/target/linux/ixp4xx/patches-2.6.30/203-npe_driver_mask_phy_features.patch deleted file mode 100644 index aa88939cb..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/203-npe_driver_mask_phy_features.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -1215,6 +1215,10 @@ static int __devinit eth_init_one(struct - if ((err = IS_ERR(port->phydev))) - goto err_free_mem; - -+ /* mask with MAC supported features */ -+ port->phydev->supported &= PHY_BASIC_FEATURES; -+ port->phydev->advertising = port->phydev->supported; -+ - port->phydev->irq = PHY_POLL; - - if ((err = register_netdev(dev))) diff --git a/target/linux/ixp4xx/patches-2.6.30/205-npe_driver_separate_phy_functions.patch b/target/linux/ixp4xx/patches-2.6.30/205-npe_driver_separate_phy_functions.patch deleted file mode 100644 index 53fa05e1b..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/205-npe_driver_separate_phy_functions.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -396,6 +396,50 @@ static void ixp4xx_adjust_link(struct ne - dev->name, port->speed, port->duplex ? "full" : "half"); - } - -+static int ixp4xx_phy_connect(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ struct eth_plat_info *plat = port->plat; -+ char phy_id[BUS_ID_SIZE]; -+ -+ snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); -+ port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, -+ PHY_INTERFACE_MODE_MII); -+ if (IS_ERR(port->phydev)) { -+ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); -+ return PTR_ERR(port->phydev); -+ } -+ -+ /* mask with MAC supported features */ -+ port->phydev->supported &= PHY_BASIC_FEATURES; -+ port->phydev->advertising = port->phydev->supported; -+ -+ port->phydev->irq = PHY_POLL; -+ -+ return 0; -+} -+ -+static void ixp4xx_phy_disconnect(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ -+ phy_disconnect(port->phydev); -+} -+ -+static void ixp4xx_phy_start(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ -+ port->speed = 0; /* force "link up" message */ -+ phy_start(port->phydev); -+} -+ -+static void ixp4xx_phy_stop(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ -+ phy_stop(port->phydev); -+} - - static inline void debug_pkt(struct net_device *dev, const char *func, - u8 *data, int len) -@@ -1003,8 +1047,7 @@ static int eth_open(struct net_device *d - return err; - } - -- port->speed = 0; /* force "link up" message */ -- phy_start(port->phydev); -+ ixp4xx_phy_start(dev); - - for (i = 0; i < ETH_ALEN; i++) - __raw_writel(dev->dev_addr[i], &port->regs->hw_addr[i]); -@@ -1125,7 +1168,7 @@ static int eth_close(struct net_device * - printk(KERN_CRIT "%s: unable to disable loopback\n", - dev->name); - -- phy_stop(port->phydev); -+ ixp4xx_phy_stop(dev); - - if (!ports_open) - qmgr_disable_irq(TXDONE_QUEUE); -@@ -1151,7 +1194,6 @@ static int __devinit eth_init_one(struct - struct net_device *dev; - struct eth_plat_info *plat = pdev->dev.platform_data; - u32 regs_phys; -- char phy_id[BUS_ID_SIZE]; - int err; - - if (!(dev = alloc_etherdev(sizeof(struct port)))) -@@ -1209,18 +1251,10 @@ static int __devinit eth_init_one(struct - __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); - udelay(50); - -- snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); -- port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, -- PHY_INTERFACE_MODE_MII); -- if ((err = IS_ERR(port->phydev))) -+ err = ixp4xx_phy_connect(dev); -+ if (err) - goto err_free_mem; - -- /* mask with MAC supported features */ -- port->phydev->supported &= PHY_BASIC_FEATURES; -- port->phydev->advertising = port->phydev->supported; -- -- port->phydev->irq = PHY_POLL; -- - if ((err = register_netdev(dev))) - goto err_phy_dis; - -@@ -1230,7 +1264,7 @@ static int __devinit eth_init_one(struct - return 0; - - err_phy_dis: -- phy_disconnect(port->phydev); -+ ixp4xx_phy_disconnect(dev); - err_free_mem: - npe_port_tab[NPE_ID(port->id)] = NULL; - platform_set_drvdata(pdev, NULL); -@@ -1248,7 +1282,7 @@ static int __devexit eth_remove_one(stru - struct port *port = netdev_priv(dev); - - unregister_netdev(dev); -- phy_disconnect(port->phydev); -+ ixp4xx_phy_disconnect(dev); - npe_port_tab[NPE_ID(port->id)] = NULL; - platform_set_drvdata(pdev, NULL); - npe_release(port->npe); diff --git a/target/linux/ixp4xx/patches-2.6.30/206-npe_driver_add_update_link_function.patch b/target/linux/ixp4xx/patches-2.6.30/206-npe_driver_add_update_link_function.patch deleted file mode 100644 index f12c671a3..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/206-npe_driver_add_update_link_function.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -168,7 +168,7 @@ struct port { - struct desc *desc_tab; /* coherent */ - u32 desc_tab_phys; - int id; /* logical port ID */ -- int speed, duplex; -+ int link, speed, duplex; - u8 firmware[4]; - }; - -@@ -365,37 +365,52 @@ static void ixp4xx_mdio_remove(void) - mdiobus_free(mdio_bus); - } - -- --static void ixp4xx_adjust_link(struct net_device *dev) -+static void ixp4xx_update_link(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -- struct phy_device *phydev = port->phydev; - -- if (!phydev->link) { -- if (port->speed) { -- port->speed = 0; -- printk(KERN_INFO "%s: link down\n", dev->name); -- } -+ if (!port->link) { -+ netif_carrier_off(dev); -+ printk(KERN_INFO "%s: link down\n", dev->name); - return; - } - -- if (port->speed == phydev->speed && port->duplex == phydev->duplex) -- return; -- -- port->speed = phydev->speed; -- port->duplex = phydev->duplex; -- -- if (port->duplex) -+ if (port->duplex == DUPLEX_FULL) - __raw_writel(DEFAULT_TX_CNTRL0 & ~TX_CNTRL0_HALFDUPLEX, - &port->regs->tx_control[0]); - else - __raw_writel(DEFAULT_TX_CNTRL0 | TX_CNTRL0_HALFDUPLEX, - &port->regs->tx_control[0]); - -+ netif_carrier_on(dev); - printk(KERN_INFO "%s: link up, speed %u Mb/s, %s duplex\n", - dev->name, port->speed, port->duplex ? "full" : "half"); - } - -+static void ixp4xx_adjust_link(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ struct phy_device *phydev = port->phydev; -+ int status_change = 0; -+ -+ if (phydev->link) { -+ if (port->duplex != phydev->duplex -+ || port->speed != phydev->speed) { -+ status_change = 1; -+ } -+ } -+ -+ if (phydev->link != port->link) -+ status_change = 1; -+ -+ port->link = phydev->link; -+ port->speed = phydev->speed; -+ port->duplex = phydev->duplex; -+ -+ if (status_change) -+ ixp4xx_update_link(dev); -+} -+ - static int ixp4xx_phy_connect(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -@@ -430,7 +445,6 @@ static void ixp4xx_phy_start(struct net_ - { - struct port *port = netdev_priv(dev); - -- port->speed = 0; /* force "link up" message */ - phy_start(port->phydev); - } - -@@ -1258,6 +1272,10 @@ static int __devinit eth_init_one(struct - if ((err = register_netdev(dev))) - goto err_phy_dis; - -+ port->link = 0; -+ port->speed = 0; -+ port->duplex = -1; -+ - printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, - npe_name(port->npe)); - diff --git a/target/linux/ixp4xx/patches-2.6.30/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-2.6.30/207-npe_driver_multiphy_support.patch deleted file mode 100644 index a3866a908..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/207-npe_driver_multiphy_support.patch +++ /dev/null @@ -1,155 +0,0 @@ -TODO: take care of additional PHYs through the PHY abstraction layer - ---- a/arch/arm/mach-ixp4xx/include/mach/platform.h -+++ b/arch/arm/mach-ixp4xx/include/mach/platform.h -@@ -72,7 +72,7 @@ extern unsigned long ixp4xx_exp_bus_size - /* - * Clock Speed Definitions. - */ --#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */ -+#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */ - #define IXP4XX_UART_XTAL 14745600 - - /* -@@ -95,12 +95,23 @@ struct sys_timer; - #define IXP4XX_ETH_NPEB 0x10 - #define IXP4XX_ETH_NPEC 0x20 - -+#define IXP4XX_ETH_PHY_MAX_ADDR 32 -+ - /* Information about built-in Ethernet MAC interfaces */ - struct eth_plat_info { - u8 phy; /* MII PHY ID, 0 - 31 */ - u8 rxq; /* configurable, currently 0 - 31 only */ - u8 txreadyq; - u8 hwaddr[6]; -+ -+ u32 phy_mask; -+#if 0 -+ int speed; -+ int duplex; -+#else -+ int speed_10; -+ int half_duplex; -+#endif - }; - - /* Information about built-in HSS (synchronous serial) interfaces */ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -417,6 +417,37 @@ static int ixp4xx_phy_connect(struct net - struct eth_plat_info *plat = port->plat; - char phy_id[BUS_ID_SIZE]; - -+ if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) { -+#if 0 -+ switch (plat->speed) { -+ case SPEED_10: -+ case SPEED_100: -+ break; -+ default: -+ printk(KERN_ERR "%s: invalid speed (%d)\n", -+ dev->name, plat->speed); -+ return -EINVAL; -+ } -+ -+ switch (plat->duplex) { -+ case DUPLEX_HALF: -+ case DUPLEX_FULL: -+ break; -+ default: -+ printk(KERN_ERR "%s: invalid duplex mode (%d)\n", -+ dev->name, plat->duplex); -+ return -EINVAL; -+ } -+ port->speed = plat->speed; -+ port->duplex = plat->duplex; -+#else -+ port->speed = plat->speed_10 ? SPEED_10 : SPEED_100; -+ port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL; -+#endif -+ -+ return 0; -+ } -+ - snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); - port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, - PHY_INTERFACE_MODE_MII); -@@ -438,21 +469,32 @@ static void ixp4xx_phy_disconnect(struct - { - struct port *port = netdev_priv(dev); - -- phy_disconnect(port->phydev); -+ if (port->phydev) -+ phy_disconnect(port->phydev); - } - - static void ixp4xx_phy_start(struct net_device *dev) - { - struct port *port = netdev_priv(dev); - -- phy_start(port->phydev); -+ if (port->phydev) { -+ phy_start(port->phydev); -+ } else { -+ port->link = 1; -+ ixp4xx_update_link(dev); -+ } - } - - static void ixp4xx_phy_stop(struct net_device *dev) - { - struct port *port = netdev_priv(dev); - -- phy_stop(port->phydev); -+ if (port->phydev) { -+ phy_stop(port->phydev); -+ } else { -+ port->link = 0; -+ ixp4xx_update_link(dev); -+ } - } - - static inline void debug_pkt(struct net_device *dev, const char *func, -@@ -824,6 +866,10 @@ static int eth_ioctl(struct net_device * - - if (!netif_running(dev)) - return -EINVAL; -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_mii_ioctl(port->phydev, if_mii(req), cmd); - } - -@@ -843,18 +889,30 @@ static void ixp4xx_get_drvinfo(struct ne - static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) - { - struct port *port = netdev_priv(dev); -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_ethtool_gset(port->phydev, cmd); - } - - static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) - { - struct port *port = netdev_priv(dev); -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_ethtool_sset(port->phydev, cmd); - } - - static int ixp4xx_nway_reset(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_start_aneg(port->phydev); - } - diff --git a/target/linux/ixp4xx/patches-2.6.30/295-latch_led_driver.patch b/target/linux/ixp4xx/patches-2.6.30/295-latch_led_driver.patch deleted file mode 100644 index 9cbf5e971..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/295-latch_led_driver.patch +++ /dev/null @@ -1,200 +0,0 @@ ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -155,6 +155,13 @@ config LEDS_LP5521 - This driver can be built as a module by choosing 'M'. The module - will be called leds-lp5521. - -+config LEDS_LATCH -+ tristate "LED Support for Memory Latched LEDs" -+ depends on LEDS_CLASS -+ help -+ -- To Do -- -+ -+ - config LEDS_CLEVO_MAIL - tristate "Mail LED on Clevo notebook" - depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI ---- /dev/null -+++ b/drivers/leds/leds-latch.c -@@ -0,0 +1,149 @@ -+/* -+ * LEDs driver for Memory Latched Devices -+ * -+ * Copyright (C) 2008 Gateworks Corp. -+ * Chris Lang -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static unsigned int mem_keep = 0xFF; -+static spinlock_t mem_lock; -+static unsigned char *iobase; -+ -+struct latch_led_data { -+ struct led_classdev cdev; -+ struct work_struct work; -+ u8 new_level; -+ u8 bit; -+ void (*set_led)(u8 bit, enum led_brightness value); -+}; -+ -+static void latch_set_led(u8 bit, enum led_brightness value) -+{ -+ if (value == LED_OFF) -+ mem_keep |= (0x1 << bit); -+ else -+ mem_keep &= ~(0x1 << bit); -+ -+ writeb(mem_keep, iobase); -+} -+ -+static void latch_led_set(struct led_classdev *led_cdev, -+ enum led_brightness value) -+{ -+ struct latch_led_data *led_dat = -+ container_of(led_cdev, struct latch_led_data, cdev); -+ -+ spin_lock(mem_lock); -+ -+ led_dat->set_led(led_dat->bit, value); -+ -+ spin_unlock(mem_lock); -+} -+ -+static int latch_led_probe(struct platform_device *pdev) -+{ -+ struct latch_led_platform_data *pdata = pdev->dev.platform_data; -+ struct latch_led *cur_led; -+ struct latch_led_data *leds_data, *led_dat; -+ int i, ret = 0; -+ -+ if (!pdata) -+ return -EBUSY; -+ -+ leds_data = kzalloc(sizeof(struct latch_led_data) * pdata->num_leds, -+ GFP_KERNEL); -+ if (!leds_data) -+ return -ENOMEM; -+ -+ for (i = 0; i < pdata->num_leds; i++) { -+ cur_led = &pdata->leds[i]; -+ led_dat = &leds_data[i]; -+ -+ led_dat->cdev.name = cur_led->name; -+ led_dat->cdev.default_trigger = cur_led->default_trigger; -+ led_dat->cdev.brightness_set = latch_led_set; -+ led_dat->cdev.brightness = LED_OFF; -+ led_dat->bit = cur_led->bit; -+ led_dat->set_led = pdata->set_led ? pdata->set_led : latch_set_led; -+ -+ ret = led_classdev_register(&pdev->dev, &led_dat->cdev); -+ if (ret < 0) { -+ goto err; -+ } -+ } -+ -+ if (!pdata->set_led) { -+ iobase = ioremap_nocache(pdata->mem, 0x1000); -+ writeb(0xFF, iobase); -+ } -+ platform_set_drvdata(pdev, leds_data); -+ -+ return 0; -+ -+err: -+ if (i > 0) { -+ for (i = i - 1; i >= 0; i--) { -+ led_classdev_unregister(&leds_data[i].cdev); -+ } -+ } -+ -+ kfree(leds_data); -+ -+ return ret; -+} -+ -+static int __devexit latch_led_remove(struct platform_device *pdev) -+{ -+ int i; -+ struct latch_led_platform_data *pdata = pdev->dev.platform_data; -+ struct latch_led_data *leds_data; -+ -+ leds_data = platform_get_drvdata(pdev); -+ -+ for (i = 0; i < pdata->num_leds; i++) { -+ led_classdev_unregister(&leds_data[i].cdev); -+ cancel_work_sync(&leds_data[i].work); -+ } -+ -+ kfree(leds_data); -+ -+ return 0; -+} -+ -+static struct platform_driver latch_led_driver = { -+ .probe = latch_led_probe, -+ .remove = __devexit_p(latch_led_remove), -+ .driver = { -+ .name = "leds-latch", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static int __init latch_led_init(void) -+{ -+ return platform_driver_register(&latch_led_driver); -+} -+ -+static void __exit latch_led_exit(void) -+{ -+ platform_driver_unregister(&latch_led_driver); -+} -+ -+module_init(latch_led_init); -+module_exit(latch_led_exit); -+ -+MODULE_AUTHOR("Chris Lang "); -+MODULE_DESCRIPTION("Latch LED driver"); -+MODULE_LICENSE("GPL"); ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-c - obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o - obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o - obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o -+obj-$(CONFIG_LEDS_LATCH) += leds-latch.o - obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o - obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o - obj-$(CONFIG_LEDS_FSG) += leds-fsg.o ---- a/include/linux/leds.h -+++ b/include/linux/leds.h -@@ -153,5 +153,19 @@ struct gpio_led_platform_data { - unsigned long *delay_off); - }; - -+/* For the leds-latch driver */ -+struct latch_led { -+ const char *name; -+ char *default_trigger; -+ unsigned bit; -+}; -+ -+struct latch_led_platform_data { -+ int num_leds; -+ u32 mem; -+ struct latch_led *leds; -+ void (*set_led)(u8 bit, enum led_brightness value); -+}; -+ - - #endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/target/linux/ixp4xx/patches-2.6.30/300-avila_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.30/300-avila_fetch_mac.patch deleted file mode 100644 index ca8cae12c..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/300-avila_fetch_mac.patch +++ /dev/null @@ -1,244 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/avila-setup.c -+++ b/arch/arm/mach-ixp4xx/avila-setup.c -@@ -14,10 +14,16 @@ - #include - #include - #include -+#include -+#include -+#include - #include - #include - #include - #include -+#include -+#include -+ - #include - - #include -@@ -29,6 +35,13 @@ - #include - #include - -+struct avila_board_info { -+ unsigned char *model; -+ void (*setup)(void); -+}; -+ -+static struct avila_board_info *avila_info __initdata; -+ - static struct flash_platform_data avila_flash_data = { - .map_name = "cfi_probe", - .width = 2, -@@ -132,16 +145,181 @@ static struct platform_device avila_pata - .resource = avila_pata_resources, - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info avila_npeb_data = { -+ .phy = 0, -+ .rxq = 3, -+ .txreadyq = 20, -+}; -+ -+static struct eth_plat_info avila_npec_data = { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct platform_device avila_npeb_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = &avila_npeb_data, -+}; -+ -+static struct platform_device avila_npec_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = &avila_npec_data, -+}; -+ - static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, - &avila_uart - }; - -+static void __init avila_gw23xx_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2342_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2345_setup(void) -+{ -+ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; -+ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ -+ platform_device_register(&avila_npeb_device); -+ -+ avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2347_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+} -+ -+static void __init avila_gw2348_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2353_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+} -+ -+static void __init avila_gw2355_setup(void) -+{ -+ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; -+ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ -+ platform_device_register(&avila_npeb_device); -+ -+ avila_npec_data.phy = 16; -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2357_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+} -+ -+static struct avila_board_info avila_boards[] __initdata = { -+ { -+ .model = "GW2342", -+ .setup = avila_gw2342_setup, -+ }, { -+ .model = "GW2345", -+ .setup = avila_gw2345_setup, -+ }, { -+ .model = "GW2347", -+ .setup = avila_gw2347_setup, -+ }, { -+ .model = "GW2348", -+ .setup = avila_gw2348_setup, -+ }, { -+ .model = "GW2353", -+ .setup = avila_gw2353_setup, -+ }, { -+ .model = "GW2355", -+ .setup = avila_gw2355_setup, -+ }, { -+ .model = "GW2357", -+ .setup = avila_gw2357_setup, -+ } -+}; -+ -+static struct avila_board_info * __init avila_find_board_info(char *model) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(avila_boards); i++) { -+ struct avila_board_info *info = &avila_boards[i]; -+ if (strcmp(info->model, model) == 0) -+ return info; -+ } -+ -+ return NULL; -+} -+ -+static struct memory_accessor *at24_mem_acc; -+ -+static int at24_setup(struct memory_accessor *mem_acc, void *context) -+{ -+ char mac_addr[ETH_ALEN]; -+ char model[6]; -+ -+ at24_mem_acc = mem_acc; -+ -+ /* Read MAC addresses */ -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x0, 6) == 6) { -+ memcpy(&avila_npeb_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x6, 6) == 6) { -+ memcpy(&avila_npec_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ -+ /* Read the first 6 bytes of the model number */ -+ if (at24_mem_acc->read(at24_mem_acc, model, 0x20, 6) == 6) { -+ avila_info = avila_find_board_info(model); -+ } -+ -+ return 0; -+} -+ -+static struct at24_platform_data avila_eeprom_info = { -+ .byte_len = 1024, -+ .page_size = 16, -+ .flags = AT24_FLAG_READONLY, -+ .setup = at24_setup, -+}; -+ -+static struct i2c_board_info __initdata avila_i2c_board_info[] = { -+ { -+ I2C_BOARD_INFO("ds1672", 0x68), -+ }, -+ { -+ I2C_BOARD_INFO("ad7418", 0x28), -+ }, -+ { -+ I2C_BOARD_INFO("24c08", 0x51), -+ .platform_data = &avila_eeprom_info -+ }, -+}; -+ - static void __init avila_init(void) - { - ixp4xx_sys_init(); - -+ /* -+ * These devices are present on all Avila models and don't need any -+ * model specific setup. -+ */ - avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - avila_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; -@@ -159,7 +337,28 @@ static void __init avila_init(void) - - platform_device_register(&avila_pata); - -+ i2c_register_board_info(0, avila_i2c_board_info, -+ ARRAY_SIZE(avila_i2c_board_info)); -+} -+ -+static int __init avila_model_setup(void) -+{ -+ if (!machine_is_avila()) -+ return 0; -+ -+ if (avila_info) { -+ printk(KERN_DEBUG "Running on Gateworks Avila %s\n", -+ avila_info->model); -+ avila_info->setup(); -+ } else { -+ printk(KERN_INFO "Unknown/missing Avila model number" -+ " -- defaults will be used\n"); -+ avila_gw23xx_setup(); -+ } -+ -+ return 0; - } -+late_initcall(avila_model_setup); - - MACHINE_START(AVILA, "Gateworks Avila Network Platform") - /* Maintainer: Deepak Saxena */ diff --git a/target/linux/ixp4xx/patches-2.6.30/301-avila_led.patch b/target/linux/ixp4xx/patches-2.6.30/301-avila_led.patch deleted file mode 100644 index 2bd0e1609..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/301-avila_led.patch +++ /dev/null @@ -1,171 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/avila-setup.c -+++ b/arch/arm/mach-ixp4xx/avila-setup.c -@@ -24,6 +24,7 @@ - #include - #include - -+#include - #include - - #include -@@ -170,6 +171,72 @@ static struct platform_device avila_npec - .dev.platform_data = &avila_npec_data, - }; - -+static struct gpio_led avila_gpio_leds[] = { -+ { -+ .name = "user", /* green led */ -+ .gpio = AVILA_GW23XX_LED_USER_GPIO, -+ .active_low = 1, -+ } -+}; -+ -+static struct gpio_led_platform_data avila_gpio_leds_data = { -+ .num_leds = 1, -+ .leds = avila_gpio_leds, -+}; -+ -+static struct platform_device avila_gpio_leds_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &avila_gpio_leds_data, -+}; -+ -+static struct latch_led avila_latch_leds[] = { -+ { -+ .name = "led0", /* green led */ -+ .bit = 0, -+ }, -+ { -+ .name = "led1", /* green led */ -+ .bit = 1, -+ }, -+ { -+ .name = "led2", /* green led */ -+ .bit = 2, -+ }, -+ { -+ .name = "led3", /* green led */ -+ .bit = 3, -+ }, -+ { -+ .name = "led4", /* green led */ -+ .bit = 4, -+ }, -+ { -+ .name = "led5", /* green led */ -+ .bit = 5, -+ }, -+ { -+ .name = "led6", /* green led */ -+ .bit = 6, -+ }, -+ { -+ .name = "led7", /* green led */ -+ .bit = 7, -+ } -+}; -+ -+static struct latch_led_platform_data avila_latch_leds_data = { -+ .num_leds = 8, -+ .leds = avila_latch_leds, -+ .mem = 0x51000000, -+}; -+ -+static struct platform_device avila_latch_leds_device = { -+ .name = "leds-latch", -+ .id = -1, -+ .dev.platform_data = &avila_latch_leds_data, -+}; -+ - static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, -@@ -180,12 +247,16 @@ static void __init avila_gw23xx_setup(vo - { - platform_device_register(&avila_npeb_device); - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2342_setup(void) - { - platform_device_register(&avila_npeb_device); - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2345_setup(void) -@@ -196,22 +267,30 @@ static void __init avila_gw2345_setup(vo - - avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2347_setup(void) - { - platform_device_register(&avila_npeb_device); -+ -+ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2348_setup(void) - { - platform_device_register(&avila_npeb_device); - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2353_setup(void) - { - platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2355_setup(void) -@@ -222,11 +301,29 @@ static void __init avila_gw2355_setup(vo - - avila_npec_data.phy = 16; - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); -+ -+ *IXP4XX_EXP_CS4 |= 0xbfff3c03; -+ avila_latch_leds[0].name = "RXD"; -+ avila_latch_leds[1].name = "TXD"; -+ avila_latch_leds[2].name = "POL"; -+ avila_latch_leds[3].name = "LNK"; -+ avila_latch_leds[4].name = "ERR"; -+ avila_latch_leds_data.num_leds = 5; -+ avila_latch_leds_data.mem = 0x54000000; -+ platform_device_register(&avila_latch_leds_device); - } - - static void __init avila_gw2357_setup(void) - { - platform_device_register(&avila_npeb_device); -+ -+ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; -+ platform_device_register(&avila_gpio_leds_device); -+ -+ *IXP4XX_EXP_CS1 |= 0xbfff3c03; -+ platform_device_register(&avila_latch_leds_device); - } - - static struct avila_board_info avila_boards[] __initdata = { ---- a/arch/arm/mach-ixp4xx/include/mach/avila.h -+++ b/arch/arm/mach-ixp4xx/include/mach/avila.h -@@ -36,4 +36,6 @@ - #define AVILA_PCI_INTC_PIN 9 - #define AVILA_PCI_INTD_PIN 8 - -- -+/* User LEDs */ -+#define AVILA_GW23XX_LED_USER_GPIO 3 -+#define AVILA_GW23X7_LED_USER_GPIO 4 diff --git a/target/linux/ixp4xx/patches-2.6.30/302-avila_gpio_device.patch b/target/linux/ixp4xx/patches-2.6.30/302-avila_gpio_device.patch deleted file mode 100644 index 3b75a59f7..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/302-avila_gpio_device.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/avila-setup.c -+++ b/arch/arm/mach-ixp4xx/avila-setup.c -@@ -237,10 +237,28 @@ static struct platform_device avila_latc - .dev.platform_data = &avila_latch_leds_data, - }; - -+static struct resource avila_gpio_resources[] = { -+ { -+ .name = "gpio", -+ /* FIXME: gpio mask should be model specific */ -+ .start = AVILA_GPIO_MASK, -+ .end = AVILA_GPIO_MASK, -+ .flags = 0, -+ }, -+}; -+ -+static struct platform_device avila_gpio = { -+ .name = "GPIODEV", -+ .id = -1, -+ .num_resources = ARRAY_SIZE(avila_gpio_resources), -+ .resource = avila_gpio_resources, -+}; -+ - static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, -- &avila_uart -+ &avila_uart, -+ &avila_gpio, - }; - - static void __init avila_gw23xx_setup(void) ---- a/arch/arm/mach-ixp4xx/include/mach/avila.h -+++ b/arch/arm/mach-ixp4xx/include/mach/avila.h -@@ -39,3 +39,6 @@ - /* User LEDs */ - #define AVILA_GW23XX_LED_USER_GPIO 3 - #define AVILA_GW23X7_LED_USER_GPIO 4 -+ -+/* gpio mask used by platform device */ -+#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9) diff --git a/target/linux/ixp4xx/patches-2.6.30/304-ixp4xx_eth_jumboframe.patch b/target/linux/ixp4xx/patches-2.6.30/304-ixp4xx_eth_jumboframe.patch deleted file mode 100644 index b4cf82437..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/304-ixp4xx_eth_jumboframe.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -52,7 +52,7 @@ - - #define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) - #define REGS_SIZE 0x1000 --#define MAX_MRU 1536 /* 0x600 */ -+#define MAX_MRU (14320 - ETH_HLEN - ETH_FCS_LEN) - #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) - - #define NAPI_WEIGHT 16 -@@ -1059,6 +1059,32 @@ static void destroy_queues(struct port * - } - } - -+static int eth_do_change_mtu(struct net_device *dev, int mtu) -+{ -+ struct port *port; -+ struct msg msg; -+ /* adjust for ethernet headers */ -+ int framesize = mtu + ETH_HLEN + ETH_FCS_LEN; -+ -+ port = netdev_priv(dev); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.cmd = NPE_SETMAXFRAMELENGTHS; -+ msg.eth_id = port->id; -+ -+ /* max rx/tx 64 byte blocks */ -+ msg.byte2 = ((framesize + 63) / 64) << 8; -+ msg.byte3 = ((framesize + 63) / 64) << 8; -+ -+ msg.byte4 = msg.byte6 = framesize >> 8; -+ msg.byte5 = msg.byte7 = framesize & 0xff; -+ -+ if (npe_send_recv_message(port->npe, &msg, "ETH_SET_MAX_FRAME_LENGTH")) -+ return -EIO; -+ -+ return 0; -+} -+ - static int eth_open(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -@@ -1110,6 +1136,8 @@ static int eth_open(struct net_device *d - if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) - return -EIO; - -+ eth_do_change_mtu(dev, dev->mtu); -+ - if ((err = request_queues(port)) != 0) - return err; - -@@ -1249,7 +1277,26 @@ static int eth_close(struct net_device * - return 0; - } - -+static int ixp_eth_change_mtu(struct net_device *dev, int mtu) -+{ -+ int ret; -+ -+ if (mtu > MAX_MRU) -+ return -EINVAL; -+ -+ if (dev->flags & IFF_UP) { -+ ret = eth_do_change_mtu(dev, mtu); -+ if (ret < 0) -+ return ret; -+ } -+ -+ dev->mtu = mtu; -+ -+ return 0; -+} -+ - static const struct net_device_ops ixp4xx_netdev_ops = { -+ .ndo_change_mtu = ixp_eth_change_mtu, - .ndo_open = eth_open, - .ndo_stop = eth_close, - .ndo_start_xmit = eth_xmit, diff --git a/target/linux/ixp4xx/patches-2.6.30/310-gtwx5717_spi_bus.patch b/target/linux/ixp4xx/patches-2.6.30/310-gtwx5717_spi_bus.patch deleted file mode 100644 index e6013d758..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/310-gtwx5717_spi_bus.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c -+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c -@@ -29,6 +29,8 @@ - #include - #include - -+#include -+ - #include - #include - #include -@@ -121,9 +123,41 @@ static struct platform_device gtwx5715_f - .resource = >wx5715_flash_resource, - }; - -+static int gtwx5715_spi_boardinfo_setup(struct spi_board_info *bi, -+ struct spi_master *master, void *data) -+{ -+ -+ strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias)); -+ -+ bi->max_speed_hz = 5000000 /* Hz */; -+ bi->bus_num = master->bus_num; -+ bi->mode = SPI_MODE_0; -+ -+ return 0; -+} -+ -+static struct spi_gpio_platform_data gtwx5715_spi_bus_data = { -+ .pin_cs = GTWX5715_KSSPI_SELECT, -+ .pin_clk = GTWX5715_KSSPI_CLOCK, -+ .pin_miso = GTWX5715_KSSPI_RXD, -+ .pin_mosi = GTWX5715_KSSPI_TXD, -+ .cs_activelow = 1, -+ .no_spi_delay = 1, -+ .boardinfo_setup = gtwx5715_spi_boardinfo_setup, -+}; -+ -+static struct platform_device gtwx5715_spi_bus = { -+ .name = "spi-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = >wx5715_spi_bus_data, -+ }, -+}; -+ - static struct platform_device *gtwx5715_devices[] __initdata = { - >wx5715_uart_device, - >wx5715_flash, -+ >wx5715_spi_bus, - }; - - static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.30/311-gtwx5717_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.30/311-gtwx5717_mac_plat_info.patch deleted file mode 100644 index 29f329017..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/311-gtwx5717_mac_plat_info.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c -+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c -@@ -154,10 +154,37 @@ static struct platform_device gtwx5715_s - }, - }; - -+static struct eth_plat_info gtwx5715_npeb_data = { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ -+ .rxq = 3, -+ .txreadyq = 20, -+}; -+ -+static struct eth_plat_info gtwx5715_npec_data = { -+ .phy = 5, /* port 5 of the KS8995 switch */ -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct platform_device gtwx5715_npeb_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = >wx5715_npeb_data, -+}; -+ -+static struct platform_device gtwx5715_npec_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = >wx5715_npec_data, -+}; -+ - static struct platform_device *gtwx5715_devices[] __initdata = { - >wx5715_uart_device, - >wx5715_flash, - >wx5715_spi_bus, -+ >wx5715_npeb_device, -+ >wx5715_npec_device, - }; - - static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.30/312-ixp4xx_pata_optimization.patch b/target/linux/ixp4xx/patches-2.6.30/312-ixp4xx_pata_optimization.patch deleted file mode 100644 index 3bf1b7497..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/312-ixp4xx_pata_optimization.patch +++ /dev/null @@ -1,137 +0,0 @@ ---- a/drivers/ata/pata_ixp4xx_cf.c -+++ b/drivers/ata/pata_ixp4xx_cf.c -@@ -24,16 +24,58 @@ - #include - - #define DRV_NAME "pata_ixp4xx_cf" --#define DRV_VERSION "0.2" -+#define DRV_VERSION "0.3" - - static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error) - { - struct ata_device *dev; -+ struct ixp4xx_pata_data *data = link->ap->host->dev->platform_data; -+ unsigned int pio_mask; - - ata_for_each_dev(dev, link, ENABLED) { -- ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); -- dev->pio_mode = XFER_PIO_0; -- dev->xfer_mode = XFER_PIO_0; -+ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)) { -+ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; -+ if (pio_mask & (1 << 1)) { -+ pio_mask = 4; -+ } else { -+ pio_mask = 3; -+ } -+ } else { -+ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); -+ } -+ -+ switch (pio_mask){ -+ case 0: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); -+ dev->pio_mode = XFER_PIO_0; -+ dev->xfer_mode = XFER_PIO_0; -+ *data->cs0_cfg = 0x8a473c03; -+ break; -+ case 1: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO1\n"); -+ dev->pio_mode = XFER_PIO_1; -+ dev->xfer_mode = XFER_PIO_1; -+ *data->cs0_cfg = 0x86433c03; -+ break; -+ case 2: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO2\n"); -+ dev->pio_mode = XFER_PIO_2; -+ dev->xfer_mode = XFER_PIO_2; -+ *data->cs0_cfg = 0x82413c03; -+ break; -+ case 3: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO3\n"); -+ dev->pio_mode = XFER_PIO_3; -+ dev->xfer_mode = XFER_PIO_3; -+ *data->cs0_cfg = 0x80823c03; -+ break; -+ case 4: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO4\n"); -+ dev->pio_mode = XFER_PIO_4; -+ dev->xfer_mode = XFER_PIO_4; -+ *data->cs0_cfg = 0x80403c03; -+ break; -+ } - dev->xfer_shift = ATA_SHIFT_PIO; - dev->flags |= ATA_DFLAG_PIO; - } -@@ -46,6 +88,7 @@ static unsigned int ixp4xx_mmio_data_xfe - unsigned int i; - unsigned int words = buflen >> 1; - u16 *buf16 = (u16 *) buf; -+ unsigned int pio_mask; - struct ata_port *ap = dev->link->ap; - void __iomem *mmio = ap->ioaddr.data_addr; - struct ixp4xx_pata_data *data = ap->host->dev->platform_data; -@@ -53,8 +96,34 @@ static unsigned int ixp4xx_mmio_data_xfe - /* set the expansion bus in 16bit mode and restore - * 8 bit mode after the transaction. - */ -- *data->cs0_cfg &= ~(0x01); -- udelay(100); -+ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)){ -+ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; -+ if (pio_mask & (1 << 1)){ -+ pio_mask = 4; -+ }else{ -+ pio_mask = 3; -+ } -+ }else{ -+ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); -+ } -+ switch (pio_mask){ -+ case 0: -+ *data->cs0_cfg = 0xa9643c42; -+ break; -+ case 1: -+ *data->cs0_cfg = 0x85033c42; -+ break; -+ case 2: -+ *data->cs0_cfg = 0x80b23c42; -+ break; -+ case 3: -+ *data->cs0_cfg = 0x80823c42; -+ break; -+ case 4: -+ *data->cs0_cfg = 0x80403c42; -+ break; -+ } -+ udelay(5); - - /* Transfer multiple of 2 bytes */ - if (rw == READ) -@@ -79,8 +148,24 @@ static unsigned int ixp4xx_mmio_data_xfe - words++; - } - -- udelay(100); -- *data->cs0_cfg |= 0x01; -+ udelay(5); -+ switch (pio_mask){ -+ case 0: -+ *data->cs0_cfg = 0x8a473c03; -+ break; -+ case 1: -+ *data->cs0_cfg = 0x86433c03; -+ break; -+ case 2: -+ *data->cs0_cfg = 0x82413c03; -+ break; -+ case 3: -+ *data->cs0_cfg = 0x80823c03; -+ break; -+ case 4: -+ *data->cs0_cfg = 0x80403c03; -+ break; -+ } - - return words << 1; - } diff --git a/target/linux/ixp4xx/patches-2.6.30/401-avila_pci_dev.patch b/target/linux/ixp4xx/patches-2.6.30/401-avila_pci_dev.patch deleted file mode 100644 index 3e5087f34..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/401-avila_pci_dev.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/include/mach/avila.h -+++ b/arch/arm/mach-ixp4xx/include/mach/avila.h -@@ -25,7 +25,7 @@ - /* - * AVILA PCI IRQs - */ --#define AVILA_PCI_MAX_DEV 4 -+#define AVILA_PCI_MAX_DEV 6 - #define LOFT_PCI_MAX_DEV 6 - #define AVILA_PCI_IRQ_LINES 4 - diff --git a/target/linux/ixp4xx/patches-2.6.30/402-ixp4xx_gpiolib.patch b/target/linux/ixp4xx/patches-2.6.30/402-ixp4xx_gpiolib.patch deleted file mode 100644 index 979a63d6e..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/402-ixp4xx_gpiolib.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/common.c -+++ b/arch/arm/mach-ixp4xx/common.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -374,12 +375,39 @@ static struct platform_device *ixp46x_de - unsigned long ixp4xx_exp_bus_size; - EXPORT_SYMBOL(ixp4xx_exp_bus_size); - -+static int ixp4xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) -+{ -+ gpio_line_config(gpio, IXP4XX_GPIO_IN); -+ return 0; -+} -+EXPORT_SYMBOL(ixp4xx_gpio_direction_input); -+ -+static int ixp4xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int level) -+{ -+ gpio_line_set(gpio, level); -+ gpio_line_config(gpio, IXP4XX_GPIO_OUT); -+ return 0; -+} -+EXPORT_SYMBOL(ixp4xx_gpio_direction_output); -+ -+static struct gpio_chip ixp4xx_gpio_chip = { -+ .label = "IXP4XX_GPIO_CHIP", -+ .direction_input = ixp4xx_gpio_direction_input, -+ .direction_output = ixp4xx_gpio_direction_output, -+ .get = gpio_get_value, -+ .set = gpio_set_value, -+ .base = 0, -+ .ngpio = 16, -+}; -+ - void __init ixp4xx_sys_init(void) - { - ixp4xx_exp_bus_size = SZ_16M; - - platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices)); - -+ gpiochip_add(&ixp4xx_gpio_chip); -+ - if (cpu_is_ixp46x()) { - int region; - ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -375,6 +375,7 @@ config ARCH_IXP4XX - select GENERIC_GPIO - select GENERIC_TIME - select GENERIC_CLOCKEVENTS -+ select ARCH_REQUIRE_GPIOLIB - help - Support for Intel's IXP4XX (XScale) family of processors. - ---- a/arch/arm/mach-ixp4xx/include/mach/gpio.h -+++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h -@@ -27,47 +27,31 @@ - - #include - #include -+#include /* cansleep wrappers */ - --static inline int gpio_request(unsigned gpio, const char *label) --{ -- return 0; --} -- --static inline void gpio_free(unsigned gpio) --{ -- might_sleep(); -- -- return; --} -- --static inline int gpio_direction_input(unsigned gpio) --{ -- gpio_line_config(gpio, IXP4XX_GPIO_IN); -- return 0; --} -- --static inline int gpio_direction_output(unsigned gpio, int level) --{ -- gpio_line_set(gpio, level); -- gpio_line_config(gpio, IXP4XX_GPIO_OUT); -- return 0; --} -+#define NR_BUILTIN_GPIO 16 - - static inline int gpio_get_value(unsigned gpio) - { -- int value; -- -- gpio_line_get(gpio, &value); -- -- return value; -+ if (gpio < NR_BUILTIN_GPIO) -+ { -+ int value; -+ gpio_line_get(gpio, &value); -+ return value; -+ } -+ else -+ return __gpio_get_value(gpio); - } - - static inline void gpio_set_value(unsigned gpio, int value) - { -- gpio_line_set(gpio, value); -+ if (gpio < NR_BUILTIN_GPIO) -+ gpio_line_set(gpio, value); -+ else -+ __gpio_set_value(gpio, value); - } - --#include /* cansleep wrappers */ -+#define gpio_cansleep __gpio_cansleep - - extern int gpio_to_irq(int gpio); - extern int irq_to_gpio(int gpio); diff --git a/target/linux/ixp4xx/patches-2.6.30/500-usr8200_support.patch b/target/linux/ixp4xx/patches-2.6.30/500-usr8200_support.patch deleted file mode 100644 index d0175044d..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/500-usr8200_support.patch +++ /dev/null @@ -1,342 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -97,6 +97,14 @@ config MACH_SIDEWINDER - Engineering Sidewinder board. For more information on this - platform, see http://www.adiengineering.com - -+config MACH_USR8200 -+ bool "USRobotics USR8200" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the USRobotics -+ USR8200 router board. For more information on this platform, see -+ http://openwrt.org -+ - config MACH_COMPEX - bool "Compex WP18 / NP18A" - select PCI ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt - obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o - obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o -+obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o - - obj-y += common.o - -@@ -48,6 +49,7 @@ obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv - obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o - obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o - obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o -+obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/usr8200-pci.c -@@ -0,0 +1,78 @@ -+/* -+ * arch/arch/mach-ixp4xx/usr8200-pci.c -+ * -+ * PCI setup routines for USRobotics USR8200 -+ * -+ * Copyright (C) 2008 Peter Denison -+ * -+ * based on pronghorn-pci.c -+ * Copyright (C) 2008 Imre Kaloz -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Peter Denison -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init usr8200_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init usr8200_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 14) -+ return IRQ_IXP4XX_GPIO7; -+ else if (slot == 15) -+ return IRQ_IXP4XX_GPIO8; -+ else if (slot == 16) { -+ if (pin == 1) -+ return IRQ_IXP4XX_GPIO11; -+ else if (pin == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else if (pin == 3) -+ return IRQ_IXP4XX_GPIO9; -+ else -+ return -1; -+ } else -+ return -1; -+} -+ -+struct hw_pci usr8200_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = usr8200_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = usr8200_map_irq, -+}; -+ -+int __init usr8200_pci_init(void) -+{ -+ if (machine_is_usr8200()) -+ pci_common_init(&usr8200_pci); -+ return 0; -+} -+ -+subsys_initcall(usr8200_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/usr8200-setup.c -@@ -0,0 +1,212 @@ -+/* -+ * arch/arm/mach-ixp4xx/usr8200-setup.c -+ * -+ * Board setup for the USRobotics USR8200 -+ * -+ * Copyright (C) 2008 Peter Denison -+ * -+ * based on pronghorn-setup.c: -+ * Copyright (C) 2008 Imre Kaloz -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Peter Denison -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data usr8200_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource usr8200_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device usr8200_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &usr8200_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &usr8200_flash_resource, -+}; -+ -+static struct resource usr8200_uart_resources [] = { -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port usr8200_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device usr8200_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = usr8200_uart_data, -+ }, -+ .num_resources = 2, -+ .resource = usr8200_uart_resources, -+}; -+ -+static struct gpio_led usr8200_led_pin[] = { -+ { -+ .name = "usr8200:usb1", -+ .gpio = 0, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:usb2", -+ .gpio = 1, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:ieee1394", -+ .gpio = 2, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:internal", -+ .gpio = 3, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:power", -+ .gpio = 14, -+ } -+}; -+ -+static struct gpio_led_platform_data usr8200_led_data = { -+ .num_leds = ARRAY_SIZE(usr8200_led_pin), -+ .leds = usr8200_led_pin, -+}; -+ -+static struct platform_device usr8200_led = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &usr8200_led_data, -+}; -+ -+static struct eth_plat_info usr8200_plat_eth[] = { -+ { /* NPEC - LAN with Marvell 88E6060 switch */ -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x0F0000, -+ .rxq = 4, -+ .txreadyq = 21, -+ }, { /* NPEB - WAN */ -+ .phy = 9, -+ .rxq = 3, -+ .txreadyq = 20, -+ } -+}; -+ -+static struct platform_device usr8200_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = usr8200_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = usr8200_plat_eth + 1, -+ } -+}; -+ -+static struct resource usr8200_rtc_resources = { -+ .flags = IORESOURCE_MEM -+}; -+ -+static struct platform_device usr8200_rtc = { -+ .name = "rtc7301", -+ .id = 0, -+ .num_resources = 1, -+ .resource = &usr8200_rtc_resources, -+}; -+ -+static struct platform_device *usr8200_devices[] __initdata = { -+ &usr8200_flash, -+ &usr8200_uart, -+ &usr8200_led, -+ &usr8200_eth[0], -+ &usr8200_eth[1], -+ &usr8200_rtc, -+}; -+ -+static void __init usr8200_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; -+ -+ usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2); -+ usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN | -+ IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN; -+ *IXP4XX_GPIO_GPCLKR = 0x01100000; -+ -+ /* configure button as input */ -+ gpio_line_config(12, IXP4XX_GPIO_IN); -+ -+ platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices)); -+} -+ -+MACHINE_START(USR8200, "USRobotics USR8200") -+ /* Maintainer: Peter Denison */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = usr8200_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -43,7 +43,7 @@ static __inline__ void __arch_decomp_set - if (machine_is_adi_coyote() || machine_is_gtwx5715() || - machine_is_gateway7001() || machine_is_wg302v2() || - machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2() || -- machine_is_tw5334()) -+ machine_is_tw5334() || machine_is_usr8200()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.30/600-dma_performance.patch b/target/linux/ixp4xx/patches-2.6.30/600-dma_performance.patch deleted file mode 100644 index 5aac26ee8..000000000 --- a/target/linux/ixp4xx/patches-2.6.30/600-dma_performance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -260,6 +260,10 @@ struct sk_buff *__alloc_skb(unsigned int - if (!skb) - goto out; - -+#ifdef CONFIG_ARCH_IXP4XX -+ gfp_mask |= GFP_DMA; -+#endif -+ - size = SKB_DATA_ALIGN(size); - data = kmalloc_node_track_caller(size + sizeof(struct skb_shared_info), - gfp_mask, node); diff --git a/target/linux/ixp4xx/patches-2.6.31/010-ixp43x_pci_fixup.patch b/target/linux/ixp4xx/patches-2.6.31/010-ixp43x_pci_fixup.patch deleted file mode 100644 index 35af7f4fa..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/010-ixp43x_pci_fixup.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/include/mach/hardware.h -+++ b/arch/arm/mach-ixp4xx/include/mach/hardware.h -@@ -18,7 +18,7 @@ - #define __ASM_ARCH_HARDWARE_H__ - - #define PCIBIOS_MIN_IO 0x00001000 --#define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x40000000 : 0x48000000) -+#define PCIBIOS_MIN_MEM 0x48000000 - - /* - * We override the standard dma-mask routines for bouncing. diff --git a/target/linux/ixp4xx/patches-2.6.31/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-2.6.31/020-gateworks_i2c_pld.patch deleted file mode 100644 index 782daf75a..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/020-gateworks_i2c_pld.patch +++ /dev/null @@ -1,421 +0,0 @@ ---- /dev/null -+++ b/drivers/gpio/gw_i2c_pld.c -@@ -0,0 +1,371 @@ -+/* -+ * Gateworks I2C PLD GPIO expander -+ * -+ * Copyright (C) 2009 Gateworks Corporation -+ * -+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static const struct i2c_device_id gw_i2c_pld_id[] = { -+ { "gw_i2c_pld", 8 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(i2c, gw_i2c_pld_id); -+ -+/* -+ * The Gateworks I2C PLD chip only expose one read and one -+ * write register. Writing a "one" bit (to match the reset state) lets -+ * that pin be used as an input. It is an open-drain model. -+ */ -+ -+struct gw_i2c_pld { -+ struct gpio_chip chip; -+ struct i2c_client *client; -+ unsigned out; /* software latch */ -+}; -+ -+/*-------------------------------------------------------------------------*/ -+ -+/* -+ * The Gateworks I2C PLD chip does not properly send the acknowledge bit -+ * thus we cannot use standard i2c_smbus functions. We have recreated -+ * our own here, but we still use the mutex_lock to lock the i2c_bus -+ * as the device still exists on the I2C bus. -+*/ -+ -+#define PLD_SCL_GPIO 6 -+#define PLD_SDA_GPIO 7 -+ -+#define SCL_LO() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_LOW) -+#define SCL_HI() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_HIGH) -+#define SCL_EN() gpio_line_config(PLD_SCL_GPIO, IXP4XX_GPIO_OUT) -+#define SDA_LO() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_LOW) -+#define SDA_HI() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_HIGH) -+#define SDA_EN() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_OUT) -+#define SDA_DIS() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_IN) -+#define SDA_IN(x) gpio_line_get(PLD_SDA_GPIO, &x); -+ -+static int i2c_pld_write_byte(int address, int byte) -+{ -+ int i; -+ -+ address = (address << 1) & ~0x1; -+ -+ SDA_HI(); -+ SDA_EN(); -+ SCL_EN(); -+ SCL_HI(); -+ SDA_LO(); -+ SCL_LO(); -+ -+ for (i = 7; i >= 0; i--) -+ { -+ if (address & (1 << i)) -+ SDA_HI(); -+ else -+ SDA_LO(); -+ -+ SCL_HI(); -+ SCL_LO(); -+ } -+ -+ SDA_DIS(); -+ SCL_HI(); -+ SDA_IN(i); -+ SCL_LO(); -+ SDA_EN(); -+ -+ for (i = 7; i >= 0; i--) -+ { -+ if (byte & (1 << i)) -+ SDA_HI(); -+ else -+ SDA_LO(); -+ SCL_HI(); -+ SCL_LO(); -+ } -+ -+ SDA_DIS(); -+ SCL_HI(); -+ SDA_IN(i); -+ SCL_LO(); -+ -+ SDA_HI(); -+ SDA_EN(); -+ -+ SDA_LO(); -+ SCL_HI(); -+ SDA_HI(); -+ SCL_LO(); -+ SCL_HI(); -+ -+ return 0; -+} -+ -+static unsigned int i2c_pld_read_byte(int address) -+{ -+ int i = 0, byte = 0; -+ int bit; -+ -+ address = (address << 1) | 0x1; -+ -+ SDA_HI(); -+ SDA_EN(); -+ SCL_EN(); -+ SCL_HI(); -+ SDA_LO(); -+ SCL_LO(); -+ -+ for (i = 7; i >= 0; i--) -+ { -+ if (address & (1 << i)) -+ SDA_HI(); -+ else -+ SDA_LO(); -+ -+ SCL_HI(); -+ SCL_LO(); -+ } -+ -+ SDA_DIS(); -+ SCL_HI(); -+ SDA_IN(i); -+ SCL_LO(); -+ SDA_EN(); -+ -+ SDA_DIS(); -+ for (i = 7; i >= 0; i--) -+ { -+ SCL_HI(); -+ SDA_IN(bit); -+ byte |= bit << i; -+ SCL_LO(); -+ } -+ -+ SDA_LO(); -+ SCL_HI(); -+ SDA_HI(); -+ SCL_LO(); -+ SCL_HI(); -+ -+ return byte; -+} -+ -+ -+static int gw_i2c_pld_input8(struct gpio_chip *chip, unsigned offset) -+{ -+ int ret; -+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); -+ struct i2c_adapter *adap = gpio->client->adapter; -+ -+ if (in_atomic() || irqs_disabled()) { -+ ret = mutex_trylock(&adap->bus_lock); -+ if (!ret) -+ /* I2C activity is ongoing. */ -+ return -EAGAIN; -+ } else { -+ mutex_lock_nested(&adap->bus_lock, adap->level); -+ } -+ -+ gpio->out |= (1 << offset); -+ -+ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); -+ -+ mutex_unlock(&adap->bus_lock); -+ -+ return ret; -+} -+ -+static int gw_i2c_pld_get8(struct gpio_chip *chip, unsigned offset) -+{ -+ int ret; -+ s32 value; -+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); -+ struct i2c_adapter *adap = gpio->client->adapter; -+ -+ if (in_atomic() || irqs_disabled()) { -+ ret = mutex_trylock(&adap->bus_lock); -+ if (!ret) -+ /* I2C activity is ongoing. */ -+ return -EAGAIN; -+ } else { -+ mutex_lock_nested(&adap->bus_lock, adap->level); -+ } -+ -+ value = i2c_pld_read_byte(gpio->client->addr); -+ -+ mutex_unlock(&adap->bus_lock); -+ -+ return (value < 0) ? 0 : (value & (1 << offset)); -+} -+ -+static int gw_i2c_pld_output8(struct gpio_chip *chip, unsigned offset, int value) -+{ -+ int ret; -+ -+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); -+ struct i2c_adapter *adap = gpio->client->adapter; -+ -+ unsigned bit = 1 << offset; -+ -+ if (in_atomic() || irqs_disabled()) { -+ ret = mutex_trylock(&adap->bus_lock); -+ if (!ret) -+ /* I2C activity is ongoing. */ -+ return -EAGAIN; -+ } else { -+ mutex_lock_nested(&adap->bus_lock, adap->level); -+ } -+ -+ -+ if (value) -+ gpio->out |= bit; -+ else -+ gpio->out &= ~bit; -+ -+ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); -+ -+ mutex_unlock(&adap->bus_lock); -+ -+ return ret; -+} -+ -+static void gw_i2c_pld_set8(struct gpio_chip *chip, unsigned offset, int value) -+{ -+ gw_i2c_pld_output8(chip, offset, value); -+} -+ -+/*-------------------------------------------------------------------------*/ -+ -+static int gw_i2c_pld_probe(struct i2c_client *client, -+ const struct i2c_device_id *id) -+{ -+ struct gw_i2c_pld_platform_data *pdata; -+ struct gw_i2c_pld *gpio; -+ int status; -+ -+ pdata = client->dev.platform_data; -+ if (!pdata) -+ return -ENODEV; -+ -+ /* Allocate, initialize, and register this gpio_chip. */ -+ gpio = kzalloc(sizeof *gpio, GFP_KERNEL); -+ if (!gpio) -+ return -ENOMEM; -+ -+ gpio->chip.base = pdata->gpio_base; -+ gpio->chip.can_sleep = 1; -+ gpio->chip.dev = &client->dev; -+ gpio->chip.owner = THIS_MODULE; -+ -+ gpio->chip.ngpio = pdata->nr_gpio; -+ gpio->chip.direction_input = gw_i2c_pld_input8; -+ gpio->chip.get = gw_i2c_pld_get8; -+ gpio->chip.direction_output = gw_i2c_pld_output8; -+ gpio->chip.set = gw_i2c_pld_set8; -+ -+ gpio->chip.label = client->name; -+ -+ gpio->client = client; -+ i2c_set_clientdata(client, gpio); -+ -+ gpio->out = 0xFF; -+ -+ status = gpiochip_add(&gpio->chip); -+ if (status < 0) -+ goto fail; -+ -+ dev_info(&client->dev, "gpios %d..%d on a %s%s\n", -+ gpio->chip.base, -+ gpio->chip.base + gpio->chip.ngpio - 1, -+ client->name, -+ client->irq ? " (irq ignored)" : ""); -+ -+ /* Let platform code set up the GPIOs and their users. -+ * Now is the first time anyone could use them. -+ */ -+ if (pdata->setup) { -+ status = pdata->setup(client, -+ gpio->chip.base, gpio->chip.ngpio, -+ pdata->context); -+ if (status < 0) -+ dev_warn(&client->dev, "setup --> %d\n", status); -+ } -+ -+ return 0; -+ -+fail: -+ dev_dbg(&client->dev, "probe error %d for '%s'\n", -+ status, client->name); -+ kfree(gpio); -+ return status; -+} -+ -+static int gw_i2c_pld_remove(struct i2c_client *client) -+{ -+ struct gw_i2c_pld_platform_data *pdata = client->dev.platform_data; -+ struct gw_i2c_pld *gpio = i2c_get_clientdata(client); -+ int status = 0; -+ -+ if (pdata->teardown) { -+ status = pdata->teardown(client, -+ gpio->chip.base, gpio->chip.ngpio, -+ pdata->context); -+ if (status < 0) { -+ dev_err(&client->dev, "%s --> %d\n", -+ "teardown", status); -+ return status; -+ } -+ } -+ -+ status = gpiochip_remove(&gpio->chip); -+ if (status == 0) -+ kfree(gpio); -+ else -+ dev_err(&client->dev, "%s --> %d\n", "remove", status); -+ return status; -+} -+ -+static struct i2c_driver gw_i2c_pld_driver = { -+ .driver = { -+ .name = "gw_i2c_pld", -+ .owner = THIS_MODULE, -+ }, -+ .probe = gw_i2c_pld_probe, -+ .remove = gw_i2c_pld_remove, -+ .id_table = gw_i2c_pld_id, -+}; -+ -+static int __init gw_i2c_pld_init(void) -+{ -+ return i2c_add_driver(&gw_i2c_pld_driver); -+} -+module_init(gw_i2c_pld_init); -+ -+static void __exit gw_i2c_pld_exit(void) -+{ -+ i2c_del_driver(&gw_i2c_pld_driver); -+} -+module_exit(gw_i2c_pld_exit); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Chris Lang"); ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -173,6 +173,14 @@ config GPIO_BT8XX - - If unsure, say N. - -+config GPIO_GW_I2C_PLD -+ tristate "Gateworks I2C PLD GPIO Expander" -+ depends on I2C -+ help -+ Say yes here to provide access to the Gateworks I2C PLD GPIO -+ Expander. This is used at least on the GW2358-4. -+ -+ - comment "SPI GPIO expanders:" - - config GPIO_MAX7301 ---- a/drivers/gpio/Makefile -+++ b/drivers/gpio/Makefile -@@ -14,3 +14,4 @@ obj-$(CONFIG_GPIO_TWL4030) += twl4030-gp - obj-$(CONFIG_GPIO_XILINX) += xilinx_gpio.o - obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o - obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o -+obj-$(CONFIG_GPIO_GW_I2C_PLD) += gw_i2c_pld.o ---- /dev/null -+++ b/include/linux/i2c/gw_i2c_pld.h -@@ -0,0 +1,20 @@ -+#ifndef __LINUX_GW_I2C_PLD_H -+#define __LINUX_GW_I2C_PLD_H -+ -+/** -+ * The Gateworks I2C PLD Implements an additional 8 bits of GPIO through the PLD -+ */ -+ -+struct gw_i2c_pld_platform_data { -+ unsigned gpio_base; -+ unsigned nr_gpio; -+ int (*setup)(struct i2c_client *client, -+ int gpio, unsigned ngpio, -+ void *context); -+ int (*teardown)(struct i2c_client *client, -+ int gpio, unsigned ngpio, -+ void *context); -+ void *context; -+}; -+ -+#endif /* __LINUX_GW_I2C_PLD_H */ diff --git a/target/linux/ixp4xx/patches-2.6.31/050-disable_dmabounce.patch b/target/linux/ixp4xx/patches-2.6.31/050-disable_dmabounce.patch deleted file mode 100644 index ad7cbdd98..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/050-disable_dmabounce.patch +++ /dev/null @@ -1,164 +0,0 @@ ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -384,7 +384,6 @@ config ARCH_IXP4XX - select GENERIC_GPIO - select GENERIC_TIME - select GENERIC_CLOCKEVENTS -- select DMABOUNCE if PCI - help - Support for Intel's IXP4XX (XScale) family of processors. - ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -199,6 +199,45 @@ config IXP4XX_INDIRECT_PCI - need to use the indirect method instead. If you don't know - what you need, leave this option unselected. - -+config IXP4XX_LEGACY_DMABOUNCE -+ bool "legacy PCI DMA bounce support" -+ depends on PCI -+ default n -+ select DMABOUNCE -+ help -+ The IXP4xx is limited to a 64MB window for PCI DMA, which -+ requires that PCI accesses above 64MB are bounced via buffers -+ below 64MB. Furthermore the IXP4xx has an erratum where PCI -+ read prefetches just below the 64MB limit can trigger lockups. -+ -+ The kernel has traditionally handled these two issue by using -+ ARM specific DMA bounce support code for all accesses >= 64MB. -+ That code causes problems of its own, so it is desirable to -+ disable it. As the kernel now has a workaround for the PCI read -+ prefetch erratum, it no longer requires the ARM bounce code. -+ -+ Enabling this option makes IXP4xx continue to use the problematic -+ ARM DMA bounce code. Disabling this option makes IXP4xx use the -+ kernel's generic bounce code. -+ -+ Say 'N'. -+ -+config IXP4XX_ZONE_DMA -+ bool "Support > 64MB RAM" -+ depends on !IXP4XX_LEGACY_DMABOUNCE -+ default y -+ select ZONE_DMA -+ help -+ The IXP4xx is limited to a 64MB window for PCI DMA, which -+ requires that PCI accesses above 64MB are bounced via buffers -+ below 64MB. -+ -+ Disabling this option allows you to omit the support code for -+ DMA-able memory allocations and DMA bouncing, but the kernel -+ will then not work properly if more than 64MB of RAM is present. -+ -+ Say 'Y' unless your platform is limited to <= 64MB of RAM. -+ - config IXP4XX_QMGR - tristate "IXP4xx Queue Manager support" - help ---- a/arch/arm/mach-ixp4xx/common-pci.c -+++ b/arch/arm/mach-ixp4xx/common-pci.c -@@ -321,27 +321,38 @@ static int abort_handler(unsigned long a - */ - static int ixp4xx_pci_platform_notify(struct device *dev) - { -- if(dev->bus == &pci_bus_type) { -- *dev->dma_mask = SZ_64M - 1; -+ if (dev->bus == &pci_bus_type) { -+ *dev->dma_mask = SZ_64M - 1; - dev->coherent_dma_mask = SZ_64M - 1; -+#ifdef CONFIG_DMABOUNCE - dmabounce_register_dev(dev, 2048, 4096); -+#endif - } - return 0; - } - - static int ixp4xx_pci_platform_notify_remove(struct device *dev) - { -- if(dev->bus == &pci_bus_type) { -+#ifdef CONFIG_DMABOUNCE -+ if (dev->bus == &pci_bus_type) - dmabounce_unregister_dev(dev); -- } -+#endif - return 0; - } - -+#ifdef CONFIG_DMABOUNCE - int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) - { -+ /* Note that this returns true for the last page below 64M due to -+ * IXP4xx erratum 15 (SCR 1289), which states that PCI prefetches -+ * can cross the boundary between valid memory and a reserved region -+ * causing AHB bus errors and a lock-up. -+ */ - return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M); - } -+#endif - -+#ifdef CONFIG_ZONE_DMA - /* - * Only first 64MB of memory can be accessed via PCI. - * We use GFP_DMA to allocate safe buffers to do map/unmap. -@@ -364,6 +375,7 @@ void __init ixp4xx_adjust_zones(int node - zhole_size[1] = zhole_size[0]; - zhole_size[0] = 0; - } -+#endif - - void __init ixp4xx_pci_preinit(void) - { -@@ -517,19 +529,35 @@ struct pci_bus * __devinit ixp4xx_scan_b - int - pci_set_dma_mask(struct pci_dev *dev, u64 mask) - { -- if (mask >= SZ_64M - 1 ) -+#ifdef CONFIG_DMABOUNCE -+ if (mask >= SZ_64M - 1) - return 0; - - return -EIO; -+#else -+ /* Only honour masks < SZ_64M. Silently ignore masks >= SZ_64M -+ as generic drivers do not know about IXP4xx PCI DMA quirks. */ -+ if (mask < SZ_64M) -+ dev->dma_mask = mask; -+ return 0; -+#endif - } - - int - pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) - { -- if (mask >= SZ_64M - 1 ) -+#ifdef CONFIG_DMABOUNCE -+ if (mask >= SZ_64M - 1) - return 0; - - return -EIO; -+#else -+ /* Only honour masks < SZ_64M. Silently ignore masks >= SZ_64M -+ as generic drivers do not know about IXP4xx PCI DMA quirks. */ -+ if (mask < SZ_64M) -+ dev->dev.coherent_dma_mask = mask; -+ return 0; -+#endif - } - - EXPORT_SYMBOL(ixp4xx_pci_read); ---- a/arch/arm/mach-ixp4xx/include/mach/memory.h -+++ b/arch/arm/mach-ixp4xx/include/mach/memory.h -@@ -16,10 +16,12 @@ - - #if !defined(__ASSEMBLY__) && defined(CONFIG_PCI) - -+#ifdef CONFIG_ZONE_DMA - void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes); - - #define arch_adjust_zones(node, size, holes) \ - ixp4xx_adjust_zones(node, size, holes) -+#endif - - #define ISA_DMA_THRESHOLD (SZ_64M - 1) - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) diff --git a/target/linux/ixp4xx/patches-2.6.31/090-increase_entropy_pools.patch b/target/linux/ixp4xx/patches-2.6.31/090-increase_entropy_pools.patch deleted file mode 100644 index bb168fa84..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/090-increase_entropy_pools.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/drivers/char/random.c -+++ b/drivers/char/random.c -@@ -263,9 +263,9 @@ - /* - * Configuration information - */ --#define INPUT_POOL_WORDS 128 --#define OUTPUT_POOL_WORDS 32 --#define SEC_XFER_SIZE 512 -+#define INPUT_POOL_WORDS 256 -+#define OUTPUT_POOL_WORDS 64 -+#define SEC_XFER_SIZE 1024 - - /* - * The minimum number of bits of entropy before we wake up a read on diff --git a/target/linux/ixp4xx/patches-2.6.31/100-wg302v2_gateway7001_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.31/100-wg302v2_gateway7001_mac_plat_info.patch deleted file mode 100644 index a19a4085a..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/100-wg302v2_gateway7001_mac_plat_info.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/gateway7001-setup.c -+++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c -@@ -76,9 +76,35 @@ static struct platform_device gateway700 - .resource = &gateway7001_uart_resource, - }; - -+static struct eth_plat_info gateway7001_plat_eth[] = { -+ { -+ .phy = 1, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 2, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device gateway7001_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = gateway7001_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = gateway7001_plat_eth + 1, -+ } -+}; -+ - static struct platform_device *gateway7001_devices[] __initdata = { - &gateway7001_flash, -- &gateway7001_uart -+ &gateway7001_uart, -+ &gateway7001_eth[0], -+ &gateway7001_eth[1], - }; - - static void __init gateway7001_init(void) ---- a/arch/arm/mach-ixp4xx/wg302v2-setup.c -+++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c -@@ -77,9 +77,26 @@ static struct platform_device wg302v2_ua - .resource = &wg302v2_uart_resource, - }; - -+static struct eth_plat_info wg302v2_plat_eth[] = { -+ { -+ .phy = 8, -+ .rxq = 3, -+ .txreadyq = 20, -+ } -+}; -+ -+static struct platform_device wg302v2_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = wg302v2_plat_eth, -+ } -+}; -+ - static struct platform_device *wg302v2_devices[] __initdata = { - &wg302v2_flash, - &wg302v2_uart, -+ &wg302v2_eth[0], - }; - - static void __init wg302v2_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.31/105-wg302v1_support.patch b/target/linux/ixp4xx/patches-2.6.31/105-wg302v1_support.patch deleted file mode 100644 index e8b4342e7..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/105-wg302v1_support.patch +++ /dev/null @@ -1,257 +0,0 @@ ---- a/arch/arm/configs/ixp4xx_defconfig -+++ b/arch/arm/configs/ixp4xx_defconfig -@@ -155,6 +155,7 @@ CONFIG_MACH_AVILA=y - CONFIG_MACH_LOFT=y - CONFIG_ARCH_ADI_COYOTE=y - CONFIG_MACH_GATEWAY7001=y -+CONFIG_MACH_WG302V1=y - CONFIG_MACH_WG302V2=y - CONFIG_ARCH_IXDP425=y - CONFIG_MACH_IXDPG425=y ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -49,6 +49,14 @@ config MACH_GATEWAY7001 - 7001 Access Point. For more information on this platform, - see http://openwrt.org - -+config MACH_WG302V1 -+ bool "Netgear WG302 v1 / WAG302 v1" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Netgear's -+ WG302 v1 or WAG302 v1 Access Points. For more information -+ on this platform, see http://openwrt.org -+ - config MACH_WG302V2 - bool "Netgear WG302 v2 / WAG302 v2" - select PCI ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -14,6 +14,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p - obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o - obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o - obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o -+obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o - obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - -@@ -28,6 +29,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup. - obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o - obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o - obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o -+obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o - obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o - obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wg302v1-pci.c -@@ -0,0 +1,64 @@ -+/* -+ * arch/arch/mach-ixp4xx/wg302v1-pci.c -+ * -+ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Software, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init wg302v1_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO8; -+ else if (slot == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else -+ return -1; -+} -+ -+struct hw_pci wg302v1_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = wg302v1_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = wg302v1_map_irq, -+}; -+ -+int __init wg302v1_pci_init(void) -+{ -+ if (machine_is_wg302v1()) -+ pci_common_init(&wg302v1_pci); -+ return 0; -+} -+ -+subsys_initcall(wg302v1_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c -@@ -0,0 +1,142 @@ -+/* -+ * arch/arm/mach-ixp4xx/wg302v1-setup.c -+ * -+ * Board setup for the Netgear WG302 v1 and WAG302 v1 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data wg302v1_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource wg302v1_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device wg302v1_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &wg302v1_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &wg302v1_flash_resource, -+}; -+ -+static struct resource wg302v1_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+static struct plat_serial8250_port wg302v1_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device wg302v1_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = wg302v1_uart_data, -+ }, -+ .num_resources = 2, -+ .resource = wg302v1_uart_resources, -+}; -+ -+static struct eth_plat_info wg302v1_plat_eth[] = { -+ { -+ .phy = 30, -+ .rxq = 3, -+ .txreadyq = 20, -+ } -+}; -+ -+static struct platform_device wg302v1_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = wg302v1_plat_eth, -+ } -+}; -+ -+static struct platform_device *wg302v1_devices[] __initdata = { -+ &wg302v1_flash, -+ &wg302v1_uart, -+ &wg302v1_eth[0], -+}; -+ -+static void __init wg302v1_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices)); -+} -+ -+#ifdef CONFIG_MACH_WG302V1 -+MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = wg302v1_init, -+MACHINE_END -+#endif diff --git a/target/linux/ixp4xx/patches-2.6.31/110-pronghorn_series_support.patch b/target/linux/ixp4xx/patches-2.6.31/110-pronghorn_series_support.patch deleted file mode 100644 index c03869226..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/110-pronghorn_series_support.patch +++ /dev/null @@ -1,387 +0,0 @@ ---- a/arch/arm/configs/ixp4xx_defconfig -+++ b/arch/arm/configs/ixp4xx_defconfig -@@ -157,6 +157,8 @@ CONFIG_ARCH_ADI_COYOTE=y - CONFIG_MACH_GATEWAY7001=y - CONFIG_MACH_WG302V1=y - CONFIG_MACH_WG302V2=y -+CONFIG_MACH_PRONGHORN=y -+CONFIG_MACH_PRONGHORNMETRO=y - CONFIG_ARCH_IXDP425=y - CONFIG_MACH_IXDPG425=y - CONFIG_MACH_IXDP465=y ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -65,6 +65,22 @@ config MACH_WG302V2 - WG302 v2 or WAG302 v2 Access Points. For more information - on this platform, see http://openwrt.org - -+config MACH_PRONGHORN -+ bool "ADI Pronghorn series" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the ADI -+ Engineering Pronghorn series. For more -+ information on this platform, see http://www.adiengineering.com -+ -+# -+# There're only minimal differences kernel-wise between the Pronghorn and -+# Pronghorn Metro boards - they use different chip selects to drive the -+# CF slot connected to the expansion bus, so we just enable them together. -+# -+config MACH_PRONGHORNMETRO -+ def_bool MACH_PRONGHORN -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -17,6 +17,7 @@ obj-pci-$(CONFIG_MACH_GATEWAY7001) += ga - obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o - obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o -+obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o - - obj-y += common.o - -@@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_WG302V1) += wg302v1-se - obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o - obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o -+obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/pronghorn-pci.c -@@ -0,0 +1,70 @@ -+/* -+ * arch/arch/mach-ixp4xx/pronghorn-pci.c -+ * -+ * PCI setup routines for ADI Engineering Pronghorn series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init pronghorn_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init pronghorn_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 13) -+ return IRQ_IXP4XX_GPIO4; -+ else if (slot == 14) -+ return IRQ_IXP4XX_GPIO6; -+ else if (slot == 15) -+ return IRQ_IXP4XX_GPIO11; -+ else if (slot == 16) -+ return IRQ_IXP4XX_GPIO1; -+ else -+ return -1; -+} -+ -+struct hw_pci pronghorn_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = pronghorn_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = pronghorn_map_irq, -+}; -+ -+int __init pronghorn_pci_init(void) -+{ -+ if (machine_is_pronghorn() || machine_is_pronghorn_metro()) -+ pci_common_init(&pronghorn_pci); -+ return 0; -+} -+ -+subsys_initcall(pronghorn_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c -@@ -0,0 +1,245 @@ -+/* -+ * arch/arm/mach-ixp4xx/pronghorn-setup.c -+ * -+ * Board setup for the ADI Engineering Pronghorn series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data pronghorn_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource pronghorn_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device pronghorn_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &pronghorn_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &pronghorn_flash_resource, -+}; -+ -+static struct resource pronghorn_uart_resources [] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port pronghorn_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device pronghorn_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = pronghorn_uart_data, -+ }, -+ .num_resources = 2, -+ .resource = pronghorn_uart_resources, -+}; -+ -+static struct i2c_gpio_platform_data pronghorn_i2c_gpio_data = { -+ .sda_pin = 9, -+ .scl_pin = 10, -+}; -+ -+static struct platform_device pronghorn_i2c_gpio = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &pronghorn_i2c_gpio_data, -+ }, -+}; -+ -+static struct gpio_led pronghorn_led_pin[] = { -+ { -+ .name = "pronghorn:green:status", -+ .gpio = 7, -+ } -+}; -+ -+static struct gpio_led_platform_data pronghorn_led_data = { -+ .num_leds = 1, -+ .leds = pronghorn_led_pin, -+}; -+ -+static struct platform_device pronghorn_led = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &pronghorn_led_data, -+}; -+ -+static struct resource pronghorn_pata_resources[] = { -+ { -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .name = "intrq", -+ .start = IRQ_IXP4XX_GPIO0, -+ .end = IRQ_IXP4XX_GPIO0, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct ixp4xx_pata_data pronghorn_pata_data = { -+ .cs0_bits = 0xbfff0043, -+ .cs1_bits = 0xbfff0043, -+}; -+ -+static struct platform_device pronghorn_pata = { -+ .name = "pata_ixp4xx_cf", -+ .id = 0, -+ .dev.platform_data = &pronghorn_pata_data, -+ .num_resources = ARRAY_SIZE(pronghorn_pata_resources), -+ .resource = pronghorn_pata_resources, -+}; -+ -+static struct eth_plat_info pronghorn_plat_eth[] = { -+ { -+ .phy = 0, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device pronghorn_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = pronghorn_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = pronghorn_plat_eth + 1, -+ } -+}; -+ -+static struct platform_device *pronghorn_devices[] __initdata = { -+ &pronghorn_flash, -+ &pronghorn_uart, -+ &pronghorn_led, -+ &pronghorn_eth[0], -+ &pronghorn_eth[1], -+}; -+ -+static void __init pronghorn_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ pronghorn_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ pronghorn_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(pronghorn_devices, ARRAY_SIZE(pronghorn_devices)); -+ -+ if (machine_is_pronghorn()) { -+ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); -+ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); -+ -+ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); -+ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); -+ -+ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS2; -+ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS3; -+ } else { -+ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(3); -+ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(3); -+ -+ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(4); -+ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(4); -+ -+ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS3; -+ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS4; -+ -+ platform_device_register(&pronghorn_i2c_gpio); -+ } -+ -+ platform_device_register(&pronghorn_pata); -+} -+ -+MACHINE_START(PRONGHORN, "ADI Engineering Pronghorn") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = pronghorn_init, -+MACHINE_END -+ -+MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = pronghorn_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -41,7 +41,8 @@ static __inline__ void __arch_decomp_set - * Some boards are using UART2 as console - */ - if (machine_is_adi_coyote() || machine_is_gtwx5715() || -- machine_is_gateway7001() || machine_is_wg302v2()) -+ machine_is_gateway7001() || machine_is_wg302v2() || -+ machine_is_pronghorn() || machine_is_pronghorn_metro()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.31/111-pronghorn_swap_uarts.patch b/target/linux/ixp4xx/patches-2.6.31/111-pronghorn_swap_uarts.patch deleted file mode 100644 index b9fa50768..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/111-pronghorn_swap_uarts.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/pronghorn-setup.c -+++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c -@@ -51,31 +51,31 @@ static struct platform_device pronghorn_ - - static struct resource pronghorn_uart_resources [] = { - { -- .start = IXP4XX_UART1_BASE_PHYS, -- .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - }, - { -- .start = IXP4XX_UART2_BASE_PHYS, -- .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - } - }; - - static struct plat_serial8250_port pronghorn_uart_data[] = { - { -- .mapbase = IXP4XX_UART1_BASE_PHYS, -- .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -- .irq = IRQ_IXP4XX_UART1, -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { -- .mapbase = IXP4XX_UART2_BASE_PHYS, -- .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -- .irq = IRQ_IXP4XX_UART2, -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, diff --git a/target/linux/ixp4xx/patches-2.6.31/115-sidewinder_support.patch b/target/linux/ixp4xx/patches-2.6.31/115-sidewinder_support.patch deleted file mode 100644 index bad0826c8..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/115-sidewinder_support.patch +++ /dev/null @@ -1,282 +0,0 @@ -From 60bdaaaf3446b4237566c6e04855186fc7bd766b Mon Sep 17 00:00:00 2001 -From: Imre Kaloz -Date: Sun, 13 Jul 2008 22:46:45 +0200 -Subject: [PATCH] Add support for the ADI Sidewinder - -Signed-off-by: Imre Kaloz ---- - arch/arm/mach-ixp4xx/Kconfig | 10 ++- - arch/arm/mach-ixp4xx/Makefile | 2 + - arch/arm/mach-ixp4xx/sidewinder-pci.c | 68 ++++++++++++++ - arch/arm/mach-ixp4xx/sidewinder-setup.c | 151 +++++++++++++++++++++++++++++++ - 4 files changed, 230 insertions(+), 1 deletions(-) - create mode 100644 arch/arm/mach-ixp4xx/sidewinder-pci.c - create mode 100644 arch/arm/mach-ixp4xx/sidewinder-setup.c - ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -81,6 +81,14 @@ config MACH_PRONGHORN - config MACH_PRONGHORNMETRO - def_bool MACH_PRONGHORN - -+config MACH_SIDEWINDER -+ bool "ADI Sidewinder" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the ADI -+ Engineering Sidewinder board. For more information on this -+ platform, see http://www.adiengineering.com -+ - config ARCH_IXDP425 - bool "IXDP425" - help -@@ -169,7 +177,7 @@ config MACH_FSG - # - config CPU_IXP46X - bool -- depends on MACH_IXDP465 -+ depends on MACH_IXDP465 || MACH_SIDEWINDER - default y - - config CPU_IXP43X ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -18,6 +18,7 @@ obj-pci-$(CONFIG_MACH_WG302V1) += wg302 - obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o -+obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o - - obj-y += common.o - -@@ -35,6 +36,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se - obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o - obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o -+obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/sidewinder-pci.c -@@ -0,0 +1,68 @@ -+/* -+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c -+ * -+ * PCI setup routines for ADI Engineering Sidewinder -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+ -+void __init sidewinder_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO11; -+ else if (slot == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else if (slot == 3) -+ return IRQ_IXP4XX_GPIO9; -+ else -+ return -1; -+} -+ -+struct hw_pci sidewinder_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = sidewinder_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = sidewinder_map_irq, -+}; -+ -+int __init sidewinder_pci_init(void) -+{ -+ if (machine_is_sidewinder()) -+ pci_common_init(&sidewinder_pci); -+ return 0; -+} -+ -+subsys_initcall(sidewinder_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/sidewinder-setup.c -@@ -0,0 +1,149 @@ -+/* -+ * arch/arm/mach-ixp4xx/sidewinder-setup.c -+ * -+ * Board setup for the ADI Engineering Sidewinder -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+static struct flash_platform_data sidewinder_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource sidewinder_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device sidewinder_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &sidewinder_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &sidewinder_flash_resource, -+}; -+ -+static struct resource sidewinder_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+static struct plat_serial8250_port sidewinder_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device sidewinder_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = sidewinder_uart_data, -+ }, -+ .num_resources = ARRAY_SIZE(sidewinder_uart_resources), -+ .resource = sidewinder_uart_resources, -+}; -+ -+static struct eth_plat_info sidewinder_plat_eth[] = { -+ { -+ .phy = 5, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, -+ .rxq = 4, -+ .txreadyq = 21, -+ }, { -+ .phy = 31, -+ .rxq = 2, -+ .txreadyq = 19, -+ } -+}; -+ -+static struct platform_device sidewinder_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = sidewinder_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = sidewinder_plat_eth + 1, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEA, -+ .dev.platform_data = sidewinder_plat_eth + 2, -+ } -+}; -+ -+static struct platform_device *sidewinder_devices[] __initdata = { -+ &sidewinder_flash, -+ &sidewinder_uart, -+ &sidewinder_eth[0], -+ &sidewinder_eth[1], -+ &sidewinder_eth[2], -+}; -+ -+static void __init sidewinder_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices)); -+} -+ -+MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = sidewinder_init, -+MACHINE_END diff --git a/target/linux/ixp4xx/patches-2.6.31/116-sidewinder_fis_location.patch b/target/linux/ixp4xx/patches-2.6.31/116-sidewinder_fis_location.patch deleted file mode 100644 index 1d0a98398..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/116-sidewinder_fis_location.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -13,6 +13,8 @@ - - #define BOARD_CONFIG_PART "boardconfig" - -+#include -+ - struct fis_image_desc { - unsigned char name[16]; // Null terminated name - uint32_t flash_base; // Address within FLASH of image -@@ -30,7 +32,8 @@ struct fis_list { - struct fis_list *next; - }; - --static int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; -+int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; -+ - module_param(directory, int, 0); - - static inline int redboot_checksum(struct fis_image_desc *img) -@@ -59,6 +62,8 @@ static int parse_redboot_partitions(stru - #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED - static char nullstring[] = "unallocated"; - #endif -+ if (machine_is_sidewinder()) -+ directory = -5; - - if ( directory < 0 ) { - offset = master->size + directory * master->erasesize; diff --git a/target/linux/ixp4xx/patches-2.6.31/120-compex_support.patch b/target/linux/ixp4xx/patches-2.6.31/120-compex_support.patch deleted file mode 100644 index ccac8cc78..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/120-compex_support.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 24025a2dcf1248079dd3019fac6ed955252d277f Mon Sep 17 00:00:00 2001 -From: Imre Kaloz -Date: Mon, 14 Jul 2008 21:56:34 +0200 -Subject: [PATCH] Add support for the Compex WP18 / NP18A boards - -Signed-off-by: Imre Kaloz ---- - arch/arm/mach-ixp4xx/Kconfig | 8 ++ - arch/arm/mach-ixp4xx/Makefile | 2 + - arch/arm/mach-ixp4xx/compex-setup.c | 136 +++++++++++++++++++++++++++++++++++ - arch/arm/mach-ixp4xx/ixdp425-pci.c | 3 +- - arch/arm/tools/mach-types | 2 +- - 5 files changed, 149 insertions(+), 2 deletions(-) - create mode 100644 arch/arm/mach-ixp4xx/compex-setup.c - ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -89,6 +89,14 @@ config MACH_SIDEWINDER - Engineering Sidewinder board. For more information on this - platform, see http://www.adiengineering.com - -+config MACH_COMPEX -+ bool "Compex WP18 / NP18A" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Compex' -+ WP18 or NP18A boards. For more information on this -+ platform, see http://www.compex.com.sg/home/OEM/product_ap.htm -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302 - obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o - obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o -+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o - - obj-y += common.o - -@@ -37,6 +38,7 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o - obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o - obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o - obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o -+obj-$(CONFIG_MACH_COMPEX) += compex-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/compex-setup.c -@@ -0,0 +1,136 @@ -+/* -+ * arch/arm/mach-ixp4xx/compex-setup.c -+ * -+ * Compex WP18 / NP18A board-setup -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+static struct flash_platform_data compex_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource compex_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device compex_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &compex_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &compex_flash_resource, -+}; -+ -+static struct resource compex_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port compex_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device compex_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = compex_uart_data, -+ .num_resources = 2, -+ .resource = compex_uart_resources, -+}; -+ -+static struct eth_plat_info compex_plat_eth[] = { -+ { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0xf0000, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 3, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device compex_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = compex_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = compex_plat_eth + 1, -+ } -+}; -+ -+static struct platform_device *compex_devices[] __initdata = { -+ &compex_flash, -+ &compex_uart, -+ &compex_eth[0], -+ &compex_eth[1], -+}; -+ -+static void __init compex_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ compex_flash_resource.end = -+ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices)); -+} -+ -+MACHINE_START(COMPEX, "Compex WP18 / NP18A") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = compex_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/ixdp425-pci.c -+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c -@@ -66,7 +66,8 @@ struct hw_pci ixdp425_pci __initdata = { - int __init ixdp425_pci_init(void) - { - if (machine_is_ixdp425() || machine_is_ixcdp1100() || -- machine_is_ixdp465() || machine_is_kixrp435()) -+ machine_is_ixdp465() || machine_is_kixrp435() || -+ machine_is_compex()) - pci_common_init(&ixdp425_pci); - return 0; - } ---- a/arch/arm/tools/mach-types -+++ b/arch/arm/tools/mach-types -@@ -1273,7 +1273,7 @@ oiab MACH_OIAB OIAB 1269 - smdk6400 MACH_SMDK6400 SMDK6400 1270 - nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271 - greenphone MACH_GREENPHONE GREENPHONE 1272 --compex42x MACH_COMPEXWP18 COMPEXWP18 1273 -+compex MACH_COMPEX COMPEX 1273 - xmate MACH_XMATE XMATE 1274 - energizer MACH_ENERGIZER ENERGIZER 1275 - ime1 MACH_IME1 IME1 1276 diff --git a/target/linux/ixp4xx/patches-2.6.31/130-wrt300nv2_support.patch b/target/linux/ixp4xx/patches-2.6.31/130-wrt300nv2_support.patch deleted file mode 100644 index c184a6c6c..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/130-wrt300nv2_support.patch +++ /dev/null @@ -1,225 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -97,6 +97,14 @@ config MACH_COMPEX - WP18 or NP18A boards. For more information on this - platform, see http://www.compex.com.sg/home/OEM/product_ap.htm - -+config MACH_WRT300NV2 -+ bool "Linksys WRT300N v2" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Linksys' -+ WRT300N v2 router. For more information on this -+ platform, see http://openwrt.org -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o - obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o - obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o - obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o -+obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o - - obj-y += common.o - -@@ -39,6 +40,7 @@ obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_ - obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o - obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o - obj-$(CONFIG_MACH_COMPEX) += compex-setup.o -+obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c -@@ -0,0 +1,65 @@ -+/* -+ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c -+ * -+ * PCI setup routines for Linksys WRT300N v2 -+ * -+ * Copyright (C) 2007 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+ -+extern void ixp4xx_pci_preinit(void); -+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); -+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); -+ -+void __init wrt300nv2_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO8; -+ else return -1; -+} -+ -+struct hw_pci wrt300nv2_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = wrt300nv2_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = wrt300nv2_map_irq, -+}; -+ -+int __init wrt300nv2_pci_init(void) -+{ -+ if (machine_is_wrt300nv2()) -+ pci_common_init(&wrt300nv2_pci); -+ return 0; -+} -+ -+subsys_initcall(wrt300nv2_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c -@@ -0,0 +1,108 @@ -+/* -+ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c -+ * -+ * Board setup for the Linksys WRT300N v2 -+ * -+ * Copyright (C) 2007 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data wrt300nv2_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource wrt300nv2_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device wrt300nv2_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &wrt300nv2_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &wrt300nv2_flash_resource, -+}; -+ -+static struct resource wrt300nv2_uart_resource = { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct plat_serial8250_port wrt300nv2_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device wrt300nv2_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = wrt300nv2_uart_data, -+ }, -+ .num_resources = 1, -+ .resource = &wrt300nv2_uart_resource, -+}; -+ -+static struct platform_device *wrt300nv2_devices[] __initdata = { -+ &wrt300nv2_flash, -+ &wrt300nv2_uart -+}; -+ -+static void __init wrt300nv2_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); -+} -+ -+#ifdef CONFIG_MACH_WRT300NV2 -+MACHINE_START(WRT300NV2, "Linksys WRT300N v2") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = wrt300nv2_init, -+MACHINE_END -+#endif ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -42,7 +42,7 @@ static __inline__ void __arch_decomp_set - */ - if (machine_is_adi_coyote() || machine_is_gtwx5715() || - machine_is_gateway7001() || machine_is_wg302v2() || -- machine_is_pronghorn() || machine_is_pronghorn_metro()) -+ machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.31/131-wrt300nv2_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.31/131-wrt300nv2_mac_plat_info.patch deleted file mode 100644 index 3ab68c4f3..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/131-wrt300nv2_mac_plat_info.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c -+++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c -@@ -76,9 +76,36 @@ static struct platform_device wrt300nv2_ - .resource = &wrt300nv2_uart_resource, - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info wrt300nv2_plat_eth[] = { -+ { -+ .phy = -1, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device wrt300nv2_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = wrt300nv2_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = wrt300nv2_plat_eth + 1, -+ } -+}; -+ - static struct platform_device *wrt300nv2_devices[] __initdata = { - &wrt300nv2_flash, -- &wrt300nv2_uart -+ &wrt300nv2_uart, -+ &wrt300nv2_eth[0], -+ &wrt300nv2_eth[1], - }; - - static void __init wrt300nv2_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.31/150-lanready_ap1000_support.patch b/target/linux/ixp4xx/patches-2.6.31/150-lanready_ap1000_support.patch deleted file mode 100644 index 378786e27..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/150-lanready_ap1000_support.patch +++ /dev/null @@ -1,200 +0,0 @@ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/ap1000-setup.c -@@ -0,0 +1,151 @@ -+/* -+ * arch/arm/mach-ixp4xx/ap1000-setup.c -+ * -+ * Lanready AP-1000 -+ * -+ * Copyright (C) 2007 Imre Kaloz -+ * -+ * based on ixdp425-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data ap1000_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource ap1000_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device ap1000_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &ap1000_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &ap1000_flash_resource, -+}; -+ -+static struct resource ap1000_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port ap1000_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device ap1000_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = ap1000_uart_data, -+ .num_resources = 2, -+ .resource = ap1000_uart_resources -+}; -+ -+static struct platform_device *ap1000_devices[] __initdata = { -+ &ap1000_flash, -+ &ap1000_uart -+}; -+ -+static char ap1000_mem_fixup[] __initdata = "mem=64M "; -+ -+static void __init ap1000_fixup(struct machine_desc *desc, -+ struct tag *tags, char **cmdline, struct meminfo *mi) -+ -+{ -+ struct tag *t = tags; -+ char *p = *cmdline; -+ -+ /* Find the end of the tags table, taking note of any cmdline tag. */ -+ for (; t->hdr.size; t = tag_next(t)) { -+ if (t->hdr.tag == ATAG_CMDLINE) { -+ p = t->u.cmdline.cmdline; -+ } -+ } -+ -+ /* Overwrite the end of the table with a new cmdline tag. */ -+ t->hdr.tag = ATAG_CMDLINE; -+ t->hdr.size = (sizeof (struct tag_header) + -+ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2; -+ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE); -+ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p, -+ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup)); -+ -+ /* Terminate the table. */ -+ t = tag_next(t); -+ t->hdr.tag = ATAG_NONE; -+ t->hdr.size = 0; -+} -+ -+static void __init ap1000_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ ap1000_flash_resource.end = -+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; -+ -+ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices)); -+} -+ -+#ifdef CONFIG_MACH_AP1000 -+MACHINE_START(AP1000, "Lanready AP-1000") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .fixup = ap1000_fixup, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = ap1000_init, -+MACHINE_END -+#endif ---- a/arch/arm/mach-ixp4xx/ixdp425-pci.c -+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c -@@ -67,7 +67,7 @@ int __init ixdp425_pci_init(void) - { - if (machine_is_ixdp425() || machine_is_ixcdp1100() || - machine_is_ixdp465() || machine_is_kixrp435() || -- machine_is_compex()) -+ machine_is_compex() || machine_is_ap1000()) - pci_common_init(&ixdp425_pci); - return 0; - } ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -105,6 +105,14 @@ config MACH_WRT300NV2 - WRT300N v2 router. For more information on this - platform, see http://openwrt.org - -+config MACH_AP1000 -+ bool "Lanready AP-1000" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support Lanready's -+ AP1000 board. For more information on this -+ platform, see http://openwrt.org -+ - config ARCH_IXDP425 - bool "IXDP425" - help ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -21,6 +21,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORN) += pron - obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o - obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o -+obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o - - obj-y += common.o - -@@ -41,6 +42,7 @@ obj-$(CONFIG_MACH_PRONGHORN) += pronghor - obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o - obj-$(CONFIG_MACH_COMPEX) += compex-setup.o - obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o -+obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o diff --git a/target/linux/ixp4xx/patches-2.6.31/151-lanready_ap1000_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.31/151-lanready_ap1000_mac_plat_info.patch deleted file mode 100644 index a1214d567..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/151-lanready_ap1000_mac_plat_info.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/ap1000-setup.c -+++ b/arch/arm/mach-ixp4xx/ap1000-setup.c -@@ -90,9 +90,37 @@ static struct platform_device ap1000_uar - .resource = ap1000_uart_resources - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info ap1000_plat_eth[] = { -+ { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 5, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device ap1000_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = ap1000_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = ap1000_plat_eth + 1, -+ } -+}; -+ - static struct platform_device *ap1000_devices[] __initdata = { - &ap1000_flash, -- &ap1000_uart -+ &ap1000_uart, -+ &ap1000_eth[0], -+ &ap1000_eth[1], - }; - - static char ap1000_mem_fixup[] __initdata = "mem=64M "; diff --git a/target/linux/ixp4xx/patches-2.6.31/162-wg302v1_mem_fixup.patch b/target/linux/ixp4xx/patches-2.6.31/162-wg302v1_mem_fixup.patch deleted file mode 100644 index 684db4475..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/162-wg302v1_mem_fixup.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/wg302v1-setup.c -+++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c -@@ -115,6 +115,36 @@ static struct platform_device *wg302v1_d - &wg302v1_eth[0], - }; - -+static char wg302v1_mem_fixup[] __initdata = "mem=32M "; -+ -+static void __init wg302v1_fixup(struct machine_desc *desc, -+ struct tag *tags, char **cmdline, struct meminfo *mi) -+ -+{ -+ struct tag *t = tags; -+ char *p = *cmdline; -+ -+ /* Find the end of the tags table, taking note of any cmdline tag. */ -+ for (; t->hdr.size; t = tag_next(t)) { -+ if (t->hdr.tag == ATAG_CMDLINE) { -+ p = t->u.cmdline.cmdline; -+ } -+ } -+ -+ /* Overwrite the end of the table with a new cmdline tag. */ -+ t->hdr.tag = ATAG_CMDLINE; -+ t->hdr.size = (sizeof (struct tag_header) + -+ strlen(wg302v1_mem_fixup) + strlen(p) + 1 + 4) >> 2; -+ strlcpy(t->u.cmdline.cmdline, wg302v1_mem_fixup, COMMAND_LINE_SIZE); -+ strlcpy(t->u.cmdline.cmdline + strlen(wg302v1_mem_fixup), p, -+ COMMAND_LINE_SIZE - strlen(wg302v1_mem_fixup)); -+ -+ /* Terminate the table. */ -+ t = tag_next(t); -+ t->hdr.tag = ATAG_NONE; -+ t->hdr.size = 0; -+} -+ - static void __init wg302v1_init(void) - { - ixp4xx_sys_init(); -@@ -133,6 +163,7 @@ MACHINE_START(WG302V1, "Netgear WG302 v1 - /* Maintainer: Imre Kaloz */ - .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, - .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .fixup = wg302v1_fixup, - .map_io = ixp4xx_map_io, - .init_irq = ixp4xx_init_irq, - .timer = &ixp4xx_timer, diff --git a/target/linux/ixp4xx/patches-2.6.31/170-ixdpg425_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.31/170-ixdpg425_mac_plat_info.patch deleted file mode 100644 index 772b697aa..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/170-ixdpg425_mac_plat_info.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/coyote-setup.c -+++ b/arch/arm/mach-ixp4xx/coyote-setup.c -@@ -73,9 +73,37 @@ static struct platform_device coyote_uar - .resource = &coyote_uart_resource, - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info ixdpg425_plat_eth[] = { -+ { -+ .phy = 5, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 4, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device ixdpg425_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = ixdpg425_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = ixdpg425_plat_eth + 1, -+ } -+}; -+ -+ - static struct platform_device *coyote_devices[] __initdata = { - &coyote_flash, -- &coyote_uart -+ &coyote_uart, -+ &ixdpg425_eth[0], -+ &ixdpg425_eth[1], - }; - - static void __init coyote_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.31/180-tw5334_support.patch b/target/linux/ixp4xx/patches-2.6.31/180-tw5334_support.patch deleted file mode 100644 index f59792a53..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/180-tw5334_support.patch +++ /dev/null @@ -1,284 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -164,6 +164,14 @@ config ARCH_PRPMC1100 - PrPCM1100 Processor Mezanine Module. For more information on - this platform, see . - -+config MACH_TW5334 -+ bool "Titan Wireless TW-533-4" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the Titan -+ Wireless TW533-4. For more information on this platform, -+ see http://openwrt.org -+ - config MACH_NAS100D - bool - prompt "NAS100D" ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid - obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o - obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o -+obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o - - obj-y += common.o - -@@ -43,6 +44,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin - obj-$(CONFIG_MACH_COMPEX) += compex-setup.o - obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o - obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o -+obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/tw5334-setup.c -@@ -0,0 +1,162 @@ -+/* -+ * arch/arm/mach-ixp4xx/tw5334-setup.c -+ * -+ * Board setup for the Titan Wireless TW-533-4 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data tw5334_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource tw5334_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device tw5334_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &tw5334_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &tw5334_flash_resource, -+}; -+ -+static struct resource tw5334_uart_resource = { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct plat_serial8250_port tw5334_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device tw5334_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = tw5334_uart_data, -+ }, -+ .num_resources = 1, -+ .resource = &tw5334_uart_resource, -+}; -+ -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info tw5334_plat_eth[] = { -+ { -+ .phy = 0, -+ .rxq = 3, -+ .txreadyq = 20, -+ }, { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+ } -+}; -+ -+static struct platform_device tw5334_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = tw5334_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = tw5334_plat_eth + 1, -+ } -+}; -+ -+static struct platform_device *tw5334_devices[] __initdata = { -+ &tw5334_flash, -+ &tw5334_uart, -+ &tw5334_eth[0], -+ &tw5334_eth[1], -+}; -+ -+static void __init tw5334_init(void) -+{ -+ DECLARE_MAC_BUF(mac_buf); -+ uint8_t __iomem *f; -+ int i; -+ -+ ixp4xx_sys_init(); -+ -+ tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices)); -+ -+ /* -+ * Map in a portion of the flash and read the MAC addresses. -+ * Since it is stored in BE in the flash itself, we need to -+ * byteswap it if we're in LE mode. -+ */ -+ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000); -+ if (f) { -+ for (i = 0; i < 6; i++) -+#ifdef __ARMEB__ -+ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i); -+ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i); -+#else -+ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3)); -+ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3)); -+#endif -+ iounmap(f); -+ } -+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 0\n", -+ print_mac(mac_buf, tw5334_plat_eth[0].hwaddr)); -+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 1\n", -+ print_mac(mac_buf, tw5334_plat_eth[1].hwaddr)); -+} -+ -+#ifdef CONFIG_MACH_TW5334 -+MACHINE_START(TW5334, "Titan Wireless TW-533-4") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = tw5334_init, -+MACHINE_END -+#endif ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/tw5334-pci.c -@@ -0,0 +1,69 @@ -+/* -+ * arch/arch/mach-ixp4xx/tw5334-pci.c -+ * -+ * PCI setup routines for the Titan Wireless TW-533-4 -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init tw5334_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init tw5334_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 12) -+ return IRQ_IXP4XX_GPIO6; -+ else if (slot == 13) -+ return IRQ_IXP4XX_GPIO2; -+ else if (slot == 14) -+ return IRQ_IXP4XX_GPIO1; -+ else if (slot == 15) -+ return IRQ_IXP4XX_GPIO0; -+ else return -1; -+} -+ -+struct hw_pci tw5334_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = tw5334_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = tw5334_map_irq, -+}; -+ -+int __init tw5334_pci_init(void) -+{ -+ if (machine_is_tw5334()) -+ pci_common_init(&tw5334_pci); -+ return 0; -+} -+ -+subsys_initcall(tw5334_pci_init); ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set - */ - if (machine_is_adi_coyote() || machine_is_gtwx5715() || - machine_is_gateway7001() || machine_is_wg302v2() || -- machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2()) -+ machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2() || -+ machine_is_tw5334()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.31/185-mi424wr_support.patch b/target/linux/ixp4xx/patches-2.6.31/185-mi424wr_support.patch deleted file mode 100644 index 1b8ee89c9..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/185-mi424wr_support.patch +++ /dev/null @@ -1,465 +0,0 @@ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/mi424wr-pci.c -@@ -0,0 +1,71 @@ -+/* -+ * arch/arm/mach-ixp4xx/mi424wr-pci.c -+ * -+ * Actiontec MI424WR board-level PCI initialization -+ * -+ * Copyright (C) 2008 Jose Vasconcellos -+ * -+ * Maintainer: Jose Vasconcellos -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+/* PCI controller GPIO to IRQ pin mappings -+ * This information was obtained from Actiontec's GPL release. -+ * -+ * INTA INTB -+ * SLOT 13 8 6 -+ * SLOT 14 7 8 -+ * SLOT 15 6 7 -+ */ -+ -+void __init mi424wr_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init mi424wr_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 13) -+ return IRQ_IXP4XX_GPIO8; -+ if (slot == 14) -+ return IRQ_IXP4XX_GPIO7; -+ if (slot == 15) -+ return IRQ_IXP4XX_GPIO6; -+ -+ return -1; -+} -+ -+struct hw_pci mi424wr_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = mi424wr_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = mi424wr_map_irq, -+}; -+ -+int __init mi424wr_pci_init(void) -+{ -+ if (machine_is_mi424wr()) -+ pci_common_init(&mi424wr_pci); -+ return 0; -+} -+ -+subsys_initcall(mi424wr_pci_init); -+ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/mi424wr-setup.c -@@ -0,0 +1,344 @@ -+/* -+ * arch/arm/mach-ixp4xx/mi424wr-setup.c -+ * -+ * Actiontec MI424-WR board setup -+ * Copyright (c) 2008 Jose Vasconcellos -+ * -+ * Based on Gemtek GTWX5715 by -+ * Copyright (C) 2004 George T. Joseph -+ * Derived from Coyote -+ * -+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * GPIO 2,3,4 and 9 are hard wired to the Micrel/Kendin KS8995M Switch -+ * and operate as an SPI type interface. The details of the interface -+ * are available on Kendin/Micrel's web site. -+ */ -+ -+#define MI424WR_KSSPI_SELECT 9 -+#define MI424WR_KSSPI_TXD 4 -+#define MI424WR_KSSPI_CLOCK 2 -+#define MI424WR_KSSPI_RXD 3 -+ -+/* -+ * The "reset" button is wired to GPIO 10. -+ * The GPIO is brought "low" when the button is pushed. -+ */ -+ -+#define MI424WR_BUTTON_GPIO 10 -+#define MI424WR_BUTTON_IRQ IRQ_IXP4XX_GPIO10 -+ -+#define MI424WR_MOCA_WAN_LED 11 -+ -+/* Latch on CS1 - taken from Actiontec's 2.4 source code -+ * -+ * default latch value -+ * 0 - power alarm led (red) 0 (off) -+ * 1 - power led (green) 0 (off) -+ * 2 - wireless led (green) 1 (off) -+ * 3 - no internet led (red) 0 (off) -+ * 4 - internet ok led (green) 0 (off) -+ * 5 - moca LAN 0 (off) -+ * 6 - WAN alarm led (red) 0 (off) -+ * 7 - PCI reset 1 (not reset) -+ * 8 - IP phone 1 led (green) 1 (off) -+ * 9 - IP phone 2 led (green) 1 (off) -+ * 10 - VOIP ready led (green) 1 (off) -+ * 11 - PSTN relay 1 control 0 (PSTN) -+ * 12 - PSTN relay 1 control 0 (PSTN) -+ * 13 - N/A -+ * 14 - N/A -+ * 15 - N/A -+ */ -+ -+#define MI424WR_LATCH_MASK 0x04 -+#define MI424WR_LATCH_DEFAULT 0x1f86 -+ -+#define MI424WR_LATCH_ALARM_LED 0x00 -+#define MI424WR_LATCH_POWER_LED 0x01 -+#define MI424WR_LATCH_WIRELESS_LED 0x02 -+#define MI424WR_LATCH_INET_DOWN_LED 0x03 -+#define MI424WR_LATCH_INET_OK_LED 0x04 -+#define MI424WR_LATCH_MOCA_LAN_LED 0x05 -+#define MI424WR_LATCH_WAN_ALARM_LED 0x06 -+#define MI424WR_LATCH_PCI_RESET 0x07 -+#define MI424WR_LATCH_PHONE1_LED 0x08 -+#define MI424WR_LATCH_PHONE2_LED 0x09 -+#define MI424WR_LATCH_VOIP_LED 0x10 -+#define MI424WR_LATCH_PSTN_RELAY1 0x11 -+#define MI424WR_LATCH_PSTN_RELAY2 0x12 -+ -+/* initialize CS1 to default timings, Intel style, 16-bit bus */ -+#define MI424WR_CS1_CONFIG 0x80000002 -+ -+/* Define both UARTs but they are not easily accessible. -+ */ -+ -+static struct resource mi424wr_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+ -+static struct plat_serial8250_port mi424wr_uart_platform_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device mi424wr_uart_device = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = mi424wr_uart_platform_data, -+ .num_resources = ARRAY_SIZE(mi424wr_uart_resources), -+ .resource = mi424wr_uart_resources, -+}; -+ -+static struct flash_platform_data mi424wr_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource mi424wr_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device mi424wr_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev.platform_data = &mi424wr_flash_data, -+ .num_resources = 1, -+ .resource = &mi424wr_flash_resource, -+}; -+ -+static int mi424wr_spi_boardinfo_setup(struct spi_board_info *bi, -+ struct spi_master *master, void *data) -+{ -+ -+ strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias)); -+ -+ bi->max_speed_hz = 5000000 /* Hz */; -+ bi->bus_num = master->bus_num; -+ bi->mode = SPI_MODE_0; -+ -+ return 0; -+} -+ -+static struct spi_gpio_platform_data mi424wr_spi_bus_data = { -+ .pin_cs = MI424WR_KSSPI_SELECT, -+ .pin_clk = MI424WR_KSSPI_CLOCK, -+ .pin_miso = MI424WR_KSSPI_RXD, -+ .pin_mosi = MI424WR_KSSPI_TXD, -+ .cs_activelow = 1, -+ .no_spi_delay = 1, -+ .boardinfo_setup = mi424wr_spi_boardinfo_setup, -+}; -+ -+static struct gpio_led mi424wr_gpio_led[] = { -+ { -+ .name = "moca-wan", /* green led */ -+ .gpio = MI424WR_MOCA_WAN_LED, -+ .active_low = 0, -+ } -+}; -+ -+static struct gpio_led_platform_data mi424wr_gpio_leds_data = { -+ .num_leds = 1, -+ .leds = mi424wr_gpio_led, -+}; -+ -+static struct platform_device mi424wr_gpio_leds = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &mi424wr_gpio_leds_data, -+}; -+ -+static uint16_t latch_value = MI424WR_LATCH_DEFAULT; -+static uint16_t __iomem *iobase; -+ -+static void mi424wr_latch_set_led(u8 bit, enum led_brightness value) -+{ -+ -+ if (((MI424WR_LATCH_MASK >> bit) & 1) ^ (value == LED_OFF)) -+ latch_value &= ~(0x1 << bit); -+ else -+ latch_value |= (0x1 << bit); -+ -+ __raw_writew(latch_value, iobase); -+ -+} -+ -+static struct latch_led mi424wr_latch_led[] = { -+ { -+ .name = "power-alarm", -+ .bit = MI424WR_LATCH_ALARM_LED, -+ }, -+ { -+ .name = "power-ok", -+ .bit = MI424WR_LATCH_POWER_LED, -+ }, -+ { -+ .name = "wireless", /* green led */ -+ .bit = MI424WR_LATCH_WIRELESS_LED, -+ }, -+ { -+ .name = "inet-down", /* red led */ -+ .bit = MI424WR_LATCH_INET_DOWN_LED, -+ }, -+ { -+ .name = "inet-up", /* green led */ -+ .bit = MI424WR_LATCH_INET_OK_LED, -+ }, -+ { -+ .name = "moca-lan", /* green led */ -+ .bit = MI424WR_LATCH_MOCA_LAN_LED, -+ }, -+ { -+ .name = "wan-alarm", /* red led */ -+ .bit = MI424WR_LATCH_WAN_ALARM_LED, -+ } -+}; -+ -+static struct latch_led_platform_data mi424wr_latch_leds_data = { -+ .num_leds = ARRAY_SIZE(mi424wr_latch_led), -+ .mem = 0x51000000, -+ .leds = mi424wr_latch_led, -+ .set_led = mi424wr_latch_set_led, -+}; -+ -+static struct platform_device mi424wr_latch_leds = { -+ .name = "leds-latch", -+ .id = -1, -+ .dev.platform_data = &mi424wr_latch_leds_data, -+}; -+ -+static struct platform_device mi424wr_spi_bus = { -+ .name = "spi-gpio", -+ .id = 0, -+ .dev.platform_data = &mi424wr_spi_bus_data, -+}; -+ -+static struct eth_plat_info mi424wr_npeb_data = { -+ .phy = 17, /* KS8721 */ -+ .rxq = 3, -+ .txreadyq = 20, -+}; -+ -+static struct eth_plat_info mi424wr_npec_data = { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct platform_device mi424wr_npe_devices[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = &mi424wr_npec_data, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = &mi424wr_npeb_data, -+ } -+}; -+ -+static struct platform_device *mi424wr_devices[] __initdata = { -+ &mi424wr_uart_device, -+ &mi424wr_flash, -+ &mi424wr_gpio_leds, -+ &mi424wr_latch_leds, -+ &mi424wr_spi_bus, -+ &mi424wr_npe_devices[0], -+ &mi424wr_npe_devices[1], -+}; -+ -+static void __init mi424wr_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ mi424wr_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ mi424wr_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = MI424WR_CS1_CONFIG; -+ -+ /* configure button as input -+ */ -+ gpio_line_config(MI424WR_BUTTON_GPIO, IXP4XX_GPIO_IN); -+ -+ /* Initialize LEDs and enables PCI bus. -+ */ -+ iobase = ioremap_nocache(IXP4XX_EXP_BUS_BASE(1), 0x1000); -+ __raw_writew(latch_value, iobase); -+ -+ platform_add_devices(mi424wr_devices, ARRAY_SIZE(mi424wr_devices)); -+} -+ -+ -+MACHINE_START(MI424WR, "Actiontec MI424WR") -+ /* Maintainer: Jose Vasconcellos */ -+ .phys_io = IXP4XX_UART2_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = mi424wr_init, -+MACHINE_END -+ ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -23,6 +23,7 @@ obj-pci-$(CONFIG_MACH_COMPEX) += ixdp42 - obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o - obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o -+obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o - - obj-y += common.o - -@@ -45,6 +46,7 @@ obj-$(CONFIG_MACH_COMPEX) += compex-setu - obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o - obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o - obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o -+obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -235,6 +235,13 @@ config MACH_GTWX5715 - "High Speed" UART is n/c (as far as I can tell) - 20 Pin ARM/Xscale JTAG interface on J2 - -+config MACH_MI424WR -+ bool "Actiontec MI424WR" -+ depends on ARCH_IXP4XX -+ select PCI -+ help -+ Add support for the Actiontec MI424-WR. -+ - comment "IXP4xx Options" - - config IXP4XX_INDIRECT_PCI ---- a/arch/arm/configs/ixp4xx_defconfig -+++ b/arch/arm/configs/ixp4xx_defconfig -@@ -172,6 +172,7 @@ CONFIG_MACH_FSG=y - CONFIG_CPU_IXP46X=y - CONFIG_CPU_IXP43X=y - CONFIG_MACH_GTWX5715=y -+CONFIG_MACH_MI424WR=y - - # - # IXP4xx Options diff --git a/target/linux/ixp4xx/patches-2.6.31/190-cambria_support.patch b/target/linux/ixp4xx/patches-2.6.31/190-cambria_support.patch deleted file mode 100644 index c3791c690..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/190-cambria_support.patch +++ /dev/null @@ -1,553 +0,0 @@ ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/cambria-pci.c -@@ -0,0 +1,74 @@ -+/* -+ * arch/arch/mach-ixp4xx/cambria-pci.c -+ * -+ * PCI setup routines for Gateworks Cambria series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Imre Kaloz -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+ -+extern void ixp4xx_pci_preinit(void); -+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); -+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); -+ -+void __init cambria_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init cambria_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 1) -+ return IRQ_IXP4XX_GPIO11; -+ else if (slot == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else if (slot == 3) -+ return IRQ_IXP4XX_GPIO9; -+ else if (slot == 4) -+ return IRQ_IXP4XX_GPIO8; -+ else return -1; -+} -+ -+struct hw_pci cambria_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = cambria_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = cambria_map_irq, -+}; -+ -+int __init cambria_pci_init(void) -+{ -+ if (machine_is_cambria()) -+ pci_common_init(&cambria_pci); -+ return 0; -+} -+ -+subsys_initcall(cambria_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -0,0 +1,429 @@ -+/* -+ * arch/arm/mach-ixp4xx/cambria-setup.c -+ * -+ * Board setup for the Gateworks Cambria series -+ * -+ * Copyright (C) 2008 Imre Kaloz -+ * -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Imre Kaloz -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct cambria_board_info { -+ unsigned char *model; -+ void (*setup)(void); -+}; -+ -+static struct cambria_board_info *cambria_info __initdata; -+ -+static struct flash_platform_data cambria_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource cambria_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device cambria_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &cambria_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &cambria_flash_resource, -+}; -+ -+static struct i2c_gpio_platform_data cambria_i2c_gpio_data = { -+ .sda_pin = 7, -+ .scl_pin = 6, -+}; -+ -+static struct platform_device cambria_i2c_gpio = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &cambria_i2c_gpio_data, -+ }, -+}; -+ -+static struct eth_plat_info cambria_npec_data = { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct eth_plat_info cambria_npea_data = { -+ .phy = 2, -+ .rxq = 2, -+ .txreadyq = 19, -+}; -+ -+static struct platform_device cambria_npec_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = &cambria_npec_data, -+}; -+ -+static struct platform_device cambria_npea_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEA, -+ .dev.platform_data = &cambria_npea_data, -+}; -+ -+static struct resource cambria_uart_resource = { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct plat_serial8250_port cambria_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device cambria_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = cambria_uart_data, -+ }, -+ .num_resources = 1, -+ .resource = &cambria_uart_resource, -+}; -+ -+static struct resource cambria_pata_resources[] = { -+ { -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .name = "intrq", -+ .start = IRQ_IXP4XX_GPIO12, -+ .end = IRQ_IXP4XX_GPIO12, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct ixp4xx_pata_data cambria_pata_data = { -+ .cs0_bits = 0xbfff3c03, -+ .cs1_bits = 0xbfff3c03, -+}; -+ -+static struct platform_device cambria_pata = { -+ .name = "pata_ixp4xx_cf", -+ .id = 0, -+ .dev.platform_data = &cambria_pata_data, -+ .num_resources = ARRAY_SIZE(cambria_pata_resources), -+ .resource = cambria_pata_resources, -+}; -+ -+static struct gpio_led cambria_gpio_leds[] = { -+ { -+ .name = "user", /* green led */ -+ .gpio = 5, -+ .active_low = 1, -+ } -+}; -+ -+static struct gpio_led_platform_data cambria_gpio_leds_data = { -+ .num_leds = 1, -+ .leds = cambria_gpio_leds, -+}; -+ -+static struct platform_device cambria_gpio_leds_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &cambria_gpio_leds_data, -+}; -+ -+static struct latch_led cambria_latch_leds[] = { -+ { -+ .name = "ledA", /* green led */ -+ .bit = 0, -+ }, -+ { -+ .name = "ledB", /* green led */ -+ .bit = 1, -+ }, -+ { -+ .name = "ledC", /* green led */ -+ .bit = 2, -+ }, -+ { -+ .name = "ledD", /* green led */ -+ .bit = 3, -+ }, -+ { -+ .name = "ledE", /* green led */ -+ .bit = 4, -+ }, -+ { -+ .name = "ledF", /* green led */ -+ .bit = 5, -+ }, -+ { -+ .name = "ledG", /* green led */ -+ .bit = 6, -+ }, -+ { -+ .name = "ledH", /* green led */ -+ .bit = 7, -+ } -+}; -+ -+static struct latch_led_platform_data cambria_latch_leds_data = { -+ .num_leds = 8, -+ .leds = cambria_latch_leds, -+ .mem = 0x53F40000, -+}; -+ -+static struct platform_device cambria_latch_leds_device = { -+ .name = "leds-latch", -+ .id = -1, -+ .dev.platform_data = &cambria_latch_leds_data, -+}; -+ -+static struct resource cambria_usb0_resources[] = { -+ { -+ .start = 0xCD000000, -+ .end = 0xCD000300, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = 32, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct resource cambria_usb1_resources[] = { -+ { -+ .start = 0xCE000000, -+ .end = 0xCE000300, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = 33, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static u64 ehci_dma_mask = ~(u32)0; -+ -+static struct platform_device cambria_usb0_device = { -+ .name = "ixp4xx-ehci", -+ .id = 0, -+ .resource = cambria_usb0_resources, -+ .num_resources = ARRAY_SIZE(cambria_usb0_resources), -+ .dev = { -+ .dma_mask = &ehci_dma_mask, -+ .coherent_dma_mask = 0xffffffff, -+ }, -+}; -+ -+static struct platform_device cambria_usb1_device = { -+ .name = "ixp4xx-ehci", -+ .id = 1, -+ .resource = cambria_usb1_resources, -+ .num_resources = ARRAY_SIZE(cambria_usb1_resources), -+ .dev = { -+ .dma_mask = &ehci_dma_mask, -+ .coherent_dma_mask = 0xffffffff, -+ }, -+}; -+ -+static struct platform_device *cambria_devices[] __initdata = { -+ &cambria_i2c_gpio, -+ &cambria_flash, -+ &cambria_uart, -+}; -+ -+static void __init cambria_gw23xx_setup(void) -+{ -+ platform_device_register(&cambria_npec_device); -+ platform_device_register(&cambria_npea_device); -+} -+ -+static void __init cambria_gw2350_setup(void) -+{ -+ platform_device_register(&cambria_npec_device); -+ platform_device_register(&cambria_npea_device); -+ -+ platform_device_register(&cambria_usb0_device); -+ platform_device_register(&cambria_usb1_device); -+ -+ platform_device_register(&cambria_gpio_leds_device); -+} -+ -+static void __init cambria_gw2358_setup(void) -+{ -+ platform_device_register(&cambria_npec_device); -+ platform_device_register(&cambria_npea_device); -+ -+ platform_device_register(&cambria_usb0_device); -+ platform_device_register(&cambria_usb1_device); -+ -+ platform_device_register(&cambria_pata); -+ -+ platform_device_register(&cambria_latch_leds_device); -+} -+ -+static struct cambria_board_info cambria_boards[] __initdata = { -+ { -+ .model = "GW2350", -+ .setup = cambria_gw2350_setup, -+ }, { -+ .model = "GW2358", -+ .setup = cambria_gw2358_setup, -+ } -+}; -+ -+static struct cambria_board_info * __init cambria_find_board_info(char *model) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) { -+ struct cambria_board_info *info = &cambria_boards[i]; -+ if (strcmp(info->model, model) == 0) -+ return info; -+ } -+ -+ return NULL; -+} -+ -+static struct memory_accessor *at24_mem_acc; -+ -+static int at24_setup(struct memory_accessor *mem_acc, void *context) -+{ -+ char mac_addr[ETH_ALEN]; -+ char model[6]; -+ -+ at24_mem_acc = mem_acc; -+ -+ /* Read MAC addresses */ -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x0, 6) == 6) { -+ memcpy(&cambria_npec_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x6, 6) == 6) { -+ memcpy(&cambria_npea_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ -+ /* Read the first 6 bytes of the model number */ -+ if (at24_mem_acc->read(at24_mem_acc, model, 0x20, 6) == 6) { -+ cambria_info = cambria_find_board_info(model); -+ } -+ -+ return 0; -+} -+ -+static struct at24_platform_data cambria_eeprom_info = { -+ .byte_len = 1024, -+ .page_size = 16, -+ .flags = AT24_FLAG_READONLY, -+ .setup = at24_setup, -+}; -+ -+static struct i2c_board_info __initdata cambria_i2c_board_info[] = { -+ { -+ I2C_BOARD_INFO("ds1672", 0x68), -+ }, -+ { -+ I2C_BOARD_INFO("ad7418", 0x28), -+ }, -+ { -+ I2C_BOARD_INFO("24c08", 0x51), -+ .platform_data = &cambria_eeprom_info -+ }, -+}; -+ -+static void __init cambria_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ cambria_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ cambria_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; -+ -+ platform_add_devices(cambria_devices, ARRAY_SIZE(cambria_devices)); -+ -+ cambria_pata_resources[0].start = 0x53e00000; -+ cambria_pata_resources[0].end = 0x53e3ffff; -+ -+ cambria_pata_resources[1].start = 0x53e40000; -+ cambria_pata_resources[1].end = 0x53e7ffff; -+ -+ cambria_pata_data.cs0_cfg = IXP4XX_EXP_CS3; -+ cambria_pata_data.cs1_cfg = IXP4XX_EXP_CS3; -+ -+ i2c_register_board_info(0, cambria_i2c_board_info, -+ ARRAY_SIZE(cambria_i2c_board_info)); -+} -+ -+static int __init cambria_model_setup(void) -+{ -+ if (!machine_is_cambria()) -+ return 0; -+ -+ if (cambria_info) { -+ printk(KERN_DEBUG "Running on Gateworks Cambria %s\n", -+ cambria_info->model); -+ cambria_info->setup(); -+ } else { -+ printk(KERN_INFO "Unknown/missing Cambria model number" -+ " -- defaults will be used\n"); -+ cambria_gw23xx_setup(); -+ } -+ -+ return 0; -+} -+late_initcall(cambria_model_setup); -+ -+MACHINE_START(CAMBRIA, "Gateworks Cambria series") -+ /* Maintainer: Imre Kaloz */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = cambria_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -25,6 +25,14 @@ config MACH_AVILA - Avila Network Platform. For more information on this platform, - see . - -+config MACH_CAMBRIA -+ bool "Cambria" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the Gateworks -+ Cambria series. For more information on this platform, -+ see . -+ - config MACH_LOFT - bool "Loft" - depends on MACH_AVILA -@@ -214,7 +222,7 @@ config CPU_IXP46X - - config CPU_IXP43X - bool -- depends on MACH_KIXRP435 -+ depends on MACH_KIXRP435 || MACH_CAMBRIA - default y - - config MACH_GTWX5715 ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -7,6 +7,7 @@ obj-pci-n := - - obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o -+obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o - obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o - obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o - obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o -@@ -29,6 +30,7 @@ obj-y += common.o - - obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o - obj-$(CONFIG_MACH_AVILA) += avila-setup.o -+obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o - obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o - obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o - obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o diff --git a/target/linux/ixp4xx/patches-2.6.31/191-cambria_optional_uart.patch b/target/linux/ixp4xx/patches-2.6.31/191-cambria_optional_uart.patch deleted file mode 100644 index 1495766ff..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/191-cambria_optional_uart.patch +++ /dev/null @@ -1,217 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/cambria-setup.c -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - - struct cambria_board_info { - unsigned char *model; -@@ -127,6 +128,45 @@ static struct platform_device cambria_ua - .resource = &cambria_uart_resource, - }; - -+static struct resource cambria_optional_uart_resources[] = { -+ { -+ .start = 0x52000000, -+ .end = 0x52000fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = 0x53000000, -+ .end = 0x53000fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port cambria_optional_uart_data[] = { -+ { -+ .flags = UPF_BOOT_AUTOCONF, -+ .iotype = UPIO_MEM_DELAY, -+ .regshift = 0, -+ .uartclk = 1843200, -+ .rw_delay = 2, -+ }, -+ { -+ .flags = UPF_BOOT_AUTOCONF, -+ .iotype = UPIO_MEM_DELAY, -+ .regshift = 0, -+ .uartclk = 1843200, -+ .rw_delay = 2, -+ }, -+ { }, -+}; -+ -+static struct platform_device cambria_optional_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM1, -+ .dev.platform_data = cambria_optional_uart_data, -+ .num_resources = 2, -+ .resource = cambria_optional_uart_resources, -+}; -+ - static struct resource cambria_pata_resources[] = { - { - .flags = IORESOURCE_MEM -@@ -283,6 +323,19 @@ static void __init cambria_gw23xx_setup( - - static void __init cambria_gw2350_setup(void) - { -+ *IXP4XX_EXP_CS2 = 0xBFFF3C43; -+ set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[0].mapbase = 0x52FF0000; -+ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52FF0000, 0x0fff); -+ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; -+ -+ *IXP4XX_EXP_CS3 = 0xBFFF3C43; -+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[1].mapbase = 0x53FF0000; -+ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); -+ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; -+ -+ platform_device_register(&cambria_optional_uart); - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); - -@@ -294,6 +347,19 @@ static void __init cambria_gw2350_setup( - - static void __init cambria_gw2358_setup(void) - { -+ *IXP4XX_EXP_CS3 = 0xBFFF3C43; -+ set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[0].mapbase = 0x53FC0000; -+ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x53FC0000, 0x0fff); -+ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; -+ -+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); -+ cambria_optional_uart_data[1].mapbase = 0x53F80000; -+ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); -+ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; -+ -+ platform_device_register(&cambria_optional_uart); -+ - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); - ---- a/include/linux/serial_8250.h -+++ b/include/linux/serial_8250.h -@@ -26,6 +26,7 @@ struct plat_serial8250_port { - void *private_data; - unsigned char regshift; /* register shift */ - unsigned char iotype; /* UPIO_* */ -+ unsigned int rw_delay; /* udelay for slower busses IXP4XX Expansion Bus */ - unsigned char hub6; - upf_t flags; /* UPF_* flags */ - unsigned int type; /* If UPF_FIXED_TYPE */ ---- a/include/linux/serial_core.h -+++ b/include/linux/serial_core.h -@@ -280,6 +280,7 @@ struct uart_port { - #define UPIO_TSI (5) /* Tsi108/109 type IO */ - #define UPIO_DWAPB (6) /* DesignWare APB UART */ - #define UPIO_RM9000 (7) /* RM9000 type IO */ -+#define UPIO_MEM_DELAY (8) - - unsigned int read_status_mask; /* driver specific */ - unsigned int ignore_status_mask; /* driver specific */ -@@ -322,6 +323,7 @@ struct uart_port { - - unsigned int mctrl; /* current modem ctrl settings */ - unsigned int timeout; /* character-based timeout */ -+ unsigned int rw_delay; /* udelay for slow busses, IXP4XX Expansion Bus */ - unsigned int type; /* port type */ - const struct uart_ops *ops; - unsigned int custom_divisor; ---- a/drivers/serial/8250.c -+++ b/drivers/serial/8250.c -@@ -404,6 +404,20 @@ static void mem_serial_out(struct uart_p - writeb(value, p->membase + offset); - } - -+static unsigned int memdelay_serial_in(struct uart_port *p, int offset) -+{ -+ struct uart_8250_port *up = (struct uart_8250_port *)p; -+ udelay(up->port.rw_delay); -+ return mem_serial_in(p, offset); -+} -+ -+static void memdelay_serial_out(struct uart_port *p, int offset, int value) -+{ -+ struct uart_8250_port *up = (struct uart_8250_port *)p; -+ udelay(up->port.rw_delay); -+ mem_serial_out(p, offset, value); -+} -+ - static void mem32_serial_out(struct uart_port *p, int offset, int value) - { - offset = map_8250_out_reg(p, offset) << p->regshift; -@@ -497,6 +511,11 @@ static void set_io_from_upio(struct uart - p->serial_out = mem32_serial_out; - break; - -+ case UPIO_MEM_DELAY: -+ p->serial_in = memdelay_serial_in; -+ p->serial_out = memdelay_serial_out; -+ break; -+ - #ifdef CONFIG_SERIAL_8250_AU1X00 - case UPIO_AU: - p->serial_in = au_serial_in; -@@ -529,6 +548,7 @@ serial_out_sync(struct uart_8250_port *u - switch (p->iotype) { - case UPIO_MEM: - case UPIO_MEM32: -+ case UPIO_MEM_DELAY: - #ifdef CONFIG_SERIAL_8250_AU1X00 - case UPIO_AU: - #endif -@@ -2447,6 +2467,7 @@ static int serial8250_request_std_resour - case UPIO_MEM32: - case UPIO_MEM: - case UPIO_DWAPB: -+ case UPIO_MEM_DELAY: - if (!up->port.mapbase) - break; - -@@ -2484,6 +2505,7 @@ static void serial8250_release_std_resou - case UPIO_MEM32: - case UPIO_MEM: - case UPIO_DWAPB: -+ case UPIO_MEM_DELAY: - if (!up->port.mapbase) - break; - -@@ -2953,6 +2975,7 @@ static int __devinit serial8250_probe(st - port.serial_in = p->serial_in; - port.serial_out = p->serial_out; - port.dev = &dev->dev; -+ port.rw_delay = p->rw_delay; - if (share_irqs) - port.flags |= UPF_SHARE_IRQ; - ret = serial8250_register_port(&port); -@@ -3102,6 +3125,7 @@ int serial8250_register_port(struct uart - uart->port.iotype = port->iotype; - uart->port.flags = port->flags | UPF_BOOT_AUTOCONF; - uart->port.mapbase = port->mapbase; -+ uart->port.rw_delay = port->rw_delay; - uart->port.private_data = port->private_data; - if (port->dev) - uart->port.dev = port->dev; ---- a/drivers/serial/serial_core.c -+++ b/drivers/serial/serial_core.c -@@ -2138,6 +2138,7 @@ uart_report_port(struct uart_driver *drv - snprintf(address, sizeof(address), - "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); - break; -+ case UPIO_MEM_DELAY: - case UPIO_MEM: - case UPIO_MEM32: - case UPIO_AU: -@@ -2552,6 +2553,7 @@ int uart_match_port(struct uart_port *po - case UPIO_HUB6: - return (port1->iobase == port2->iobase) && - (port1->hub6 == port2->hub6); -+ case UPIO_MEM_DELAY: - case UPIO_MEM: - case UPIO_MEM32: - case UPIO_AU: diff --git a/target/linux/ixp4xx/patches-2.6.31/192-cambria_gpio_device.patch b/target/linux/ixp4xx/patches-2.6.31/192-cambria_gpio_device.patch deleted file mode 100644 index d785c3a8c..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/192-cambria_gpio_device.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/cambria-setup.c -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -214,6 +214,20 @@ static struct platform_device cambria_gp - .dev.platform_data = &cambria_gpio_leds_data, - }; - -+static struct resource cambria_gpio_resources[] = { -+ { -+ .name = "gpio", -+ .flags = 0, -+ }, -+}; -+ -+static struct platform_device cambria_gpio = { -+ .name = "GPIODEV", -+ .id = -1, -+ .num_resources = ARRAY_SIZE(cambria_gpio_resources), -+ .resource = cambria_gpio_resources, -+}; -+ - static struct latch_led cambria_latch_leds[] = { - { - .name = "ledA", /* green led */ -@@ -335,6 +349,11 @@ static void __init cambria_gw2350_setup( - cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); - cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; - -+ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ -+ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); -+ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; -+ -+ platform_device_register(&cambria_gpio); - platform_device_register(&cambria_optional_uart); - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); -@@ -358,6 +377,10 @@ static void __init cambria_gw2358_setup( - cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); - cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; - -+ cambria_gpio_resources[0].start = (1 << 14); -+ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; -+ -+ platform_device_register(&cambria_gpio); - platform_device_register(&cambria_optional_uart); - - platform_device_register(&cambria_npec_device); diff --git a/target/linux/ixp4xx/patches-2.6.31/193-cambria_pld_gpio.patch b/target/linux/ixp4xx/patches-2.6.31/193-cambria_pld_gpio.patch deleted file mode 100644 index 299630f17..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/193-cambria_pld_gpio.patch +++ /dev/null @@ -1,107 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/cambria-setup.c -+++ b/arch/arm/mach-ixp4xx/cambria-setup.c -@@ -12,11 +12,14 @@ - */ - - #include -+#include - #include - #include - #include -+#include - #include - #include -+#include - #include - #include - #include -@@ -323,6 +326,39 @@ static struct platform_device cambria_us - }, - }; - -+static struct gw_i2c_pld_platform_data gw_i2c_pld_data0 = { -+ .gpio_base = 16, -+ .nr_gpio = 8, -+}; -+ -+static struct gw_i2c_pld_platform_data gw_i2c_pld_data1 = { -+ .gpio_base = 24, -+ .nr_gpio = 2, -+}; -+ -+ -+static struct gpio_button cambria_gpio_buttons[] = { -+ { -+ .desc = "user", -+ .type = EV_KEY, -+ .code = BTN_0, -+ .threshold = 2, -+ .gpio = 25, -+ } -+}; -+ -+static struct gpio_buttons_platform_data cambria_gpio_buttons_data = { -+ .poll_interval = 500, -+ .nbuttons = 1, -+ .buttons = cambria_gpio_buttons, -+}; -+ -+static struct platform_device cambria_gpio_buttons_device = { -+ .name = "gpio-buttons", -+ .id = -1, -+ .dev.platform_data = &cambria_gpio_buttons_data, -+}; -+ - static struct platform_device *cambria_devices[] __initdata = { - &cambria_i2c_gpio, - &cambria_flash, -@@ -331,6 +367,11 @@ static struct platform_device *cambria_d - - static void __init cambria_gw23xx_setup(void) - { -+ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ -+ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); -+ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; -+ -+ platform_device_register(&cambria_gpio); - platform_device_register(&cambria_npec_device); - platform_device_register(&cambria_npea_device); - } -@@ -377,7 +418,8 @@ static void __init cambria_gw2358_setup( - cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); - cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; - -- cambria_gpio_resources[0].start = (1 << 14); -+ cambria_gpio_resources[0].start = (1 << 14) | (1 << 16) | (1 << 17) | (1 << 18) |\ -+ (1 << 19) | (1 << 20) | (1 << 24) | (1 << 25); - cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; - - platform_device_register(&cambria_gpio); -@@ -391,7 +433,12 @@ static void __init cambria_gw2358_setup( - - platform_device_register(&cambria_pata); - -+ cambria_gpio_leds[0].gpio = 24; -+ platform_device_register(&cambria_gpio_leds_device); -+ - platform_device_register(&cambria_latch_leds_device); -+ -+ platform_device_register(&cambria_gpio_buttons_device); - } - - static struct cambria_board_info cambria_boards[] __initdata = { -@@ -460,6 +507,14 @@ static struct i2c_board_info __initdata - I2C_BOARD_INFO("24c08", 0x51), - .platform_data = &cambria_eeprom_info - }, -+ { -+ I2C_BOARD_INFO("gw_i2c_pld", 0x56), -+ .platform_data = &gw_i2c_pld_data0, -+ }, -+ { -+ I2C_BOARD_INFO("gw_i2c_pld", 0x57), -+ .platform_data = &gw_i2c_pld_data1, -+ }, - }; - - static void __init cambria_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.31/201-npe_driver_print_license_location.patch b/target/linux/ixp4xx/patches-2.6.31/201-npe_driver_print_license_location.patch deleted file mode 100644 index b97dd77dc..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/201-npe_driver_print_license_location.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c -+++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c -@@ -583,6 +583,8 @@ int npe_load_firmware(struct npe *npe, c - npe_reset(npe); - #endif - -+ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n"); -+ - print_npe(KERN_INFO, npe, "firmware functionality 0x%X, " - "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, - (image->id >> 8) & 0xFF, image->id & 0xFF); diff --git a/target/linux/ixp4xx/patches-2.6.31/203-npe_driver_mask_phy_features.patch b/target/linux/ixp4xx/patches-2.6.31/203-npe_driver_mask_phy_features.patch deleted file mode 100644 index eacf35d07..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/203-npe_driver_mask_phy_features.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -1217,6 +1217,10 @@ static int __devinit eth_init_one(struct - if ((err = IS_ERR(port->phydev))) - goto err_free_mem; - -+ /* mask with MAC supported features */ -+ port->phydev->supported &= PHY_BASIC_FEATURES; -+ port->phydev->advertising = port->phydev->supported; -+ - port->phydev->irq = PHY_POLL; - - if ((err = register_netdev(dev))) diff --git a/target/linux/ixp4xx/patches-2.6.31/205-npe_driver_separate_phy_functions.patch b/target/linux/ixp4xx/patches-2.6.31/205-npe_driver_separate_phy_functions.patch deleted file mode 100644 index b9835a012..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/205-npe_driver_separate_phy_functions.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -396,6 +396,50 @@ static void ixp4xx_adjust_link(struct ne - dev->name, port->speed, port->duplex ? "full" : "half"); - } - -+static int ixp4xx_phy_connect(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ struct eth_plat_info *plat = port->plat; -+ char phy_id[MII_BUS_ID_SIZE + 3]; -+ -+ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); -+ port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, -+ PHY_INTERFACE_MODE_MII); -+ if (IS_ERR(port->phydev)) { -+ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); -+ return PTR_ERR(port->phydev); -+ } -+ -+ /* mask with MAC supported features */ -+ port->phydev->supported &= PHY_BASIC_FEATURES; -+ port->phydev->advertising = port->phydev->supported; -+ -+ port->phydev->irq = PHY_POLL; -+ -+ return 0; -+} -+ -+static void ixp4xx_phy_disconnect(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ -+ phy_disconnect(port->phydev); -+} -+ -+static void ixp4xx_phy_start(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ -+ port->speed = 0; /* force "link up" message */ -+ phy_start(port->phydev); -+} -+ -+static void ixp4xx_phy_stop(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ -+ phy_stop(port->phydev); -+} - - static inline void debug_pkt(struct net_device *dev, const char *func, - u8 *data, int len) -@@ -1005,8 +1049,7 @@ static int eth_open(struct net_device *d - return err; - } - -- port->speed = 0; /* force "link up" message */ -- phy_start(port->phydev); -+ ixp4xx_phy_start(dev); - - for (i = 0; i < ETH_ALEN; i++) - __raw_writel(dev->dev_addr[i], &port->regs->hw_addr[i]); -@@ -1127,7 +1170,7 @@ static int eth_close(struct net_device * - printk(KERN_CRIT "%s: unable to disable loopback\n", - dev->name); - -- phy_stop(port->phydev); -+ ixp4xx_phy_stop(dev); - - if (!ports_open) - qmgr_disable_irq(TXDONE_QUEUE); -@@ -1153,7 +1196,6 @@ static int __devinit eth_init_one(struct - struct net_device *dev; - struct eth_plat_info *plat = pdev->dev.platform_data; - u32 regs_phys; -- char phy_id[MII_BUS_ID_SIZE + 3]; - int err; - - if (!(dev = alloc_etherdev(sizeof(struct port)))) -@@ -1211,18 +1253,10 @@ static int __devinit eth_init_one(struct - __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); - udelay(50); - -- snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); -- port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, -- PHY_INTERFACE_MODE_MII); -- if ((err = IS_ERR(port->phydev))) -+ err = ixp4xx_phy_connect(dev); -+ if (err) - goto err_free_mem; - -- /* mask with MAC supported features */ -- port->phydev->supported &= PHY_BASIC_FEATURES; -- port->phydev->advertising = port->phydev->supported; -- -- port->phydev->irq = PHY_POLL; -- - if ((err = register_netdev(dev))) - goto err_phy_dis; - -@@ -1232,7 +1266,7 @@ static int __devinit eth_init_one(struct - return 0; - - err_phy_dis: -- phy_disconnect(port->phydev); -+ ixp4xx_phy_disconnect(port->phydev); - err_free_mem: - npe_port_tab[NPE_ID(port->id)] = NULL; - platform_set_drvdata(pdev, NULL); -@@ -1250,7 +1284,7 @@ static int __devexit eth_remove_one(stru - struct port *port = netdev_priv(dev); - - unregister_netdev(dev); -- phy_disconnect(port->phydev); -+ ixp4xx_phy_disconnect(dev); - npe_port_tab[NPE_ID(port->id)] = NULL; - platform_set_drvdata(pdev, NULL); - npe_release(port->npe); diff --git a/target/linux/ixp4xx/patches-2.6.31/206-npe_driver_add_update_link_function.patch b/target/linux/ixp4xx/patches-2.6.31/206-npe_driver_add_update_link_function.patch deleted file mode 100644 index 419ec4cdb..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/206-npe_driver_add_update_link_function.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -168,7 +168,7 @@ struct port { - struct desc *desc_tab; /* coherent */ - u32 desc_tab_phys; - int id; /* logical port ID */ -- int speed, duplex; -+ int link, speed, duplex; - u8 firmware[4]; - }; - -@@ -365,37 +365,52 @@ static void ixp4xx_mdio_remove(void) - mdiobus_free(mdio_bus); - } - -- --static void ixp4xx_adjust_link(struct net_device *dev) -+static void ixp4xx_update_link(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -- struct phy_device *phydev = port->phydev; - -- if (!phydev->link) { -- if (port->speed) { -- port->speed = 0; -- printk(KERN_INFO "%s: link down\n", dev->name); -- } -+ if (!port->link) { -+ netif_carrier_off(dev); -+ printk(KERN_INFO "%s: link down\n", dev->name); - return; - } - -- if (port->speed == phydev->speed && port->duplex == phydev->duplex) -- return; -- -- port->speed = phydev->speed; -- port->duplex = phydev->duplex; -- -- if (port->duplex) -+ if (port->duplex == DUPLEX_FULL) - __raw_writel(DEFAULT_TX_CNTRL0 & ~TX_CNTRL0_HALFDUPLEX, - &port->regs->tx_control[0]); - else - __raw_writel(DEFAULT_TX_CNTRL0 | TX_CNTRL0_HALFDUPLEX, - &port->regs->tx_control[0]); - -+ netif_carrier_on(dev); - printk(KERN_INFO "%s: link up, speed %u Mb/s, %s duplex\n", - dev->name, port->speed, port->duplex ? "full" : "half"); - } - -+static void ixp4xx_adjust_link(struct net_device *dev) -+{ -+ struct port *port = netdev_priv(dev); -+ struct phy_device *phydev = port->phydev; -+ int status_change = 0; -+ -+ if (phydev->link) { -+ if (port->duplex != phydev->duplex -+ || port->speed != phydev->speed) { -+ status_change = 1; -+ } -+ } -+ -+ if (phydev->link != port->link) -+ status_change = 1; -+ -+ port->link = phydev->link; -+ port->speed = phydev->speed; -+ port->duplex = phydev->duplex; -+ -+ if (status_change) -+ ixp4xx_update_link(dev); -+} -+ - static int ixp4xx_phy_connect(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -@@ -430,7 +445,6 @@ static void ixp4xx_phy_start(struct net_ - { - struct port *port = netdev_priv(dev); - -- port->speed = 0; /* force "link up" message */ - phy_start(port->phydev); - } - -@@ -1260,6 +1274,10 @@ static int __devinit eth_init_one(struct - if ((err = register_netdev(dev))) - goto err_phy_dis; - -+ port->link = 0; -+ port->speed = 0; -+ port->duplex = -1; -+ - printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, - npe_name(port->npe)); - diff --git a/target/linux/ixp4xx/patches-2.6.31/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-2.6.31/207-npe_driver_multiphy_support.patch deleted file mode 100644 index afcf7e156..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/207-npe_driver_multiphy_support.patch +++ /dev/null @@ -1,155 +0,0 @@ -TODO: take care of additional PHYs through the PHY abstraction layer - ---- a/arch/arm/mach-ixp4xx/include/mach/platform.h -+++ b/arch/arm/mach-ixp4xx/include/mach/platform.h -@@ -72,7 +72,7 @@ extern unsigned long ixp4xx_exp_bus_size - /* - * Clock Speed Definitions. - */ --#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */ -+#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */ - #define IXP4XX_UART_XTAL 14745600 - - /* -@@ -95,12 +95,23 @@ struct sys_timer; - #define IXP4XX_ETH_NPEB 0x10 - #define IXP4XX_ETH_NPEC 0x20 - -+#define IXP4XX_ETH_PHY_MAX_ADDR 32 -+ - /* Information about built-in Ethernet MAC interfaces */ - struct eth_plat_info { - u8 phy; /* MII PHY ID, 0 - 31 */ - u8 rxq; /* configurable, currently 0 - 31 only */ - u8 txreadyq; - u8 hwaddr[6]; -+ -+ u32 phy_mask; -+#if 0 -+ int speed; -+ int duplex; -+#else -+ int speed_10; -+ int half_duplex; -+#endif - }; - - /* Information about built-in HSS (synchronous serial) interfaces */ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -417,6 +417,37 @@ static int ixp4xx_phy_connect(struct net - struct eth_plat_info *plat = port->plat; - char phy_id[MII_BUS_ID_SIZE + 3]; - -+ if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) { -+#if 0 -+ switch (plat->speed) { -+ case SPEED_10: -+ case SPEED_100: -+ break; -+ default: -+ printk(KERN_ERR "%s: invalid speed (%d)\n", -+ dev->name, plat->speed); -+ return -EINVAL; -+ } -+ -+ switch (plat->duplex) { -+ case DUPLEX_HALF: -+ case DUPLEX_FULL: -+ break; -+ default: -+ printk(KERN_ERR "%s: invalid duplex mode (%d)\n", -+ dev->name, plat->duplex); -+ return -EINVAL; -+ } -+ port->speed = plat->speed; -+ port->duplex = plat->duplex; -+#else -+ port->speed = plat->speed_10 ? SPEED_10 : SPEED_100; -+ port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL; -+#endif -+ -+ return 0; -+ } -+ - snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); - port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, - PHY_INTERFACE_MODE_MII); -@@ -438,21 +469,32 @@ static void ixp4xx_phy_disconnect(struct - { - struct port *port = netdev_priv(dev); - -- phy_disconnect(port->phydev); -+ if (port->phydev) -+ phy_disconnect(port->phydev); - } - - static void ixp4xx_phy_start(struct net_device *dev) - { - struct port *port = netdev_priv(dev); - -- phy_start(port->phydev); -+ if (port->phydev) { -+ phy_start(port->phydev); -+ } else { -+ port->link = 1; -+ ixp4xx_update_link(dev); -+ } - } - - static void ixp4xx_phy_stop(struct net_device *dev) - { - struct port *port = netdev_priv(dev); - -- phy_stop(port->phydev); -+ if (port->phydev) { -+ phy_stop(port->phydev); -+ } else { -+ port->link = 0; -+ ixp4xx_update_link(dev); -+ } - } - - static inline void debug_pkt(struct net_device *dev, const char *func, -@@ -826,6 +868,10 @@ static int eth_ioctl(struct net_device * - - if (!netif_running(dev)) - return -EINVAL; -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_mii_ioctl(port->phydev, if_mii(req), cmd); - } - -@@ -845,18 +891,30 @@ static void ixp4xx_get_drvinfo(struct ne - static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) - { - struct port *port = netdev_priv(dev); -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_ethtool_gset(port->phydev, cmd); - } - - static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) - { - struct port *port = netdev_priv(dev); -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_ethtool_sset(port->phydev, cmd); - } - - static int ixp4xx_nway_reset(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -+ -+ if (!port->phydev) -+ return -EOPNOTSUPP; -+ - return phy_start_aneg(port->phydev); - } - diff --git a/target/linux/ixp4xx/patches-2.6.31/295-latch_led_driver.patch b/target/linux/ixp4xx/patches-2.6.31/295-latch_led_driver.patch deleted file mode 100644 index 853636d31..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/295-latch_led_driver.patch +++ /dev/null @@ -1,200 +0,0 @@ ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -157,6 +157,13 @@ config LEDS_LP3944 - To compile this driver as a module, choose M here: the - module will be called leds-lp3944. - -+config LEDS_LATCH -+ tristate "LED Support for Memory Latched LEDs" -+ depends on LEDS_CLASS -+ help -+ -- To Do -- -+ -+ - config LEDS_CLEVO_MAIL - tristate "Mail LED on Clevo notebook" - depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI ---- /dev/null -+++ b/drivers/leds/leds-latch.c -@@ -0,0 +1,149 @@ -+/* -+ * LEDs driver for Memory Latched Devices -+ * -+ * Copyright (C) 2008 Gateworks Corp. -+ * Chris Lang -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static unsigned int mem_keep = 0xFF; -+static spinlock_t mem_lock; -+static unsigned char *iobase; -+ -+struct latch_led_data { -+ struct led_classdev cdev; -+ struct work_struct work; -+ u8 new_level; -+ u8 bit; -+ void (*set_led)(u8 bit, enum led_brightness value); -+}; -+ -+static void latch_set_led(u8 bit, enum led_brightness value) -+{ -+ if (value == LED_OFF) -+ mem_keep |= (0x1 << bit); -+ else -+ mem_keep &= ~(0x1 << bit); -+ -+ writeb(mem_keep, iobase); -+} -+ -+static void latch_led_set(struct led_classdev *led_cdev, -+ enum led_brightness value) -+{ -+ struct latch_led_data *led_dat = -+ container_of(led_cdev, struct latch_led_data, cdev); -+ -+ spin_lock(mem_lock); -+ -+ led_dat->set_led(led_dat->bit, value); -+ -+ spin_unlock(mem_lock); -+} -+ -+static int latch_led_probe(struct platform_device *pdev) -+{ -+ struct latch_led_platform_data *pdata = pdev->dev.platform_data; -+ struct latch_led *cur_led; -+ struct latch_led_data *leds_data, *led_dat; -+ int i, ret = 0; -+ -+ if (!pdata) -+ return -EBUSY; -+ -+ leds_data = kzalloc(sizeof(struct latch_led_data) * pdata->num_leds, -+ GFP_KERNEL); -+ if (!leds_data) -+ return -ENOMEM; -+ -+ for (i = 0; i < pdata->num_leds; i++) { -+ cur_led = &pdata->leds[i]; -+ led_dat = &leds_data[i]; -+ -+ led_dat->cdev.name = cur_led->name; -+ led_dat->cdev.default_trigger = cur_led->default_trigger; -+ led_dat->cdev.brightness_set = latch_led_set; -+ led_dat->cdev.brightness = LED_OFF; -+ led_dat->bit = cur_led->bit; -+ led_dat->set_led = pdata->set_led ? pdata->set_led : latch_set_led; -+ -+ ret = led_classdev_register(&pdev->dev, &led_dat->cdev); -+ if (ret < 0) { -+ goto err; -+ } -+ } -+ -+ if (!pdata->set_led) { -+ iobase = ioremap_nocache(pdata->mem, 0x1000); -+ writeb(0xFF, iobase); -+ } -+ platform_set_drvdata(pdev, leds_data); -+ -+ return 0; -+ -+err: -+ if (i > 0) { -+ for (i = i - 1; i >= 0; i--) { -+ led_classdev_unregister(&leds_data[i].cdev); -+ } -+ } -+ -+ kfree(leds_data); -+ -+ return ret; -+} -+ -+static int __devexit latch_led_remove(struct platform_device *pdev) -+{ -+ int i; -+ struct latch_led_platform_data *pdata = pdev->dev.platform_data; -+ struct latch_led_data *leds_data; -+ -+ leds_data = platform_get_drvdata(pdev); -+ -+ for (i = 0; i < pdata->num_leds; i++) { -+ led_classdev_unregister(&leds_data[i].cdev); -+ cancel_work_sync(&leds_data[i].work); -+ } -+ -+ kfree(leds_data); -+ -+ return 0; -+} -+ -+static struct platform_driver latch_led_driver = { -+ .probe = latch_led_probe, -+ .remove = __devexit_p(latch_led_remove), -+ .driver = { -+ .name = "leds-latch", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static int __init latch_led_init(void) -+{ -+ return platform_driver_register(&latch_led_driver); -+} -+ -+static void __exit latch_led_exit(void) -+{ -+ platform_driver_unregister(&latch_led_driver); -+} -+ -+module_init(latch_led_init); -+module_exit(latch_led_exit); -+ -+MODULE_AUTHOR("Chris Lang "); -+MODULE_DESCRIPTION("Latch LED driver"); -+MODULE_LICENSE("GPL"); ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-c - obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o - obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o - obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o -+obj-$(CONFIG_LEDS_LATCH) += leds-latch.o - obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o - obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o - obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o ---- a/include/linux/leds.h -+++ b/include/linux/leds.h -@@ -161,5 +161,19 @@ struct gpio_led_platform_data { - unsigned long *delay_off); - }; - -+/* For the leds-latch driver */ -+struct latch_led { -+ const char *name; -+ char *default_trigger; -+ unsigned bit; -+}; -+ -+struct latch_led_platform_data { -+ int num_leds; -+ u32 mem; -+ struct latch_led *leds; -+ void (*set_led)(u8 bit, enum led_brightness value); -+}; -+ - - #endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/target/linux/ixp4xx/patches-2.6.31/300-avila_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.31/300-avila_fetch_mac.patch deleted file mode 100644 index ca8cae12c..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/300-avila_fetch_mac.patch +++ /dev/null @@ -1,244 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/avila-setup.c -+++ b/arch/arm/mach-ixp4xx/avila-setup.c -@@ -14,10 +14,16 @@ - #include - #include - #include -+#include -+#include -+#include - #include - #include - #include - #include -+#include -+#include -+ - #include - - #include -@@ -29,6 +35,13 @@ - #include - #include - -+struct avila_board_info { -+ unsigned char *model; -+ void (*setup)(void); -+}; -+ -+static struct avila_board_info *avila_info __initdata; -+ - static struct flash_platform_data avila_flash_data = { - .map_name = "cfi_probe", - .width = 2, -@@ -132,16 +145,181 @@ static struct platform_device avila_pata - .resource = avila_pata_resources, - }; - -+/* Built-in 10/100 Ethernet MAC interfaces */ -+static struct eth_plat_info avila_npeb_data = { -+ .phy = 0, -+ .rxq = 3, -+ .txreadyq = 20, -+}; -+ -+static struct eth_plat_info avila_npec_data = { -+ .phy = 1, -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct platform_device avila_npeb_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = &avila_npeb_data, -+}; -+ -+static struct platform_device avila_npec_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = &avila_npec_data, -+}; -+ - static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, - &avila_uart - }; - -+static void __init avila_gw23xx_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2342_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2345_setup(void) -+{ -+ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; -+ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ -+ platform_device_register(&avila_npeb_device); -+ -+ avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2347_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+} -+ -+static void __init avila_gw2348_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2353_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+} -+ -+static void __init avila_gw2355_setup(void) -+{ -+ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; -+ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ -+ platform_device_register(&avila_npeb_device); -+ -+ avila_npec_data.phy = 16; -+ platform_device_register(&avila_npec_device); -+} -+ -+static void __init avila_gw2357_setup(void) -+{ -+ platform_device_register(&avila_npeb_device); -+} -+ -+static struct avila_board_info avila_boards[] __initdata = { -+ { -+ .model = "GW2342", -+ .setup = avila_gw2342_setup, -+ }, { -+ .model = "GW2345", -+ .setup = avila_gw2345_setup, -+ }, { -+ .model = "GW2347", -+ .setup = avila_gw2347_setup, -+ }, { -+ .model = "GW2348", -+ .setup = avila_gw2348_setup, -+ }, { -+ .model = "GW2353", -+ .setup = avila_gw2353_setup, -+ }, { -+ .model = "GW2355", -+ .setup = avila_gw2355_setup, -+ }, { -+ .model = "GW2357", -+ .setup = avila_gw2357_setup, -+ } -+}; -+ -+static struct avila_board_info * __init avila_find_board_info(char *model) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(avila_boards); i++) { -+ struct avila_board_info *info = &avila_boards[i]; -+ if (strcmp(info->model, model) == 0) -+ return info; -+ } -+ -+ return NULL; -+} -+ -+static struct memory_accessor *at24_mem_acc; -+ -+static int at24_setup(struct memory_accessor *mem_acc, void *context) -+{ -+ char mac_addr[ETH_ALEN]; -+ char model[6]; -+ -+ at24_mem_acc = mem_acc; -+ -+ /* Read MAC addresses */ -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x0, 6) == 6) { -+ memcpy(&avila_npeb_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x6, 6) == 6) { -+ memcpy(&avila_npec_data.hwaddr, mac_addr, ETH_ALEN); -+ } -+ -+ /* Read the first 6 bytes of the model number */ -+ if (at24_mem_acc->read(at24_mem_acc, model, 0x20, 6) == 6) { -+ avila_info = avila_find_board_info(model); -+ } -+ -+ return 0; -+} -+ -+static struct at24_platform_data avila_eeprom_info = { -+ .byte_len = 1024, -+ .page_size = 16, -+ .flags = AT24_FLAG_READONLY, -+ .setup = at24_setup, -+}; -+ -+static struct i2c_board_info __initdata avila_i2c_board_info[] = { -+ { -+ I2C_BOARD_INFO("ds1672", 0x68), -+ }, -+ { -+ I2C_BOARD_INFO("ad7418", 0x28), -+ }, -+ { -+ I2C_BOARD_INFO("24c08", 0x51), -+ .platform_data = &avila_eeprom_info -+ }, -+}; -+ - static void __init avila_init(void) - { - ixp4xx_sys_init(); - -+ /* -+ * These devices are present on all Avila models and don't need any -+ * model specific setup. -+ */ - avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - avila_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; -@@ -159,7 +337,28 @@ static void __init avila_init(void) - - platform_device_register(&avila_pata); - -+ i2c_register_board_info(0, avila_i2c_board_info, -+ ARRAY_SIZE(avila_i2c_board_info)); -+} -+ -+static int __init avila_model_setup(void) -+{ -+ if (!machine_is_avila()) -+ return 0; -+ -+ if (avila_info) { -+ printk(KERN_DEBUG "Running on Gateworks Avila %s\n", -+ avila_info->model); -+ avila_info->setup(); -+ } else { -+ printk(KERN_INFO "Unknown/missing Avila model number" -+ " -- defaults will be used\n"); -+ avila_gw23xx_setup(); -+ } -+ -+ return 0; - } -+late_initcall(avila_model_setup); - - MACHINE_START(AVILA, "Gateworks Avila Network Platform") - /* Maintainer: Deepak Saxena */ diff --git a/target/linux/ixp4xx/patches-2.6.31/301-avila_led.patch b/target/linux/ixp4xx/patches-2.6.31/301-avila_led.patch deleted file mode 100644 index 2bd0e1609..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/301-avila_led.patch +++ /dev/null @@ -1,171 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/avila-setup.c -+++ b/arch/arm/mach-ixp4xx/avila-setup.c -@@ -24,6 +24,7 @@ - #include - #include - -+#include - #include - - #include -@@ -170,6 +171,72 @@ static struct platform_device avila_npec - .dev.platform_data = &avila_npec_data, - }; - -+static struct gpio_led avila_gpio_leds[] = { -+ { -+ .name = "user", /* green led */ -+ .gpio = AVILA_GW23XX_LED_USER_GPIO, -+ .active_low = 1, -+ } -+}; -+ -+static struct gpio_led_platform_data avila_gpio_leds_data = { -+ .num_leds = 1, -+ .leds = avila_gpio_leds, -+}; -+ -+static struct platform_device avila_gpio_leds_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &avila_gpio_leds_data, -+}; -+ -+static struct latch_led avila_latch_leds[] = { -+ { -+ .name = "led0", /* green led */ -+ .bit = 0, -+ }, -+ { -+ .name = "led1", /* green led */ -+ .bit = 1, -+ }, -+ { -+ .name = "led2", /* green led */ -+ .bit = 2, -+ }, -+ { -+ .name = "led3", /* green led */ -+ .bit = 3, -+ }, -+ { -+ .name = "led4", /* green led */ -+ .bit = 4, -+ }, -+ { -+ .name = "led5", /* green led */ -+ .bit = 5, -+ }, -+ { -+ .name = "led6", /* green led */ -+ .bit = 6, -+ }, -+ { -+ .name = "led7", /* green led */ -+ .bit = 7, -+ } -+}; -+ -+static struct latch_led_platform_data avila_latch_leds_data = { -+ .num_leds = 8, -+ .leds = avila_latch_leds, -+ .mem = 0x51000000, -+}; -+ -+static struct platform_device avila_latch_leds_device = { -+ .name = "leds-latch", -+ .id = -1, -+ .dev.platform_data = &avila_latch_leds_data, -+}; -+ - static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, -@@ -180,12 +247,16 @@ static void __init avila_gw23xx_setup(vo - { - platform_device_register(&avila_npeb_device); - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2342_setup(void) - { - platform_device_register(&avila_npeb_device); - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2345_setup(void) -@@ -196,22 +267,30 @@ static void __init avila_gw2345_setup(vo - - avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2347_setup(void) - { - platform_device_register(&avila_npeb_device); -+ -+ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2348_setup(void) - { - platform_device_register(&avila_npeb_device); - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2353_setup(void) - { - platform_device_register(&avila_npeb_device); -+ platform_device_register(&avila_gpio_leds_device); - } - - static void __init avila_gw2355_setup(void) -@@ -222,11 +301,29 @@ static void __init avila_gw2355_setup(vo - - avila_npec_data.phy = 16; - platform_device_register(&avila_npec_device); -+ -+ platform_device_register(&avila_gpio_leds_device); -+ -+ *IXP4XX_EXP_CS4 |= 0xbfff3c03; -+ avila_latch_leds[0].name = "RXD"; -+ avila_latch_leds[1].name = "TXD"; -+ avila_latch_leds[2].name = "POL"; -+ avila_latch_leds[3].name = "LNK"; -+ avila_latch_leds[4].name = "ERR"; -+ avila_latch_leds_data.num_leds = 5; -+ avila_latch_leds_data.mem = 0x54000000; -+ platform_device_register(&avila_latch_leds_device); - } - - static void __init avila_gw2357_setup(void) - { - platform_device_register(&avila_npeb_device); -+ -+ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; -+ platform_device_register(&avila_gpio_leds_device); -+ -+ *IXP4XX_EXP_CS1 |= 0xbfff3c03; -+ platform_device_register(&avila_latch_leds_device); - } - - static struct avila_board_info avila_boards[] __initdata = { ---- a/arch/arm/mach-ixp4xx/include/mach/avila.h -+++ b/arch/arm/mach-ixp4xx/include/mach/avila.h -@@ -36,4 +36,6 @@ - #define AVILA_PCI_INTC_PIN 9 - #define AVILA_PCI_INTD_PIN 8 - -- -+/* User LEDs */ -+#define AVILA_GW23XX_LED_USER_GPIO 3 -+#define AVILA_GW23X7_LED_USER_GPIO 4 diff --git a/target/linux/ixp4xx/patches-2.6.31/302-avila_gpio_device.patch b/target/linux/ixp4xx/patches-2.6.31/302-avila_gpio_device.patch deleted file mode 100644 index 3b75a59f7..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/302-avila_gpio_device.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/avila-setup.c -+++ b/arch/arm/mach-ixp4xx/avila-setup.c -@@ -237,10 +237,28 @@ static struct platform_device avila_latc - .dev.platform_data = &avila_latch_leds_data, - }; - -+static struct resource avila_gpio_resources[] = { -+ { -+ .name = "gpio", -+ /* FIXME: gpio mask should be model specific */ -+ .start = AVILA_GPIO_MASK, -+ .end = AVILA_GPIO_MASK, -+ .flags = 0, -+ }, -+}; -+ -+static struct platform_device avila_gpio = { -+ .name = "GPIODEV", -+ .id = -1, -+ .num_resources = ARRAY_SIZE(avila_gpio_resources), -+ .resource = avila_gpio_resources, -+}; -+ - static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, -- &avila_uart -+ &avila_uart, -+ &avila_gpio, - }; - - static void __init avila_gw23xx_setup(void) ---- a/arch/arm/mach-ixp4xx/include/mach/avila.h -+++ b/arch/arm/mach-ixp4xx/include/mach/avila.h -@@ -39,3 +39,6 @@ - /* User LEDs */ - #define AVILA_GW23XX_LED_USER_GPIO 3 - #define AVILA_GW23X7_LED_USER_GPIO 4 -+ -+/* gpio mask used by platform device */ -+#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9) diff --git a/target/linux/ixp4xx/patches-2.6.31/304-ixp4xx_eth_jumboframe.patch b/target/linux/ixp4xx/patches-2.6.31/304-ixp4xx_eth_jumboframe.patch deleted file mode 100644 index a9cbddcf5..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/304-ixp4xx_eth_jumboframe.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/drivers/net/arm/ixp4xx_eth.c -+++ b/drivers/net/arm/ixp4xx_eth.c -@@ -52,7 +52,7 @@ - - #define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) - #define REGS_SIZE 0x1000 --#define MAX_MRU 1536 /* 0x600 */ -+#define MAX_MRU (14320 - ETH_HLEN - ETH_FCS_LEN) - #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) - - #define NAPI_WEIGHT 16 -@@ -1061,6 +1061,32 @@ static void destroy_queues(struct port * - } - } - -+static int eth_do_change_mtu(struct net_device *dev, int mtu) -+{ -+ struct port *port; -+ struct msg msg; -+ /* adjust for ethernet headers */ -+ int framesize = mtu + ETH_HLEN + ETH_FCS_LEN; -+ -+ port = netdev_priv(dev); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.cmd = NPE_SETMAXFRAMELENGTHS; -+ msg.eth_id = port->id; -+ -+ /* max rx/tx 64 byte blocks */ -+ msg.byte2 = ((framesize + 63) / 64) << 8; -+ msg.byte3 = ((framesize + 63) / 64) << 8; -+ -+ msg.byte4 = msg.byte6 = framesize >> 8; -+ msg.byte5 = msg.byte7 = framesize & 0xff; -+ -+ if (npe_send_recv_message(port->npe, &msg, "ETH_SET_MAX_FRAME_LENGTH")) -+ return -EIO; -+ -+ return 0; -+} -+ - static int eth_open(struct net_device *dev) - { - struct port *port = netdev_priv(dev); -@@ -1112,6 +1138,8 @@ static int eth_open(struct net_device *d - if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) - return -EIO; - -+ eth_do_change_mtu(dev, dev->mtu); -+ - if ((err = request_queues(port)) != 0) - return err; - -@@ -1251,7 +1279,26 @@ static int eth_close(struct net_device * - return 0; - } - -+static int ixp_eth_change_mtu(struct net_device *dev, int mtu) -+{ -+ int ret; -+ -+ if (mtu > MAX_MRU) -+ return -EINVAL; -+ -+ if (dev->flags & IFF_UP) { -+ ret = eth_do_change_mtu(dev, mtu); -+ if (ret < 0) -+ return ret; -+ } -+ -+ dev->mtu = mtu; -+ -+ return 0; -+} -+ - static const struct net_device_ops ixp4xx_netdev_ops = { -+ .ndo_change_mtu = ixp_eth_change_mtu, - .ndo_open = eth_open, - .ndo_stop = eth_close, - .ndo_start_xmit = eth_xmit, diff --git a/target/linux/ixp4xx/patches-2.6.31/310-gtwx5717_spi_bus.patch b/target/linux/ixp4xx/patches-2.6.31/310-gtwx5717_spi_bus.patch deleted file mode 100644 index e6013d758..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/310-gtwx5717_spi_bus.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c -+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c -@@ -29,6 +29,8 @@ - #include - #include - -+#include -+ - #include - #include - #include -@@ -121,9 +123,41 @@ static struct platform_device gtwx5715_f - .resource = >wx5715_flash_resource, - }; - -+static int gtwx5715_spi_boardinfo_setup(struct spi_board_info *bi, -+ struct spi_master *master, void *data) -+{ -+ -+ strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias)); -+ -+ bi->max_speed_hz = 5000000 /* Hz */; -+ bi->bus_num = master->bus_num; -+ bi->mode = SPI_MODE_0; -+ -+ return 0; -+} -+ -+static struct spi_gpio_platform_data gtwx5715_spi_bus_data = { -+ .pin_cs = GTWX5715_KSSPI_SELECT, -+ .pin_clk = GTWX5715_KSSPI_CLOCK, -+ .pin_miso = GTWX5715_KSSPI_RXD, -+ .pin_mosi = GTWX5715_KSSPI_TXD, -+ .cs_activelow = 1, -+ .no_spi_delay = 1, -+ .boardinfo_setup = gtwx5715_spi_boardinfo_setup, -+}; -+ -+static struct platform_device gtwx5715_spi_bus = { -+ .name = "spi-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = >wx5715_spi_bus_data, -+ }, -+}; -+ - static struct platform_device *gtwx5715_devices[] __initdata = { - >wx5715_uart_device, - >wx5715_flash, -+ >wx5715_spi_bus, - }; - - static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.31/311-gtwx5717_mac_plat_info.patch b/target/linux/ixp4xx/patches-2.6.31/311-gtwx5717_mac_plat_info.patch deleted file mode 100644 index 29f329017..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/311-gtwx5717_mac_plat_info.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c -+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c -@@ -154,10 +154,37 @@ static struct platform_device gtwx5715_s - }, - }; - -+static struct eth_plat_info gtwx5715_npeb_data = { -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ -+ .rxq = 3, -+ .txreadyq = 20, -+}; -+ -+static struct eth_plat_info gtwx5715_npec_data = { -+ .phy = 5, /* port 5 of the KS8995 switch */ -+ .rxq = 4, -+ .txreadyq = 21, -+}; -+ -+static struct platform_device gtwx5715_npeb_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = >wx5715_npeb_data, -+}; -+ -+static struct platform_device gtwx5715_npec_device = { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = >wx5715_npec_data, -+}; -+ - static struct platform_device *gtwx5715_devices[] __initdata = { - >wx5715_uart_device, - >wx5715_flash, - >wx5715_spi_bus, -+ >wx5715_npeb_device, -+ >wx5715_npec_device, - }; - - static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-2.6.31/312-ixp4xx_pata_optimization.patch b/target/linux/ixp4xx/patches-2.6.31/312-ixp4xx_pata_optimization.patch deleted file mode 100644 index 3bf1b7497..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/312-ixp4xx_pata_optimization.patch +++ /dev/null @@ -1,137 +0,0 @@ ---- a/drivers/ata/pata_ixp4xx_cf.c -+++ b/drivers/ata/pata_ixp4xx_cf.c -@@ -24,16 +24,58 @@ - #include - - #define DRV_NAME "pata_ixp4xx_cf" --#define DRV_VERSION "0.2" -+#define DRV_VERSION "0.3" - - static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error) - { - struct ata_device *dev; -+ struct ixp4xx_pata_data *data = link->ap->host->dev->platform_data; -+ unsigned int pio_mask; - - ata_for_each_dev(dev, link, ENABLED) { -- ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); -- dev->pio_mode = XFER_PIO_0; -- dev->xfer_mode = XFER_PIO_0; -+ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)) { -+ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; -+ if (pio_mask & (1 << 1)) { -+ pio_mask = 4; -+ } else { -+ pio_mask = 3; -+ } -+ } else { -+ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); -+ } -+ -+ switch (pio_mask){ -+ case 0: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); -+ dev->pio_mode = XFER_PIO_0; -+ dev->xfer_mode = XFER_PIO_0; -+ *data->cs0_cfg = 0x8a473c03; -+ break; -+ case 1: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO1\n"); -+ dev->pio_mode = XFER_PIO_1; -+ dev->xfer_mode = XFER_PIO_1; -+ *data->cs0_cfg = 0x86433c03; -+ break; -+ case 2: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO2\n"); -+ dev->pio_mode = XFER_PIO_2; -+ dev->xfer_mode = XFER_PIO_2; -+ *data->cs0_cfg = 0x82413c03; -+ break; -+ case 3: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO3\n"); -+ dev->pio_mode = XFER_PIO_3; -+ dev->xfer_mode = XFER_PIO_3; -+ *data->cs0_cfg = 0x80823c03; -+ break; -+ case 4: -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO4\n"); -+ dev->pio_mode = XFER_PIO_4; -+ dev->xfer_mode = XFER_PIO_4; -+ *data->cs0_cfg = 0x80403c03; -+ break; -+ } - dev->xfer_shift = ATA_SHIFT_PIO; - dev->flags |= ATA_DFLAG_PIO; - } -@@ -46,6 +88,7 @@ static unsigned int ixp4xx_mmio_data_xfe - unsigned int i; - unsigned int words = buflen >> 1; - u16 *buf16 = (u16 *) buf; -+ unsigned int pio_mask; - struct ata_port *ap = dev->link->ap; - void __iomem *mmio = ap->ioaddr.data_addr; - struct ixp4xx_pata_data *data = ap->host->dev->platform_data; -@@ -53,8 +96,34 @@ static unsigned int ixp4xx_mmio_data_xfe - /* set the expansion bus in 16bit mode and restore - * 8 bit mode after the transaction. - */ -- *data->cs0_cfg &= ~(0x01); -- udelay(100); -+ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)){ -+ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; -+ if (pio_mask & (1 << 1)){ -+ pio_mask = 4; -+ }else{ -+ pio_mask = 3; -+ } -+ }else{ -+ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); -+ } -+ switch (pio_mask){ -+ case 0: -+ *data->cs0_cfg = 0xa9643c42; -+ break; -+ case 1: -+ *data->cs0_cfg = 0x85033c42; -+ break; -+ case 2: -+ *data->cs0_cfg = 0x80b23c42; -+ break; -+ case 3: -+ *data->cs0_cfg = 0x80823c42; -+ break; -+ case 4: -+ *data->cs0_cfg = 0x80403c42; -+ break; -+ } -+ udelay(5); - - /* Transfer multiple of 2 bytes */ - if (rw == READ) -@@ -79,8 +148,24 @@ static unsigned int ixp4xx_mmio_data_xfe - words++; - } - -- udelay(100); -- *data->cs0_cfg |= 0x01; -+ udelay(5); -+ switch (pio_mask){ -+ case 0: -+ *data->cs0_cfg = 0x8a473c03; -+ break; -+ case 1: -+ *data->cs0_cfg = 0x86433c03; -+ break; -+ case 2: -+ *data->cs0_cfg = 0x82413c03; -+ break; -+ case 3: -+ *data->cs0_cfg = 0x80823c03; -+ break; -+ case 4: -+ *data->cs0_cfg = 0x80403c03; -+ break; -+ } - - return words << 1; - } diff --git a/target/linux/ixp4xx/patches-2.6.31/401-avila_pci_dev.patch b/target/linux/ixp4xx/patches-2.6.31/401-avila_pci_dev.patch deleted file mode 100644 index 3e5087f34..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/401-avila_pci_dev.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/include/mach/avila.h -+++ b/arch/arm/mach-ixp4xx/include/mach/avila.h -@@ -25,7 +25,7 @@ - /* - * AVILA PCI IRQs - */ --#define AVILA_PCI_MAX_DEV 4 -+#define AVILA_PCI_MAX_DEV 6 - #define LOFT_PCI_MAX_DEV 6 - #define AVILA_PCI_IRQ_LINES 4 - diff --git a/target/linux/ixp4xx/patches-2.6.31/402-ixp4xx_gpiolib.patch b/target/linux/ixp4xx/patches-2.6.31/402-ixp4xx_gpiolib.patch deleted file mode 100644 index b148d96b4..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/402-ixp4xx_gpiolib.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/common.c -+++ b/arch/arm/mach-ixp4xx/common.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -374,12 +375,39 @@ static struct platform_device *ixp46x_de - unsigned long ixp4xx_exp_bus_size; - EXPORT_SYMBOL(ixp4xx_exp_bus_size); - -+static int ixp4xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) -+{ -+ gpio_line_config(gpio, IXP4XX_GPIO_IN); -+ return 0; -+} -+EXPORT_SYMBOL(ixp4xx_gpio_direction_input); -+ -+static int ixp4xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int level) -+{ -+ gpio_line_set(gpio, level); -+ gpio_line_config(gpio, IXP4XX_GPIO_OUT); -+ return 0; -+} -+EXPORT_SYMBOL(ixp4xx_gpio_direction_output); -+ -+static struct gpio_chip ixp4xx_gpio_chip = { -+ .label = "IXP4XX_GPIO_CHIP", -+ .direction_input = ixp4xx_gpio_direction_input, -+ .direction_output = ixp4xx_gpio_direction_output, -+ .get = gpio_get_value, -+ .set = gpio_set_value, -+ .base = 0, -+ .ngpio = 16, -+}; -+ - void __init ixp4xx_sys_init(void) - { - ixp4xx_exp_bus_size = SZ_16M; - - platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices)); - -+ gpiochip_add(&ixp4xx_gpio_chip); -+ - if (cpu_is_ixp46x()) { - int region; - ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -384,6 +384,7 @@ config ARCH_IXP4XX - select GENERIC_GPIO - select GENERIC_TIME - select GENERIC_CLOCKEVENTS -+ select ARCH_REQUIRE_GPIOLIB - help - Support for Intel's IXP4XX (XScale) family of processors. - ---- a/arch/arm/mach-ixp4xx/include/mach/gpio.h -+++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h -@@ -27,47 +27,31 @@ - - #include - #include -+#include /* cansleep wrappers */ - --static inline int gpio_request(unsigned gpio, const char *label) --{ -- return 0; --} -- --static inline void gpio_free(unsigned gpio) --{ -- might_sleep(); -- -- return; --} -- --static inline int gpio_direction_input(unsigned gpio) --{ -- gpio_line_config(gpio, IXP4XX_GPIO_IN); -- return 0; --} -- --static inline int gpio_direction_output(unsigned gpio, int level) --{ -- gpio_line_set(gpio, level); -- gpio_line_config(gpio, IXP4XX_GPIO_OUT); -- return 0; --} -+#define NR_BUILTIN_GPIO 16 - - static inline int gpio_get_value(unsigned gpio) - { -- int value; -- -- gpio_line_get(gpio, &value); -- -- return value; -+ if (gpio < NR_BUILTIN_GPIO) -+ { -+ int value; -+ gpio_line_get(gpio, &value); -+ return value; -+ } -+ else -+ return __gpio_get_value(gpio); - } - - static inline void gpio_set_value(unsigned gpio, int value) - { -- gpio_line_set(gpio, value); -+ if (gpio < NR_BUILTIN_GPIO) -+ gpio_line_set(gpio, value); -+ else -+ __gpio_set_value(gpio, value); - } - --#include /* cansleep wrappers */ -+#define gpio_cansleep __gpio_cansleep - - extern int gpio_to_irq(int gpio); - extern int irq_to_gpio(int gpio); diff --git a/target/linux/ixp4xx/patches-2.6.31/500-usr8200_support.patch b/target/linux/ixp4xx/patches-2.6.31/500-usr8200_support.patch deleted file mode 100644 index 2d78425f4..000000000 --- a/target/linux/ixp4xx/patches-2.6.31/500-usr8200_support.patch +++ /dev/null @@ -1,342 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/Kconfig -+++ b/arch/arm/mach-ixp4xx/Kconfig -@@ -97,6 +97,14 @@ config MACH_SIDEWINDER - Engineering Sidewinder board. For more information on this - platform, see http://www.adiengineering.com - -+config MACH_USR8200 -+ bool "USRobotics USR8200" -+ select PCI -+ help -+ Say 'Y' here if you want your kernel to support the USRobotics -+ USR8200 router board. For more information on this platform, see -+ http://openwrt.org -+ - config MACH_COMPEX - bool "Compex WP18 / NP18A" - select PCI ---- a/arch/arm/mach-ixp4xx/Makefile -+++ b/arch/arm/mach-ixp4xx/Makefile -@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt - obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o - obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o - obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o -+obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o - - obj-y += common.o - -@@ -49,6 +50,7 @@ obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv - obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o - obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o - obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o -+obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o - - obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/usr8200-pci.c -@@ -0,0 +1,78 @@ -+/* -+ * arch/arch/mach-ixp4xx/usr8200-pci.c -+ * -+ * PCI setup routines for USRobotics USR8200 -+ * -+ * Copyright (C) 2008 Peter Denison -+ * -+ * based on pronghorn-pci.c -+ * Copyright (C) 2008 Imre Kaloz -+ * based on coyote-pci.c: -+ * Copyright (C) 2002 Jungo Software Technologies. -+ * Copyright (C) 2003 MontaVista Softwrae, Inc. -+ * -+ * Maintainer: Peter Denison -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+void __init usr8200_pci_preinit(void) -+{ -+ set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); -+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); -+ -+ ixp4xx_pci_preinit(); -+} -+ -+static int __init usr8200_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -+{ -+ if (slot == 14) -+ return IRQ_IXP4XX_GPIO7; -+ else if (slot == 15) -+ return IRQ_IXP4XX_GPIO8; -+ else if (slot == 16) { -+ if (pin == 1) -+ return IRQ_IXP4XX_GPIO11; -+ else if (pin == 2) -+ return IRQ_IXP4XX_GPIO10; -+ else if (pin == 3) -+ return IRQ_IXP4XX_GPIO9; -+ else -+ return -1; -+ } else -+ return -1; -+} -+ -+struct hw_pci usr8200_pci __initdata = { -+ .nr_controllers = 1, -+ .preinit = usr8200_pci_preinit, -+ .swizzle = pci_std_swizzle, -+ .setup = ixp4xx_setup, -+ .scan = ixp4xx_scan_bus, -+ .map_irq = usr8200_map_irq, -+}; -+ -+int __init usr8200_pci_init(void) -+{ -+ if (machine_is_usr8200()) -+ pci_common_init(&usr8200_pci); -+ return 0; -+} -+ -+subsys_initcall(usr8200_pci_init); ---- /dev/null -+++ b/arch/arm/mach-ixp4xx/usr8200-setup.c -@@ -0,0 +1,212 @@ -+/* -+ * arch/arm/mach-ixp4xx/usr8200-setup.c -+ * -+ * Board setup for the USRobotics USR8200 -+ * -+ * Copyright (C) 2008 Peter Denison -+ * -+ * based on pronghorn-setup.c: -+ * Copyright (C) 2008 Imre Kaloz -+ * based on coyote-setup.c: -+ * Copyright (C) 2003-2005 MontaVista Software, Inc. -+ * -+ * Author: Peter Denison -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct flash_platform_data usr8200_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource usr8200_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device usr8200_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev = { -+ .platform_data = &usr8200_flash_data, -+ }, -+ .num_resources = 1, -+ .resource = &usr8200_flash_resource, -+}; -+ -+static struct resource usr8200_uart_resources [] = { -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ }, -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM -+ } -+}; -+ -+static struct plat_serial8250_port usr8200_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { }, -+}; -+ -+static struct platform_device usr8200_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev = { -+ .platform_data = usr8200_uart_data, -+ }, -+ .num_resources = 2, -+ .resource = usr8200_uart_resources, -+}; -+ -+static struct gpio_led usr8200_led_pin[] = { -+ { -+ .name = "usr8200:usb1", -+ .gpio = 0, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:usb2", -+ .gpio = 1, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:ieee1394", -+ .gpio = 2, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:internal", -+ .gpio = 3, -+ .active_low = 1, -+ }, -+ { -+ .name = "usr8200:power", -+ .gpio = 14, -+ } -+}; -+ -+static struct gpio_led_platform_data usr8200_led_data = { -+ .num_leds = ARRAY_SIZE(usr8200_led_pin), -+ .leds = usr8200_led_pin, -+}; -+ -+static struct platform_device usr8200_led = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev.platform_data = &usr8200_led_data, -+}; -+ -+static struct eth_plat_info usr8200_plat_eth[] = { -+ { /* NPEC - LAN with Marvell 88E6060 switch */ -+ .phy = IXP4XX_ETH_PHY_MAX_ADDR, -+ .phy_mask = 0x0F0000, -+ .rxq = 4, -+ .txreadyq = 21, -+ }, { /* NPEB - WAN */ -+ .phy = 9, -+ .rxq = 3, -+ .txreadyq = 20, -+ } -+}; -+ -+static struct platform_device usr8200_eth[] = { -+ { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEC, -+ .dev.platform_data = usr8200_plat_eth, -+ }, { -+ .name = "ixp4xx_eth", -+ .id = IXP4XX_ETH_NPEB, -+ .dev.platform_data = usr8200_plat_eth + 1, -+ } -+}; -+ -+static struct resource usr8200_rtc_resources = { -+ .flags = IORESOURCE_MEM -+}; -+ -+static struct platform_device usr8200_rtc = { -+ .name = "rtc7301", -+ .id = 0, -+ .num_resources = 1, -+ .resource = &usr8200_rtc_resources, -+}; -+ -+static struct platform_device *usr8200_devices[] __initdata = { -+ &usr8200_flash, -+ &usr8200_uart, -+ &usr8200_led, -+ &usr8200_eth[0], -+ &usr8200_eth[1], -+ &usr8200_rtc, -+}; -+ -+static void __init usr8200_init(void) -+{ -+ ixp4xx_sys_init(); -+ -+ usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; -+ -+ usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2); -+ usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff; -+ -+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; -+ *IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN | -+ IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN; -+ *IXP4XX_GPIO_GPCLKR = 0x01100000; -+ -+ /* configure button as input */ -+ gpio_line_config(12, IXP4XX_GPIO_IN); -+ -+ platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices)); -+} -+ -+MACHINE_START(USR8200, "USRobotics USR8200") -+ /* Maintainer: Peter Denison */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .boot_params = 0x0100, -+ .init_machine = usr8200_init, -+MACHINE_END ---- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h -+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h -@@ -43,7 +43,7 @@ static __inline__ void __arch_decomp_set - if (machine_is_adi_coyote() || machine_is_gtwx5715() || - machine_is_gateway7001() || machine_is_wg302v2() || - machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2() || -- machine_is_tw5334()) -+ machine_is_tw5334() || machine_is_usr8200()) - uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; - else - uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-2.6.32/180-tw5334_support.patch b/target/linux/ixp4xx/patches-2.6.32/180-tw5334_support.patch index f59792a53..6370c9983 100644 --- a/target/linux/ixp4xx/patches-2.6.32/180-tw5334_support.patch +++ b/target/linux/ixp4xx/patches-2.6.32/180-tw5334_support.patch @@ -149,7 +149,6 @@ + +static void __init tw5334_init(void) +{ -+ DECLARE_MAC_BUF(mac_buf); + uint8_t __iomem *f; + int i; + @@ -180,10 +179,11 @@ +#endif + iounmap(f); + } -+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 0\n", -+ print_mac(mac_buf, tw5334_plat_eth[0].hwaddr)); -+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 1\n", -+ print_mac(mac_buf, tw5334_plat_eth[1].hwaddr)); ++ ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 0\n", ++ tw5334_plat_eth[0].hwaddr); ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 1\n", ++ tw5334_plat_eth[1].hwaddr); +} + +#ifdef CONFIG_MACH_TW5334 diff --git a/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch b/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch index c3791c690..6753451be 100644 --- a/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch +++ b/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch @@ -398,6 +398,7 @@ +static struct cambria_board_info * __init cambria_find_board_info(char *model) +{ + int i; ++ model[6] = '\0'; + + for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) { + struct cambria_board_info *info = &cambria_boards[i]; @@ -410,10 +411,10 @@ + +static struct memory_accessor *at24_mem_acc; + -+static int at24_setup(struct memory_accessor *mem_acc, void *context) ++static void at24_setup(struct memory_accessor *mem_acc, void *context) +{ + char mac_addr[ETH_ALEN]; -+ char model[6]; ++ char model[7]; + + at24_mem_acc = mem_acc; + @@ -430,7 +431,6 @@ + cambria_info = cambria_find_board_info(model); + } + -+ return 0; +} + +static struct at24_platform_data cambria_eeprom_info = { diff --git a/target/linux/ixp4xx/patches-2.6.32/191-cambria_optional_uart.patch b/target/linux/ixp4xx/patches-2.6.32/191-cambria_optional_uart.patch index e41b7e1ad..0e12f6e87 100644 --- a/target/linux/ixp4xx/patches-2.6.32/191-cambria_optional_uart.patch +++ b/target/linux/ixp4xx/patches-2.6.32/191-cambria_optional_uart.patch @@ -165,7 +165,7 @@ #ifdef CONFIG_SERIAL_8250_AU1X00 case UPIO_AU: #endif -@@ -2451,6 +2471,7 @@ static int serial8250_request_std_resour +@@ -2449,6 +2469,7 @@ static int serial8250_request_std_resour case UPIO_MEM32: case UPIO_MEM: case UPIO_DWAPB: @@ -173,7 +173,7 @@ if (!up->port.mapbase) break; -@@ -2488,6 +2509,7 @@ static void serial8250_release_std_resou +@@ -2486,6 +2507,7 @@ static void serial8250_release_std_resou case UPIO_MEM32: case UPIO_MEM: case UPIO_DWAPB: @@ -181,7 +181,7 @@ if (!up->port.mapbase) break; -@@ -2960,6 +2982,7 @@ static int __devinit serial8250_probe(st +@@ -2958,6 +2980,7 @@ static int __devinit serial8250_probe(st port.serial_in = p->serial_in; port.serial_out = p->serial_out; port.dev = &dev->dev; @@ -189,7 +189,7 @@ if (share_irqs) port.irqflags |= IRQF_SHARED; ret = serial8250_register_port(&port); -@@ -3110,6 +3133,7 @@ int serial8250_register_port(struct uart +@@ -3108,6 +3131,7 @@ int serial8250_register_port(struct uart uart->port.iotype = port->iotype; uart->port.flags = port->flags | UPF_BOOT_AUTOCONF; uart->port.mapbase = port->mapbase; diff --git a/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch index ca8cae12c..d3ccb045c 100644 --- a/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch +++ b/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch @@ -147,6 +147,7 @@ +static struct avila_board_info * __init avila_find_board_info(char *model) +{ + int i; ++ model[6] = '\0'; + + for (i = 0; i < ARRAY_SIZE(avila_boards); i++) { + struct avila_board_info *info = &avila_boards[i]; @@ -159,10 +160,10 @@ + +static struct memory_accessor *at24_mem_acc; + -+static int at24_setup(struct memory_accessor *mem_acc, void *context) ++static void at24_setup(struct memory_accessor *mem_acc, void *context) +{ + char mac_addr[ETH_ALEN]; -+ char model[6]; ++ char model[7]; + + at24_mem_acc = mem_acc; + @@ -179,7 +180,6 @@ + avila_info = avila_find_board_info(model); + } + -+ return 0; +} + +static struct at24_platform_data avila_eeprom_info = { diff --git a/target/linux/octeon/config-2.6.30 b/target/linux/octeon/config-2.6.30 new file mode 100644 index 000000000..5054d158a --- /dev/null +++ b/target/linux/octeon/config-2.6.30 @@ -0,0 +1,269 @@ +# CONFIG_32BIT is not set +CONFIG_64BIT=y +CONFIG_64BIT_PHYS_ADDR=y +# CONFIG_ALTERA_PCIE_CHDMA is not set +# CONFIG_ANDROID is not set +# CONFIG_ANDROID_BINDER_IPC is not set +# CONFIG_ANDROID_LOGGER is not set +# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set +# CONFIG_ANDROID_RAM_CONSOLE is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_ARCH_SUPPORTS_OPROFILE=y +# CONFIG_ARPD is not set +# CONFIG_B3DFG is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_BCM47XX is not set +# CONFIG_BINARY_PRINTF is not set +CONFIG_BINFMT_ELF32=y +CONFIG_BITREVERSE=y +CONFIG_BLOCK_COMPAT=y +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BSD_PROCESS_ACCT_V3=y +# CONFIG_CAVIUM_OCTEON_2ND_KERNEL is not set +CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2 +CONFIG_CAVIUM_OCTEON_HW_FIX_UNALIGNED=y +CONFIG_CAVIUM_OCTEON_LOCK_L2=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB=y +CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD=y +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +CONFIG_CAVIUM_OCTEON_SPECIFIC_OPTIONS=y +CONFIG_CEVT_R4K=y +CONFIG_CEVT_R4K_LIB=y +# CONFIG_CGROUP_SCHED is not set +CONFIG_CMDLINE="console=ttyS0,115200" +# CONFIG_COMEDI is not set +CONFIG_COMPAT=y +CONFIG_COMPAT_BRK=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CAVIUM_OCTEON=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +# CONFIG_CPU_LITTLE_ENDIAN is not set +# CONFIG_CPU_LOONGSON2 is not set +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +CONFIG_CPU_MIPSR2=y +# CONFIG_CPU_NEVADA is not set +# CONFIG_CPU_R10000 is not set +# CONFIG_CPU_R3000 is not set +# CONFIG_CPU_R4300 is not set +# CONFIG_CPU_R4X00 is not set +# CONFIG_CPU_R5000 is not set +# CONFIG_CPU_R5432 is not set +# CONFIG_CPU_R5500 is not set +# CONFIG_CPU_R6000 is not set +# CONFIG_CPU_R8000 is not set +# CONFIG_CPU_RM7000 is not set +# CONFIG_CPU_RM9000 is not set +# CONFIG_CPU_SB1 is not set +CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +# CONFIG_CPU_TX39XX is not set +# CONFIG_CPU_TX49XX is not set +# CONFIG_CPU_VR41XX is not set +CONFIG_CRAMFS=y +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_SPINLOCK_SLEEP=y +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DETECT_SOFTLOCKUP=y +CONFIG_DEVKMEM=y +CONFIG_DEVPORT=y +# CONFIG_DM9000 is not set +CONFIG_DMA_COHERENT=y +CONFIG_DNOTIFY=y +# CONFIG_DST is not set +CONFIG_EARLY_PRINTK=y +# CONFIG_ECHO is not set +CONFIG_ELF_CORE=y +CONFIG_ENABLE_MUST_CHECK=y +# CONFIG_ET131X is not set +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_FAULT_INJECTION is not set +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FRAME_WARN=2048 +# CONFIG_FW_LOADER is not set +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_GROUP_SCHED=y +# CONFIG_HAMRADIO is not set +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_IDE=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_HAVE_MLOCK=y +CONFIG_HAVE_MLOCKED_PAGE_BIT=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_SYSCALL_WRAPPERS=y +# CONFIG_HECI is not set +# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_OCTEON=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_IRQ_CPU=y +CONFIG_IRQ_CPU_OCTEON=y +CONFIG_IRQ_PER_CPU=y +# CONFIG_ISDN is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_KEXEC=y +# CONFIG_KGDB is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +# CONFIG_LEMOTE_FULONG is not set +CONFIG_LOCK_KERNEL=y +# CONFIG_LOCK_STAT is not set +# CONFIG_MACH_ALCHEMY is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MACH_VR41XX is not set +CONFIG_MAGIC_SYSRQ=y +# CONFIG_ME4000 is not set +# CONFIG_MEILHAUS is not set +# CONFIG_MIKROTIK_RB532 is not set +CONFIG_MIPS=y +CONFIG_MIPS32_COMPAT=y +CONFIG_MIPS32_N32=y +CONFIG_MIPS32_O32=y +# CONFIG_MIPS_COBALT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=7 +# CONFIG_MIPS_MACHINE is not set +# CONFIG_MIPS_MALTA is not set +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_MIPS_MT_SMP is not set +# CONFIG_MIPS_MT_SMTC is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_MISC_DEVICES is not set +# CONFIG_MTD_CFI_INTELEXT is not set +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_NETWORK_FILESYSTEMS is not set +# CONFIG_NO_IOPORT is not set +CONFIG_NR_CPUS=16 +CONFIG_NR_CPUS_DEFAULT_16=y +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +CONFIG_OCTEON_ETHERNET=y +CONFIG_OCTEON_MGMT=y +CONFIG_PAGEFLAGS_EXTENDED=y +# CONFIG_PAGE_POISONING is not set +# CONFIG_PARTITION_ADVANCED is not set +# CONFIG_PCI_DEBUG is not set +CONFIG_PCI_DOMAINS=y +CONFIG_PHYS_ADDR_T_64BIT=y +# CONFIG_PLAN9AUTH is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_POHMELFS is not set +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_PROBE_INITRD_HEADER is not set +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_PROVE_LOCKING is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RELAY=y +# CONFIG_RTL8187SE is not set +# CONFIG_RT_GROUP_SCHED is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_RUNTIME_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +# CONFIG_SCSI_DMA is not set +CONFIG_SECCOMP=y +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SLOW_WORK is not set +CONFIG_SMP=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_STAGING=y +# CONFIG_STAGING_EXCLUDE_BUILD is not set +CONFIG_STOP_MACHINE=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HIGHMEM=y +CONFIG_SYS_SUPPORTS_SMP=y +# CONFIG_TC35815 is not set +# CONFIG_TIMER_STATS is not set +CONFIG_TRACING_SUPPORT=y +CONFIG_UNEVICTABLE_LRU=y +CONFIG_USB_SUPPORT=y +CONFIG_USER_SCHED=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +# CONFIG_VLAN_8021Q is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WEAK_ORDERING=y +CONFIG_WEAK_REORDERING_BEYOND_LLSC=y +# CONFIG_WLAN_80211 is not set +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/octeon/patches/001-handle_removal_h_constraint.patch b/target/linux/octeon/patches-2.6.30/001-handle_removal_h_constraint.patch similarity index 100% rename from target/linux/octeon/patches/001-handle_removal_h_constraint.patch rename to target/linux/octeon/patches-2.6.30/001-handle_removal_h_constraint.patch diff --git a/target/linux/octeon/patches/002-register_defs_pci.patch b/target/linux/octeon/patches-2.6.30/002-register_defs_pci.patch similarity index 100% rename from target/linux/octeon/patches/002-register_defs_pci.patch rename to target/linux/octeon/patches-2.6.30/002-register_defs_pci.patch diff --git a/target/linux/octeon/patches/003_pci_pcie_support.patch b/target/linux/octeon/patches-2.6.30/003_pci_pcie_support.patch similarity index 100% rename from target/linux/octeon/patches/003_pci_pcie_support.patch rename to target/linux/octeon/patches-2.6.30/003_pci_pcie_support.patch diff --git a/target/linux/octeon/patches/004-named_alloc_function.patch b/target/linux/octeon/patches-2.6.30/004-named_alloc_function.patch similarity index 100% rename from target/linux/octeon/patches/004-named_alloc_function.patch rename to target/linux/octeon/patches-2.6.30/004-named_alloc_function.patch diff --git a/target/linux/octeon/patches/005-register_defs_octeon_mgmt.patch b/target/linux/octeon/patches-2.6.30/005-register_defs_octeon_mgmt.patch similarity index 100% rename from target/linux/octeon/patches/005-register_defs_octeon_mgmt.patch rename to target/linux/octeon/patches-2.6.30/005-register_defs_octeon_mgmt.patch diff --git a/target/linux/octeon/patches/006-octeon_mgmt_driver.patch b/target/linux/octeon/patches-2.6.30/006-octeon_mgmt_driver.patch similarity index 100% rename from target/linux/octeon/patches/006-octeon_mgmt_driver.patch rename to target/linux/octeon/patches-2.6.30/006-octeon_mgmt_driver.patch diff --git a/target/linux/octeon/patches/007-export_cvmx_sysinfo.patch b/target/linux/octeon/patches-2.6.30/007-export_cvmx_sysinfo.patch similarity index 100% rename from target/linux/octeon/patches/007-export_cvmx_sysinfo.patch rename to target/linux/octeon/patches-2.6.30/007-export_cvmx_sysinfo.patch diff --git a/target/linux/octeon/patches/008-more_board_types_constraints.patch b/target/linux/octeon/patches-2.6.30/008-more_board_types_constraints.patch similarity index 100% rename from target/linux/octeon/patches/008-more_board_types_constraints.patch rename to target/linux/octeon/patches-2.6.30/008-more_board_types_constraints.patch diff --git a/target/linux/octeon/patches/009-more_chip_specific_feature_tests.patch b/target/linux/octeon/patches-2.6.30/009-more_chip_specific_feature_tests.patch similarity index 100% rename from target/linux/octeon/patches/009-more_chip_specific_feature_tests.patch rename to target/linux/octeon/patches-2.6.30/009-more_chip_specific_feature_tests.patch diff --git a/target/linux/octeon/patches/010-export_erratum_function.patch b/target/linux/octeon/patches-2.6.30/010-export_erratum_function.patch similarity index 100% rename from target/linux/octeon/patches/010-export_erratum_function.patch rename to target/linux/octeon/patches-2.6.30/010-export_erratum_function.patch diff --git a/target/linux/octeon/patches/011-octeon_ethernet_driver.patch b/target/linux/octeon/patches-2.6.30/011-octeon_ethernet_driver.patch similarity index 100% rename from target/linux/octeon/patches/011-octeon_ethernet_driver.patch rename to target/linux/octeon/patches-2.6.30/011-octeon_ethernet_driver.patch diff --git a/target/linux/octeon/patches/012-hook_up_eth_driver.patch b/target/linux/octeon/patches-2.6.30/012-hook_up_eth_driver.patch similarity index 100% rename from target/linux/octeon/patches/012-hook_up_eth_driver.patch rename to target/linux/octeon/patches-2.6.30/012-hook_up_eth_driver.patch diff --git a/target/linux/octeon/patches/013-compile_fixes.patch b/target/linux/octeon/patches-2.6.30/013-compile_fixes.patch similarity index 100% rename from target/linux/octeon/patches/013-compile_fixes.patch rename to target/linux/octeon/patches-2.6.30/013-compile_fixes.patch diff --git a/target/linux/octeon/patches/015-no_werror.patch b/target/linux/octeon/patches-2.6.30/015-no_werror.patch similarity index 100% rename from target/linux/octeon/patches/015-no_werror.patch rename to target/linux/octeon/patches-2.6.30/015-no_werror.patch diff --git a/target/linux/octeon/patches/016-octeon_hw_rng.patch b/target/linux/octeon/patches-2.6.30/016-octeon_hw_rng.patch similarity index 100% rename from target/linux/octeon/patches/016-octeon_hw_rng.patch rename to target/linux/octeon/patches-2.6.30/016-octeon_hw_rng.patch diff --git a/target/linux/octeon/patches/017-platform_devices.patch b/target/linux/octeon/patches-2.6.30/017-platform_devices.patch similarity index 100% rename from target/linux/octeon/patches/017-platform_devices.patch rename to target/linux/octeon/patches-2.6.30/017-platform_devices.patch diff --git a/target/linux/octeon/patches/018-dwc_otg.patch b/target/linux/octeon/patches-2.6.30/018-dwc_otg.patch similarity index 100% rename from target/linux/octeon/patches/018-dwc_otg.patch rename to target/linux/octeon/patches-2.6.30/018-dwc_otg.patch diff --git a/target/linux/octeon/patches/100-wndap330_hacks.patch b/target/linux/octeon/patches-2.6.30/100-wndap330_hacks.patch similarity index 100% rename from target/linux/octeon/patches/100-wndap330_hacks.patch rename to target/linux/octeon/patches-2.6.30/100-wndap330_hacks.patch diff --git a/target/linux/octeon/patches/105-nb5_fixup.patch b/target/linux/octeon/patches-2.6.30/105-nb5_fixup.patch similarity index 100% rename from target/linux/octeon/patches/105-nb5_fixup.patch rename to target/linux/octeon/patches-2.6.30/105-nb5_fixup.patch diff --git a/target/linux/octeon/patches/106-no_module_reloc.patch b/target/linux/octeon/patches-2.6.30/106-no_module_reloc.patch similarity index 100% rename from target/linux/octeon/patches/106-no_module_reloc.patch rename to target/linux/octeon/patches-2.6.30/106-no_module_reloc.patch diff --git a/target/linux/omap35xx/config-2.6.32 b/target/linux/omap35xx/config-2.6.32 index 5b79b4276..d08ff8900 100644 --- a/target/linux/omap35xx/config-2.6.32 +++ b/target/linux/omap35xx/config-2.6.32 @@ -674,14 +674,11 @@ CONFIG_INPUT_EVDEV=y # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADP5588 is not set CONFIG_KEYBOARD_ATKBD=y -# CONFIG_QT2160 is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_GPIO is not set # CONFIG_KEYBOARD_MATRIX is not set # CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_MAX7359 is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_OPENCORES is not set # CONFIG_KEYBOARD_STOWAWAY is not set diff --git a/target/linux/pxcab/base-files/lib/preinit/45_failsafe_pxcab b/target/linux/pxcab/base-files/lib/preinit/45_failsafe_pxcab index 97392774d..dd7330d5d 100644 --- a/target/linux/pxcab/base-files/lib/preinit/45_failsafe_pxcab +++ b/target/linux/pxcab/base-files/lib/preinit/45_failsafe_pxcab @@ -4,7 +4,7 @@ failsafe_wait() { FAILSAFE= - grep 'failsafe=' /proc/cmdline > /dev/null && FAILSAFE=true && export FAILSAFE + grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE if [ "$FAILSAFE" != "true" ]; then preinit_net_echo "Please press button now to enter failsafe" echo -n "Press " diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile index cf094f396..ceef88e58 100644 --- a/target/linux/ramips/Makefile +++ b/target/linux/ramips/Makefile @@ -13,7 +13,7 @@ SUBTARGETS:=rt288x rt305x CFLAGS:=-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time FEATURES:=squashfs broken -LINUX_VERSION:=2.6.30.10 +LINUX_VERSION:=2.6.32.7 include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES+=kmod-leds-gpio diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-buttons.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-buttons.h new file mode 100644 index 000000000..c1ae71e8f --- /dev/null +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-buttons.h @@ -0,0 +1,31 @@ +/* + * Ralink SoC GPIO button support + * + * Copyright (C) 2010 Gabor Juhos + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#ifndef __ASM_MACH_RALINK_DEV_GPIO_BUTTONS_H +#define __ASM_MACH_RALINK_DEV_GPIO_BUTTONS_H + +#include +#include + +#ifdef CONFIG_RALINK_DEV_GPIO_BUTTONS +void __init ramips_register_gpio_buttons(int id, + unsigned poll_interval, + unsigned nbuttons, + struct gpio_button *buttons); +#else +static inline void ramips_register_gpio_buttons(int id, + unsigned poll_interval, + unsigned nbuttons, + struct gpio_button *buttons); +{ +} +#endif + +#endif /* __ASM_MACH_RALINK_DEV_GPIO_BUTTONS_H */ diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev_gpio_leds.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-leds.h similarity index 88% rename from target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev_gpio_leds.h rename to target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-leds.h index 1d6fbc29d..ad2ed2667 100644 --- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev_gpio_leds.h +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-leds.h @@ -1,7 +1,7 @@ /* * Ralink SoC GPIO LED device support * - * Copyright (C) 2009 Gabor Juhos + * Copyright (C) 2009-2010 Gabor Juhos * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -11,7 +11,7 @@ #ifndef __ASM_MACH_RALINK_DEV_GPIO_LEDS_H #define __ASM_MACH_RALINK_DEV_GPIO_LEDS_H -struct gpio_led; +#include #ifdef CONFIG_RALINK_DEV_GPIO_LEDS __init void ramips_register_gpio_leds(int id, unsigned num_leds, diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h index 08e939d5d..22e2b6462 100644 --- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h @@ -9,6 +9,8 @@ * by the Free Software Foundation. */ +#include + enum ramips_mach_type { RAMIPS_MACH_GENERIC, /* RT2880 based machines */ @@ -23,5 +25,3 @@ enum ramips_mach_type { RAMIPS_MACH_WHR_G300N, /* Buffalo WHR-G300N */ RAMIPS_MACH_FONERA20N, /* La Fonera 2.0N */ }; - -extern enum ramips_mach_type ramips_mach; diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h index a60a572f5..ec1e7d4fa 100644 --- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h @@ -24,6 +24,7 @@ struct ramips_eth_platform_data unsigned char mac[6]; void (*reset_fe)(void); int min_pkt_len; + unsigned long sys_freq; }; #endif /* _RAMIPS_ETH_PLATFORM_H */ diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h index b2be7e508..1dd6c2dce 100644 --- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h @@ -1,7 +1,7 @@ /* * Ralink RT288x SoC register definitions * - * Copyright (C) 2008-2009 Gabor Juhos + * Copyright (C) 2008-2010 Gabor Juhos * Copyright (C) 2008 Imre Kaloz * * This program is free software; you can redistribute it and/or modify it @@ -23,10 +23,11 @@ #define RT2880_I2C_BASE 0x00300900 #define RT2880_SPI_BASE 0x00300b00 #define RT2880_UART1_BASE 0x00300c00 -#define RT2880_FE_BASE 0x00310000 -#define RT2880_ROM_BASE 0x00400000 +#define RT2880_FE_BASE 0x00400000 +#define RT2880_ROM_BASE 0x00410000 +#define RT2880_PCM_BASE 0x00420000 #define RT2880_PCI_BASE 0x00440000 -#define RT2880_WMAC_BASE 0x00600000 +#define RT2880_WMAC_BASE 0x00480000 #define RT2880_FLASH1_BASE 0x01000000 #define RT2880_FLASH0_BASE 0x1fc00000 #define RT2880_SDRAM_BASE 0x08000000 diff --git a/target/linux/ramips/files/arch/mips/ralink/Kconfig b/target/linux/ramips/files/arch/mips/ralink/Kconfig index fac5c7bfd..c30dbe1c3 100644 --- a/target/linux/ramips/files/arch/mips/ralink/Kconfig +++ b/target/linux/ramips/files/arch/mips/ralink/Kconfig @@ -48,6 +48,9 @@ config SOC_RT305X select SYS_HAS_EARLY_PRINTK select MIPS_MACHINE +config RALINK_DEV_GPIO_BUTTONS + def_bool n + config RALINK_DEV_GPIO_LEDS def_bool n diff --git a/target/linux/ramips/files/arch/mips/ralink/common/Makefile b/target/linux/ramips/files/arch/mips/ralink/common/Makefile index c2cf48bcb..adab85f68 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/Makefile +++ b/target/linux/ramips/files/arch/mips/ralink/common/Makefile @@ -1,7 +1,7 @@ # # Makefile for the Ralink common stuff # -# Copyright (C) 2009 Gabor Juhos +# Copyright (C) 2009-2010 Gabor Juhos # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -9,4 +9,5 @@ obj-y := prom.o setup.o intc.o gpio.o +obj-$(CONFIG_RALINK_DEV_GPIO_BUTTONS) += dev-gpio-buttons.o obj-$(CONFIG_RALINK_DEV_GPIO_LEDS) += dev-gpio-leds.o diff --git a/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-buttons.c b/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-buttons.c new file mode 100644 index 000000000..f32300129 --- /dev/null +++ b/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-buttons.c @@ -0,0 +1,57 @@ +/* + * Ralink SoC GPIO button support + * + * Copyright (C) 2010 Gabor Juhos + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include "linux/init.h" +#include + +#include + +void __init ramips_register_gpio_buttons(int id, + unsigned poll_interval, + unsigned nbuttons, + struct gpio_button *buttons) +{ + struct platform_device *pdev; + struct gpio_buttons_platform_data pdata; + struct gpio_button *p; + int err; + + p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL); + if (!p) + return; + + memcpy(p, buttons, nbuttons * sizeof(*p)); + + pdev = platform_device_alloc("gpio-buttons", id); + if (!pdev) + goto err_free_buttons; + + memset(&pdata, 0, sizeof(pdata)); + pdata.poll_interval = poll_interval; + pdata.nbuttons = nbuttons; + pdata.buttons = p; + + err = platform_device_add_data(pdev, &pdata, sizeof(pdata)); + if (err) + goto err_put_pdev; + + + err = platform_device_add(pdev); + if (err) + goto err_put_pdev; + + return; + +err_put_pdev: + platform_device_put(pdev); + +err_free_buttons: + kfree(p); +} diff --git a/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-leds.c b/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-leds.c index 96651e7b9..2ab187d15 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-leds.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-leds.c @@ -10,9 +10,8 @@ #include #include -#include -#include +#include void __init ramips_register_gpio_leds(int id, unsigned num_leds, struct gpio_led *leds) diff --git a/target/linux/ramips/files/arch/mips/ralink/common/gpio.c b/target/linux/ramips/files/arch/mips/ralink/common/gpio.c index 3a1b03863..892f15b1e 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/gpio.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/gpio.c @@ -131,7 +131,7 @@ static int ramips_gpio_get(struct gpio_chip *chip, unsigned offset) u32 t; t = ramips_gpio_rr(rg, RAMIPS_GPIO_REG_DATA); - return (t & (1 << offset)); + return !!(t & (1 << offset)); } static struct ramips_gpio_chip ramips_gpio_chip0 = { diff --git a/target/linux/ramips/files/arch/mips/ralink/common/prom.c b/target/linux/ramips/files/arch/mips/ralink/common/prom.c index 154d5f9f2..fb37274ff 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/prom.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/prom.c @@ -20,33 +20,6 @@ #include #include -struct board_rec { - char *name; - enum ramips_mach_type mach_type; -}; - -static struct board_rec boards[] __initdata = { - { - .name = "RT-N15", - .mach_type = RAMIPS_MACH_RT_N15, - }, { - .name = "WZR-AGL300NH", - .mach_type = RAMIPS_MACH_WZR_AGL300NH, - }, { - .name = "DIR-300-revB", - .mach_type = RAMIPS_MACH_DIR_300_REVB, - }, { - .name = "V22RW-2X2", - .mach_type = RAMIPS_MACH_V22RW_2X2, - }, { - .name = "WHR-G300N", - .mach_type = RAMIPS_MACH_WHR_G300N, - }, { - .name = "FONERA20N", - .mach_type = RAMIPS_MACH_FONERA20N, - } -}; - static inline void *to_ram_addr(void *addr) { u32 base; @@ -164,20 +137,6 @@ static __init char *prom_append_env(char **env, const char *envname) #undef PROM_MAX_ENVS } -static __init int ramips_board_setup(char *name) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(boards); i++) - if (strcmp(name, boards[i].name) == 0) { - ramips_mach = boards[i].mach_type; - break; - } - - return 1; -} -__setup("board=", ramips_board_setup); - void __init prom_init(void) { int argc; diff --git a/target/linux/ramips/files/arch/mips/ralink/common/setup.c b/target/linux/ramips/files/arch/mips/ralink/common/setup.c index 3030fcd15..877d0b7de 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/setup.c @@ -16,14 +16,12 @@ #include #include -#include #include #include #include unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN]; -enum ramips_mach_type ramips_mach = RAMIPS_MACH_GENERIC; const char *get_system_type(void) { @@ -76,9 +74,11 @@ void __init plat_mem_setup(void) ramips_soc_setup(); } +__setup("board=", mips_machtype_setup); + static int __init ramips_machine_setup(void) { - mips_machine_setup(ramips_mach); + mips_machine_setup(); return 0; } @@ -88,4 +88,5 @@ static void __init ramips_generic_init(void) { } -MIPS_MACHINE(RAMIPS_MACH_GENERIC, "Generic Ralink board", ramips_generic_init); +MIPS_MACHINE(RAMIPS_MACH_GENERIC, "Generic", "Generic Ralink board", + ramips_generic_init); diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/Kconfig b/target/linux/ramips/files/arch/mips/ralink/rt288x/Kconfig index 1b0b85468..857f4d32b 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/Kconfig +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/Kconfig @@ -5,6 +5,7 @@ menu "Ralink RT288x machine selection" config RT288X_MACH_RT_N15 bool "Asus RT-N15 board support" default y + select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS config RT288X_MACH_WZR_AGL300NH diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-rt-n15.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-rt-n15.c index 26f08845b..d6bebf494 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-rt-n15.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-rt-n15.c @@ -1,7 +1,7 @@ /* * Asus RT-N15 board support * - * Copyright (C) 2009 Gabor Juhos + * Copyright (C) 2009-2010 Gabor Juhos * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -13,11 +13,11 @@ #include #include #include -#include +#include -#include #include -#include +#include +#include #include #include @@ -27,6 +27,11 @@ #define RT_N15_GPIO_BUTTON_WPS 0 #define RT_N15_GPIO_BUTTON_RESET 12 +#define RT_N15_GPIO_RTL8366_SCK 2 +#define RT_N15_GPIO_RTL8366_SDA 1 + +#define RT_N15_BUTTONS_POLL_INTERVAL 20 + #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition rt_n15_partitions[] = { { @@ -75,14 +80,51 @@ static struct gpio_led rt_n15_leds_gpio[] __initdata = { } }; +static struct gpio_button rt_n15_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = BTN_0, + .threshold = 3, + .gpio = RT_N15_GPIO_BUTTON_RESET, + .active_low = 1, + }, { + .desc = "wps", + .type = EV_KEY, + .code = BTN_1, + .threshold = 3, + .gpio = RT_N15_GPIO_BUTTON_WPS, + .active_low = 1, + } +}; + +static struct rtl8366s_platform_data rt_n15_rtl8366s_data = { + .gpio_sda = RT_N15_GPIO_RTL8366_SDA, + .gpio_sck = RT_N15_GPIO_RTL8366_SCK, +}; + +static struct platform_device rt_n15_rtl8366s_device = { + .name = RTL8366S_DRIVER_NAME, + .id = -1, + .dev = { + .platform_data = &rt_n15_rtl8366s_data, + } +}; + static void __init rt_n15_init(void) { - rt288x_gpio_init(RT2880_GPIO_MODE_UART0); + rt288x_gpio_init(RT2880_GPIO_MODE_UART0 | RT2880_GPIO_MODE_I2C); rt288x_register_flash(0, &rt_n15_flash_data); ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n15_leds_gpio), rt_n15_leds_gpio); + + ramips_register_gpio_buttons(-1, RT_N15_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(rt_n15_gpio_buttons), + rt_n15_gpio_buttons); + + platform_device_register(&rt_n15_rtl8366s_device); } -MIPS_MACHINE(RAMIPS_MACH_RT_N15, "Asus RT-N15", rt_n15_init); +MIPS_MACHINE(RAMIPS_MACH_RT_N15, "RT-N15", "Asus RT-N15", rt_n15_init); diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-wzr-agl300nh.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-wzr-agl300nh.c index c0a09cfb3..d37af91ab 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-wzr-agl300nh.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/mach-wzr-agl300nh.c @@ -13,34 +13,24 @@ #include #include #include -#include -#include #include -#include #include #include #include "devices.h" -#if 0 -#define WZR_AGL300NH_GPIO_LED_POWER XX -#define WZR_AGL300NH_GPIO_BUTTON_AOSS XX -#define WZR_AGL300NH_GPIO_BUTTON_RESET XX -#endif // 0 +/* + * MTD layout from stock firmware: + * mtd0: 00030000 00010000 "uboot" + * mtd1: 00010000 00010000 "uboot_environ" + * mtd2: 00010000 00010000 "factory_default" + * mtd3: 000b0000 00010000 "linux" + * mtd4: 002f0000 00010000 "rootfs" + * mtd5: 00010000 00010000 "user_property" + */ #ifdef CONFIG_MTD_PARTITIONS - -/* -From stock firmware: -mtd0: 00030000 00010000 "uboot" -mtd1: 00010000 00010000 "uboot_environ" -mtd2: 00010000 00010000 "factory_default" -mtd3: 000b0000 00010000 "linux" -mtd4: 002f0000 00010000 "rootfs" -mtd5: 00010000 00010000 "user_property" -*/ - static struct mtd_partition wzr_agl300nh_partitions[] = { { .name = "uboot", @@ -80,26 +70,12 @@ static struct physmap_flash_data wzr_agl300nh_flash_data = { #endif }; -#if 0 -static struct gpio_led wzr_agl300nh_leds_gpio[] __initdata = { - { - .name = "wzr-agl300nh:green:power", - .gpio = WZR_AGL300NH_GPIO_LED_POWER, - .active_low = ??, - } -}; -#endif - static void __init wzr_agl300nh_init(void) { rt288x_gpio_init(RT2880_GPIO_MODE_UART0); rt288x_register_flash(0, &wzr_agl300nh_flash_data); - -/* - ramips_register_gpio_leds(-1, ARRAY_SIZE(wzr_agl300nh_leds_gpio), - wzr_agl300nh_leds_gpio); -*/ } -MIPS_MACHINE(RAMIPS_MACH_WZR_AGL300NH, "Buffalo WZR-AGL300NH", wzr_agl300nh_init); +MIPS_MACHINE(RAMIPS_MACH_WZR_AGL300NH, "WZR-AGL300NH", + "Buffalo WZR-AGL300NH", wzr_agl300nh_init); diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig b/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig index ef52c05df..532e471d7 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig @@ -5,21 +5,25 @@ menu "Ralink RT350x machine selection" config RT305X_MACH_WHR_G300N bool "Buffalo WHR-G300N support" default y + select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS config RT305X_MACH_DIR_300_REVB bool "D-Link DIR-300 revB board support" default y + select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS config RT305X_MACH_V22RW_2X2 bool "Ralink AP-RT3052-V22RW-2X2 board support" default y + select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS config RT305X_MACH_FONERA20N bool "La Fonera20N board support" default y + select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS endmenu diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c index 4ad93b580..6a810a3a0 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c @@ -118,7 +118,7 @@ static struct resource rt305x_eth_resources[] = { static struct ramips_eth_platform_data ramips_eth_data = { .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }, .reset_fe = rt305x_fe_reset, - .min_pkt_len = 64 + .min_pkt_len = 64, }; static struct platform_device rt305x_eth_device = { @@ -132,5 +132,7 @@ static struct platform_device rt305x_eth_device = { void __init rt305x_register_ethernet(void) { + ramips_eth_data.sys_freq = rt305x_sys_freq; + platform_device_register(&rt305x_eth_device); } diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-300-revb.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-300-revb.c index 86152b99e..dd2a5f474 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-300-revb.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-300-revb.c @@ -1,7 +1,7 @@ /* * D-Link DIR-300 rev B board support * - * Copyright (C) 2009 Gabor Juhos + * Copyright (C) 2009-2010 Gabor Juhos * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -13,11 +13,10 @@ #include #include #include -#include -#include #include -#include +#include +#include #include #include @@ -30,6 +29,8 @@ #define DIR_300B_GPIO_BUTTON_WPS 0 /* active low */ #define DIR_300B_GPIO_BUTTON_RESET 10 /* active low */ +#define DIR_300B_BUTTONS_POLL_INTERVAL 20 + #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition dir_300b_partitions[] = { { @@ -86,6 +87,24 @@ static struct gpio_led dir_300b_leds_gpio[] __initdata = { } }; +static struct gpio_button dir_300b_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = BTN_0, + .threshold = 3, + .gpio = DIR_300B_GPIO_BUTTON_RESET, + .active_low = 1, + }, { + .desc = "wps", + .type = EV_KEY, + .code = BTN_1, + .threshold = 3, + .gpio = DIR_300B_GPIO_BUTTON_WPS, + .active_low = 1, + } +}; + static void __init dir_300b_init(void) { rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); @@ -94,6 +113,10 @@ static void __init dir_300b_init(void) rt305x_register_ethernet(); ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_300b_leds_gpio), dir_300b_leds_gpio); + ramips_register_gpio_buttons(-1, DIR_300B_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(dir_300b_gpio_buttons), + dir_300b_gpio_buttons); } -MIPS_MACHINE(RAMIPS_MACH_DIR_300_REVB, "D-Link DIR-300 revB", dir_300b_init); +MIPS_MACHINE(RAMIPS_MACH_DIR_300_REVB, "DIR-300-revB", "D-Link DIR-300 revB", + dir_300b_init); diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-fonera20n.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-fonera20n.c index 3a444caeb..6dc4b9d3f 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-fonera20n.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-fonera20n.c @@ -2,6 +2,7 @@ * La Fonera20N board support * * Copyright (C) 2009 John Crispin + * Copyright (C) 2010 Gabor Juhos * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -13,11 +14,10 @@ #include #include #include -#include -#include #include -#include +#include +#include #include #include @@ -29,6 +29,8 @@ #define FONERA20N_GPIO_LED_POWER 9 #define FONERA20N_GPIO_LED_USB 14 +#define FONERA20N_BUTTONS_POLL_INTERVAL 20 + #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition fonera20n_partitions[] = { { @@ -85,6 +87,24 @@ static struct gpio_led fonera20n_leds_gpio[] __initdata = { } }; +static struct gpio_button fonera20n_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = BTN_0, + .threshold = 3, + .gpio = FONERA20N_GPIO_BUTTON_RESET, + .active_low = 1, + }, { + .desc = "switch", + .type = EV_KEY, + .code = BTN_1, + .threshold = 3, + .gpio = FONERA20N_GPIO_SWITCH, + .active_low = 1, + } +}; + static void __init fonera20n_init(void) { rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); @@ -94,7 +114,12 @@ static void __init fonera20n_init(void) ramips_register_gpio_leds(-1, ARRAY_SIZE(fonera20n_leds_gpio), fonera20n_leds_gpio); + ramips_register_gpio_buttons(-1, FONERA20N_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(fonera20n_gpio_buttons), + fonera20n_gpio_buttons); + rt305x_register_ethernet(); } -MIPS_MACHINE(RAMIPS_MACH_FONERA20N, "La Fonera 2.0N", fonera20n_init); +MIPS_MACHINE(RAMIPS_MACH_FONERA20N, "FONERA20N", "La Fonera 2.0N", + fonera20n_init); diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-v22rw-2x2.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-v22rw-2x2.c index 64466e2ee..89822c3cf 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-v22rw-2x2.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-v22rw-2x2.c @@ -1,7 +1,7 @@ /* * Ralink AP-RT3052-V22RW-2X2 board support * - * Copyright (C) 2009 Gabor Juhos + * Copyright (C) 2009-2010 Gabor Juhos * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -13,11 +13,10 @@ #include #include #include -#include -#include #include -#include +#include +#include #include #include @@ -28,6 +27,8 @@ #define V22RW_2X2_GPIO_LED_SECURITY 13 #define V22RW_2X2_GPIO_LED_WPS 14 +#define V22RW_2X2_BUTTONS_POLL_INTERVAL 20 + #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition v22rw_2x2_partitions[] = { { @@ -80,6 +81,24 @@ static struct gpio_led v22rw_2x2_leds_gpio[] __initdata = { } }; +static struct gpio_button v22rw_2x2_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = BTN_0, + .threshold = 3, + .gpio = V22RW_2X2_GPIO_BUTTON_SWRST, + .active_low = 1, + }, { + .desc = "wps", + .type = EV_KEY, + .code = BTN_1, + .threshold = 3, + .gpio = V22RW_2X2_GPIO_BUTTON_WPS, + .active_low = 1, + } +}; + static void __init v22rw_2x2_init(void) { rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); @@ -88,7 +107,10 @@ static void __init v22rw_2x2_init(void) rt305x_register_ethernet(); ramips_register_gpio_leds(-1, ARRAY_SIZE(v22rw_2x2_leds_gpio), v22rw_2x2_leds_gpio); + ramips_register_gpio_buttons(-1, V22RW_2X2_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(v22rw_2x2_gpio_buttons), + v22rw_2x2_gpio_buttons); } -MIPS_MACHINE(RAMIPS_MACH_V22RW_2X2, "Ralink AP-RT3052-V22RW-2X2", +MIPS_MACHINE(RAMIPS_MACH_V22RW_2X2, "V22RW-2X2", "Ralink AP-RT3052-V22RW-2X2", v22rw_2x2_init); diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-whr-g300n.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-whr-g300n.c index e4c5988d6..5d015e264 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-whr-g300n.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-whr-g300n.c @@ -1,7 +1,7 @@ /* * Buffalo WHR-G300N board support * - * Copyright (C) 2009 Gabor Juhos + * Copyright (C) 2009-2010 Gabor Juhos * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -13,11 +13,10 @@ #include #include #include -#include -#include #include -#include +#include +#include #include #include @@ -27,6 +26,13 @@ #define WHR_G300N_GPIO_LED_ROUTER 9 #define WHR_G300N_GPIO_LED_SECURITY 14 +#define WHR_G300N_GPIO_BUTTON_AOSS 0 /* active low */ +#define WHR_G300N_GPIO_BUTTON_RESET 10 /* active low */ +#define WHR_G300N_GPIO_BUTTON_ROUTER_ON 8 /* active low */ +#define WHR_G300N_GPIO_BUTTON_ROUTER_OFF 11 /* active low */ + +#define WHR_G300N_BUTTONS_POLL_INTERVAL 20 + #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition whr_g300n_partitions[] = { { @@ -87,6 +93,38 @@ static struct gpio_led whr_g300n_leds_gpio[] __initdata = { } }; +static struct gpio_button whr_g300n_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = BTN_0, + .threshold = 3, + .gpio = WHR_G300N_GPIO_BUTTON_RESET, + .active_low = 1, + }, { + .desc = "aoss", + .type = EV_KEY, + .code = BTN_1, + .threshold = 3, + .gpio = WHR_G300N_GPIO_BUTTON_AOSS, + .active_low = 1, + }, { + .desc = "router-off", + .type = EV_KEY, + .code = BTN_2, + .threshold = 3, + .gpio = WHR_G300N_GPIO_BUTTON_ROUTER_OFF, + .active_low = 1, + }, { + .desc = "router-on", + .type = EV_KEY, + .code = BTN_3, + .threshold = 3, + .gpio = WHR_G300N_GPIO_BUTTON_ROUTER_ON, + .active_low = 1, + } +}; + static void __init whr_g300n_init(void) { rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); @@ -95,6 +133,10 @@ static void __init whr_g300n_init(void) rt305x_register_ethernet(); ramips_register_gpio_leds(-1, ARRAY_SIZE(whr_g300n_leds_gpio), whr_g300n_leds_gpio); + ramips_register_gpio_buttons(-1, WHR_G300N_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(whr_g300n_gpio_buttons), + whr_g300n_gpio_buttons); } -MIPS_MACHINE(RAMIPS_MACH_WHR_G300N, "Buffalo WHR-G300N", whr_g300n_init); +MIPS_MACHINE(RAMIPS_MACH_WHR_G300N, "WHR-G300N", "Buffalo WHR-G300N", + whr_g300n_init); diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c index f9ce27241..5a728be02 100644 --- a/target/linux/ramips/files/drivers/net/ramips.c +++ b/target/linux/ramips/files/drivers/net/ramips.c @@ -51,97 +51,119 @@ ramips_fe_rr(unsigned reg) return __raw_readl(ramips_fe_base + reg); } -static void -ramips_cleanup_dma(struct net_device *dev) +static inline void +ramips_fe_int_disable(u32 mask) +{ + ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) & ~mask, + RAMIPS_FE_INT_ENABLE); + /* flush write */ + ramips_fe_rr(RAMIPS_FE_INT_ENABLE); +} + +static inline void +ramips_fe_int_enable(u32 mask) +{ + ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) | mask, + RAMIPS_FE_INT_ENABLE); + /* flush write */ + ramips_fe_rr(RAMIPS_FE_INT_ENABLE); +} + +static inline void +ramips_hw_set_macaddr(unsigned char *mac) +{ + ramips_fe_wr((mac[0] << 8) | mac[1], RAMIPS_GDMA1_MAC_ADRH); + ramips_fe_wr((mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5], + RAMIPS_GDMA1_MAC_ADRL); +} + +static void +ramips_cleanup_dma(struct raeth_priv *re) { - struct raeth_priv *priv = netdev_priv(dev); int i; for (i = 0; i < NUM_RX_DESC; i++) - if (priv->rx_skb[i]) - dev_kfree_skb_any(priv->rx_skb[i]); + if (re->rx_skb[i]) + dev_kfree_skb_any(re->rx_skb[i]); - if (priv->rx) + if (re->rx) dma_free_coherent(NULL, NUM_RX_DESC * sizeof(struct ramips_rx_dma), - priv->rx, priv->phy_rx); + re->rx, re->phy_rx); - if (priv->tx) + if (re->tx) dma_free_coherent(NULL, NUM_TX_DESC * sizeof(struct ramips_tx_dma), - priv->tx, priv->phy_tx); + re->tx, re->phy_tx); } static int -ramips_alloc_dma(struct net_device *dev) +ramips_alloc_dma(struct raeth_priv *re) { - struct raeth_priv *priv = netdev_priv(dev); int err = -ENOMEM; int i; - priv->skb_free_idx = 0; + re->skb_free_idx = 0; /* setup tx ring */ - priv->tx = dma_alloc_coherent(NULL, - NUM_TX_DESC * sizeof(struct ramips_tx_dma), &priv->phy_tx, GFP_ATOMIC); - if (!priv->tx) + re->tx = dma_alloc_coherent(NULL, + NUM_TX_DESC * sizeof(struct ramips_tx_dma), + &re->phy_tx, GFP_ATOMIC); + if (!re->tx) goto err_cleanup; - for(i = 0; i < NUM_TX_DESC; i++) - { - memset(&priv->tx[i], 0, sizeof(struct ramips_tx_dma)); - priv->tx[i].txd2 |= TX_DMA_LSO | TX_DMA_DONE; - priv->tx[i].txd4 &= (TX_DMA_QN_MASK | TX_DMA_PN_MASK); - priv->tx[i].txd4 |= TX_DMA_QN(3) | TX_DMA_PN(1); + memset(re->tx, 0, NUM_TX_DESC * sizeof(struct ramips_tx_dma)); + for (i = 0; i < NUM_TX_DESC; i++) { + re->tx[i].txd2 = TX_DMA_LSO | TX_DMA_DONE; + re->tx[i].txd4 = TX_DMA_QN(3) | TX_DMA_PN(1); } /* setup rx ring */ - priv->rx = dma_alloc_coherent(NULL, - NUM_RX_DESC * sizeof(struct ramips_rx_dma), &priv->phy_rx, GFP_ATOMIC); - if (!priv->rx) + re->rx = dma_alloc_coherent(NULL, + NUM_RX_DESC * sizeof(struct ramips_rx_dma), + &re->phy_rx, GFP_ATOMIC); + if (!re->rx) goto err_cleanup; - memset(priv->rx, 0, sizeof(struct ramips_rx_dma) * NUM_RX_DESC); - for(i = 0; i < NUM_RX_DESC; i++) - { + memset(re->rx, 0, sizeof(struct ramips_rx_dma) * NUM_RX_DESC); + for (i = 0; i < NUM_RX_DESC; i++) { struct sk_buff *new_skb = dev_alloc_skb(MAX_RX_LENGTH + 2); if (!new_skb) goto err_cleanup; skb_reserve(new_skb, 2); - priv->rx[i].rxd1 = - dma_map_single(NULL, skb_put(new_skb, 2), MAX_RX_LENGTH + 2, - DMA_FROM_DEVICE); - priv->rx[i].rxd2 |= RX_DMA_LSO; - priv->rx_skb[i] = new_skb; + re->rx[i].rxd1 = dma_map_single(NULL, + skb_put(new_skb, 2), + MAX_RX_LENGTH + 2, + DMA_FROM_DEVICE); + re->rx[i].rxd2 |= RX_DMA_LSO; + re->rx_skb[i] = new_skb; } return 0; err_cleanup: - ramips_cleanup_dma(dev); + ramips_cleanup_dma(re); return err; } static void -ramips_setup_dma(struct net_device *dev) +ramips_setup_dma(struct raeth_priv *re) { - struct raeth_priv *priv = netdev_priv(dev); - - ramips_fe_wr(phys_to_bus(priv->phy_tx), RAMIPS_TX_BASE_PTR0); + ramips_fe_wr(phys_to_bus(re->phy_tx), RAMIPS_TX_BASE_PTR0); ramips_fe_wr(NUM_TX_DESC, RAMIPS_TX_MAX_CNT0); ramips_fe_wr(0, RAMIPS_TX_CTX_IDX0); ramips_fe_wr(RAMIPS_PST_DTX_IDX0, RAMIPS_PDMA_RST_CFG); - ramips_fe_wr(phys_to_bus(priv->phy_rx), RAMIPS_RX_BASE_PTR0); + ramips_fe_wr(phys_to_bus(re->phy_rx), RAMIPS_RX_BASE_PTR0); ramips_fe_wr(NUM_RX_DESC, RAMIPS_RX_MAX_CNT0); ramips_fe_wr((NUM_RX_DESC - 1), RAMIPS_RX_CALC_IDX0); ramips_fe_wr(RAMIPS_PST_DRX_IDX0, RAMIPS_PDMA_RST_CFG); } static int -ramips_eth_hard_start_xmit(struct sk_buff* skb, struct net_device *dev) +ramips_eth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct raeth_priv *priv = netdev_priv(dev); unsigned long tx; @@ -149,32 +171,31 @@ ramips_eth_hard_start_xmit(struct sk_buff* skb, struct net_device *dev) unsigned int mapped_addr; unsigned long flags; - if(priv->plat->min_pkt_len) - { - if(skb->len < priv->plat->min_pkt_len) - { - if(skb_padto(skb, priv->plat->min_pkt_len)) - { - printk(KERN_ERR "ramips_eth: skb_padto failed\n"); - kfree_skb(skb); - return 0; - } - skb_put(skb, priv->plat->min_pkt_len - skb->len); - } + if (priv->plat->min_pkt_len) { + if (skb->len < priv->plat->min_pkt_len) { + if (skb_padto(skb, priv->plat->min_pkt_len)) { + printk(KERN_ERR + "ramips_eth: skb_padto failed\n"); + kfree_skb(skb); + return 0; + } + skb_put(skb, priv->plat->min_pkt_len - skb->len); + } } + dev->trans_start = jiffies; - mapped_addr = (unsigned int)dma_map_single(NULL, skb->data, skb->len, - DMA_TO_DEVICE); + mapped_addr = (unsigned int) dma_map_single(NULL, skb->data, skb->len, + DMA_TO_DEVICE); dma_sync_single_for_device(NULL, mapped_addr, skb->len, DMA_TO_DEVICE); spin_lock_irqsave(&priv->page_lock, flags); tx = ramips_fe_rr(RAMIPS_TX_CTX_IDX0); - if(tx == NUM_TX_DESC - 1) - tx_next = 0; - else - tx_next = tx + 1; - if((priv->tx_skb[tx]) || (priv->tx_skb[tx_next]) || - !(priv->tx[tx].txd2 & TX_DMA_DONE) || !(priv->tx[tx_next].txd2 & TX_DMA_DONE)) + tx_next = (tx + 1) % NUM_TX_DESC; + + if ((priv->tx_skb[tx]) || (priv->tx_skb[tx_next]) || + !(priv->tx[tx].txd2 & TX_DMA_DONE) || + !(priv->tx[tx_next].txd2 & TX_DMA_DONE)) goto out; + priv->tx[tx].txd1 = mapped_addr; priv->tx[tx].txd2 &= ~(TX_DMA_PLEN0_MASK | TX_DMA_DONE); priv->tx[tx].txd2 |= TX_DMA_PLEN0(skb->len); @@ -182,10 +203,11 @@ ramips_eth_hard_start_xmit(struct sk_buff* skb, struct net_device *dev) dev->stats.tx_bytes += skb->len; priv->tx_skb[tx] = skb; wmb(); - ramips_fe_wr((tx + 1) % NUM_TX_DESC, RAMIPS_TX_CTX_IDX0); + ramips_fe_wr(tx_next, RAMIPS_TX_CTX_IDX0); spin_unlock_irqrestore(&priv->page_lock, flags); return NETDEV_TX_OK; -out: + + out: spin_unlock_irqrestore(&priv->page_lock, flags); dev->stats.tx_dropped++; kfree_skb(skb); @@ -195,17 +217,16 @@ out: static void ramips_eth_rx_hw(unsigned long ptr) { - struct net_device *dev = (struct net_device*)ptr; + struct net_device *dev = (struct net_device *) ptr; struct raeth_priv *priv = netdev_priv(dev); int rx; int max_rx = 16; - while(max_rx) - { + while (max_rx) { struct sk_buff *rx_skb, *new_skb; rx = (ramips_fe_rr(RAMIPS_RX_CALC_IDX0) + 1) % NUM_RX_DESC; - if(!(priv->rx[rx].rxd2 & RX_DMA_DONE)) + if (!(priv->rx[rx].rxd2 & RX_DMA_DONE)) break; max_rx--; @@ -222,18 +243,19 @@ ramips_eth_rx_hw(unsigned long ptr) priv->rx_skb[rx] = new_skb; BUG_ON(!new_skb); skb_reserve(new_skb, 2); - priv->rx[rx].rxd1 = - dma_map_single(NULL, new_skb->data, MAX_RX_LENGTH + 2, - DMA_FROM_DEVICE); + priv->rx[rx].rxd1 = dma_map_single(NULL, + new_skb->data, + MAX_RX_LENGTH + 2, + DMA_FROM_DEVICE); priv->rx[rx].rxd2 &= ~RX_DMA_DONE; wmb(); ramips_fe_wr(rx, RAMIPS_RX_CALC_IDX0); } - if(max_rx == 0) + + if (max_rx == 0) tasklet_schedule(&priv->rx_tasklet); else - ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) | RAMIPS_RX_DLY_INT, - RAMIPS_FE_INT_ENABLE); + ramips_fe_int_enable(RAMIPS_RX_DLY_INT); } static void @@ -242,31 +264,16 @@ ramips_eth_tx_housekeeping(unsigned long ptr) struct net_device *dev = (struct net_device*)ptr; struct raeth_priv *priv = netdev_priv(dev); - while((priv->tx[priv->skb_free_idx].txd2 & TX_DMA_DONE) && - (priv->tx_skb[priv->skb_free_idx])) - { - dev_kfree_skb_irq((struct sk_buff*)priv->tx_skb[priv->skb_free_idx]); + while ((priv->tx[priv->skb_free_idx].txd2 & TX_DMA_DONE) && + (priv->tx_skb[priv->skb_free_idx])) { + dev_kfree_skb_irq(priv->tx_skb[priv->skb_free_idx]); priv->tx_skb[priv->skb_free_idx] = 0; priv->skb_free_idx++; - if(priv->skb_free_idx >= NUM_TX_DESC) + if (priv->skb_free_idx >= NUM_TX_DESC) priv->skb_free_idx = 0; } - ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) | RAMIPS_TX_DLY_INT, - RAMIPS_FE_INT_ENABLE); -} -static int -ramips_eth_set_mac_addr(struct net_device *dev, void *priv) -{ - unsigned char *mac = (unsigned char*)priv; - - if(netif_running(dev)) - return -EBUSY; - memcpy(dev->dev_addr, ((struct sockaddr*)priv)->sa_data, dev->addr_len); - ramips_fe_wr((mac[0] << 8) | mac[1], RAMIPS_GDMA1_MAC_ADRH); - ramips_fe_wr(RAMIPS_GDMA1_MAC_ADRL, - (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5]); - return 0; + ramips_fe_int_enable(RAMIPS_TX_DLY_INT); } static void @@ -285,14 +292,14 @@ ramips_eth_irq(int irq, void *dev) ramips_fe_wr(0xFFFFFFFF, RAMIPS_FE_INT_STATUS); - if(fe_int & RAMIPS_RX_DLY_INT) - { - ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) & ~(RAMIPS_RX_DLY_INT), - RAMIPS_FE_INT_ENABLE); + if (fe_int & RAMIPS_RX_DLY_INT) { + ramips_fe_int_disable(RAMIPS_RX_DLY_INT); tasklet_schedule(&priv->rx_tasklet); } - if(fe_int & RAMIPS_TX_DLY_INT) + + if (fe_int & RAMIPS_TX_DLY_INT) ramips_eth_tx_housekeeping((unsigned long)dev); + return IRQ_HANDLED; } @@ -307,22 +314,26 @@ ramips_eth_open(struct net_device *dev) if (err) return err; - err = ramips_alloc_dma(dev); + err = ramips_alloc_dma(priv); if (err) goto err_free_irq; - ramips_setup_dma(dev); + ramips_hw_set_macaddr(dev->dev_addr); + + ramips_setup_dma(priv); ramips_fe_wr((ramips_fe_rr(RAMIPS_PDMA_GLO_CFG) & 0xff) | (RAMIPS_TX_WB_DDONE | RAMIPS_RX_DMA_EN | RAMIPS_TX_DMA_EN | RAMIPS_PDMA_SIZE_4DWORDS), RAMIPS_PDMA_GLO_CFG); ramips_fe_wr((ramips_fe_rr(RAMIPS_FE_GLO_CFG) & ~(RAMIPS_US_CYC_CNT_MASK << RAMIPS_US_CYC_CNT_SHIFT)) | - ((rt305x_sys_freq / RAMIPS_US_CYC_CNT_DIVISOR) << RAMIPS_US_CYC_CNT_SHIFT), + ((priv->plat->sys_freq / RAMIPS_US_CYC_CNT_DIVISOR) << RAMIPS_US_CYC_CNT_SHIFT), RAMIPS_FE_GLO_CFG); + tasklet_init(&priv->tx_housekeeping_tasklet, ramips_eth_tx_housekeeping, - (unsigned long)dev); + (unsigned long)dev); tasklet_init(&priv->rx_tasklet, ramips_eth_rx_hw, (unsigned long)dev); + ramips_fe_wr(RAMIPS_DELAY_INIT, RAMIPS_DLY_INT_CFG); ramips_fe_wr(RAMIPS_TX_DLY_INT | RAMIPS_RX_DLY_INT, RAMIPS_FE_INT_ENABLE); ramips_fe_wr(ramips_fe_rr(RAMIPS_GDMA1_FWD_CFG) & @@ -334,6 +345,7 @@ ramips_eth_open(struct net_device *dev) ramips_fe_wr(RAMIPS_PSE_FQFC_CFG_INIT, RAMIPS_PSE_FQ_CFG); ramips_fe_wr(1, RAMIPS_FE_RST_GL); ramips_fe_wr(0, RAMIPS_FE_RST_GL); + netif_start_queue(dev); return 0; @@ -347,13 +359,14 @@ ramips_eth_stop(struct net_device *dev) { struct raeth_priv *priv = netdev_priv(dev); - ramips_fe_wr(RAMIPS_PDMA_GLO_CFG, ramips_fe_rr(RAMIPS_PDMA_GLO_CFG) & - ~(RAMIPS_TX_WB_DDONE | RAMIPS_RX_DMA_EN | RAMIPS_TX_DMA_EN)); + ramips_fe_wr(ramips_fe_rr(RAMIPS_PDMA_GLO_CFG) & + ~(RAMIPS_TX_WB_DDONE | RAMIPS_RX_DMA_EN | RAMIPS_TX_DMA_EN), + RAMIPS_PDMA_GLO_CFG); free_irq(dev->irq, dev); netif_stop_queue(dev); tasklet_kill(&priv->tx_housekeeping_tasklet); tasklet_kill(&priv->rx_tasklet); - ramips_cleanup_dma(dev); + ramips_cleanup_dma(priv); printk(KERN_DEBUG "ramips_eth: stopped\n"); return 0; } @@ -362,26 +375,31 @@ static int __init ramips_eth_probe(struct net_device *dev) { struct raeth_priv *priv = netdev_priv(dev); - struct sockaddr addr; BUG_ON(!priv->plat->reset_fe); priv->plat->reset_fe(); net_srandom(jiffies); - memcpy(addr.sa_data, priv->plat->mac, 6); - ramips_eth_set_mac_addr(dev, &addr); + memcpy(dev->dev_addr, priv->plat->mac, ETH_ALEN); ether_setup(dev); - dev->open = ramips_eth_open; - dev->stop = ramips_eth_stop; - dev->hard_start_xmit = ramips_eth_hard_start_xmit; - dev->set_mac_address = ramips_eth_set_mac_addr; dev->mtu = 1500; - dev->tx_timeout = ramips_eth_timeout; dev->watchdog_timeo = TX_TIMEOUT; spin_lock_init(&priv->page_lock); + return 0; } +static const struct net_device_ops ramips_eth_netdev_ops = { + .ndo_init = ramips_eth_probe, + .ndo_open = ramips_eth_open, + .ndo_stop = ramips_eth_stop, + .ndo_start_xmit = ramips_eth_hard_start_xmit, + .ndo_tx_timeout = ramips_eth_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; + static int ramips_eth_plat_probe(struct platform_device *plat) { @@ -402,11 +420,11 @@ ramips_eth_plat_probe(struct platform_device *plat) } ramips_fe_base = ioremap_nocache(res->start, res->end - res->start + 1); - if(!ramips_fe_base) + if (!ramips_fe_base) return -ENOMEM; ramips_dev = alloc_etherdev(sizeof(struct raeth_priv)); - if(!ramips_dev) { + if (!ramips_dev) { dev_err(&plat->dev, "alloc_etherdev failed\n"); err = -ENOMEM; goto err_unmap; @@ -421,8 +439,9 @@ ramips_eth_plat_probe(struct platform_device *plat) } ramips_dev->addr_len = ETH_ALEN; ramips_dev->base_addr = (unsigned long)ramips_fe_base; - ramips_dev->init = ramips_eth_probe; - priv = (struct raeth_priv*)netdev_priv(ramips_dev); + ramips_dev->netdev_ops = &ramips_eth_netdev_ops; + + priv = netdev_priv(ramips_dev); priv->plat = data; err = register_netdev(ramips_dev); diff --git a/target/linux/ramips/files/drivers/net/ramips_eth.h b/target/linux/ramips/files/drivers/net/ramips_eth.h index ead1b785c..593dd1d87 100644 --- a/target/linux/ramips/files/drivers/net/ramips_eth.h +++ b/target/linux/ramips/files/drivers/net/ramips_eth.h @@ -26,141 +26,142 @@ #define NUM_RX_DESC 256 #define NUM_TX_DESC 256 -#define RAMIPS_DELAY_EN_INT 0x80 -#define RAMIPS_DELAY_MAX_INT 0x04 -#define RAMIPS_DELAY_MAX_TOUT 0x04 -#define RAMIPS_DELAY_CHAN (((RAMIPS_DELAY_EN_INT | RAMIPS_DELAY_MAX_INT) << 8) | RAMIPS_DELAY_MAX_TOUT) -#define RAMIPS_DELAY_INIT ((RAMIPS_DELAY_CHAN << 16) | RAMIPS_DELAY_CHAN) -#define RAMIPS_PSE_FQFC_CFG_INIT 0x80504000 +#define RAMIPS_DELAY_EN_INT 0x80 +#define RAMIPS_DELAY_MAX_INT 0x04 +#define RAMIPS_DELAY_MAX_TOUT 0x04 +#define RAMIPS_DELAY_CHAN (((RAMIPS_DELAY_EN_INT | RAMIPS_DELAY_MAX_INT) << 8) | RAMIPS_DELAY_MAX_TOUT) +#define RAMIPS_DELAY_INIT ((RAMIPS_DELAY_CHAN << 16) | RAMIPS_DELAY_CHAN) +#define RAMIPS_PSE_FQFC_CFG_INIT 0x80504000 -/* interrupt bitd */ -#define RAMIPS_CNT_PPE_AF BIT(31) -#define RAMIPS_CNT_GDM_AF BIT(29) -#define RAMIPS_PSE_P2_FC BIT(26) -#define RAMIPS_PSE_BUF_DROP BIT(24) -#define RAMIPS_GDM_OTHER_DROP BIT(23) -#define RAMIPS_PSE_P1_FC BIT(22) -#define RAMIPS_PSE_P0_FC BIT(21) -#define RAMIPS_PSE_FQ_EMPTY BIT(20) -#define RAMIPS_GE1_STA_CHG BIT(18) -#define RAMIPS_TX_COHERENT BIT(17) -#define RAMIPS_RX_COHERENT BIT(16) -#define RAMIPS_TX_DONE_INT3 BIT(11) -#define RAMIPS_TX_DONE_INT2 BIT(10) -#define RAMIPS_TX_DONE_INT1 BIT(9) -#define RAMIPS_TX_DONE_INT0 BIT(8) -#define RAMIPS_RX_DONE_INT0 BIT(2) -#define RAMIPS_TX_DLY_INT BIT(1) -#define RAMIPS_RX_DLY_INT BIT(0) +/* interrupt bits */ +#define RAMIPS_CNT_PPE_AF BIT(31) +#define RAMIPS_CNT_GDM_AF BIT(29) +#define RAMIPS_PSE_P2_FC BIT(26) +#define RAMIPS_PSE_BUF_DROP BIT(24) +#define RAMIPS_GDM_OTHER_DROP BIT(23) +#define RAMIPS_PSE_P1_FC BIT(22) +#define RAMIPS_PSE_P0_FC BIT(21) +#define RAMIPS_PSE_FQ_EMPTY BIT(20) +#define RAMIPS_GE1_STA_CHG BIT(18) +#define RAMIPS_TX_COHERENT BIT(17) +#define RAMIPS_RX_COHERENT BIT(16) +#define RAMIPS_TX_DONE_INT3 BIT(11) +#define RAMIPS_TX_DONE_INT2 BIT(10) +#define RAMIPS_TX_DONE_INT1 BIT(9) +#define RAMIPS_TX_DONE_INT0 BIT(8) +#define RAMIPS_RX_DONE_INT0 BIT(2) +#define RAMIPS_TX_DLY_INT BIT(1) +#define RAMIPS_RX_DLY_INT BIT(0) /* registers */ -#define RAMIPS_FE_OFFSET 0x0000 -#define RAMIPS_GDMA_OFFSET 0x0020 -#define RAMIPS_PSE_OFFSET 0x0040 -#define RAMIPS_GDMA2_OFFSET 0x0060 -#define RAMIPS_CDMA_OFFSET 0x0080 -#define RAMIPS_PDMA_OFFSET 0x0100 -#define RAMIPS_PPE_OFFSET 0x0200 -#define RAMIPS_CMTABLE_OFFSET 0x0400 -#define RAMIPS_POLICYTABLE_OFFSET 0x1000 +#define RAMIPS_FE_OFFSET 0x0000 +#define RAMIPS_GDMA_OFFSET 0x0020 +#define RAMIPS_PSE_OFFSET 0x0040 +#define RAMIPS_GDMA2_OFFSET 0x0060 +#define RAMIPS_CDMA_OFFSET 0x0080 +#define RAMIPS_PDMA_OFFSET 0x0100 +#define RAMIPS_PPE_OFFSET 0x0200 +#define RAMIPS_CMTABLE_OFFSET 0x0400 +#define RAMIPS_POLICYTABLE_OFFSET 0x1000 -#define RAMIPS_MDIO_ACCESS (RAMIPS_FE_OFFSET + 0x00) -#define RAMIPS_MDIO_CFG (RAMIPS_FE_OFFSET + 0x04) -#define RAMIPS_FE_GLO_CFG (RAMIPS_FE_OFFSET + 0x08) -#define RAMIPS_FE_RST_GL (RAMIPS_FE_OFFSET + 0x0C) -#define RAMIPS_FE_INT_STATUS (RAMIPS_FE_OFFSET + 0x10) -#define RAMIPS_FE_INT_ENABLE (RAMIPS_FE_OFFSET + 0x14) -#define RAMIPS_MDIO_CFG2 (RAMIPS_FE_OFFSET + 0x18) -#define RAMIPS_FOC_TS_T (RAMIPS_FE_OFFSET + 0x1C) +#define RAMIPS_MDIO_ACCESS (RAMIPS_FE_OFFSET + 0x00) +#define RAMIPS_MDIO_CFG (RAMIPS_FE_OFFSET + 0x04) +#define RAMIPS_FE_GLO_CFG (RAMIPS_FE_OFFSET + 0x08) +#define RAMIPS_FE_RST_GL (RAMIPS_FE_OFFSET + 0x0C) +#define RAMIPS_FE_INT_STATUS (RAMIPS_FE_OFFSET + 0x10) +#define RAMIPS_FE_INT_ENABLE (RAMIPS_FE_OFFSET + 0x14) +#define RAMIPS_MDIO_CFG2 (RAMIPS_FE_OFFSET + 0x18) +#define RAMIPS_FOC_TS_T (RAMIPS_FE_OFFSET + 0x1C) -#define RAMIPS_GDMA1_FWD_CFG (RAMIPS_GDMA_OFFSET + 0x00) -#define RAMIPS_GDMA1_SCH_CFG (RAMIPS_GDMA_OFFSET + 0x04) -#define RAMIPS_GDMA1_SHPR_CFG (RAMIPS_GDMA_OFFSET + 0x08) -#define RAMIPS_GDMA1_MAC_ADRL (RAMIPS_GDMA_OFFSET + 0x0C) -#define RAMIPS_GDMA1_MAC_ADRH (RAMIPS_GDMA_OFFSET + 0x10) +#define RAMIPS_GDMA1_FWD_CFG (RAMIPS_GDMA_OFFSET + 0x00) +#define RAMIPS_GDMA1_SCH_CFG (RAMIPS_GDMA_OFFSET + 0x04) +#define RAMIPS_GDMA1_SHPR_CFG (RAMIPS_GDMA_OFFSET + 0x08) +#define RAMIPS_GDMA1_MAC_ADRL (RAMIPS_GDMA_OFFSET + 0x0C) +#define RAMIPS_GDMA1_MAC_ADRH (RAMIPS_GDMA_OFFSET + 0x10) -#define RAMIPS_GDMA2_FWD_CFG (RAMIPS_GDMA2_OFFSET + 0x00) -#define RAMIPS_GDMA2_SCH_CFG (RAMIPS_GDMA2_OFFSET + 0x04) -#define RAMIPS_GDMA2_SHPR_CFG (RAMIPS_GDMA2_OFFSET + 0x08) -#define RAMIPS_GDMA2_MAC_ADRL (RAMIPS_GDMA2_OFFSET + 0x0C) -#define RAMIPS_GDMA2_MAC_ADRH (RAMIPS_GDMA2_OFFSET + 0x10) +#define RAMIPS_GDMA2_FWD_CFG (RAMIPS_GDMA2_OFFSET + 0x00) +#define RAMIPS_GDMA2_SCH_CFG (RAMIPS_GDMA2_OFFSET + 0x04) +#define RAMIPS_GDMA2_SHPR_CFG (RAMIPS_GDMA2_OFFSET + 0x08) +#define RAMIPS_GDMA2_MAC_ADRL (RAMIPS_GDMA2_OFFSET + 0x0C) +#define RAMIPS_GDMA2_MAC_ADRH (RAMIPS_GDMA2_OFFSET + 0x10) -#define RAMIPS_PSE_FQ_CFG (RAMIPS_PSE_OFFSET + 0x00) -#define RAMIPS_CDMA_FC_CFG (RAMIPS_PSE_OFFSET + 0x04) -#define RAMIPS_GDMA1_FC_CFG (RAMIPS_PSE_OFFSET + 0x08) -#define RAMIPS_GDMA2_FC_CFG (RAMIPS_PSE_OFFSET + 0x0C) +#define RAMIPS_PSE_FQ_CFG (RAMIPS_PSE_OFFSET + 0x00) +#define RAMIPS_CDMA_FC_CFG (RAMIPS_PSE_OFFSET + 0x04) +#define RAMIPS_GDMA1_FC_CFG (RAMIPS_PSE_OFFSET + 0x08) +#define RAMIPS_GDMA2_FC_CFG (RAMIPS_PSE_OFFSET + 0x0C) -#define RAMIPS_CDMA_CSG_CFG (RAMIPS_CDMA_OFFSET + 0x00) -#define RAMIPS_CDMA_SCH_CFG (RAMIPS_CDMA_OFFSET + 0x04) +#define RAMIPS_CDMA_CSG_CFG (RAMIPS_CDMA_OFFSET + 0x00) +#define RAMIPS_CDMA_SCH_CFG (RAMIPS_CDMA_OFFSET + 0x04) -#define RAMIPS_PDMA_GLO_CFG (RAMIPS_PDMA_OFFSET + 0x00) -#define RAMIPS_PDMA_RST_CFG (RAMIPS_PDMA_OFFSET + 0x04) -#define RAMIPS_PDMA_SCH_CFG (RAMIPS_PDMA_OFFSET + 0x08) -#define RAMIPS_DLY_INT_CFG (RAMIPS_PDMA_OFFSET + 0x0C) -#define RAMIPS_TX_BASE_PTR0 (RAMIPS_PDMA_OFFSET + 0x10) -#define RAMIPS_TX_MAX_CNT0 (RAMIPS_PDMA_OFFSET + 0x14) -#define RAMIPS_TX_CTX_IDX0 (RAMIPS_PDMA_OFFSET + 0x18) -#define RAMIPS_TX_DTX_IDX0 (RAMIPS_PDMA_OFFSET + 0x1C) -#define RAMIPS_TX_BASE_PTR1 (RAMIPS_PDMA_OFFSET + 0x20) -#define RAMIPS_TX_MAX_CNT1 (RAMIPS_PDMA_OFFSET + 0x24) -#define RAMIPS_TX_CTX_IDX1 (RAMIPS_PDMA_OFFSET + 0x28) -#define RAMIPS_TX_DTX_IDX1 (RAMIPS_PDMA_OFFSET + 0x2C) -#define RAMIPS_TX_BASE_PTR2 (RAMIPS_PDMA_OFFSET + 0x40) -#define RAMIPS_TX_MAX_CNT2 (RAMIPS_PDMA_OFFSET + 0x44) -#define RAMIPS_TX_CTX_IDX2 (RAMIPS_PDMA_OFFSET + 0x48) -#define RAMIPS_TX_DTX_IDX2 (RAMIPS_PDMA_OFFSET + 0x4C) -#define RAMIPS_TX_BASE_PTR3 (RAMIPS_PDMA_OFFSET + 0x50) -#define RAMIPS_TX_MAX_CNT3 (RAMIPS_PDMA_OFFSET + 0x54) -#define RAMIPS_TX_CTX_IDX3 (RAMIPS_PDMA_OFFSET + 0x58) -#define RAMIPS_TX_DTX_IDX3 (RAMIPS_PDMA_OFFSET + 0x5C) -#define RAMIPS_RX_BASE_PTR0 (RAMIPS_PDMA_OFFSET + 0x30) -#define RAMIPS_RX_MAX_CNT0 (RAMIPS_PDMA_OFFSET + 0x34) -#define RAMIPS_RX_CALC_IDX0 (RAMIPS_PDMA_OFFSET + 0x38) -#define RAMIPS_RX_DRX_IDX0 (RAMIPS_PDMA_OFFSET + 0x3C) -#define RAMIPS_RX_BASE_PTR1 (RAMIPS_PDMA_OFFSET + 0x40) -#define RAMIPS_RX_MAX_CNT1 (RAMIPS_PDMA_OFFSET + 0x44) -#define RAMIPS_RX_CALC_IDX1 (RAMIPS_PDMA_OFFSET + 0x48) -#define RAMIPS_RX_DRX_IDX1 (RAMIPS_PDMA_OFFSET + 0x4C) +#define RAMIPS_PDMA_GLO_CFG (RAMIPS_PDMA_OFFSET + 0x00) +#define RAMIPS_PDMA_RST_CFG (RAMIPS_PDMA_OFFSET + 0x04) +#define RAMIPS_PDMA_SCH_CFG (RAMIPS_PDMA_OFFSET + 0x08) +#define RAMIPS_DLY_INT_CFG (RAMIPS_PDMA_OFFSET + 0x0C) +#define RAMIPS_TX_BASE_PTR0 (RAMIPS_PDMA_OFFSET + 0x10) +#define RAMIPS_TX_MAX_CNT0 (RAMIPS_PDMA_OFFSET + 0x14) +#define RAMIPS_TX_CTX_IDX0 (RAMIPS_PDMA_OFFSET + 0x18) +#define RAMIPS_TX_DTX_IDX0 (RAMIPS_PDMA_OFFSET + 0x1C) +#define RAMIPS_TX_BASE_PTR1 (RAMIPS_PDMA_OFFSET + 0x20) +#define RAMIPS_TX_MAX_CNT1 (RAMIPS_PDMA_OFFSET + 0x24) +#define RAMIPS_TX_CTX_IDX1 (RAMIPS_PDMA_OFFSET + 0x28) +#define RAMIPS_TX_DTX_IDX1 (RAMIPS_PDMA_OFFSET + 0x2C) +#define RAMIPS_RX_BASE_PTR0 (RAMIPS_PDMA_OFFSET + 0x30) +#define RAMIPS_RX_MAX_CNT0 (RAMIPS_PDMA_OFFSET + 0x34) +#define RAMIPS_RX_CALC_IDX0 (RAMIPS_PDMA_OFFSET + 0x38) +#define RAMIPS_RX_DRX_IDX0 (RAMIPS_PDMA_OFFSET + 0x3C) +#define RAMIPS_TX_BASE_PTR2 (RAMIPS_PDMA_OFFSET + 0x40) +#define RAMIPS_TX_MAX_CNT2 (RAMIPS_PDMA_OFFSET + 0x44) +#define RAMIPS_TX_CTX_IDX2 (RAMIPS_PDMA_OFFSET + 0x48) +#define RAMIPS_TX_DTX_IDX2 (RAMIPS_PDMA_OFFSET + 0x4C) +#define RAMIPS_TX_BASE_PTR3 (RAMIPS_PDMA_OFFSET + 0x50) +#define RAMIPS_TX_MAX_CNT3 (RAMIPS_PDMA_OFFSET + 0x54) +#define RAMIPS_TX_CTX_IDX3 (RAMIPS_PDMA_OFFSET + 0x58) +#define RAMIPS_TX_DTX_IDX3 (RAMIPS_PDMA_OFFSET + 0x5C) +#define RAMIPS_RX_BASE_PTR1 (RAMIPS_PDMA_OFFSET + 0x60) +#define RAMIPS_RX_MAX_CNT1 (RAMIPS_PDMA_OFFSET + 0x64) +#define RAMIPS_RX_CALC_IDX1 (RAMIPS_PDMA_OFFSET + 0x68) +#define RAMIPS_RX_DRX_IDX1 (RAMIPS_PDMA_OFFSET + 0x6C) /* uni-cast port */ -#define RAMIPS_GDM1_ICS_EN (0x1 << 22) -#define RAMIPS_GDM1_TCS_EN (0x1 << 21) -#define RAMIPS_GDM1_UCS_EN (0x1 << 20) -#define RAMIPS_GDM1_JMB_EN (0x1 << 19) -#define RAMIPS_GDM1_STRPCRC (0x1 << 16) -#define RAMIPS_GDM1_UFRC_P_CPU (0 << 12) -#define RAMIPS_GDM1_UFRC_P_GDMA1 (1 << 12) -#define RAMIPS_GDM1_UFRC_P_PPE (6 << 12) +#define RAMIPS_GDM1_ICS_EN BIT(22) +#define RAMIPS_GDM1_TCS_EN BIT(21) +#define RAMIPS_GDM1_UCS_EN BIT(20) +#define RAMIPS_GDM1_JMB_EN BIT(19) +#define RAMIPS_GDM1_STRPCRC BIT(16) +#define RAMIPS_GDM1_UFRC_P_CPU (0 << 12) +#define RAMIPS_GDM1_UFRC_P_GDMA1 (1 << 12) +#define RAMIPS_GDM1_UFRC_P_PPE (6 << 12) /* checksums */ -#define RAMIPS_ICS_GEN_EN BIT(2) -#define RAMIPS_UCS_GEN_EN BIT(1) -#define RAMIPS_TCS_GEN_EN BIT(0) +#define RAMIPS_ICS_GEN_EN BIT(2) +#define RAMIPS_UCS_GEN_EN BIT(1) +#define RAMIPS_TCS_GEN_EN BIT(0) -/* dma rimg */ -#define RAMIPS_PST_DRX_IDX0 BIT(16) -#define RAMIPS_PST_DTX_IDX3 BIT(3) -#define RAMIPS_PST_DTX_IDX2 BIT(2) -#define RAMIPS_PST_DTX_IDX1 BIT(1) -#define RAMIPS_PST_DTX_IDX0 BIT(0) +/* dma ring */ +#define RAMIPS_PST_DRX_IDX0 BIT(16) +#define RAMIPS_PST_DTX_IDX3 BIT(3) +#define RAMIPS_PST_DTX_IDX2 BIT(2) +#define RAMIPS_PST_DTX_IDX1 BIT(1) +#define RAMIPS_PST_DTX_IDX0 BIT(0) -#define RAMIPS_TX_WB_DDONE BIT(6) -#define RAMIPS_RX_DMA_BUSY BIT(3) -#define RAMIPS_TX_DMA_BUSY BIT(1) -#define RAMIPS_RX_DMA_EN BIT(2) -#define RAMIPS_TX_DMA_EN BIT(0) +#define RAMIPS_TX_WB_DDONE BIT(6) +#define RAMIPS_RX_DMA_BUSY BIT(3) +#define RAMIPS_TX_DMA_BUSY BIT(1) +#define RAMIPS_RX_DMA_EN BIT(2) +#define RAMIPS_TX_DMA_EN BIT(0) -#define RAMIPS_PDMA_SIZE_4DWORDS (0<<4) -#define RAMIPS_PDMA_SIZE_8DWORDS (1<<4) -#define RAMIPS_PDMA_SIZE_16DWORDS (2<<4) +#define RAMIPS_PDMA_SIZE_4DWORDS (0 << 4) +#define RAMIPS_PDMA_SIZE_8DWORDS (1 << 4) +#define RAMIPS_PDMA_SIZE_16DWORDS (2 << 4) -#define RAMIPS_US_CYC_CNT_MASK 0xff -#define RAMIPS_US_CYC_CNT_SHIFT 0x8 -#define RAMIPS_US_CYC_CNT_DIVISOR 1000000 +#define RAMIPS_US_CYC_CNT_MASK 0xff +#define RAMIPS_US_CYC_CNT_SHIFT 0x8 +#define RAMIPS_US_CYC_CNT_DIVISOR 1000000 + +#define RX_DMA_PLEN0(x) ((x >> 16) & 0x3fff) +#define RX_DMA_LSO BIT(30) +#define RX_DMA_DONE BIT(31) -#define RX_DMA_PLEN0(x) ((x >> 16) & 0x3fff) -#define RX_DMA_LSO BIT(30) -#define RX_DMA_DONE BIT(31) struct ramips_rx_dma { unsigned int rxd1; unsigned int rxd2; @@ -168,14 +169,15 @@ struct ramips_rx_dma { unsigned int rxd4; }; -#define TX_DMA_PLEN0_MASK ((0x3fff) << 16) -#define TX_DMA_PLEN0(x) ((x & 0x3fff) << 16) -#define TX_DMA_LSO BIT(30) -#define TX_DMA_DONE BIT(31) -#define TX_DMA_QN(x) (x << 16) -#define TX_DMA_PN(x) (x << 24) -#define TX_DMA_QN_MASK TX_DMA_QN(0x7) -#define TX_DMA_PN_MASK TX_DMA_PN(0x7) +#define TX_DMA_PLEN0_MASK ((0x3fff) << 16) +#define TX_DMA_PLEN0(x) ((x & 0x3fff) << 16) +#define TX_DMA_LSO BIT(30) +#define TX_DMA_DONE BIT(31) +#define TX_DMA_QN(x) (x << 16) +#define TX_DMA_PN(x) (x << 24) +#define TX_DMA_QN_MASK TX_DMA_QN(0x7) +#define TX_DMA_PN_MASK TX_DMA_PN(0x7) + struct ramips_tx_dma { unsigned int txd1; unsigned int txd2; @@ -185,20 +187,20 @@ struct ramips_tx_dma { struct raeth_priv { - unsigned int phy_rx; + unsigned int phy_rx; struct tasklet_struct rx_tasklet; struct ramips_rx_dma *rx; - struct sk_buff *rx_skb[NUM_RX_DESC]; + struct sk_buff *rx_skb[NUM_RX_DESC]; - unsigned int phy_tx; + unsigned int phy_tx; struct tasklet_struct tx_housekeeping_tasklet; struct ramips_tx_dma *tx; - struct sk_buff *tx_skb[NUM_RX_DESC]; + struct sk_buff *tx_skb[NUM_RX_DESC]; - unsigned int skb_free_idx; + unsigned int skb_free_idx; - spinlock_t page_lock; + spinlock_t page_lock; struct ramips_eth_platform_data *plat; }; -#endif +#endif /* RAMIPS_ETH_H */ diff --git a/target/linux/ramips/patches-2.6.30/001-mips-add-cp0-compare-irq-function.patch b/target/linux/ramips/patches-2.6.30/001-mips-add-cp0-compare-irq-function.patch deleted file mode 100644 index adb8044af..000000000 --- a/target/linux/ramips/patches-2.6.30/001-mips-add-cp0-compare-irq-function.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - extern void check_wait(void); - extern asmlinkage void r4k_wait(void); -@@ -1542,6 +1543,8 @@ void __cpuinit per_cpu_trap_init(void) - */ - if (cpu_has_mips_r2) { - cp0_compare_irq = (read_c0_intctl() >> 29) & 7; -+ if (get_c0_compare_irq) -+ cp0_compare_irq = get_c0_compare_irq(); - cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7; - if (cp0_perfcount_irq == cp0_compare_irq) - cp0_perfcount_irq = -1; ---- a/arch/mips/include/asm/time.h -+++ b/arch/mips/include/asm/time.h -@@ -52,6 +52,7 @@ extern int (*perf_irq)(void); - */ - #ifdef CONFIG_CEVT_R4K_LIB - extern unsigned int __weak get_c0_compare_int(void); -+extern unsigned int __weak get_c0_compare_irq(void); - extern int r4k_clockevent_init(void); - #endif - diff --git a/target/linux/ramips/patches-2.6.30/002-mips-clocksource-init-war.patch b/target/linux/ramips/patches-2.6.30/002-mips-clocksource-init-war.patch deleted file mode 100644 index 03a66ff13..000000000 --- a/target/linux/ramips/patches-2.6.30/002-mips-clocksource-init-war.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/arch/mips/kernel/cevt-r4k.c -+++ b/arch/mips/kernel/cevt-r4k.c -@@ -15,6 +15,22 @@ - #include - - /* -+ * Compare interrupt can be routed and latched outside the core, -+ * so a single execution hazard barrier may not be enough to give -+ * it time to clear as seen in the Cause register. 4 time the -+ * pipeline depth seems reasonably conservative, and empirically -+ * works better in configurations with high CPU/bus clock ratios. -+ */ -+ -+#define compare_change_hazard() \ -+ do { \ -+ irq_disable_hazard(); \ -+ irq_disable_hazard(); \ -+ irq_disable_hazard(); \ -+ irq_disable_hazard(); \ -+ } while (0) -+ -+/* - * The SMTC Kernel for the 34K, 1004K, et. al. replaces several - * of these routines with SMTC-specific variants. - */ -@@ -30,6 +46,7 @@ static int mips_next_event(unsigned long - cnt = read_c0_count(); - cnt += delta; - write_c0_compare(cnt); -+ compare_change_hazard(); - res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0; - return res; - } -@@ -99,22 +116,6 @@ static int c0_compare_int_pending(void) - return (read_c0_cause() >> cp0_compare_irq) & 0x100; - } - --/* -- * Compare interrupt can be routed and latched outside the core, -- * so a single execution hazard barrier may not be enough to give -- * it time to clear as seen in the Cause register. 4 time the -- * pipeline depth seems reasonably conservative, and empirically -- * works better in configurations with high CPU/bus clock ratios. -- */ -- --#define compare_change_hazard() \ -- do { \ -- irq_disable_hazard(); \ -- irq_disable_hazard(); \ -- irq_disable_hazard(); \ -- irq_disable_hazard(); \ -- } while (0) -- - int c0_compare_int_usable(void) - { - unsigned int delta; diff --git a/target/linux/ramips/patches-2.6.30/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch b/target/linux/ramips/patches-2.6.30/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch deleted file mode 100644 index 3f25b61dd..000000000 --- a/target/linux/ramips/patches-2.6.30/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/mtd/chips/cfi_cmdset_0002.c -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1579,7 +1579,7 @@ static int __xipram do_erase_chip(struct - chip->erase_suspended = 0; - } - -- if (chip_ready(map, adr)) -+ if (chip_good(map, adr, map_word_ff(map))) - break; - - if (time_after(jiffies, timeo)) { -@@ -1667,7 +1667,7 @@ static int __xipram do_erase_oneblock(st - chip->erase_suspended = 0; - } - -- if (chip_ready(map, adr)) { -+ if (chip_good(map, adr, map_word_ff(map))) { - xip_enable(map, chip, adr); - break; - } diff --git a/target/linux/ramips/patches-2.6.30/100-mips-ralink-core.patch b/target/linux/ramips/patches-2.6.30/100-mips-ralink-core.patch deleted file mode 100644 index d6635357b..000000000 --- a/target/linux/ramips/patches-2.6.30/100-mips-ralink-core.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -607,6 +607,26 @@ ifdef CONFIG_PHYSICAL_START - load-y = $(CONFIG_PHYSICAL_START) - endif - -+# -+# Ralink SoC common stuff -+# -+core-$(CONFIG_MIPS_RALINK) += arch/mips/ralink/common/ -+cflags-$(CONFIG_MIPS_RALINK) += -I$(srctree)/arch/mips/include/asm/mach-ralink -+ -+# -+# Ralink RT288x -+# -+core-$(CONFIG_RALINK_RT288X) += arch/mips/ralink/rt288x/ -+cflags-$(CONFIG_RALINK_RT288X) += -I$(srctree)//arch/mips/include/asm/mach-ralink/rt288x -+load-$(CONFIG_RALINK_RT288X) += 0xffffffff88000000 -+ -+# -+# Ralink RT305x -+# -+core-$(CONFIG_RALINK_RT305X) += arch/mips/ralink/rt305x/ -+cflags-$(CONFIG_RALINK_RT305X) += -I$(srctree)/arch/mips/include/asm/mach-ralink/rt305x -+load-$(CONFIG_RALINK_RT305X) += 0xffffffff80000000 -+ - # temporary until string.h is fixed - cflags-y += -ffreestanding - ---- a/arch/mips/Kconfig -+++ b/arch/mips/Kconfig -@@ -22,6 +22,9 @@ choice - config MACH_ALCHEMY - bool "Alchemy processor based machines" - -+config MIPS_RALINK -+ bool "Ralink MIPS SoC based boards" -+ - config BASLER_EXCITE - bool "Basler eXcite smart camera" - select CEVT_R4K -@@ -638,6 +641,7 @@ source "arch/mips/basler/excite/Kconfig" - source "arch/mips/jazz/Kconfig" - source "arch/mips/lasat/Kconfig" - source "arch/mips/pmc-sierra/Kconfig" -+source "arch/mips/ralink/Kconfig" - source "arch/mips/sgi-ip27/Kconfig" - source "arch/mips/sibyte/Kconfig" - source "arch/mips/txx9/Kconfig" -@@ -989,7 +993,7 @@ config BOOT_ELF32 - - config MIPS_L1_CACHE_SHIFT - int -- default "4" if MACH_DECSTATION || MIKROTIK_RB532 -+ default "4" if MACH_DECSTATION || MIKROTIK_RB532 || RALINK_RT288X - default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || CPU_CAVIUM_OCTEON - default "4" if PMC_MSP4200_EVAL - default "5" diff --git a/target/linux/ramips/patches-2.6.30/101-rt288x_serial_driver_hack.patch b/target/linux/ramips/patches-2.6.30/101-rt288x_serial_driver_hack.patch deleted file mode 100644 index eedd704aa..000000000 --- a/target/linux/ramips/patches-2.6.30/101-rt288x_serial_driver_hack.patch +++ /dev/null @@ -1,118 +0,0 @@ ---- a/drivers/serial/8250.c -+++ b/drivers/serial/8250.c -@@ -289,9 +289,9 @@ static const struct serial8250_config ua - }, - }; - --#if defined (CONFIG_SERIAL_8250_AU1X00) -+#if defined (CONFIG_SERIAL_8250_AU1X00) || defined (CONFIG_SERIAL_8250_RT288X) - --/* Au1x00 UART hardware has a weird register layout */ -+/* Au1x00 and RT288x UART hardware has a weird register layout */ - static const u8 au_io_in_map[] = { - [UART_RX] = 0, - [UART_IER] = 2, -@@ -409,7 +409,7 @@ static unsigned int mem32_serial_in(stru - return readl(p->membase + offset); - } - --#ifdef CONFIG_SERIAL_8250_AU1X00 -+#if defined(CONFIG_SERIAL_8250_AU1X00) || defined(CONFIG_SERIAL_8250_RT288X) - static unsigned int au_serial_in(struct uart_port *p, int offset) - { - offset = map_8250_in_reg(p, offset) << p->regshift; -@@ -490,7 +490,7 @@ static void set_io_from_upio(struct uart - p->serial_out = mem32_serial_out; - break; - --#ifdef CONFIG_SERIAL_8250_AU1X00 -+#if defined (CONFIG_SERIAL_8250_AU1X00) || defined (CONFIG_SERIAL_8250_RT288X) - case UPIO_AU: - p->serial_in = au_serial_in; - p->serial_out = au_serial_out; -@@ -522,7 +522,7 @@ serial_out_sync(struct uart_8250_port *u - switch (p->iotype) { - case UPIO_MEM: - case UPIO_MEM32: --#ifdef CONFIG_SERIAL_8250_AU1X00 -+#if defined (CONFIG_SERIAL_8250_AU1X00) || defined (CONFIG_SERIAL_8250_RT288X) - case UPIO_AU: - #endif - case UPIO_DWAPB: -@@ -560,8 +560,8 @@ static inline void _serial_dl_write(stru - serial_outp(up, UART_DLM, value >> 8 & 0xff); - } - --#if defined(CONFIG_SERIAL_8250_AU1X00) --/* Au1x00 haven't got a standard divisor latch */ -+#if defined (CONFIG_SERIAL_8250_AU1X00) || defined (CONFIG_SERIAL_8250_RT288X) -+/* Au1x00 and RT288x haven't got a standard divisor latch */ - static int serial_dl_read(struct uart_8250_port *up) - { - if (up->port.iotype == UPIO_AU) -@@ -768,22 +768,19 @@ static int size_fifo(struct uart_8250_po - */ - static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p) - { -- unsigned char old_dll, old_dlm, old_lcr; -+ unsigned char old_lcr; -+ unsigned int old_dl; - unsigned int id; - - old_lcr = serial_inp(p, UART_LCR); - serial_outp(p, UART_LCR, UART_LCR_DLAB); - -- old_dll = serial_inp(p, UART_DLL); -- old_dlm = serial_inp(p, UART_DLM); -+ old_dl = serial_dl_read(p); - -- serial_outp(p, UART_DLL, 0); -- serial_outp(p, UART_DLM, 0); -+ serial_dl_write(p, 0); -+ id = serial_dl_read(p); - -- id = serial_inp(p, UART_DLL) | serial_inp(p, UART_DLM) << 8; -- -- serial_outp(p, UART_DLL, old_dll); -- serial_outp(p, UART_DLM, old_dlm); -+ serial_dl_write(p, old_dl); - serial_outp(p, UART_LCR, old_lcr); - - return id; -@@ -1205,7 +1202,7 @@ static void autoconfig(struct uart_8250_ - } - #endif - --#ifdef CONFIG_SERIAL_8250_AU1X00 -+#if defined (CONFIG_SERIAL_8250_AU1X00) || defined (CONFIG_SERIAL_8250_RT288X) - /* if access method is AU, it is a 16550 with a quirk */ - if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU) - up->bugs |= UART_BUG_NOMSR; ---- a/drivers/serial/Kconfig -+++ b/drivers/serial/Kconfig -@@ -266,6 +266,14 @@ config SERIAL_8250_AU1X00 - say Y to this option. The driver can handle up to 4 serial ports, - depending on the SOC. If unsure, say N. - -+config SERIAL_8250_RT288X -+ bool "Ralink RT288x/RT305x serial port support" -+ depends on SERIAL_8250 != n && (SOC_RT288X || SOC_RT305X) -+ help -+ If you have a Ralink RT288x/RT305x SoC based board and want to use the -+ serial port, say Y to this option. The driver can handle up to 2 serial -+ ports. If unsure, say N. -+ - config SERIAL_8250_RM9K - bool "Support for MIPS RM9xxx integrated serial port" - depends on SERIAL_8250 != n && SERIAL_RM9000 ---- a/include/linux/serial_core.h -+++ b/include/linux/serial_core.h -@@ -269,7 +269,7 @@ struct uart_port { - #define UPIO_HUB6 (1) - #define UPIO_MEM (2) - #define UPIO_MEM32 (3) --#define UPIO_AU (4) /* Au1x00 type IO */ -+#define UPIO_AU (4) /* Au1x00 and RT288x type IO */ - #define UPIO_TSI (5) /* Tsi108/109 type IO */ - #define UPIO_DWAPB (6) /* DesignWare APB UART */ - #define UPIO_RM9000 (7) /* RM9000 type IO */ diff --git a/target/linux/ramips/patches-2.6.30/102-rt288x-pci-driver-hook.patch b/target/linux/ramips/patches-2.6.30/102-rt288x-pci-driver-hook.patch deleted file mode 100644 index f6f71c3e3..000000000 --- a/target/linux/ramips/patches-2.6.30/102-rt288x-pci-driver-hook.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- a/arch/mips/pci/Makefile -+++ b/arch/mips/pci/Makefile -@@ -52,3 +52,4 @@ obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc - obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o - obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o - obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o -+obj-$(CONFIG_SOC_RT288X) += pci-rt288x.o diff --git a/target/linux/ramips/patches-2.6.30/103-ethernet.patch b/target/linux/ramips/patches-2.6.30/103-ethernet.patch deleted file mode 100644 index 1828cbfc1..000000000 --- a/target/linux/ramips/patches-2.6.30/103-ethernet.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/drivers/net/Kconfig -+++ b/drivers/net/Kconfig -@@ -612,6 +612,12 @@ config MIPS_AU1X00_ENET - If you have an Alchemy Semi AU1X00 based system - say Y. Otherwise, say N. - -+config MIPS_RAMIPS_NET -+ tristate "Ethernet driver for rt288x/rt305x" -+ depends on MIPS_RALINK -+ help -+ This driver supports the etehrnet mac inside the ralink wisocs -+ - config SGI_IOC3_ETH - bool "SGI IOC3 Ethernet" - depends on PCI && SGI_IP27 ---- a/drivers/net/Makefile -+++ b/drivers/net/Makefile -@@ -204,6 +204,7 @@ obj-$(CONFIG_KORINA) += korina.o - obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o - obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o - obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o -+obj-$(CONFIG_MIPS_RAMIPS_NET) += ramips.o - obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o - obj-$(CONFIG_DECLANCE) += declance.o - obj-$(CONFIG_ATARILANCE) += atarilance.o diff --git a/target/linux/ar71xx/patches-2.6.30/400-mips-multi-machine-update.patch b/target/linux/ramips/patches-2.6.32/400-mips-multi-machine-update.patch similarity index 100% rename from target/linux/ar71xx/patches-2.6.30/400-mips-multi-machine-update.patch rename to target/linux/ramips/patches-2.6.32/400-mips-multi-machine-update.patch diff --git a/target/linux/ramips/rt288x/config-2.6.32 b/target/linux/ramips/rt288x/config-2.6.32 index e0e0e166d..a89d42229 100644 --- a/target/linux/ramips/rt288x/config-2.6.32 +++ b/target/linux/ramips/rt288x/config-2.6.32 @@ -116,11 +116,14 @@ CONFIG_PHYLIB=y # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_STB810 is not set # CONFIG_PROBE_INITRD_HEADER is not set +CONFIG_RALINK_DEV_GPIO_BUTTONS=y CONFIG_RALINK_DEV_GPIO_LEDS=y CONFIG_RALINK_RT288X=y # CONFIG_RALINK_RT305X is not set CONFIG_RT288X_MACH_RT_N15=y CONFIG_RT288X_MACH_WZR_AGL300NH=y +CONFIG_RTL8366S_PHY=y +CONFIG_RTL8366_SMI=y CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCSI_DMA is not set # CONFIG_SERIAL_8250_EXTENDED is not set @@ -141,6 +144,7 @@ CONFIG_SERIAL_8250_RT288X=y # CONFIG_SLAB is not set CONFIG_SLUB=y CONFIG_SOC_RT288X=y +CONFIG_SWCONFIG=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y CONFIG_SYS_HAS_CPU_MIPS32_R2=y CONFIG_SYS_HAS_EARLY_PRINTK=y diff --git a/target/linux/ramips/rt305x/config-2.6.32 b/target/linux/ramips/rt305x/config-2.6.32 index 76e97e3f3..d6e873f42 100644 --- a/target/linux/ramips/rt305x/config-2.6.32 +++ b/target/linux/ramips/rt305x/config-2.6.32 @@ -112,6 +112,7 @@ CONFIG_PHYLIB=y # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_STB810 is not set # CONFIG_PROBE_INITRD_HEADER is not set +CONFIG_RALINK_DEV_GPIO_BUTTONS=y CONFIG_RALINK_DEV_GPIO_LEDS=y # CONFIG_RALINK_RT288X is not set CONFIG_RALINK_RT305X=y diff --git a/target/linux/rb532/config-default b/target/linux/rb532/config-default index 811477904..5018a2fae 100644 --- a/target/linux/rb532/config-default +++ b/target/linux/rb532/config-default @@ -1,33 +1,37 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +# CONFIG_AR7 is not set # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_POPULATES_NODE_MAP=y CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SUPPORTS_MSI is not set CONFIG_ARCH_SUPPORTS_OPROFILE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ATA=y +# CONFIG_ATA_PIIX is not set # CONFIG_BCM47XX is not set -# CONFIG_BINARY_PRINTF is not set +# CONFIG_BCM63XX is not set CONFIG_BITREVERSE=y CONFIG_BLK_DEV_SD=y CONFIG_BOOT_RAW=y # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_CEVT_R4K_LIB=y CONFIG_CEVT_R4K=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 # CONFIG_CPU_BIG_ENDIAN is not set # CONFIG_CPU_CAVIUM_OCTEON is not set -CONFIG_CPU_HAS_LLSC=y CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y CONFIG_CPU_LITTLE_ENDIAN=y -# CONFIG_CPU_LOONGSON2 is not set +# CONFIG_CPU_LOONGSON2E is not set +CONFIG_CPU_MIPS32=y CONFIG_CPU_MIPS32_R1=y # CONFIG_CPU_MIPS32_R2 is not set -CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS64_R1 is not set # CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR1=y @@ -49,8 +53,8 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y # CONFIG_CPU_TX39XX is not set # CONFIG_CPU_TX49XX is not set # CONFIG_CPU_VR41XX is not set -CONFIG_CSRC_R4K_LIB=y CONFIG_CSRC_R4K=y +CONFIG_CSRC_R4K_LIB=y # CONFIG_DEBUG_FS is not set CONFIG_DECOMPRESS_LZMA=y CONFIG_DEVPORT=y @@ -59,8 +63,9 @@ CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y # CONFIG_ENABLE_WARN_DEPRECATED is not set CONFIG_EXT2_FS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_FSNOTIFY is not set CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y @@ -73,15 +78,14 @@ CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y -CONFIG_HAVE_MLOCK=y CONFIG_HAVE_OPROFILE=y # CONFIG_HIGH_RES_TIMERS is not set CONFIG_HW_HAS_PCI=y CONFIG_HW_RANDOM=y -# CONFIG_HZ_100 is not set CONFIG_HZ=250 +# CONFIG_HZ_100 is not set CONFIG_HZ_250=y CONFIG_IMAGE_CMDLINE_HACK=y CONFIG_INITRAMFS_SOURCE="" @@ -90,14 +94,15 @@ CONFIG_KEXEC=y CONFIG_KORINA=y # CONFIG_LEDS_GPIO is not set CONFIG_LEDS_MIKROTIK_RB532=y -# CONFIG_LEMOTE_FULONG is not set # CONFIG_MACH_ALCHEMY is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_LOONGSON is not set # CONFIG_MACH_TX39XX is not set # CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set CONFIG_MIKROTIK_RB532=y +CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set CONFIG_MIPS_L1_CACHE_SHIFT=4 # CONFIG_MIPS_MACHINE is not set @@ -106,16 +111,15 @@ CONFIG_MIPS_MT_DISABLED=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_MT_SMTC is not set # CONFIG_MIPS_SIM is not set -CONFIG_MIPS=y CONFIG_MTD_BLOCK2MTD=y CONFIG_MTD_CFI_ADV_OPTIONS=y # CONFIG_MTD_CFI_AMDSTD is not set CONFIG_MTD_CFI_GEOMETRY=y # CONFIG_MTD_CFI_INTELEXT is not set # CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_NAND=y CONFIG_MTD_NAND_PLATFORM=y CONFIG_MTD_NAND_VERIFY_WRITE=y -CONFIG_MTD_NAND=y CONFIG_MTD_PHYSMAP=y # CONFIG_MTD_ROOTFS_ROOT_DEV is not set # CONFIG_MTD_ROOTFS_SPLIT is not set @@ -135,10 +139,10 @@ CONFIG_PCSPKR_PLATFORM=y # CONFIG_PROBE_INITRD_HEADER is not set CONFIG_RC32434_WDT=y CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_SCSI=y # CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_PROC_FS is not set -CONFIG_SCSI=y # CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SGI_IP22 is not set # CONFIG_SGI_IP27 is not set @@ -152,17 +156,17 @@ CONFIG_SCSI=y # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set -# CONFIG_SLOW_WORK is not set CONFIG_SWAP_IO_SPACE=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y # CONFIG_TC35815 is not set -CONFIG_TRACING_SUPPORT=y CONFIG_TRAD_SIGNALS=y -CONFIG_VIA_RHINE_MMIO=y +# CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y CONFIG_VIA_RHINE=y +CONFIG_VIA_RHINE_MMIO=y CONFIG_YAFFS_9BYTE_TAGS=y # CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set CONFIG_YAFFS_AUTO_YAFFS2=y diff --git a/target/linux/rb532/patches/001-cmdline_hack.patch b/target/linux/rb532/patches-2.6.30/001-cmdline_hack.patch similarity index 100% rename from target/linux/rb532/patches/001-cmdline_hack.patch rename to target/linux/rb532/patches-2.6.30/001-cmdline_hack.patch diff --git a/target/linux/rb532/patches/002-rb532_nand_fixup.patch b/target/linux/rb532/patches-2.6.30/002-rb532_nand_fixup.patch similarity index 100% rename from target/linux/rb532/patches/002-rb532_nand_fixup.patch rename to target/linux/rb532/patches-2.6.30/002-rb532_nand_fixup.patch diff --git a/target/linux/rb532/patches/100-check_media.patch b/target/linux/rb532/patches-2.6.30/100-check_media.patch similarity index 100% rename from target/linux/rb532/patches/100-check_media.patch rename to target/linux/rb532/patches-2.6.30/100-check_media.patch diff --git a/target/linux/rb532/patches-2.6.32/001-cmdline_hack.patch b/target/linux/rb532/patches-2.6.32/001-cmdline_hack.patch new file mode 100644 index 000000000..82a324ccf --- /dev/null +++ b/target/linux/rb532/patches-2.6.32/001-cmdline_hack.patch @@ -0,0 +1,20 @@ +--- a/arch/mips/rb532/prom.c ++++ b/arch/mips/rb532/prom.c +@@ -67,6 +67,7 @@ static inline unsigned long tag2ul(char + return simple_strtoul(num, 0, 10); + } + ++extern char __image_cmdline[]; + void __init prom_setup_cmdline(void) + { + static char cmd_line[CL_SIZE] __initdata; +@@ -109,6 +110,9 @@ void __init prom_setup_cmdline(void) + } + *(cp++) = ' '; + ++ strcpy(cp,(__image_cmdline)); ++ cp += strlen(__image_cmdline); ++ + i = strlen(arcs_cmdline); + if (i > 0) { + *(cp++) = ' '; diff --git a/target/linux/rb532/patches-2.6.32/002-rb532_nand_fixup.patch b/target/linux/rb532/patches-2.6.32/002-rb532_nand_fixup.patch new file mode 100644 index 000000000..0ba9fefb0 --- /dev/null +++ b/target/linux/rb532/patches-2.6.32/002-rb532_nand_fixup.patch @@ -0,0 +1,48 @@ +--- a/arch/mips/rb532/devices.c ++++ b/arch/mips/rb532/devices.c +@@ -139,6 +139,19 @@ static struct platform_device cf_slot0 = + }; + + /* Resources and device for NAND */ ++ ++/* ++ * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader ++ * will not be able to find the kernel that we load. So set the oobinfo ++ * when creating the partitions ++ */ ++static struct nand_ecclayout rb532_nand_ecclayout = { ++ .eccbytes = 6, ++ .eccpos = { 8, 9, 10, 13, 14, 15 }, ++ .oobavail = 9, ++ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } } ++}; ++ + static int rb532_dev_ready(struct mtd_info *mtd) + { + return gpio_get_value(GPIO_RDY); +@@ -280,6 +293,16 @@ static void __init parse_mac_addr(char * + /* NAND definitions */ + #define NAND_CHIP_DELAY 25 + ++static int rb532_nand_fixup(struct mtd_info *mtd) ++{ ++ struct nand_chip *chip = mtd->priv; ++ ++ if (mtd->writesize == 512) ++ chip->ecc.layout = &rb532_nand_ecclayout; ++ ++ return 0; ++} ++ + static void __init rb532_nand_setup(void) + { + switch (mips_machtype) { +@@ -299,6 +322,8 @@ static void __init rb532_nand_setup(void + rb532_nand_data.chip.partitions = rb532_partition_info; + rb532_nand_data.chip.chip_delay = NAND_CHIP_DELAY; + rb532_nand_data.chip.options = NAND_NO_AUTOINCR; ++ ++ rb532_nand_data.chip.chip_fixup = &rb532_nand_fixup; + } + + diff --git a/target/linux/rdc/base-files/lib/preinit/05_set_ether_mac_rdc b/target/linux/rdc/base-files/lib/preinit/05_set_ether_mac_rdc index 43823c48e..afb3cb49b 100644 --- a/target/linux/rdc/base-files/lib/preinit/05_set_ether_mac_rdc +++ b/target/linux/rdc/base-files/lib/preinit/05_set_ether_mac_rdc @@ -1,7 +1,7 @@ #!/bin/sh # Copyright (C) 2009 OpenWrt.org -. /etc/boot.sh +. /lib/functions/boot.sh r6040_module() { insmod r6040 diff --git a/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 b/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 index 97392774d..dd7330d5d 100644 --- a/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 +++ b/target/linux/x86/base-files/lib/preinit/45_failsafe_x86 @@ -4,7 +4,7 @@ failsafe_wait() { FAILSAFE= - grep 'failsafe=' /proc/cmdline > /dev/null && FAILSAFE=true && export FAILSAFE + grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE if [ "$FAILSAFE" != "true" ]; then preinit_net_echo "Please press button now to enter failsafe" echo -n "Press " diff --git a/target/linux/x86/olpc/base-files/lib/preinit/45_failsafe_x86 b/target/linux/x86/olpc/base-files/lib/preinit/45_failsafe_x86 index 97392774d..dd7330d5d 100644 --- a/target/linux/x86/olpc/base-files/lib/preinit/45_failsafe_x86 +++ b/target/linux/x86/olpc/base-files/lib/preinit/45_failsafe_x86 @@ -4,7 +4,7 @@ failsafe_wait() { FAILSAFE= - grep 'failsafe=' /proc/cmdline > /dev/null && FAILSAFE=true && export FAILSAFE + grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE if [ "$FAILSAFE" != "true" ]; then preinit_net_echo "Please press button now to enter failsafe" echo -n "Press " diff --git a/target/linux/xburst/config-2.6.32 b/target/linux/xburst/config-2.6.32 index d2bbb5a0d..37d2c420c 100644 --- a/target/linux/xburst/config-2.6.32 +++ b/target/linux/xburst/config-2.6.32 @@ -24,6 +24,7 @@ CONFIG_BITREVERSE=y # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set CONFIG_CFG80211_DEFAULT_PS_VALUE=0 +CONFIG_CHARGER_GPIO=y CONFIG_CONSOLE_TRANSLATIONS=y # CONFIG_CPU_BIG_ENDIAN is not set # CONFIG_CPU_CAVIUM_OCTEON is not set @@ -102,7 +103,6 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_GPIO=y CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y CONFIG_GPIOLIB=y -# CONFIG_GPIO_MC33880 is not set # CONFIG_HAMRADIO is not set CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y @@ -122,7 +122,6 @@ CONFIG_INPUT=y CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_GPIO_BUTTONS is not set CONFIG_INPUT_KEYBOARD=y -# CONFIG_INPUT_YEALINK is not set CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_CFQ=y # CONFIG_IP_ADVANCED_ROUTER is not set @@ -174,7 +173,6 @@ CONFIG_MACH_JZ=y # CONFIG_MACH_TX39XX is not set # CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set -# CONFIG_MFD_MC13783 is not set # CONFIG_MIKROTIK_RB532 is not set # CONFIG_MINI_FO is not set CONFIG_MIPS=y @@ -198,7 +196,6 @@ CONFIG_MMC_UNSAFE_RESUME=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_JZ4740=y CONFIG_MTD_NAND_VERIFY_WRITE=y -# CONFIG_MTD_SST25L is not set CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_RESERVE=1 # CONFIG_MTD_UBI_DEBUG is not set @@ -255,6 +252,7 @@ CONFIG_NLS_UTF8=y # CONFIG_PACKET_MMAP is not set CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_PCSPKR_PLATFORM=y +# CONFIG_PCI is not set # CONFIG_PDA_POWER is not set CONFIG_PM=y # CONFIG_PMC_MSP is not set @@ -273,12 +271,11 @@ CONFIG_RELAY=y CONFIG_RTC_CLASS=y # CONFIG_RTC_DRV_CMOS is not set CONFIG_RTC_DRV_JZ4740=y -# CONFIG_RTC_DRV_PCF2123 is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCSI_DMA is not set # CONFIG_SDIO_UART is not set CONFIG_SECCOMP=y -# CONFIG_SERIAL_8250 is not set +# CONFIG_SERIAL_8250_EXTENDED is not set CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_LIBPS2=y @@ -302,7 +299,7 @@ CONFIG_SND=y CONFIG_SND_JACK=y CONFIG_SND_JZ4740_SOC=y CONFIG_SND_JZ4740_SOC_I2S=y -CONFIG_SND_JZ4740_SOC_QI_LB60=y +# CONFIG_SND_JZ4740_SOC_QI_LB60 is not set CONFIG_SND_MIXER_OSS=y # CONFIG_SND_OPL3_LIB_SEQ is not set # CONFIG_SND_OPL4_LIB_SEQ is not set @@ -347,6 +344,8 @@ CONFIG_UBIFS_FS_LZO=y # CONFIG_UBIFS_FS_XATTR is not set CONFIG_UBIFS_FS_ZLIB=y # CONFIG_USB_ARCH_HAS_EHCI is not set +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set # CONFIG_USB_AUDIO is not set # CONFIG_USB_CDC_COMPOSITE is not set CONFIG_USB_ETH=y diff --git a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c index 5d22e2037..643f9c838 100644 --- a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c +++ b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -286,8 +287,6 @@ static struct spi_board_info qi_lb60_spi_board_info[] = { /* Battery */ static struct jz_batt_info qi_lb60_battery_pdata = { - .dc_dect_gpio = GPIO_DC_DETE_N, - .usb_dect_gpio = GPIO_USB_DETE, .charg_stat_gpio = GPIO_CHARG_STAT_N, .min_voltag = 3600000, @@ -295,6 +294,26 @@ static struct jz_batt_info qi_lb60_battery_pdata = { .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO, }; +static char *qi_lb60_batteries[] = { + "battery", +}; + +static struct gpio_charger_platform_data qi_lb60_charger_pdata = { + .name = "USB", + .type = POWER_SUPPLY_TYPE_USB, + .gpio = GPIO_USB_DETE, + .gpio_active_low = 1, + .batteries = qi_lb60_batteries, + .num_batteries = ARRAY_SIZE(qi_lb60_batteries), +}; + +static struct platform_device qi_lb60_charger_device = { + .name = "gpio-charger", + .dev = { + .platform_data = &qi_lb60_charger_pdata, + }, +}; + /* GPIO Key: power */ static struct gpio_keys_button qi_lb60_gpio_keys_buttons[] = { [0] = { @@ -340,6 +359,7 @@ static struct platform_device *jz_platform_devices[] __initdata = { &jz4740_adc_device, &jz4740_battery_device, &qi_lb60_gpio_keys, + &qi_lb60_charger_device, }; static void __init board_gpio_setup(void) diff --git a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c index 1145921ba..1b32a8dee 100644 --- a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c +++ b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c @@ -27,9 +27,9 @@ #define JZ_REG_CLOCK_CTRL 0x00 #define JZ_REG_CLOCK_LOW_POWER 0x04 -#define JZ_REG_CLOCK_SLEEP_CTRL 0x08 #define JZ_REG_CLOCK_PLL 0x10 #define JZ_REG_CLOCK_GATE 0x20 +#define JZ_REG_CLOCK_SLEEP_CTRL 0x24 #define JZ_REG_CLOCK_I2S 0x60 #define JZ_REG_CLOCK_LCD 0x64 #define JZ_REG_CLOCK_MMC 0x68 diff --git a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/platform.c b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/platform.c index 4e379294a..ec34ea257 100644 --- a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/platform.c +++ b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/platform.c @@ -108,7 +108,7 @@ struct platform_device jz4740_mmc_device = { static struct resource jz4740_rtc_resources[] = { [0] = { .start = CPHYSADDR(RTC_BASE), - .end = CPHYSADDR(RTC_BASE) + 0x10, + .end = CPHYSADDR(RTC_BASE) + 0x38 - 1, .flags = IORESOURCE_MEM, }, [1] = { diff --git a/target/linux/xburst/files-2.6.32/drivers/power/gpio-charger.c b/target/linux/xburst/files-2.6.32/drivers/power/gpio-charger.c new file mode 100644 index 000000000..95c6ba71d --- /dev/null +++ b/target/linux/xburst/files-2.6.32/drivers/power/gpio-charger.c @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2010, Lars-Peter Clausen + * Driver for chargers indicating their status through a GPIO pin + * + * 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. + * + * 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., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct gpio_charger { + const struct gpio_charger_platform_data *pdata; + + int irq; + + struct power_supply charger; +}; + +static irqreturn_t gpio_charger_irq(int irq, void *devid) +{ + struct power_supply *charger = devid; + power_supply_changed(charger); + + return IRQ_HANDLED; +} + +static inline struct gpio_charger *psy_to_gpio_charger(struct power_supply *psy) +{ + return container_of(psy, struct gpio_charger, charger); +} + +static int gpio_charger_get_property(struct power_supply *psy, + enum power_supply_property psp, + union power_supply_propval *val) +{ + struct gpio_charger *gpio_charger = psy_to_gpio_charger(psy); + const struct gpio_charger_platform_data *pdata = gpio_charger->pdata; + + switch (psp) { + case POWER_SUPPLY_PROP_ONLINE: + val->intval = gpio_get_value(pdata->gpio); + val->intval ^= pdata->gpio_active_low; + break; + default: + return -EINVAL; + } + + return 0; +} + +static enum power_supply_property gpio_charger_properties[] = { + POWER_SUPPLY_PROP_ONLINE, +}; + +static int __devinit gpio_charger_probe(struct platform_device *pdev) +{ + const struct gpio_charger_platform_data *pdata = pdev->dev.platform_data; + struct gpio_charger *gpio_charger; + struct power_supply *charger; + int ret; + + if (!pdata) { + dev_err(&pdev->dev, "No platform data"); + return -EINVAL; + } + + gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL); + + charger = &gpio_charger->charger; + + charger->name = pdata->name; + charger->type = pdata->type; + charger->properties = gpio_charger_properties; + charger->num_properties = ARRAY_SIZE(gpio_charger_properties); + charger->get_property = gpio_charger_get_property; + charger->supplied_to = pdata->batteries; + charger->num_supplicants = pdata->num_batteries; + + if (gpio_is_valid(pdata->gpio)) { + ret = gpio_request(pdata->gpio, dev_name(&pdev->dev)); + if (ret) { + dev_err(&pdev->dev, "Failed to request gpio pin: %d\n", ret); + goto err; + } + ret = gpio_direction_input(pdata->gpio); + if (ret) { + dev_err(&pdev->dev, "Failed to set gpio to input: %d\n", ret); + goto err_gpio_free; + } + + gpio_charger->irq = gpio_to_irq(pdata->gpio); + if (gpio_charger->irq >= 0) { + ret = request_irq(gpio_charger->irq, gpio_charger_irq, + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + dev_name(&pdev->dev), charger); + if (ret) { + dev_warn(&pdev->dev, "Failed to request online gpio irq: %d\n", ret); + gpio_charger->irq = -1; + } + } + } + + ret = power_supply_register(&pdev->dev, charger); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to register power supply: %d\n", ret); + goto err_gpio_free; + } + + gpio_charger->pdata = pdata; + platform_set_drvdata(pdev, gpio_charger); + + return 0; + +err_gpio_free: + if (gpio_is_valid(pdata->gpio)) { + if (gpio_charger->irq >= 0) + free_irq(gpio_charger->irq, charger); + gpio_free(pdata->gpio); + } +err: + return ret; +} + +static int __devexit gpio_charger_remove(struct platform_device *pdev) +{ + struct gpio_charger *gpio_charger = platform_get_drvdata(pdev); + const struct gpio_charger_platform_data *pdata = gpio_charger->pdata; + + power_supply_unregister(&gpio_charger->charger); + + if (gpio_is_valid(pdata->gpio)) { + if (gpio_charger->irq >= 0) + free_irq(gpio_charger->irq, &gpio_charger->charger); + gpio_free(pdata->gpio); + } + + platform_set_drvdata(pdev, NULL); + kfree(gpio_charger); + + return 0; +} + +static struct platform_driver gpio_charger_driver = { + .probe = gpio_charger_probe, + .remove = __devexit_p(gpio_charger_remove), + .driver = { + .name = "gpio-charger", + .owner = THIS_MODULE, + }, +}; + +static int __init gpio_charger_init(void) +{ + return platform_driver_register(&gpio_charger_driver); +} +module_init(gpio_charger_init); + +static void gpio_charger_exit(void) +{ + platform_driver_unregister(&gpio_charger_driver); +} +module_exit(gpio_charger_exit); + +MODULE_AUTHOR("Lars-Peter Clausen "); +MODULE_DESCRIPTION("Driver for chargers indicating their status through a gpio"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:gpio-charger"); diff --git a/target/linux/xburst/files-2.6.32/drivers/power/jz4740-battery.c b/target/linux/xburst/files-2.6.32/drivers/power/jz4740-battery.c index fe03d8076..70c80ebd7 100644 --- a/target/linux/xburst/files-2.6.32/drivers/power/jz4740-battery.c +++ b/target/linux/xburst/files-2.6.32/drivers/power/jz4740-battery.c @@ -1,11 +1,13 @@ /* * Battery measurement code for Ingenic JZ SOC. * + * Copyright (C) 2009 Jiejing Zhang + * Copyright (C) 2010, Lars-Peter Clausen + * * based on tosa_battery.c * * Copyright (C) 2008 Marek Vasut - * Copyright (C) 2009 Jiejing Zhang - * +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -19,120 +21,56 @@ #include #include #include +#include #include #include -struct jz_battery_info { - struct power_supply usb; - struct power_supply bat; - struct power_supply ac; - int bat_status; - struct jz_batt_info *pdata; - struct mutex work_lock; - struct workqueue_struct *monitor_wqueue; - struct delayed_work bat_work; +struct jz_battery { + struct jz_battery_platform_data *pdata; + + int charge_irq; + + int status; + long voltage; + + struct power_supply battery; + struct delayed_work work; }; -#define ps_to_jz_battery(x) container_of((x), struct jz_battery_info, bat); - -/********************************************************************* - * Power - *********************************************************************/ - - -static int jz_get_power_prop(struct jz_battery_info *bat_info, - struct power_supply *psy, - enum power_supply_property psp, - union power_supply_propval *val) +static inline struct jz_battery *psy_to_jz_battery(struct power_supply *psy) { - int gpio; - - if (bat_info == 0 || bat_info->pdata == 0) - return -EINVAL; - gpio = (psy->type == POWER_SUPPLY_TYPE_MAINS) ? - bat_info->pdata->dc_dect_gpio : - bat_info->pdata->usb_dect_gpio; - if (!gpio_is_valid(gpio)) - return -EINVAL; - switch (psp) { - case POWER_SUPPLY_PROP_ONLINE: - val->intval = !gpio_get_value(gpio); - break; - default: - return -EINVAL; - } - - return 0; + return container_of(psy, struct jz_battery, battery); } -static int jz_usb_get_power_prop(struct power_supply *psy, - enum power_supply_property psp, - union power_supply_propval *val) +static long jz_battery_read_voltage(struct jz_battery *jz_battery) { - struct jz_battery_info *bat_info = container_of(psy, struct jz_battery_info, usb); - return jz_get_power_prop(bat_info, psy, psp, val); -} - -static int jz_ac_get_power_prop(struct power_supply *psy, - enum power_supply_property psp, - union power_supply_propval *val) -{ - struct jz_battery_info *bat_info = container_of(psy, struct jz_battery_info, ac); - return jz_get_power_prop(bat_info, psy, psp, val); -} - - -static enum power_supply_property jz_power_props[] = { - POWER_SUPPLY_PROP_ONLINE, -}; - -static struct power_supply jz_ac = { - .name = "ac", - .type = POWER_SUPPLY_TYPE_MAINS, - .properties = jz_power_props, - .num_properties = ARRAY_SIZE(jz_power_props), - .get_property = jz_ac_get_power_prop, -}; - -static struct power_supply jz_usb = { - .name = "usb", - .type = POWER_SUPPLY_TYPE_USB, - .properties = jz_power_props, - .num_properties = ARRAY_SIZE(jz_power_props), - .get_property = jz_usb_get_power_prop, -}; - - -/********************************************************************* - * Battery properties - *********************************************************************/ - -static long jz_read_bat(struct power_supply *psy) -{ - struct jz_battery_info *bat_info = ps_to_jz_battery(psy); + struct device *adc = jz_battery->battery.dev->parent->parent; enum jz_adc_battery_scale scale; - if (bat_info->pdata->max_voltag > 2500000) + if (jz_battery->pdata->info.voltage_max_design > 2500000) scale = JZ_ADC_BATTERY_SCALE_7V5; else scale = JZ_ADC_BATTERY_SCALE_2V5; - return jz4740_adc_read_battery_voltage(psy->dev->parent->parent, scale); + return jz4740_adc_read_battery_voltage(adc, scale); } -static int jz_bat_get_capacity(struct power_supply *psy) +static int jz_battery_get_capacity(struct power_supply *psy) { + struct jz_battery *jz_battery = psy_to_jz_battery(psy); + struct power_supply_info *info = &jz_battery->pdata->info; + long voltage; int ret; - struct jz_battery_info *bat_info = ps_to_jz_battery(psy); + int voltage_span; - ret = jz_read_bat(psy); + voltage = jz_battery_read_voltage(jz_battery); - if (ret < 0) - return ret; + if (voltage < 0) + return voltage; - ret = (ret - bat_info->pdata->min_voltag) * 100 - / (bat_info->pdata->max_voltag - bat_info->pdata->min_voltag); + voltage_span = info->voltage_max_design - info->voltage_min_design; + ret = ((voltage - info->voltage_min_design) * 100) / voltage_span; if (ret > 100) ret = 100; @@ -142,46 +80,41 @@ static int jz_bat_get_capacity(struct power_supply *psy) return ret; } -static int jz_bat_get_property(struct power_supply *psy, +static int jz_battery_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { - struct jz_battery_info *bat_info = ps_to_jz_battery(psy) - + struct jz_battery *jz_battery = psy_to_jz_battery(psy); + struct power_supply_info *info = &jz_battery->pdata->info; + long voltage; + switch (psp) { case POWER_SUPPLY_PROP_STATUS: - val->intval = bat_info->bat_status; + val->intval = jz_battery->status; break; case POWER_SUPPLY_PROP_TECHNOLOGY: - val->intval = bat_info->pdata->batt_tech; + val->intval = jz_battery->pdata->info.technology; break; case POWER_SUPPLY_PROP_HEALTH: - if(jz_read_bat(psy) < bat_info->pdata->min_voltag) { - dev_dbg(psy->dev, "%s: battery is dead," - "voltage too low!\n", __func__); + voltage = jz_battery_read_voltage(jz_battery); + if (voltage < info->voltage_min_design) val->intval = POWER_SUPPLY_HEALTH_DEAD; - } else { - dev_dbg(psy->dev, "%s: battery is good," - "voltage normal.\n", __func__); + else val->intval = POWER_SUPPLY_HEALTH_GOOD; - } break; case POWER_SUPPLY_PROP_CAPACITY: - val->intval = jz_bat_get_capacity(psy); - dev_dbg(psy->dev, "%s: battery_capacity = %d\n", - __func__, val->intval); + val->intval = jz_battery_get_capacity(psy); break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: - val->intval = jz_read_bat(psy); + val->intval = jz_battery_read_voltage(jz_battery); if (val->intval < 0) return val->intval; break; - case POWER_SUPPLY_PROP_VOLTAGE_MAX: case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: - val->intval = bat_info->pdata->max_voltag; + val->intval = info->voltage_max_design; break; case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: - val->intval = bat_info->pdata->min_voltag; + val->intval = info->voltage_min_design; break; case POWER_SUPPLY_PROP_PRESENT: val->intval = 1; @@ -192,279 +125,225 @@ static int jz_bat_get_property(struct power_supply *psy, return 0; } -static void jz_bat_external_power_changed(struct power_supply *psy) +static void jz_battery_external_power_changed(struct power_supply *psy) { - struct jz_battery_info *bat_info = ps_to_jz_battery(psy); - - cancel_delayed_work(&bat_info->bat_work); - queue_delayed_work(bat_info->monitor_wqueue, &bat_info->bat_work, HZ / 8); + struct jz_battery *jz_battery = psy_to_jz_battery(psy); + + cancel_delayed_work(&jz_battery->work); + schedule_delayed_work(&jz_battery->work, 0); } -static char *status_text[] = { - [POWER_SUPPLY_STATUS_UNKNOWN] = "Unknown", - [POWER_SUPPLY_STATUS_CHARGING] = "Charging", - [POWER_SUPPLY_STATUS_DISCHARGING] = "Discharging", - [POWER_SUPPLY_STATUS_NOT_CHARGING] = "Not charging", -}; - -static void jz_bat_update(struct power_supply *psy) +static irqreturn_t jz_battery_charge_irq(int irq, void *data) { - struct jz_battery_info *bat_info = ps_to_jz_battery(psy); - - int old_status = bat_info->bat_status; - static unsigned long old_batt_vol = 0; - unsigned long batt_vol = jz_read_bat(psy); - - mutex_lock(&bat_info->work_lock); + struct jz_battery *jz_battery = data; - if (gpio_is_valid(bat_info->pdata->charg_stat_gpio)) { - if(!gpio_get_value(bat_info->pdata->charg_stat_gpio)) - bat_info->bat_status = POWER_SUPPLY_STATUS_CHARGING; + cancel_delayed_work(&jz_battery->work); + schedule_delayed_work(&jz_battery->work, 0); + + return IRQ_HANDLED; +} + +static void jz_battery_update(struct jz_battery *jz_battery) +{ + int status; + long voltage; + long voltage_difference; + bool has_changed = 0; + + if (gpio_is_valid(jz_battery->pdata->gpio_charge)) { + int is_charging; + + is_charging = gpio_get_value(jz_battery->pdata->gpio_charge); + is_charging ^= jz_battery->pdata->gpio_charge_active_low; + if (is_charging) + status = POWER_SUPPLY_STATUS_CHARGING; else - bat_info->bat_status = POWER_SUPPLY_STATUS_NOT_CHARGING; - dev_dbg(psy->dev, "%s: battery status=%s\n", - __func__, status_text[bat_info->bat_status]); - - if (old_status != bat_info->bat_status) { - dev_dbg(psy->dev, "%s %s -> %s\n", - psy->name, - status_text[old_status], - status_text[bat_info->bat_status]); + status = POWER_SUPPLY_STATUS_NOT_CHARGING; - power_supply_changed(psy); + if (status != jz_battery->status) { + jz_battery->status = status; + has_changed = 1; } } - if (old_batt_vol - batt_vol > 50000) { - dev_dbg(psy->dev, "voltage change : %ld -> %ld\n", - old_batt_vol, batt_vol); - power_supply_changed(psy); - old_batt_vol = batt_vol; + voltage = jz_battery_read_voltage(jz_battery); + voltage_difference = voltage - jz_battery->voltage; + if (voltage_difference > 50000 || voltage_difference < 50000) { + jz_battery->voltage = voltage; + has_changed = 1; } - - mutex_unlock(&bat_info->work_lock); + if (has_changed) + power_supply_changed(&jz_battery->battery); } -static enum power_supply_property jz_bat_main_props[] = { +static enum power_supply_property jz_battery_properties[] = { POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_HEALTH, - POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ + POWER_SUPPLY_PROP_CAPACITY, POWER_SUPPLY_PROP_VOLTAGE_NOW, - POWER_SUPPLY_PROP_VOLTAGE_MAX, + POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, POWER_SUPPLY_PROP_PRESENT, }; -struct power_supply bat_ps = { - .name = "battery", - .type = POWER_SUPPLY_TYPE_BATTERY, - .properties = jz_bat_main_props, - .num_properties = ARRAY_SIZE(jz_bat_main_props), - .get_property = jz_bat_get_property, - .external_power_changed = jz_bat_external_power_changed, - .use_for_apm = 1, -}; - -static void jz_bat_work(struct work_struct *work) +static void jz_battery_work(struct work_struct *work) { - /* query interval too small will increase system workload*/ + /* Too small interval will increase system workload */ const int interval = HZ * 30; - struct jz_battery_info *bat_info = container_of(work,struct jz_battery_info, bat_work.work); + struct jz_battery *jz_battery = container_of(work, struct jz_battery, + work.work); - jz_bat_update(&bat_info->bat); - queue_delayed_work(bat_info->monitor_wqueue, - &bat_info->bat_work, interval); + jz_battery_update(jz_battery); + schedule_delayed_work(&jz_battery->work, interval); } -#ifdef CONFIG_PM -static int jz_bat_suspend(struct platform_device *pdev, pm_message_t state) +static int jz_battery_probe(struct platform_device *pdev) { - struct jz_battery_info *bat_info = platform_get_drvdata(pdev); - - bat_info->bat_status = POWER_SUPPLY_STATUS_UNKNOWN; + int ret = 0; + struct jz_battery_platform_data *pdata = pdev->dev.platform_data; + struct jz_battery *jz_battery; + struct power_supply *battery; + + if (!pdev->dev.platform_data) { + dev_err(&pdev->dev, "No platform data\n"); + return -EINVAL; + } + + jz_battery = kzalloc(sizeof(*jz_battery), GFP_KERNEL); + + if (!jz_battery) { + dev_err(&pdev->dev, "Failed to allocate driver structure\n"); + return -ENOMEM; + } + + battery = &jz_battery->battery; + battery->name = pdata->info.name; + battery->type = POWER_SUPPLY_TYPE_BATTERY; + battery->properties = jz_battery_properties; + battery->num_properties = ARRAY_SIZE(jz_battery_properties); + battery->get_property = jz_battery_get_property; + battery->external_power_changed = jz_battery_external_power_changed; + battery->use_for_apm = 1; + + jz_battery->pdata = pdata; + + INIT_DELAYED_WORK(&jz_battery->work, jz_battery_work); + + if (gpio_is_valid(pdata->gpio_charge)) { + ret = gpio_request(pdata->gpio_charge, dev_name(&pdev->dev)); + if (ret) { + dev_err(&pdev->dev, "charger state gpio request failed.\n"); + goto err_free; + } + ret = gpio_direction_input(pdata->gpio_charge); + if (ret) { + dev_err(&pdev->dev, "charger state gpio set direction failed.\n"); + goto err_free_gpio; + } + + jz_battery->charge_irq = gpio_to_irq(pdata->gpio_charge); + + if (jz_battery->charge_irq >= 0) { + ret = request_irq(jz_battery->charge_irq, + jz_battery_charge_irq, + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + dev_name(&pdev->dev), jz_battery); + if (ret) { + dev_err(&pdev->dev, "Failed to request charge irq: %d\n", ret); + goto err_free_gpio; + } + } + } else { + jz_battery->charge_irq = -1; + } + + + ret = power_supply_register(&pdev->dev, &jz_battery->battery); + if (ret) { + dev_err(&pdev->dev, "power supply battery register failed.\n"); + goto err_free_irq; + } + + platform_set_drvdata(pdev, jz_battery); + schedule_delayed_work(&jz_battery->work, 0); + + return 0; + +err_free_irq: + if (jz_battery->charge_irq >= 0) + free_irq(jz_battery->charge_irq, jz_battery); +err_free_gpio: + if (gpio_is_valid(pdata->gpio_charge)) + gpio_free(jz_battery->pdata->gpio_charge); +err_free: + kfree(jz_battery); + return ret; +} + +static int jz_battery_remove(struct platform_device *pdev) +{ + struct jz_battery *jz_battery = platform_get_drvdata(pdev); + + cancel_delayed_work_sync(&jz_battery->work); + + if (gpio_is_valid(jz_battery->pdata->gpio_charge)) { + if (jz_battery->charge_irq >= 0) + free_irq(jz_battery->charge_irq, jz_battery); + gpio_free(jz_battery->pdata->gpio_charge); + } + + power_supply_unregister(&jz_battery->battery); return 0; } -static int jz_bat_resume(struct platform_device *pdev) +#ifdef CONFIG_PM +static int jz_battery_suspend(struct platform_device *pdev, pm_message_t state) { - struct jz_battery_info *bat_info = platform_get_drvdata(pdev); + struct jz_battery *jz_battery = platform_get_drvdata(pdev); - bat_info->bat_status = POWER_SUPPLY_STATUS_UNKNOWN; + cancel_delayed_work_sync(&jz_battery->work); + jz_battery->status = POWER_SUPPLY_STATUS_UNKNOWN; - cancel_delayed_work(&bat_info->bat_work); - queue_delayed_work(bat_info->monitor_wqueue, &bat_info->bat_work, HZ/10); + return 0; +} + +static int jz_battery_resume(struct platform_device *pdev) +{ + struct jz_battery *jz_battery = platform_get_drvdata(pdev); + + schedule_delayed_work(&jz_battery->work, 0); return 0; } #else -#define jz_bat_suspend NULL -#define jz_bat_resume NULL +#define jz_battery_suspend NULL +#define jz_battery_resume NULL #endif -static int jz_bat_probe(struct platform_device *pdev) -{ - int ret = 0; - struct jz_battery_info *bat_info; - - bat_info = kzalloc(sizeof(struct jz_battery_info), GFP_KERNEL); - - if (!bat_info) { - return -ENOMEM; - } - - if (!pdev->dev.platform_data) { - dev_err(&pdev->dev, "Please set battery info\n"); - ret = -EINVAL; - goto err_platform_data; - } - platform_set_drvdata(pdev, bat_info); - bat_info->pdata = pdev->dev.platform_data; - bat_info->bat = bat_ps; - bat_info->usb = jz_usb; - bat_info->ac = jz_ac; - mutex_init(&bat_info->work_lock); - INIT_DELAYED_WORK(&bat_info->bat_work, jz_bat_work); - - if (gpio_is_valid(bat_info->pdata->dc_dect_gpio)) { - ret = gpio_request(bat_info->pdata->dc_dect_gpio, "AC/DC DECT"); - if (ret) { - dev_err(&pdev->dev, "ac/dc dect gpio request failed.\n"); - - goto err_dc_gpio_request; - } - ret = gpio_direction_input(bat_info->pdata->dc_dect_gpio); - if (ret) { - dev_err(&pdev->dev, "ac/dc dect gpio direction failed.\n"); - - goto err_dc_gpio_direction; - } - } - - if (gpio_is_valid(bat_info->pdata->usb_dect_gpio)) { - ret = gpio_request(bat_info->pdata->usb_dect_gpio, "USB DECT"); - if (ret) { - dev_err(&pdev->dev, "usb dect gpio request failed.\n"); - - goto err_usb_gpio_request; - } - ret = gpio_direction_input(bat_info->pdata->usb_dect_gpio); - if (ret) { - dev_err(&pdev->dev, "usb dect gpio set direction failed.\n"); - goto err_usb_gpio_direction; - } - - jz_gpio_disable_pullup(bat_info->pdata->usb_dect_gpio); - /* TODO: Use generic gpio is better */ - } - - if (gpio_is_valid(bat_info->pdata->charg_stat_gpio)) { - ret = gpio_request(bat_info->pdata->charg_stat_gpio, "CHARG STAT"); - if (ret) { - dev_err(&pdev->dev, "charger state gpio request failed.\n"); - goto err_charg_gpio_request; - } - ret = gpio_direction_input(bat_info->pdata->charg_stat_gpio); - if (ret) { - dev_err(&pdev->dev, "charger state gpio set direction failed.\n"); - goto err_charg_gpio_direction; - } - } - - if (gpio_is_valid(bat_info->pdata->dc_dect_gpio)) { - ret = power_supply_register(&pdev->dev, &bat_info->ac); - if (ret) { - dev_err(&pdev->dev, "power supply ac/dc register failed.\n"); - goto err_power_register_ac; - } - } - - if (gpio_is_valid(bat_info->pdata->usb_dect_gpio)) { - ret = power_supply_register(&pdev->dev, &bat_info->usb); - if (ret) { - dev_err(&pdev->dev, "power supply usb register failed.\n"); - goto err_power_register_usb; - } - } - - if (gpio_is_valid(bat_info->pdata->charg_stat_gpio)) { - ret = power_supply_register(&pdev->dev, &bat_info->bat); - if (ret) { - dev_err(&pdev->dev, "power supply battery register failed.\n"); - goto err_power_register_bat; - } else { - bat_info->monitor_wqueue = create_singlethread_workqueue("jz_battery"); - if (!bat_info->monitor_wqueue) { - return -ESRCH; - } - queue_delayed_work(bat_info->monitor_wqueue, &bat_info->bat_work, HZ * 1); - } - } - printk(KERN_INFO "jz_bat init success.\n"); - return ret; - -err_power_register_bat: - power_supply_unregister(&bat_info->usb); -err_power_register_usb: - power_supply_unregister(&bat_info->ac); -err_power_register_ac: -err_charg_gpio_direction: - gpio_free(bat_info->pdata->charg_stat_gpio); -err_charg_gpio_request: -err_usb_gpio_direction: - gpio_free(bat_info->pdata->usb_dect_gpio); -err_usb_gpio_request: -err_dc_gpio_direction: - gpio_free(bat_info->pdata->dc_dect_gpio); -err_dc_gpio_request: -err_platform_data: - kfree(bat_info); - return ret; -} - -static int jz_bat_remove(struct platform_device *pdev) -{ - struct jz_battery_info *bat_info = platform_get_drvdata(pdev); - - if (bat_info->pdata) { - if (gpio_is_valid(bat_info->pdata->dc_dect_gpio)) - gpio_free(bat_info->pdata->dc_dect_gpio); - if (gpio_is_valid(bat_info->pdata->usb_dect_gpio)) - gpio_free(bat_info->pdata->usb_dect_gpio); - if (gpio_is_valid(bat_info->pdata->charg_stat_gpio)) - gpio_free(bat_info->pdata->charg_stat_gpio); - } - - power_supply_unregister(&bat_ps); - power_supply_unregister(&jz_ac); - power_supply_unregister(&jz_usb); - - return 0; -} - -static struct platform_driver jz_bat_driver = { - .probe = jz_bat_probe, - .remove = __devexit_p(jz_bat_remove), - .suspend = jz_bat_suspend, - .resume = jz_bat_resume, +static struct platform_driver jz_battery_driver = { + .probe = jz_battery_probe, + .remove = __devexit_p(jz_battery_remove), + .suspend = jz_battery_suspend, + .resume = jz_battery_resume, .driver = { .name = "jz4740-battery", .owner = THIS_MODULE, }, }; -static int __init jz_bat_init(void) +static int __init jz_battery_init(void) { - return platform_driver_register(&jz_bat_driver); + return platform_driver_register(&jz_battery_driver); } -module_init(jz_bat_init); +module_init(jz_battery_init); -static void __exit jz_bat_exit(void) +static void __exit jz_battery_exit(void) { - platform_driver_unregister(&jz_bat_driver); + platform_driver_unregister(&jz_battery_driver); } -module_exit(jz_bat_exit); +module_exit(jz_battery_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Jiejing Zhang "); diff --git a/target/linux/xburst/files-2.6.32/drivers/rtc/rtc-jz4740.c b/target/linux/xburst/files-2.6.32/drivers/rtc/rtc-jz4740.c index 190b54afd..03479a73f 100644 --- a/target/linux/xburst/files-2.6.32/drivers/rtc/rtc-jz4740.c +++ b/target/linux/xburst/files-2.6.32/drivers/rtc/rtc-jz4740.c @@ -22,7 +22,8 @@ #define JZ_REG_RTC_CTRL 0x00 #define JZ_REG_RTC_SEC 0x04 #define JZ_REG_RTC_SEC_ALARM 0x08 -#define JZ_REG_REGULATOR 0x0C +#define JZ_REG_RTC_REGULATOR 0x0C +#define JZ_REG_RTC_SCRATCHPAD 0x34 #define JZ_RTC_CTRL_WRDY BIT(7) #define JZ_RTC_CTRL_1HZ BIT(6) @@ -211,6 +212,7 @@ static int __devinit jz4740_rtc_probe(struct platform_device *pdev) { int ret; struct jz4740_rtc *rtc; + uint32_t scratchpad; rtc = kmalloc(sizeof(*rtc), GFP_KERNEL); @@ -258,13 +260,18 @@ static int __devinit jz4740_rtc_probe(struct platform_device *pdev) } ret = request_irq(rtc->irq, jz4740_rtc_irq, 0, - pdev->name, rtc); + pdev->name, rtc); if (ret) { dev_err(&pdev->dev, "Failed to request rtc irq: %d\n", ret); goto err_unregister_rtc; } - printk("rtc-ctrl: %d\n", jz4740_rtc_reg_read(rtc, JZ_REG_RTC_CTRL)); + + scratchpad = jz4740_rtc_reg_read(rtc, JZ_REG_RTC_SCRATCHPAD); + if (scratchpad != 0x12345678) { + jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SCRATCHPAD, 0x12345678); + jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SEC, 0); + } return 0; @@ -285,6 +292,8 @@ static int __devexit jz4740_rtc_remove(struct platform_device *pdev) { struct jz4740_rtc *rtc = platform_get_drvdata(pdev); + free_irq(rtc->irq, rtc); + rtc_device_unregister(rtc->rtc); iounmap(rtc->base); @@ -322,4 +331,3 @@ MODULE_AUTHOR("Lars-Peter Clausen "); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("RTC driver for the JZ4720/JZ4740 SoC\n"); MODULE_ALIAS("platform:jz4740-rtc"); -MODULE_ALIAS("platform:jz4720-rtc"); diff --git a/target/linux/xburst/files-2.6.32/include/linux/power/gpio-charger.h b/target/linux/xburst/files-2.6.32/include/linux/power/gpio-charger.h new file mode 100644 index 000000000..95cdfc352 --- /dev/null +++ b/target/linux/xburst/files-2.6.32/include/linux/power/gpio-charger.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2010, Lars-Peter Clausen + * + * 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. + * + * 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., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef __LINUX_POWER_GPIO_CHARGER_H__ +#define __LINUX_POWER_GPIO_CHARGER_H__ + +struct gpio_charger_platform_data { + const char *name; + enum power_supply_type type; + int gpio; + int gpio_active_low; + + char **batteries; + size_t num_batteries; +}; + +#endif diff --git a/target/linux/xburst/files-2.6.32/include/linux/power/jz4740-battery.h b/target/linux/xburst/files-2.6.32/include/linux/power/jz4740-battery.h index 2bcd77283..19c9610c7 100644 --- a/target/linux/xburst/files-2.6.32/include/linux/power/jz4740-battery.h +++ b/target/linux/xburst/files-2.6.32/include/linux/power/jz4740-battery.h @@ -15,14 +15,10 @@ #ifndef __JZ4740_BATTERY_H #define __JZ4740_BATTERY_H -struct jz_batt_info { - int dc_dect_gpio; /* GPIO port of DC charger detection */ - int usb_dect_gpio; /* GPIO port of USB charger detection */ - int charg_stat_gpio; /* GPIO port of Charger state */ - - int min_voltag; /* Mininal battery voltage in uV */ - int max_voltag; /* Maximum battery voltage in uV */ - int batt_tech; /* Battery technology */ +struct jz_battery_platform_data { + struct power_supply_info info; + int gpio_charge; /* GPIO port of Charger state */ + int gpio_charge_active_low; }; #endif diff --git a/target/linux/xburst/patches-2.6.32/104-usb.patch b/target/linux/xburst/patches-2.6.32/104-usb.patch index 29127b820..7195d5b5b 100644 --- a/target/linux/xburst/patches-2.6.32/104-usb.patch +++ b/target/linux/xburst/patches-2.6.32/104-usb.patch @@ -10,16 +10,6 @@ Subject: [PATCH] /opt/Projects/openwrt/target/linux/xburst/patches-2.6.31/104-us drivers/usb/gadget/gadget_chips.h | 9 +++++++++ 4 files changed, 25 insertions(+), 0 deletions(-) ---- a/drivers/usb/Kconfig -+++ b/drivers/usb/Kconfig -@@ -44,6 +44,7 @@ config USB_ARCH_HAS_OHCI - default y if PPC_MPC52xx - # MIPS: - default y if SOC_AU1X00 -+ default y if JZSOC - # SH: - default y if CPU_SUBTYPE_SH7720 - default y if CPU_SUBTYPE_SH7721 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -121,11 +121,25 @@ choice diff --git a/target/linux/xburst/patches-2.6.32/106-gpio-charger.patch b/target/linux/xburst/patches-2.6.32/106-gpio-charger.patch new file mode 100644 index 000000000..dd1713a4d --- /dev/null +++ b/target/linux/xburst/patches-2.6.32/106-gpio-charger.patch @@ -0,0 +1,21 @@ +--- a/drivers/power/Makefile 2010-02-03 13:16:32.000000000 +0100 ++++ b/drivers/power/Makefile 2010-02-01 14:55:46.000000000 +0100 +@@ -30,3 +30,4 @@ + obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o + obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o + obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o ++obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o +--- a/drivers/power/Kconfig 2010-02-03 13:16:32.000000000 +0100 ++++ b/drivers/power/Kconfig 2010-02-01 14:58:24.000000000 +0100 +@@ -121,4 +121,11 @@ + This driver can be build as a module. If so, the module will be + called jz4740-battery. + ++config CHARGER_GPIO ++ tristate "GPIO charger" ++ depends on GPIOLIB ++ help ++ Say Y to include support for chargers indicating their status through ++ a GPIO pin. ++ + endif # POWER_SUPPLY diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 85ef59509..4f12b9fe5 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -9,21 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME := firmware-utils include $(INCLUDE_DIR)/host-build.mk - include $(INCLUDE_DIR)/kernel.mk define cc - $(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(1) src/$(1).c $(2) -endef - -define cc2 $(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2) endef -define cc3 - $(CC) $(HOST_CFLAGS) -I$(CURDIR)/../../target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx -include endian.h -o $(HOST_BUILD_DIR)/bin/$(1) src/$(1).c $(2) -endef - define Host/Compile mkdir -p $(HOST_BUILD_DIR)/bin @@ -42,16 +33,16 @@ define Host/Compile $(call cc,mkcasfw) $(call cc,mkfwimage,-lz) $(call cc,mkfwimage2,-lz) - $(call cc3,imagetag) + $(call cc,imagetag) $(call cc,add_header) $(call cc,makeamitbin) $(call cc,encode_crc) $(call cc,nand_ecc) - $(call cc2,mkplanexfw sha1) - $(call cc2,mktplinkfw md5) + $(call cc,mkplanexfw sha1) + $(call cc,mktplinkfw md5) $(call cc,pc1crypt) $(call cc,osbridge-crc) - $(call cc2,wrt400n cyg_crc32) + $(call cc,wrt400n cyg_crc32) $(call cc,wndr3700) $(call cc,mkdniimg) endef diff --git a/tools/firmware-utils/src/bcm_tag.h b/tools/firmware-utils/src/bcm_tag.h new file mode 100644 index 000000000..c06f66894 --- /dev/null +++ b/tools/firmware-utils/src/bcm_tag.h @@ -0,0 +1,178 @@ +#ifndef __BCM63XX_TAG_H +#define __BCM63XX_TAG_H + +#define IMAGE_LEN 10 /* Length of Length Field */ +#define ADDRESS_LEN 12 /* Length of Address field */ +#define TAGID_LEN 6 /* Length of tag ID */ +#define TAGINFO_LEN 20 /* Length of vendor information field in tag */ +#define TAGVER_LEN 4 /* Length of Tag Version */ +#define TAGLAYOUT_LEN 4 /* Length of FlashLayoutVer */ + +#define NUM_TAGID 5 +#define IMAGETAG_CRC_START 0xFFFFFFFF + +struct tagiddesc_t { + char tagid[TAGID_LEN + 1]; + char tagiddesc[80]; +}; + + // bc221 is used by BT Voyager and should be right + // bc310 should be right, and may apply to 3.08 code as well +#define TAGID_DEFINITIONS { \ + { "bccfe", "Broadcom CFE flash image" }, \ + { "bc300", "Broadcom code version 3.00-3.06 and all ftp/tftp flash" }, \ + { "ag306", "Alice Gate (Pirelli, based on Broadcom 3.06)" }, \ + { "bc221", "Broadcom code version 2.21" }, \ + { "bc310", "Broadcom code version 3.10-3.12" }, \ +} + +struct bcm_tag_bccfe { + unsigned char tagVersion[TAGVER_LEN]; // 0-3: Version of the image tag + unsigned char sig_1[20]; // 4-23: Company Line 1 + unsigned char sig_2[14]; // 24-37: Company Line 2 + unsigned char chipid[6]; // 38-43: Chip this image is for + unsigned char boardid[16]; // 44-59: Board name + unsigned char big_endian[2]; // 60-61: Map endianness -- 1 BE 0 LE + unsigned char totalLength[IMAGE_LEN]; // 62-71: Total length of image + unsigned char cfeAddress[ADDRESS_LEN]; // 72-83: Address in memory of CFE + unsigned char cfeLength[IMAGE_LEN]; // 84-93: Size of CFE + unsigned char rootAddress[ADDRESS_LEN]; // 94-105: Address in memory of rootfs + unsigned char rootLength[IMAGE_LEN]; // 106-115: Size of rootfs + unsigned char kernelAddress[ADDRESS_LEN]; // 116-127: Address in memory of kernel + unsigned char kernelLength[IMAGE_LEN]; // 128-137: Size of kernel + unsigned char dualImage[2]; // 138-139: Unused at present + unsigned char inactiveFlag[2]; // 140-141: Unused at present + unsigned char information1[TAGINFO_LEN]; // 142-161: Unused at present + unsigned char tagId[TAGID_LEN]; // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced + unsigned char tagIdCRC[4]; // 168-171: CRC32 of tagId + unsigned char reserved1[44]; // 172-215: Reserved area not in use + unsigned char imageCRC[4]; // 216-219: CRC32 of images + unsigned char reserved2[16]; // 220-235: Unused at present + unsigned char headerCRC[4]; // 236-239: CRC32 of header excluding tagVersion + unsigned char reserved3[16]; // 240-255: Unused at present +}; + +struct bcm_tag_bc300 { + unsigned char tagVersion[TAGVER_LEN]; // 0-3: Version of the image tag + unsigned char sig_1[20]; // 4-23: Company Line 1 + unsigned char sig_2[14]; // 24-37: Company Line 2 + unsigned char chipid[6]; // 38-43: Chip this image is for + unsigned char boardid[16]; // 44-59: Board name + unsigned char big_endian[2]; // 60-61: Map endianness -- 1 BE 0 LE + unsigned char totalLength[IMAGE_LEN]; // 62-71: Total length of image + unsigned char cfeAddress[ADDRESS_LEN]; // 72-83: Address in memory of CFE + unsigned char cfeLength[IMAGE_LEN]; // 84-93: Size of CFE + unsigned char flashImageStart[ADDRESS_LEN]; // 94-105: Address in memory of kernel (start of image) + unsigned char flashRootLength[IMAGE_LEN]; // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) + unsigned char kernelAddress[ADDRESS_LEN]; // 116-127: Address in memory of kernel + unsigned char kernelLength[IMAGE_LEN]; // 128-137: Size of kernel + unsigned char dualImage[2]; // 138-139: Unused at present + unsigned char inactiveFlag[2]; // 140-141: Unused at present + unsigned char information1[TAGINFO_LEN]; // 142-161: Unused at present + unsigned char tagId[TAGID_LEN]; // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced + unsigned char tagIdCRC[4]; // 168-173: CRC32 to ensure validity of tagId + unsigned char rootAddress[ADDRESS_LEN]; // 174-183: Address in memory of rootfs partition + unsigned char rootLength[IMAGE_LEN]; // 184-193: Size of rootfs partition + unsigned char reserved1[22]; // 194-215: Reserved area not in use + unsigned char imageCRC[4]; // 216-219: CRC32 of images + unsigned char reserved2[16]; // 220-235: Unused at present + unsigned char headerCRC[4]; // 236-239: CRC32 of header excluding tagVersion + unsigned char reserved3[16]; // 240-255: Unused at present +}; + +struct bcm_tag_ag306 { + unsigned char tagVersion[TAGVER_LEN]; // 0-3: Version of the image tag + unsigned char sig_1[20]; // 4-23: Company Line 1 + unsigned char sig_2[14]; // 24-37: Company Line 2 + unsigned char chipid[6]; // 38-43: Chip this image is for + unsigned char boardid[16]; // 44-59: Board name + unsigned char big_endian[2]; // 60-61: Map endianness -- 1 BE 0 LE + unsigned char totalLength[IMAGE_LEN]; // 62-71: Total length of image + unsigned char cfeAddress[ADDRESS_LEN]; // 72-83: Address in memory of CFE + unsigned char cfeLength[IMAGE_LEN]; // 84-93: Size of CFE + unsigned char flashImageStart[ADDRESS_LEN]; // 94-105: Address in memory of kernel (start of image) + unsigned char flashRootLength[IMAGE_LEN]; // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) + unsigned char kernelAddress[ADDRESS_LEN]; // 116-127: Address in memory of kernel + unsigned char kernelLength[IMAGE_LEN]; // 128-137: Size of kernel + unsigned char dualImage[2]; // 138-139: Unused at present + unsigned char inactiveFlag[2]; // 140-141: Unused at present + unsigned char information1[TAGINFO_LEN]; // 142-161: Unused at present + unsigned char information2[54]; // 162-215: Compilation and related information (not generated/used by OpenWRT) + unsigned char kernelCRC[4] ; // 216-219: CRC32 of images + unsigned char rootAddress[ADDRESS_LEN]; // 220-231: Address in memory of rootfs partition + unsigned char tagIdCRC[4]; // 232-235: Checksum to ensure validity of tagId + unsigned char headerCRC[4]; // 236-239: CRC32 of header excluding tagVersion + unsigned char rootLength[IMAGE_LEN]; // 240-249: Size of rootfs + unsigned char tagId[TAGID_LEN]; // 250-255: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced +}; + +struct bcm_tag_bc221 { + unsigned char tagVersion[TAGVER_LEN]; // 0-3: Version of the image tag + unsigned char sig_1[20]; // 4-23: Company Line 1 + unsigned char sig_2[14]; // 24-37: Company Line 2 + unsigned char chipid[6]; // 38-43: Chip this image is for + unsigned char boardid[16]; // 44-59: Board name + unsigned char big_endian[2]; // 60-61: Map endianness -- 1 BE 0 LE + unsigned char totalLength[IMAGE_LEN]; // 62-71: Total length of image + unsigned char cfeAddress[ADDRESS_LEN]; // 72-83: Address in memory of CFE + unsigned char cfeLength[IMAGE_LEN]; // 84-93: Size of CFE + unsigned char flashImageStart[ADDRESS_LEN]; // 94-105: Address in memory of kernel (start of image) + unsigned char flashRootLength[IMAGE_LEN]; // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) + unsigned char kernelAddress[ADDRESS_LEN]; // 116-127: Address in memory of kernel + unsigned char kernelLength[IMAGE_LEN]; // 128-137: Size of kernel + unsigned char dualImage[2]; // 138-139: Unused at present + unsigned char inactiveFlag[2]; // 140-141: Unused at present + unsigned char rsa_signature[TAGINFO_LEN]; // 142-161: RSA Signature (unused at present; some vendors may use this) + unsigned char reserved5[2]; // 162-163: Unused at present + unsigned char tagId[TAGID_LEN]; // 164-169: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced + unsigned char rootAddress[ADDRESS_LEN]; // 170-181: Address in memory of rootfs partition + unsigned char rootLength[IMAGE_LEN]; // 182-191: Size of rootfs partition + unsigned char flashLayoutVer[4]; // 192-195: Version flash layout + unsigned char fskernelCRC[4]; // 196-199: Guessed to be kernel CRC + unsigned char reserved4[16]; // 200-215: Reserved area; unused at present + unsigned char imageCRC[4]; // 216-219: CRC32 of images + unsigned char reserved2[12]; // 220-231: Unused at present + unsigned char tagIdCRC[4]; // 232-235: CRC32 to ensure validity of tagId + unsigned char headerCRC[4]; // 236-239: CRC32 of header excluding tagVersion + unsigned char reserved3[16]; // 240-255: Unused at present +}; + +struct bcm_tag_bc310 { + unsigned char tagVersion[4]; // 0-3: Version of the image tag + unsigned char sig_1[20]; // 4-23: Company Line 1 + unsigned char sig_2[14]; // 24-37: Company Line 2 + unsigned char chipid[6]; // 38-43: Chip this image is for + unsigned char boardid[16]; // 44-59: Board name + unsigned char big_endian[2]; // 60-61: Map endianness -- 1 BE 0 LE + unsigned char totalLength[IMAGE_LEN]; // 62-71: Total length of image + unsigned char cfeAddress[ADDRESS_LEN]; // 72-83: Address in memory of CFE + unsigned char cfeLength[IMAGE_LEN]; // 84-93: Size of CFE + unsigned char flashImageStart[ADDRESS_LEN]; // 94-105: Address in memory of kernel (start of image) + unsigned char flashRootLength[IMAGE_LEN]; // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) + unsigned char kernelAddress[ADDRESS_LEN]; // 116-127: Address in memory of kernel + unsigned char kernelLength[IMAGE_LEN]; // 128-137: Size of kernel + unsigned char dualImage[2]; // 138-139: Unused at present + unsigned char inactiveFlag[2]; // 140-141: Unused at present + unsigned char information1[TAGINFO_LEN]; // 142-161: Unused at present; Some vendors use this for optional information + unsigned char tagId[6]; // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced + unsigned char tagIdCRC[4]; // 168-171: CRC32 to ensure validity of tagId + unsigned char rootAddress[ADDRESS_LEN]; // 172-183: Address in memory of rootfs partition + unsigned char rootLength[IMAGE_LEN]; // 184-193: Size of rootfs partition + unsigned char reserved1[22]; // 193-215: Reserved area not in use + unsigned char imageCRC[4]; // 216-219: CRC32 of images + unsigned char rootfsCRC[4]; // 220-227: CRC32 of rootfs partition + unsigned char kernelCRC[4]; // 224-227: CRC32 of kernel partition + unsigned char reserved2[8]; // 228-235: Unused at present + unsigned char headerCRC[4]; // 235-239: CRC32 of header excluding tagVersion + unsigned char reserved3[16]; // 240-255: Unused at present +}; + +union bcm_tag { + struct bcm_tag_bccfe bccfe; + struct bcm_tag_bc300 bc300; + struct bcm_tag_ag306 ag306; + struct bcm_tag_bc221 bc221; + struct bcm_tag_bc310 bc310; +}; + +#endif /* __BCM63XX_TAG_H */