From patchwork Thu Oct 24 11:54:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: 'Patrick Supper' X-Patchwork-Id: 1182972 X-Patchwork-Delegate: mail@david-bauer.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=krtzbrtz.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oaFLz1PQ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=krtzbrtz.org header.i=@krtzbrtz.org header.b="A0yt7EDz"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46zQmb5j1mz9sPv for ; Thu, 24 Oct 2019 23:00:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DzajRD7WOhkRK/fvOf52k+qF04d4789KkaLV56pcT9I=; b=oaFLz1PQlmzaAv tieB0Q6UsR0vPAJO1oZ8Vt+2htHdQnMnRxcvO8pqKOGcA0/C/zBaQ++lts14mxS07YW+65i4AZ95X g4Nv/AJqZBbjds5l/l+rqZlGv+2VMErMbxPLG06xVYJAFhst4lAUZ1mh+5oAXwgFygRfaYC0kUw0O Ex0dsw/+xL6+X7NIEi9mGQ1BePjbolJThCYU9t6A42fIyKm+DgxkAZ4rbpe0ltECcgGR1FydhZONo T6xsBW6fob8qyBh9441579jECSz7rCcp/PWobd6D5NBgGYRBAO9YN0vgkT2wQqKg1sqAC6bLZZODp FI7JnW1xSns7zpwv68Fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNbmn-0006sk-QW; Thu, 24 Oct 2019 12:00:13 +0000 Received: from iapetos.krtzbrtz.org ([85.124.251.73]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNbmk-0006rT-Vq for openwrt-devel@lists.openwrt.org; Thu, 24 Oct 2019 12:00:12 +0000 Received: from zyxel-dev.intern.krtzbrtz.org (194-166-119-100.hdsl.highway.telekom.at [194.166.119.100]) by iapetos.krtzbrtz.org (Postfix) with ESMTPSA id 32DE19EDA9; Thu, 24 Oct 2019 13:54:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=krtzbrtz.org; s=chswiq6a; t=1571918080; bh=9nmA9l1gopy92BXrZYF9bqbm4zcnCJpRV80Q/2dHRwI=; h=From:To:Cc:Subject:Date:From; b=A0yt7EDzwRJBblCVz8Tb3kG+/emwuwLqK4smAHUA93nRUqeh31VVALAtgO6bY4nCC xA284XMwwYDu/k37NE/yLayC0lUADoafhDkF926sYo0HQruL1MO3pdtykgk84c6sot dSwAj5xq4aAyPs6UrX6ZKt/PMawpSDI2wsyzl8z7Cql4QoYdxIUv4tPxgpnra+dSD4 8tOOzwDBQDs0vUNUHpT6zaBmqjwEHtjjQPZTeAjDnIno31wD7v2HVNw2QIMkNEhx8M poyMX75aEIQjOFzvkTVfIcPKcVpHjYkOstcDJzRqJUG/+6NtG/B31hMpdeWnK/PGVQ xofMR/Ch4NvQw== From: Patrick Supper To: openwrt-devel@lists.openwrt.org Date: Thu, 24 Oct 2019 13:54:30 +0200 Message-Id: <20191024115430.19992-1-openwrt.dev@krtzbrtz.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191024_050011_359804_490E098F X-CRM114-Status: GOOD ( 13.79 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 FROM_DOMAIN_NOVOWEL From: domain has series of non-vowel letters 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH] ath79: add support for ZyXEL NWA1123-NI X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Patrick Supper Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 --- .../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 +#include + +#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 = ; + 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@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xF50000>; + }; + + partition@fa0000 { + label = "config"; + reg = <0xfa0000 0x040000>; + read-only; + }; + + partition@fe0000 { + label = "mib0"; + reg = <0xfe0000 0x010000>; + read-only; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + + +&pcie { + status = "okay"; + + wifi@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@0 { + reg = <0>; + }; +}; + +ð0 { + 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