Hello,
I've been working on a build for my Asus RT-N10+ and I've got it in pretty good shape. It's a Ralink RT3350 so the build is mostly copy & paste and fill in some values that are unique to the hardware. This is my first time working with OpenWrt, so this is all rather new to me, but I think I've got the hang of it. It builds, it runs, all five ports work and are mapped correctly, the wifi works...it's in good shape so far. I have also been keeping a wiki page (http://wiki.openwrt.org/toh/asus/rt-n10plus [1]) with notes on the hardware and how to flash. One big question...I'm not sure how to determine the actual flash layout. The stock firmware reports one thing in /proc/mtd (see wiki page) however once I have OpenWrt on the device, it reports a different layout much more similar to other RT3X5X devices which matches what I've copied & pasted from the DIR-300 B1. I'm worried this means that sysupgrade might write data to the wrong place? I've been too scared to try as I haven't tapped the serial port yet. Comments, feedback, advice, help appreciated! Cheers, Patrick van Staveren Links: ------ [1] http://wiki.openwrt.org/toh/asus/rt-n10plus
Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig =================================================================== --- target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig (revision 29921) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig (working copy) @@ -21,6 +21,11 @@ bool "Asus RT-G32 revB board support" select RALINK_DEV_GPIO_BUTTONS +config RT305X_MACH_RT_N10_PLUS + bool "Asus RT-N10+ board support" + select RALINK_DEV_GPIO_BUTTONS + select RALINK_DEV_GPIO_LEDS + config RT305X_MACH_HW550_3G bool "Aztech HW550-3G support" select RALINK_DEV_GPIO_BUTTONS Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile =================================================================== --- target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile (revision 29921) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile (working copy) @@ -25,6 +25,7 @@ obj-$(CONFIG_RT305X_MACH_OMNI_EMB) += mach-omni-emb.o obj-$(CONFIG_RT305X_MACH_PWH2004) += mach-pwh2004.o obj-$(CONFIG_RT305X_MACH_RT_G32_REVB) += mach-rt-g32-revb.o +obj-$(CONFIG_RT305X_MACH_RT_N10_PLUS) += mach-rt-n10-plus.o obj-$(CONFIG_RT305X_MACH_V22RW_2X2) += mach-v22rw-2x2.o obj-$(CONFIG_RT305X_MACH_W502U) += mach-w502u.o obj-$(CONFIG_RT305X_MACH_WCR150GN) += mach-wcr150gn.o Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-n10-plus.c =================================================================== --- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-n10-plus.c (revision 29840) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-n10-plus.c (working copy) @@ -1,7 +1,7 @@ /* - * D-Link DIR-300 rev B board support + * ASUS RT-N10+ board support * - * Copyright (C) 2009-2010 Gabor Juhos <juh...@openwrt.org> + * Copyright (C) 2009-2012 Gabor Juhos <juh...@openwrt.org> * * 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 @@ -22,17 +22,18 @@ #include "devices.h" -#define DIR_300B_GPIO_LED_STATUS_AMBER 8 -#define DIR_300B_GPIO_LED_STATUS_GREEN 9 -#define DIR_300B_GPIO_LED_WPS 13 +#define RT_N10_PLUS_GPIO_LED_STATUS_AMBER 8 +#define RT_N10_PLUS_GPIO_LED_STATUS_GREEN 9 +#define RT_N10_PLUS_GPIO_LED_WPS 13 -#define DIR_300B_GPIO_BUTTON_WPS 0 /* active low */ -#define DIR_300B_GPIO_BUTTON_RESET 10 /* active low */ +#define RT_N10_PLUS_GPIO_BUTTON_WPS 0 /* active low */ +#define RT_N10_PLUS_GPIO_BUTTON_RESET 10 /* active low */ -#define DIR_300B_BUTTONS_POLL_INTERVAL 20 +#define RT_N10_PLUS_BUTTONS_POLL_INTERVAL 20 #ifdef CONFIG_MTD_PARTITIONS -static struct mtd_partition dir_300b_partitions[] = { +static struct mtd_partition rt_n10_plus_partitions[] = { + // FIXME! I don't know if this is real? { .name = "u-boot", .offset = 0, @@ -64,68 +65,64 @@ }; #endif /* CONFIG_MTD_PARTITIONS */ -static struct physmap_flash_data dir_300b_flash_data = { +static struct physmap_flash_data rt_n10_plus_flash_data = { #ifdef CONFIG_MTD_PARTITIONS - .nr_parts = ARRAY_SIZE(dir_300b_partitions), - .parts = dir_300b_partitions, + .nr_parts = ARRAY_SIZE(rt_n10_plus_partitions), + .parts = rt_n10_plus_partitions, #endif }; -static struct gpio_led dir_300b_leds_gpio[] __initdata = { +static struct gpio_led rt_n10_plus_leds_gpio[] __initdata = { + // FIXME: these are from the DIR-300, not to do with anything real. { - .name = "d-link:amber:status", - .gpio = DIR_300B_GPIO_LED_STATUS_AMBER, + .name = "asus:amber:status", + .gpio = RT_N10_PLUS_GPIO_LED_STATUS_AMBER, .active_low = 1, }, { - .name = "d-link:green:status", - .gpio = DIR_300B_GPIO_LED_STATUS_GREEN, + .name = "asus:green:status", + .gpio = RT_N10_PLUS_GPIO_LED_STATUS_GREEN, .active_low = 1, }, { - .name = "d-link:blue:wps", - .gpio = DIR_300B_GPIO_LED_WPS, + .name = "asus:blue:wps", + .gpio = RT_N10_PLUS_GPIO_LED_WPS, .active_low = 1, } }; -static struct gpio_button dir_300b_gpio_buttons[] __initdata = { +static struct gpio_button rt_n10_plus_gpio_buttons[] __initdata = { + // TODO: check that these are actually right; these are from the DIR-300 { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, .threshold = 3, - .gpio = DIR_300B_GPIO_BUTTON_RESET, + .gpio = RT_N10_PLUS_GPIO_BUTTON_RESET, .active_low = 1, }, { .desc = "wps", .type = EV_KEY, .code = KEY_WPS_BUTTON, .threshold = 3, - .gpio = DIR_300B_GPIO_BUTTON_WPS, + .gpio = RT_N10_PLUS_GPIO_BUTTON_WPS, .active_low = 1, } }; -static void __init dir_300b_init(void) +static void __init rt_n10_plus_init(void) { rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); - rt305x_register_flash(0, &dir_300b_flash_data); - rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW; + rt305x_register_flash(0, &rt_n10_plus_flash_data); + rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL; 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); + ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n10_plus_leds_gpio), + rt_n10_plus_leds_gpio); + ramips_register_gpio_buttons(-1, RT_N10_PLUS_BUTTONS_POLL_INTERVAL, + ARRAY_SIZE(rt_n10_plus_gpio_buttons), + rt_n10_plus_gpio_buttons); rt305x_register_wifi(); rt305x_register_wdt(); } -MIPS_MACHINE(RAMIPS_MACH_DIR_300_B1, "DIR-300-B1", "D-Link DIR-300 B1", - dir_300b_init); - -MIPS_MACHINE(RAMIPS_MACH_DIR_600_B1, "DIR-600-B1", "D-Link DIR-600 B1", - dir_300b_init); - -MIPS_MACHINE(RAMIPS_MACH_DIR_600_B2, "DIR-600-B2", "D-Link DIR-600 B2", - dir_300b_init); +MIPS_MACHINE(RAMIPS_MACH_RT_N10_PLUS, "RT-N10-PLUS", "Asus RT-N10+", + rt_n10_plus_init); 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 29921) +++ target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h (working copy) @@ -25,6 +25,7 @@ RAMIPS_MACH_DIR_600_B1, /* D-Link DIR-600 B1 */ RAMIPS_MACH_DIR_600_B2, /* D-Link DIR-600 B2 */ RAMIPS_MACH_RT_G32_B1, /* Asus RT-G32 B1 */ + RAMIPS_MACH_RT_N10_PLUS, /* Asus RT-N10+ */ RAMIPS_MACH_NW718, /* Netcore NW718 */ /* RT3052 based machines */ Index: target/linux/ramips/image/Makefile =================================================================== --- target/linux/ramips/image/Makefile (revision 29921) +++ target/linux/ramips/image/Makefile (working copy) @@ -196,10 +196,25 @@ $(call BuildFirmware/Generic,$(1),$(2),board=$(3),mtdlayout_rtg32b1,$(mtd_rtg32b1_kernel_part_size),$(mtd_rtg32b1_rootfs_part_size)) endef +mtdlayout_rtn10plus=mtdparts=spi0.0:192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) +mtd_rtn10plus_kernel_part_size=851968 +mtd_rtn10plus_rootfs_part_size=3014656 +define Image/Build/Template/RTN10PLUS + $(call BuildFirmware/Generic,$(1),$(2),board=$(3),mtdlayout_rtn10plus,$(mtd_rtn10plus_kernel_part_size),$(mtd_rtn10plus_rootfs_part_size)) +# FIXME: I'm not sure the following is necessary on ASUS as this is stolen from D-Link...but the images work? + mkwrgimg -s $(4) -d /dev/mtdblock/2 \ + -i $(call imgname,$(1),$(2))-sysupgrade.bin \ + -o $(call imgname,$(1),$(2))-factory.bin +endef + define Image/Build/Profile/RTG32B1 $(call Image/Build/Template/RTG32B1,$(1),rt-g32-b1,RT-G32-B1) endef +define Image/Build/Profile/RTN10PLUS + $(call Image/Build/Template/RTN10PLUS,$(1),rt-n10-plus,RT-N10-PLUS,wrg-rt-n10-plus) +endef + define Image/Build/Profile/ESR9753 $(call Image/Build/Template/GENERIC_4M,$(1),esr-9753,ESR-9753) endef @@ -313,6 +328,7 @@ $(call Image/Build/Profile/DIR300B1,$(1)) $(call Image/Build/Profile/ESR9753,$(1)) $(call Image/Build/Profile/RTG32B1,$(1)) + $(call Image/Build/Profile/RTN10PLUS,$(1)) $(call Image/Build/Profile/FONERA20N,$(1)) $(call Image/Build/Profile/V22RW2X2,$(1)) $(call Image/Build/Profile/NBG419N,$(1)) Index: target/linux/ramips/rt305x/config-2.6.39 =================================================================== --- target/linux/ramips/rt305x/config-2.6.39 (revision 29921) +++ target/linux/ramips/rt305x/config-2.6.39 (working copy) @@ -105,6 +105,7 @@ CONFIG_RT305X_MACH_OMNI_EMB=y CONFIG_RT305X_MACH_PWH2004=y CONFIG_RT305X_MACH_RT_G32_REVB=y +CONFIG_RT305X_MACH_RT_N10_PLUS=y CONFIG_RT305X_MACH_V22RW_2X2=y CONFIG_RT305X_MACH_W502U=y CONFIG_RT305X_MACH_WCR150GN=y Index: target/linux/ramips/base-files/lib/ramips.sh =================================================================== --- target/linux/ramips/base-files/lib/ramips.sh (revision 29921) +++ target/linux/ramips/base-files/lib/ramips.sh (working copy) @@ -98,6 +98,9 @@ *"RT-G32 B1") name="rt-g32-b1" ;; + *"RT-N10+") + name="rt-n10-plus" + ;; *"RT-N15") name="rt-n15" ;; 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 29921) +++ target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom (working copy) @@ -37,6 +37,7 @@ rt2x00_eeprom_extract "devdata" 16384 272 ;; + rt-n10-plus | \ rt-g32-b1) rt2x00_eeprom_extract "devconf" 0 272 ;; Index: target/linux/ramips/base-files/etc/uci-defaults/network =================================================================== --- target/linux/ramips/base-files/etc/uci-defaults/network (revision 29921) +++ target/linux/ramips/base-files/etc/uci-defaults/network (working copy) @@ -27,6 +27,7 @@ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ;; + # TODO: Try RT-N10+ here? f5d8235-v1 | \ rt-n15) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" @@ -69,6 +70,7 @@ local wan_mac="" case $board in + # TODO: Add N10+ here all0256n) lan_mac=$(ramips_get_mac_binary factory 40) ;; Index: target/linux/ramips/base-files/etc/diag.sh =================================================================== --- target/linux/ramips/base-files/etc/diag.sh (revision 29921) +++ target/linux/ramips/base-files/etc/diag.sh (working copy) @@ -66,6 +66,9 @@ rt-n15) status_led="rt-n15:blue:power" ;; + rt-n10-plus) + status_led="rt-n10-plus:green:wps" + ;; v22rw-2x2) status_led="v22rw-2x2:green:security" ;;
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel