ath79: add support for I-O DATA WN-AC1600DGR
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Tue, 5 Feb 2019 08:23:58 +0000 (17:23 +0900)
committerChristian Lamparter <chunkeey@gmail.com>
Thu, 14 Feb 2019 15:56:15 +0000 (16:56 +0100)
I-O DATA WN-AC1600DGR is a 2.4/5 GHz band 11ac router, based on
Qualcomm Atheros QCA9557.

Specification:

- SoC:      Qualcomm Atheros QCA9557
- RAM:      128 MB
- Flash:    16 MB
- WLAN:     2.4/5 GHz
  - 2.4 GHz: 2T2R (SoC internal)
  - 5 GHz:   3T3R (QCA9880)
- Ethernet: 5x 10/100/1000 Mbps
  - Switch: QCA8337N
- LED/key:  6x/6x(4x buttons, 1x slide switch)
- UART:     through-hole on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of WN-AC1600DGR
2. Connect power cable to WN-AC1600DGR and turn on it
3. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
4. Select the OpenWrt factory image and click update ("更新") button
5. Wait ~150 seconds to complete flashing

Alternative flash instruction using initramfs image:

1. Prepare a computer and TFTP server software with the IP address
"192.168.99.8" and renamed OpenWrt initramfs image
"uImageWN-AC1600DGR"
2. Connect between WN-AC1600DGR and the computer with UART
3. Connect power cable to WN-AC1600DGR, press "4" on the serial
console and enter the U-Boot console
4. execute "tftpboot" command on the console and download initramfs
image from the TFTP server
5. execute "bootm" command and boot OpenWrt
6. On initramfs image, download the sysupgrade image to the device
and perform sysupgrade with it
7. Wait ~150 seconds to complete flashing

This commit also removes unnecessary "qca,no-eeprom" property from
the ath10k wifi node.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
target/linux/ath79/base-files/etc/board.d/02_network
target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
target/linux/ath79/dts/qca9557_iodata_wn-ac1167dgr.dts
target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts [new file with mode: 0644]
target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts
target/linux/ath79/image/generic.mk

index a63939670e71f69dc7eade4b4298ce3ba9d641cc..9a1063c2aeac614ee71ae80115507ef4eb5f3065 100755 (executable)
@@ -109,6 +109,7 @@ ath79_setup_interfaces()
                ;;
        iodata,etg3-r|\
        iodata,wn-ac1167dgr|\
+       iodata,wn-ac1600dgr|\
        iodata,wn-ac1600dgr2|\
        iodata,wn-ag300dgr|\
        pcs,cr5000)
@@ -267,6 +268,7 @@ ath79_setup_macs()
                wan_mac=$(macaddr_add "$lan_mac" -1)
                ;;
        iodata,wn-ac1167dgr|\
+       iodata,wn-ac1600dgr|\
        iodata,wn-ac1600dgr2|\
        iodata,wn-ag300dgr)
                lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
index 2da9250ddf28d85163035cd40171ffcef83ac0ca..8b217d12c043978e8aedc630fd863e0184ac7202 100644 (file)
@@ -110,6 +110,7 @@ case "$FIRMWARE" in
                ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan24mac") 2
                ;;
        iodata,wn-ac1167dgr|\
+       iodata,wn-ac1600dgr|\
        iodata,wn-ac1600dgr2|\
        iodata,wn-ag300dgr)
                ath9k_eeprom_extract "art" 4096 1088
index 14d4f6b9d60411ed5fb7d63e34a005f68c18ad08..2da2e8bfb0f58784a2b2c980e3af8c15ca739d3c 100644 (file)
@@ -19,6 +19,12 @@ case "$board" in
                [ "$PHYNBR" -eq 1 ] && \
                        echo $(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1) > /sys${DEVPATH}/macaddress
                ;;
+       iodata,wn-ac1600dgr)
+               # There is no eeprom data for 5 GHz wlan in "art" partition
+               # which would allow to patch the macaddress
+               [ "$PHYNBR" -eq 0 ] && \
+                       echo $(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1) > /sys${DEVPATH}/macaddress
+               ;;
        phicomm,k2t)
                # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
                [ "$PHYNBR" -eq 1 ] && \
index 22a23f97aec5bffc8e8fabf2b51da25e3f123b33..86b97437ea140e867e1b724bcc8639e52d587fd8 100644 (file)
@@ -18,7 +18,7 @@
                bootargs = "console=ttyS0,115200n8";
        };
 
-       leds {
+       leds: leds {
                compatible = "gpio-leds";
 
                power: power {
                        default-state = "on";
                };
 
-               copy {
-                       label = "iodata:green:copy";
-                       gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
-               };
-
                eco {
                        label = "iodata:green:eco";
                        gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
                };
        };
 
-       keys {
+       keys: keys {
                compatible = "gpio-keys-polled";
                poll-interval = <20>;
 
-               button_eco {
+               eco {
                        label = "eco";
                        gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_1>;
                        debounce-interval = <60>;
                };
 
-               button_copy {
-                       label = "copy";
-                       gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-                       linux,code = <BTN_1>;
-                       debounce-interval = <60>;
-               };
-
                wps {
                        label = "wps";
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
        wifi@0,0 {
                compatible = "pci168c,003c";
                reg = <0x0000 0 0 0 0>;
-               qca,no-eeprom;
        };
 };
 
index 7990d9cd57fd5db1f80a0a797d2a02042941cfef..c2fc7abcb3f6c63f0d00d0d276d010b22bf442c0 100644 (file)
        compatible = "iodata,wn-ac1167dgr", "qca,qca9557";
        model = "I-O DATA WN-AC1167DGR";
 };
+
+&leds {
+       copy {
+               label = "iodata:green:copy";
+               gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&keys {
+       copy {
+               label = "copy";
+               gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               linux,code = <BTN_1>;
+               debounce-interval = <60>;
+       };
+};
diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts
new file mode 100644 (file)
index 0000000..ef47e1e
--- /dev/null
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca9557_iodata_wn-ac-dgr.dtsi"
+
+/ {
+       compatible = "iodata,wn-ac1600dgr", "qca,qca9557";
+       model = "I-O DATA WN-AC1600DGR";
+};
+
+&leds {
+       function {
+               label = "iodata:green:function";
+               gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&keys {
+       function {
+               label = "function";
+               gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               linux,code = <BTN_1>;
+               debounce-interval = <60>;
+       };
+};
index 3eedec72e7ccf44c85c288c39b12679570d9a658..37ae8fe01fbdc7aeaade7d1e4d675c43d5dcc82f 100644 (file)
        compatible = "iodata,wn-ac1600dgr2", "qca,qca9557";
        model = "I-O DATA WN-AC1600DGR2";
 };
+
+&leds {
+       copy {
+               label = "iodata:green:copy";
+               gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&keys {
+       copy {
+               label = "copy";
+               gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               linux,code = <BTN_1>;
+               debounce-interval = <60>;
+       };
+};
index 94dfe3d4d7f1fe1c945e91a5350002a55f981a3d..889321867a50fd51ffc1689697707bd242bb334e 100644 (file)
@@ -349,6 +349,18 @@ define Device/iodata_wn-ac1167dgr
 endef
 TARGET_DEVICES += iodata_wn-ac1167dgr
 
+define Device/iodata_wn-ac1600dgr
+  ATH_SOC := qca9557
+  DEVICE_TITLE := I-O DATA WN-AC1600DGR
+  IMAGE_SIZE := 14656k
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+    append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \
+    senao-header -r 0x30a -p 0x60 -t 2 -v 200
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+TARGET_DEVICES += iodata_wn-ac1600dgr
+
 define Device/iodata_wn-ac1600dgr2
   ATH_SOC := qca9557
   DEVICE_TITLE := I-O DATA WN-AC1600DGR2