ath79: add support for ZyXEL NWA1123-AC
authorSebastian Schaper <openwrt@sebastianschaper.net>
Sat, 27 Mar 2021 23:33:45 +0000 (00:33 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 20 Aug 2022 22:09:53 +0000 (00:09 +0200)
Specifications:
 * AR9342, 16 MiB Flash, 64 MiB RAM, 802.11n 2T2R, 2.4 GHz
 * QCA9882 PCIe card, 802.11ac 2T2R
 * 1x Gigabit Ethernet (AR8035), 802.3af PoE

Installation:
* OEM Web UI is at 192.168.1.2
  login as `admin` with password `1234`
* Flash factory-AAOX.bin

The string `AAOX` needs to be present within the file name of the uploaded
image to be accepted by the OEM Web-based updater, the factory image is
named accordingly to save the user from the hassle of manual renaming.

TFTP Recovery:
* Open the case, connect to TTL UART port (this is the official method
  described by Zyxel, the reset button is useless during power-on)
* Extract factory image (.tar.bz2), serve `vmlinux_mi124_f1e.lzma.uImage`
  and `mi124_f1e-jffs2` via tftp at 192.168.1.10
* Interrupt uboot countdown, execute commands
  `run lk`
  `run lf`
  to flash the kernel / filesystem accordingly

MAC addresses as verified by OEM firmware:
use   address   source
LAN   *:1c      mib0 0x30 ('eth0mac'), art 0x1002 (label)
2g    *:1c      mib0 0x4b ('wifi0mac')
5g    *:1e      mib0 0x66 ('wifi1mac')

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
target/linux/ath79/dts/ar9342_zyxel_nwa1123-ac.dts [new file with mode: 0644]
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/ath79/image/generic.mk

diff --git a/target/linux/ath79/dts/ar9342_zyxel_nwa1123-ac.dts b/target/linux/ath79/dts/ar9342_zyxel_nwa1123-ac.dts
new file mode 100644 (file)
index 0000000..68d4930
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9342_zyxel_nwa11xx.dtsi"
+
+/ {
+       compatible = "zyxel,nwa1123-ac", "qca,ar9342";
+       model = "Zyxel NWA1123-AC";
+
+       aliases {
+               label-mac-device = &eth0;
+               led-boot = &led_status_green;
+               led-failsafe = &led_status_amber;
+               led-running = &led_status_green;
+               led-upgrade = &led_status_amber;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_status_green: status_green {
+                       label = "green:status";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
+               };
+
+               led_status_amber: status_amber {
+                       label = "amber:status";
+                       gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&pcie {
+       status = "okay";
+};
index f0bc9b3a9cdcf853a5ab2f5f944c1a3a29b355d1..9656c009a1e5f8cd68e9e6c611763d3429409716 100644 (file)
@@ -111,6 +111,7 @@ ath79_setup_interfaces()
        wd,mynet-wifi-rangeextender|\
        winchannel,wb2000|\
        zyxel,nwa1121-ni|\
+       zyxel,nwa1123-ac|\
        zyxel,nwa1123-ni)
                ucidef_set_interface_lan "eth0"
                ;;
index 15bdf81a053c89688c01fc29d19ee2a2fd449005..57458cdef0768c90b3b153f06db09f7906958f27 100644 (file)
@@ -68,6 +68,10 @@ case "$board" in
                [ "$PHYNBR" -eq 1 ] && \
                        mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress
                ;;
+       zyxel,nwa1123-ac)
+               [ "$PHYNBR" -eq 0 ] && \
+                       mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
+               ;;
        zyxel,nwa1123-ni)
                [ "$PHYNBR" -eq 1 ] && \
                        mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
index 617f1eed3047519b56eb5203c8bdd0464be30640..612b79f8d65881bcc32aabe061cc433a839241cf 100644 (file)
@@ -2716,6 +2716,16 @@ define Device/zyxel_nwa1121-ni
 endef
 TARGET_DEVICES += zyxel_nwa1121-ni
 
+define Device/zyxel_nwa1123-ac
+  $(Device/zyxel_nwa11xx)
+  DEVICE_MODEL := NWA1123
+  DEVICE_VARIANT := AC
+  ZYXEL_MODEL_STRING := AAOX
+  DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers \
+       ath10k-firmware-qca988x-ct
+endef
+TARGET_DEVICES += zyxel_nwa1123-ac
+
 define Device/zyxel_nwa1123-ni
   $(Device/zyxel_nwa11xx)
   DEVICE_MODEL := NWA1123