From patchwork Tue Dec 1 17:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1408973 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=u4JjB/hx; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=YUTzhdq2; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4Clq822VjPz9s1l for ; Wed, 2 Dec 2020 04:38:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=0dZGRCDYPZDzV9hDzBkTPbrAkNDyhkI/KrYwcSrGFnk=; b=u4JjB/hxh2u4Te+IFqU8gXZ8YS xi4+4r2gKxNuK6dOXIZ389vX3f7POEbQ3LaZOXEn0cUziImvjXGY+l3KpBIrx4INIXC0zR8DrVQc9 YHTce+wcDNuTvNnBWFr6RbvtHEYs67zLskbir1Ba+CSK1wWSEkqG7AQ18aBcySNokwkyZzxN1L9h0 asdBRrUveKxP9HEKsuiI9CuBKJGqW3bqAGnm181R5aTdTQcPyY/7uFNKAcWJ/IZEEbnHuf1fH40XX 0j4pRe+mlr2VklDVB2wBVdKDF39j542RZXySAbga6j5uZGt6IWALk+f2q+sL8xtXYMZgEr7sj8Uy4 pVDZKvKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk9ZY-0001pw-Me; Tue, 01 Dec 2020 17:36:16 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk9ZW-0001p4-08 for openwrt-devel@lists.openwrt.org; Tue, 01 Dec 2020 17:36:15 +0000 Received: by mail-wr1-x42a.google.com with SMTP id o1so3908729wrx.7 for ; Tue, 01 Dec 2020 09:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8shh6RomGQjTE9g6Ae9gPgZhSLbd8H3FMHV5dYkWg2o=; b=YUTzhdq2HOFE1PFXv0wfqglHlYe2g7+pvjSOeAZ+pSTT82YC4D4qiiLseee7wJSFrs UlXT2UKvNGNhfXTIjGAiNQPjvtvoq32pWETzlb9Yw0g7ULFWXZnx/OBpSqyIAcsZM9kn 4Z4W8NLzGIEbd8Xbq9h2GZraIIPuvve/QhVc1aheY4MOnMZqCrbki4fokramO0UpU1k4 VLB1uPBtJJvkp+VwUJWInBhNs2/oR+JikYqisxTltysBhJbRYufYgvyrXVTAAhWAdmiw Z+rEHhSBawmGWL+l2x83zHZwqEd5vfc9inWYuOH2ZI8YiEV2AalcFMIscQrHfxqP53J5 ktkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8shh6RomGQjTE9g6Ae9gPgZhSLbd8H3FMHV5dYkWg2o=; b=ldXlgMJkFzJu0kV7SlKENxfgBt21UR81h+0igIaJYI+FE4W5SvkQX4T9+h3OvrKWNd vgi94uQ14u/2v1EhkRSkz68jDVePmhBWNJ/3OC4o6soZCmt48lZ78uAua4uZRE17QqQe y8HfjTet0gsI2Qo2VqxkSY1AscggVLuM2gdbl0bCaQpbEgimERvH2eL+OP8cFQVfemAq ItuWtXD+/qzW7RiXeArEm6Xele12V0YaoWQnElIev6OtQ2AKUmRAM3PJ7ytu7v9887Ex /LWzT+KRfxaAhLOXmWhqHuRElw02aK3rt2wfraniWylVmIaWLxYxONCzTiw8eHIXGQi/ Jb1w== X-Gm-Message-State: AOAM533zAy7RllBVoqM7iVJqoQfY/cllgO7rqfruqEpaM22Az3XsBpWz NrPJSv3TvHFTG6L6L6inbF26ND+oh/7N2xkq X-Google-Smtp-Source: ABdhPJyYBLkumSdqICTtjEIMNnJwKPGenHdpTVLasbdiovU1bkeo5WmQU3aDaABgvqogqnZYXrnV5Q== X-Received: by 2002:adf:b310:: with SMTP id j16mr5241593wrd.293.1606844172545; Tue, 01 Dec 2020 09:36:12 -0800 (PST) Received: from localhost.localdomain (terefe.re. [5.2.67.190]) by smtp.googlemail.com with ESMTPSA id e1sm769544wma.17.2020.12.01.09.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:36:12 -0800 (PST) From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] ath79: add support for Mojo Networks AirTight C-75 Date: Tue, 1 Dec 2020 18:36:01 +0100 Message-Id: <20201201173602.415324-1-tmn505@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201201_123614_143292_5571190C X-CRM114-Status: GOOD ( 17.36 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tmn505[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [tmn505[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Georgievsky Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Mojo Networks AirTight C-75 is a dual-band access point, also sold by WatchGuard under name AP320. Specification SoC: Qualcomm Atheros QCA9550 RAM: 128 MiB DDR2 Flash: 2x 16 MiB SPI NOR WIFI: 2.4 GHz 3T3R integrated 5 GHz 3T3R QCA9890 oversized Mini PCIe card Ethernet: 2x 10/100/1000 Mbps QCA8334 port labeled LAN1 is PoE capable (802.3at) USB: 1x 2.0 LEDs: 7x which two are GPIO controlled, four switch controlled, one controlled by wireless driver Buttons: 1x GPIO controlled Serial: RJ-45 port, Cisco pinout baud: 115200, parity: none, flow control: none JTAG: Yes, pins marked J1 on PCB Installation 1. Prepare TFTP server with OpenWrt initramfs-kernel image. 2. Connect to one of LAN ports. 3. Connect to serial port. 4. Power on the device and when prompted to stop autoboot, hit any key. 5. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use 'setenv' to do that, then run following commands: tftpboot 0x81000000 bootm 0x81000000 6. Wait about 1 minute for OpenWrt to boot. 7. Transfer OpenWrt sysupgrade image to /tmp directory and flash it with: sysupgrade -n /tmp/ 8. After flashing, the access point will reboot to OpenWrt. Wait few minutes, until the Power LED stops blinking, then it's ready for configuration. Known issues Green power LED does not work. Additional information The U-Boot fails to initialise ethernet ports correctly when a UART adapter is attached to UART pins (marked J3 on PCB). Cc: Vladimir Georgievsky Signed-of-by: Tomasz Maciej Nowak --- package/boot/uboot-envtools/files/ath79 | 1 + target/linux/ath79/dts/qca9550_mojo_c-75.dts | 173 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 4 + target/linux/ath79/image/generic.mk | 11 ++ 4 files changed, 189 insertions(+) create mode 100644 target/linux/ath79/dts/qca9550_mojo_c-75.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 259c52c77034..a6b52b370530 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -20,6 +20,7 @@ alfa-network,n5q|\ alfa-network,pi-wifi4|\ alfa-network,r36a|\ allnet,all-wap02860ac|\ +airtight,c-75|\ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ diff --git a/target/linux/ath79/dts/qca9550_mojo_c-75.dts b/target/linux/ath79/dts/qca9550_mojo_c-75.dts new file mode 100644 index 000000000000..51046a740a02 --- /dev/null +++ b/target/linux/ath79/dts/qca9550_mojo_c-75.dts @@ -0,0 +1,173 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca955x.dtsi" + +/ { + model = "Mojo Networks AirTight C-75"; + compatible = "mojo,c-75", "qca,qca9550", "qca,qca9558"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + phy-handle = <&phy0>; + phy-mode = "rgmii"; + pll-data = <0xa6000000 0x00000101 0x00001616>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x6>; + phy-mode = "sgmii"; + pll-data = <0x03000101 0x00000101 0x00001616>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x0c 0x00080080 + 0x04 0x07600000 + 0x58 0xc935c935 + 0x5c 0x03ffff00 + 0x7c 0x0000007e + 0x94 0x0000007e + >; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + }; +}; + +&spi { + status = "okay"; + + num-cs = <2>; + + 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>; + }; + + partition@50000 { + label = "wlandrv"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "firmware"; + reg = <0x060000 0xf90000>; + compatible = "denx,uimage"; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; + + flash@1 { + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "opt"; + reg = <0x0 0x1000000>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x1002>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 5c0195f6ffc9..02e4d6b78dd4 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -248,6 +248,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" ;; + mojo,c-75) + ucidef_add_switch "switch0" \ + "0@eth0" "2:wan" "3:lan" "6@eth1" + ;; nec,wg1200cr|\ qxwlan,e1700ac-v2-8m|\ qxwlan,e1700ac-v2-16m|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index a0d5e7ab0190..0f90c00b9c43 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1192,6 +1192,17 @@ define Device/mercury_mw4530r-v1 endef TARGET_DEVICES += mercury_mw4530r-v1 +define Device/mojo_c-75 + SOC := qca9550 + DEVICE_VENDOR := Mojo Networks + DEVICE_MODEL := AirTight C-75 + DEVICE_ALT0_VENDOR := WatchGuard + DEVICE_ALT0_MODEL := AP320 + DEVICE_PACKAGES := ath10k-firmware-qca988x kmod-ath10k-ct kmod-usb2 + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += mojo_c-75 + define Device/nec_wg1200cr SOC := qca9563 DEVICE_VENDOR := NEC