The work has been backported from openwrt-dreambox with some modifications & code cleanup.
* updated config-3.3 * updated config-3.6 * renamed rt-n13 to rt-n13u * fixed mach-rt-n13u.c Signed-off-by: Amit Mendapara <mendapara.a...@gmail.com> --- Index: target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h =================================================================== --- target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h (revision 34384) +++ target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h (working copy) @@ -43,6 +43,7 @@ RAMIPS_MACH_ESR_9753, /* Senao / EnGenius ESR-9753*/ RAMIPS_MACH_F5D8235_V2, /* Belkin F5D8235 v2 */ RAMIPS_MACH_FONERA20N, /* La Fonera 2.0N */ + RAMIPS_MACH_RT_N13U, /* ASUS RT-N13U */ RAMIPS_MACH_FREESTATION5, /* ARC Freestation5 */ RAMIPS_MACH_HW550_3G, /* Aztech HW550-3G */ RAMIPS_MACH_MOFI3500_3GN, /* MoFi Network MOFI3500-3GN */ Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-n13u.c =================================================================== --- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-n13u.c (revision 0) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-n13u.c (working copy) @@ -0,0 +1,83 @@ +/* + * ASUS RT-N13U board support + * + * Copyright (C) 2012 lintel<lintel.hu...@gmail.com> + * + * 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 <linux/platform_device.h> + +#include <asm/mach-ralink/machine.h> +#include <asm/mach-ralink/dev-gpio-buttons.h> +#include <asm/mach-ralink/dev-gpio-leds.h> +#include <asm/mach-ralink/rt305x.h> +#include <asm/mach-ralink/rt305x_regs.h> + +#include "devices.h" + +#define RT_N13U_GPIO_BUTTON_RESET 10 +#define RT_N13U_GPIO_BUTTON_WPS 0 + +#define RT_N13U_GPIO_LED_POWER 7 +#define RT_N13U_GPIO_LED_WIFI 8 + + +#define RT_N13U_BUTTONS_POLL_INTERVAL 10 +#define RT_N13U_BUTTONS_DEBOUNCE_INTERVAL (3 * RT_N13U_BUTTONS_POLL_INTERVAL) + +static struct gpio_led rt_n13u_leds_gpio[] __initdata = { + { + .name = "rt-n13u:power", + .gpio = RT_N13U_GPIO_LED_POWER, + .active_low = 1, + }, { + .name = "rt-n13u:wifi", + .gpio = RT_N13U_GPIO_LED_WIFI, + .active_low = 1, + } +}; + +static struct gpio_keys_button rt_n13u_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RT_N13U_BUTTONS_DEBOUNCE_INTERVAL, + .gpio = RT_N13U_GPIO_BUTTON_RESET, + .active_low = 1, + }, { + .desc = "wps", + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = RT_N13U_BUTTONS_DEBOUNCE_INTERVAL, + .gpio = RT_N13U_GPIO_BUTTON_WPS, + .active_low = 1, + }, +}; + +static void __init rt_n13u_init(void) +{ + rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); + + rt305x_register_flash(0); + + ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n13u_leds_gpio), + rt_n13u_leds_gpio); + + ramips_register_gpio_buttons(-1, RT_N13U_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(rt_n13u_gpio_buttons), + rt_n13u_gpio_buttons); + + rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW; + rt305x_register_ethernet(); + rt305x_register_wifi(); + rt305x_register_wdt(); + rt305x_register_usb(); +} + +MIPS_MACHINE(RAMIPS_MACH_RT_N13U, "RT-N13U", "Asus RT-N13U", + rt_n13u_init); Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile =================================================================== --- target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile (revision 34384) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile (working copy) @@ -23,6 +23,7 @@ obj-$(CONFIG_RT305X_MACH_ESR_9753) += mach-esr-9753.o obj-$(CONFIG_RT305X_MACH_F5D8235_V2) += mach-f5d8235-v2.o obj-$(CONFIG_RT305X_MACH_FONERA20N) += mach-fonera20n.o +obj-$(CONFIG_RT305X_MACH_RT_N13U) += mach-rt-n13u.o obj-$(CONFIG_RT305X_MACH_FREESTATION5) += mach-freestation5.o obj-$(CONFIG_RT305X_MACH_HW550_3G) += mach-hw550-3g.o obj-$(CONFIG_RT305X_MACH_MOFI3500_3GN) += mach-mofi3500-3gn.o Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig =================================================================== --- target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig (revision 34384) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig (working copy) @@ -96,6 +96,12 @@ select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS +config RT305X_MACH_RT_N13U + bool "ASUS RT-N13U board support" + default y + select RALINK_DEV_GPIO_BUTTONS + select RALINK_DEV_GPIO_LEDS + config RT305X_MACH_FREESTATION5 bool "ARC FreeStation5" Index: target/linux/ramips/rt305x/config-3.6 =================================================================== --- target/linux/ramips/rt305x/config-3.6 (revision 34384) +++ target/linux/ramips/rt305x/config-3.6 (working copy) @@ -7,7 +7,6 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_BCMA_POSSIBLE=y -CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CEVT_R4K_LIB=y @@ -67,7 +66,6 @@ CONFIG_IRQ_CPU=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_M25PXX_USE_FAST_READ=y -# CONFIG_MACH_LOONGSON1 is not set CONFIG_MDIO_BOARDINFO=y # CONFIG_MII is not set CONFIG_MIPS=y @@ -85,7 +83,6 @@ # CONFIG_NET_RAMIPS_DEBUG is not set # CONFIG_NET_RAMIPS_DEBUG_FS is not set CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_PANIC_ON_OOPS_VALUE=0 CONFIG_PERF_USE_VMALLOC=y CONFIG_PHYLIB=y # CONFIG_PREEMPT_RCU is not set @@ -117,6 +114,7 @@ CONFIG_RT305X_MACH_PWH2004=y CONFIG_RT305X_MACH_RT_G32_REVB=y CONFIG_RT305X_MACH_RT_N10_PLUS=y +CONFIG_RT305X_MACH_RT_N13U=y CONFIG_RT305X_MACH_SL_R7205=y CONFIG_RT305X_MACH_UR_336UN=y CONFIG_RT305X_MACH_V22RW_2X2=y @@ -149,5 +147,4 @@ CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y # CONFIG_USB_ARCH_HAS_XHCI is not set CONFIG_USB_SUPPORT=y -CONFIG_XZ_DEC=y CONFIG_ZONE_DMA_FLAG=0 Index: target/linux/ramips/rt305x/profiles/n13u.mk =================================================================== --- target/linux/ramips/rt305x/profiles/n13u.mk (revision 0) +++ target/linux/ramips/rt305x/profiles/n13u.mk (working copy) @@ -0,0 +1,17 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/RT-N13U + NAME:=Asus RT-N13U + PACKAGES:=kmod-leds-gpio kmod-rt2800-pci wpad-mini kmod-usb-rt305x-dwc_otg +endef + +define Profile/RT-N13U/Description + Package set for Asus RT-N13U. +endef + +$(eval $(call Profile,RT-N13U)) Index: target/linux/ramips/rt305x/config-3.3 =================================================================== --- target/linux/ramips/rt305x/config-3.3 (revision 34384) +++ target/linux/ramips/rt305x/config-3.3 (working copy) @@ -109,6 +109,7 @@ CONFIG_RT305X_MACH_PWH2004=y CONFIG_RT305X_MACH_RT_G32_REVB=y CONFIG_RT305X_MACH_RT_N10_PLUS=y +CONFIG_RT305X_MACH_RT_N13U=y CONFIG_RT305X_MACH_SL_R7205=y CONFIG_RT305X_MACH_UR_336UN=y CONFIG_RT305X_MACH_V22RW_2X2=y Index: target/linux/ramips/base-files/lib/preinit/06_set_iface_mac =================================================================== --- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac (revision 34384) +++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac (working copy) @@ -45,6 +45,7 @@ carambola |\ dir-615-h1 |\ fonera20n |\ + rt-n13u |\ hw550-3g |\ nbg-419n |\ omni-emb |\ Index: target/linux/ramips/base-files/lib/ramips.sh =================================================================== --- target/linux/ramips/base-files/lib/ramips.sh (revision 34384) +++ target/linux/ramips/base-files/lib/ramips.sh (working copy) @@ -113,6 +113,9 @@ *"La Fonera 2.0N") name="fonera20n" ;; + *"Asus RT-N13U") + name="rt-n13u" + ;; *"MoFi Network MOFI3500-3GN") name="mofi3500-3gn" ;; Index: target/linux/ramips/base-files/lib/upgrade/platform.sh =================================================================== --- target/linux/ramips/base-files/lib/upgrade/platform.sh (revision 34384) +++ target/linux/ramips/base-files/lib/upgrade/platform.sh (working copy) @@ -29,6 +29,7 @@ dap-1350 | \ esr-9753 | \ fonera20n | \ + rt-n13u | \ freestation5 | \ hw550-3g | \ mofi3500-3gn | \ Index: target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom =================================================================== --- target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom (revision 34384) +++ target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom (working copy) @@ -64,6 +64,7 @@ dir-620-a1 | \ esr-9753 | \ fonera20n | \ + rt-n13u | \ freestation5 | \ hw550-3g | \ mofi3500-3gn | \ Index: target/linux/ramips/base-files/etc/uci-defaults/network =================================================================== --- target/linux/ramips/base-files/etc/uci-defaults/network (revision 34384) +++ target/linux/ramips/base-files/etc/uci-defaults/network (working copy) @@ -156,6 +156,7 @@ wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 5) ;; + rt-n13u | \ fonera20n) lan_mac=$(ramips_get_mac_binary factory 40) wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) Index: target/linux/ramips/base-files/etc/diag.sh =================================================================== --- target/linux/ramips/base-files/etc/diag.sh (revision 34384) +++ target/linux/ramips/base-files/etc/diag.sh (working copy) @@ -54,6 +54,9 @@ fonera20n) status_led="fonera20n:green:power" ;; + rt-n13u) + status_led="rt-n13u:power" + ;; all0239-3g|\ hw550-3g) status_led="hw550-3g:green:status" Index: target/linux/ramips/image/Makefile =================================================================== --- target/linux/ramips/image/Makefile (revision 34384) +++ target/linux/ramips/image/Makefile (working copy) @@ -259,6 +259,10 @@ $(call BuildFirmware/GENERIC_8M/initramfs,$(1),fonera20n,FONERA20N,ttyS1,57600,phys) endef +define BuildFirmware/RT-N13U + $(call BuildFirmware/GENERIC_8M,$(1),rt-n13u,RT-N13U,ttyS1,57600,phys) +endef + mtdlayout_nw718=192k(u-boot)ro,128k(config)ro,64k(factory)ro,896k(kernel),2816k(rootfs),3712k@0x60000(firmware) kernel_size_nw718=917504 rootfs_size_nw718=2883584 @@ -493,6 +497,10 @@ $(call Image/Build/Template/$(fs_squash)/$(1),FONERA20N) endef +define Image/Build/Profile/RT-N13U + $(call Image/Build/Template/$(fs_squash)/$(1),RT-N13U) +endef + define Image/Build/Profile/FREESTATION5 $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,freestation5,FREESTATION5,ttyS1,115200,phys) endef @@ -604,6 +612,7 @@ $(call Image/Build/Profile/F5D8235V2,$(1)) $(call Image/Build/Profile/RTN10PLUS,$(1)) $(call Image/Build/Profile/FONERA20N,$(1)) + $(call Image/Build/Profile/RT-N13U,$(1)) $(call Image/Build/Profile/FREESTATION5,$(1)) $(call Image/Build/Profile/HW5503G,$(1)) $(call Image/Build/Profile/MOFI35003GN,$(1)) _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel