ramips: add support for Asus RT-AC51U
authorØrjan Malde <foxyred333@gmail.com>
Fri, 5 May 2017 15:54:26 +0000 (17:54 +0200)
committerMathias Kresin <dev@kresin.me>
Wed, 10 May 2017 06:45:12 +0000 (08:45 +0200)
Specification:
 - SoC: MediaTek MT7620A (580 MHz)
 - RAM: 64 MiB (Winbond W9751G6JB-25)
 - Flash: 16 MiB (Spansion S25FL128SAIF00)
 - LAN: x4 100M
 - WAN: x1 100M
 - Others: USB 2.0, reset button, wps button and 9 LEDs

Issues:
 - 5 GHz band is not functional (missing driver support)

Installation:

Asus windows recovery tool:
 - install the Asus firmware restoration utility
 - unplug the router, hold the reset button while powering it on
 - release when the power LED flashes slowly
 - specify a static IP on your computer:
     IP address: 192.168.1.75;
     Subnet mask 255.255.255.0
 - Start the Asus firmware restoration utility, specify the sysupgrade
   image, and press upload

TFTP Recovery method:
 - set computer to a static ip, 192.168.1.75
 - connect computer to the LAN 1 port of the router
 - hold the reset button while powering on the router for a few seconds
 - send firmware image using a tftp client; i.e from linux:
 $ tftp
 tftp> binary
 tftp> connect 192.168.1.1
 tftp> put lede-ramips-mt7620-rt-ac51u-squashfs-sysupgrade.bin
 tftp> quit

Signed-off-by: Ørjan Malde <foxyred333@gmail.com>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/RT-AC51U.dts [new file with mode: 0644]
target/linux/ramips/image/mt7620.mk

index 9322228a10a555aae0e7bf08578337f525da09f2..2a35fc4bc21af9676bcc27ed598c865b88512e74 100755 (executable)
@@ -314,6 +314,10 @@ rp-n53)
        ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
        set_wifi_led "$board:blue:wifi"
        ;;
+rt-ac51u)
+       set_wifi_led "$board:blue:wifi"
+       set_usb_led "$board:blue:usb" "1-1"
+       ;;
 rt-n14u)
        ucidef_set_led_default "power" "power" "$board:blue:power" "1"
        ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1
index cefc4f41fe8b358d7020b55e10fe026edc3afb0c..6d93f2ccaa89be7e6b5da00a2aabb8420c67407a 100755 (executable)
@@ -135,6 +135,10 @@ ramips_setup_interfaces()
                ;;
        ar670w|\
        ar725w|\
+       rt-ac51u)
+               ucidef_add_switch "switch0" \
+                       "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
+               ;;
        rt-n15|\
        wl-351)
                ucidef_add_switch "switch0" \
index a36ce54675bc97e863f651e9baff5267af36ffaf..e37f9cfda401b853da78874280c07763311b7d16 100644 (file)
@@ -117,6 +117,7 @@ get_status_led() {
        dap-1350|\
        na930|\
        pbr-m1|\
+       rt-ac51u|\
        rt-n13u|\
        rt-n14u|\
        rt-n15|\
index 506a98230aa75f537bb183605caf560546ba6258..4213159378503d4ac43b06ffc4f85a9ef9e834ff 100755 (executable)
@@ -436,6 +436,9 @@ ramips_board_detect() {
        *"RT5350F-OLinuXino-EVB")
                name="rt5350f-olinuxino-evb"
                ;;
+       *"RT-AC51U")
+               name="rt-ac51u"
+               ;;
        *"RT-G32 B1")
                name="rt-g32-b1"
                ;;
index 039009303bbc47d9d3cc58e39fbfbeaa830611d2..32bc453497c4a6158d60774f36258c1a5f3768a5 100755 (executable)
@@ -127,6 +127,7 @@ platform_check_image() {
        rp-n53|\
        rt5350f-olinuxino|\
        rt5350f-olinuxino-evb|\
+       rt-ac51u|\
        rt-g32-b1|\
        rt-n10-plus|\
        rt-n13u|\
diff --git a/target/linux/ramips/dts/RT-AC51U.dts b/target/linux/ramips/dts/RT-AC51U.dts
new file mode 100644 (file)
index 0000000..ec313cc
--- /dev/null
@@ -0,0 +1,126 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "asus,rt-ac51u", "ralink,mt7620a-soc";
+       model = "Asus RT-AC51U";
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               power {
+                       label = "rt-ac51u:blue:power";
+                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+               };
+
+               usb {
+                       label = "rt-ac51u:blue:usb";
+                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+               };
+
+               wifi {
+                       label = "rt-ac51u:blue:wifi";
+                       gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+       gpio_export {
+               compatible = "gpio-export";
+               #size-cells = <0>;
+
+               enable-leds {
+                       gpio-export,name = "enable-leds";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&spi0 {
+       status = "okay";
+
+       m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partition@0 {
+                       label = "u-boot";
+                       reg = <0x0 0x30000>;
+                       read-only;
+               };
+
+               partition@30000 {
+                       label = "u-boot-env";
+                       reg = <0x30000 0x10000>;
+                       read-only;
+               };
+
+               factory: partition@40000 {
+                       label = "factory";
+                       reg = <0x40000 0x10000>;
+                       read-only;
+               };
+
+               partition@50000 {
+                       label = "firmware";
+                       reg = <0x50000 0xfb0000>;
+               };
+       };
+};
+
+&ehci {
+       status = "okay";
+};
+
+&ohci {
+       status = "okay";
+};
+
+&gpio3 {
+       status = "okay";
+};
+
+&ethernet {
+       status = "okay";
+       mtd-mac-address = <&factory 0x4>;
+       mediatek,portmap = "wllll";
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "i2c", "wled", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};
index 5f7798f029bd94da85e3cfe005bf4068dff4bc44..73f91cfedd3827329b8e94f2db166ca7a857e6d4 100644 (file)
@@ -354,6 +354,14 @@ define Device/rt-n14u
 endef
 TARGET_DEVICES += rt-n14u
 
+define Device/rt-ac51u
+  DTS := RT-AC51U
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := Asus RT-AC51U
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ehci kmod-usb-ledtrig-usbport
+endef
+TARGET_DEVICES += rt-ac51u
+
 define Device/tiny-ac
   DTS := TINY-AC
   DEVICE_TITLE := Dovado Tiny AC