[OpenWrt-Devel] [PATCH] ath79: add support for ZyXEL NWA1123-NI

Patrick Supper openwrt.dev at krtzbrtz.org
Thu Oct 24 07:54:30 EDT 2019


ZyXEL NWA1123-NI is a dual band 802.11n access point.

The factory firmware partition table is using a small kernel partition
after the rootfs partition. Since it has to be flashed using UART I also
merged 3 partitions (rootfs, uImage, reserve) to one firmware partition
and changed the default load address in U-Boot.

* Specification:
- SoC: Atheros AR9342 @560MHz
- RAM: 64 MiB
- Flash: 16 MiB NOR
- Ethernet: 10/100/1000 Mbps (Atheros AR8035 PHY)
- WiFi 2.4GHz: Atheros AR9340 (SoC) 802.11bgn 2×2:2
- WiFi 5.0GHz: Atheros AR9382 (PCIe) 802.11an 2×2:2
- Button: 1 (reset)
- LED: 1 (amber/green)
- Power: DC 12V/1A Barrel, PoE 802.3af
- Bootloader: U-Boot 1.1.4 (Qualcomm/Atheros SDK)

Serial Port header is located next to the On-PCB-Antenna "ANT2"
Pin 1: VCC +3.3V (small circle silkscreened)
    2: TX
    3: RX
    4: GND

* Install / Flash instruction:
Use the squashfs-sysupgrade.bin image. Set up a TFTP server, connect to
serial port and press any key after powering up the device to enter
U-boot shell.

1. Change the default boot command and unset bootargs:
     setenv bootcmd 'bootm 0x9f050000'
     setenv bootargs
     saveenv
2. Set your router ipaddr and server ipaddr. e.g.:
     setenv ipaddr 192.168.1.11
     setenv serverip 192.168.1.120
3. Load and flash the firmware:
     tftp 0x80060000 fw.bin
     erase 0x9f050000 +$filesize
     cp.b $fileaddr 0x9f050000 $filesize
4. Reset your device:
     reset
5. Wait for the LED to turn from blinking amber to solid green (ca 2min)

* Known Issue:
- U-Boot does NOT support booting large initramfs images from RAM,
  they need to be written to flash first.

Signed-off-by: Patrick Supper <openwrt.dev at krtzbrtz.org>
---
 .../ath79/base-files/etc/board.d/02_network   |   3 +-
 .../ath79/dts/ar9342_zyxel_nwa1123-ni.dts     | 161 ++++++++++++++++++
 target/linux/ath79/image/generic.mk           |   8 +
 3 files changed, 171 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ath79/dts/ar9342_zyxel_nwa1123-ni.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
index c40c07a906..67701294b4 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -54,7 +54,8 @@ ath79_setup_interfaces()
 	ubnt,unifiac-mesh|\
 	ubnt,unifi|\
 	wd,mynet-wifi-rangeextender|\
-	winchannel,wb2000)
+	winchannel,wb2000|\
+	zyxel,nwa1123-ni)
 		ucidef_set_interface_lan "eth0"
 		;;
 	avm,fritz4020|\
diff --git a/target/linux/ath79/dts/ar9342_zyxel_nwa1123-ni.dts b/target/linux/ath79/dts/ar9342_zyxel_nwa1123-ni.dts
new file mode 100644
index 0000000000..348a3d69cc
--- /dev/null
+++ b/target/linux/ath79/dts/ar9342_zyxel_nwa1123-ni.dts
@@ -0,0 +1,161 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "ar9344.dtsi"
+
+/ {
+	compatible = "zyxel,nwa1123-ni", "qca,ar9342";
+	model = "ZyXEL NWA1123-NI";
+
+	aliases {
+		led-boot = &status_amber;
+		led-failsafe = &status_amber;
+		led-running = &status_green;
+		led-upgrade = &status_amber;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		status_amber: power_amber {
+			label = "zyxel:amber:power";
+			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+		};
+
+		status_green: power_green {
+			label = "zyxel:green:power";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+};
+
+&ref {
+	clock-frequency = <40000000>;
+};
+
+&uart {
+	status = "okay";
+};
+
+&gpio {
+	status = "okay";
+};
+
+&spi {
+	status = "okay";
+	num-cs = <1>;
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x040000 0x010000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x050000 0xF50000>;
+			};
+
+			partition at fa0000 {
+				label = "config";
+				reg = <0xfa0000 0x040000>;
+				read-only;
+			};
+
+			partition at fe0000 {
+				label = "mib0";
+				reg = <0xfe0000 0x010000>;
+				read-only;
+			};
+
+			art: partition at ff0000 {
+				label = "ART";
+				reg = <0xff0000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+
+&pcie {
+	status = "okay";
+
+	wifi at 0,0 {
+		compatible = "168c,0030";
+		reg = <0x0000 0 0 0 0>;
+		mtd-mac-address = <&art 0x1002>;
+		mtd-mac-address-increment = <2>;
+		qca,disable-2ghz;
+	};
+};
+
+&wmac {
+	status = "okay";
+	qca,disable-5ghz;
+	mtd-cal-data = <&art 0x1000>;
+	mtd-mac-address = <&art 0x1002>;
+	mtd-mac-address-increment = <1>;
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy-mask = <0>;
+
+	phy0: ethernet-phy at 0 {
+		reg = <0>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	/* default for ar934x, except for 1000M and 10M */
+	pll-data = <0x06000000 0x00000101 0x00001313>;
+
+	mtd-mac-address = <&art 0x1002>;
+
+	phy-mode = "rgmii-id";
+	phy-handle = <&phy0>;
+
+	gmac-config {
+		device = <&gmac>;
+		rxdv-delay = <3>;
+		rxd-delay = <3>;
+		txen-delay = <3>;
+		txd-delay = <3>;
+		rgmii-gmac0 = <1>;
+	};
+};
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index e82e125166..0f13fad7b2 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1022,3 +1022,11 @@ define Device/zbtlink_zbt-wd323
 		     kmod-usb-serial kmod-usb-serial-cp210x uqmi
 endef
 TARGET_DEVICES += zbtlink_zbt-wd323
+
+define Device/zyxel_nwa1123-ni
+  ATH_SOC := ar9342
+  DEVICE_VENDOR := ZyXEL
+  DEVICE_MODEL := NWA1123-NI
+  IMAGE_SIZE := 15680k
+endef
+TARGET_DEVICES += zyxel_nwa1123-ni
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list