From patchwork Sat Jan 23 00:58:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1430618 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=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; 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=TbrPlfZl; 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 4DMyW31lGLz9sVF for ; Sat, 23 Jan 2021 12:01:16 +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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jdP5vuvOhBRx3cYwP71ki9TE9P5T5Y/LCYJkav1/tGk=; b=TbrPlfZlP2K8n31K2+zbU9yBWx pMNEaI50MQ0jVolbzlzXsIjagPQ3YoKzBKO8X8wt69gACkqdmOwlhXe1bGwUp17mVVCoQ2LMsr0Z0 4X3GPAoAsa3zY3T7l6uPswVcfFX+LgXNvJ/j+QOcn2C/KezDD6FKu2WcNv+7EU8XE8zNtEY3X/QxU RP196b5aKHq7PgyRHN4IT2qvbRkN0/v97scHGCOuIzaZhXcNaJVWf4EQwtY0ZOHQFY737f+lNkQdJ LFzE+qiMJYi1wivm1JxiqgsdB/3/C/edurbpFSMTvXJZyDjUpO9v+DC/mQPh05kru415SoB3v9pyp UYFoPvrw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l37Gp-00023A-LH; Sat, 23 Jan 2021 00:59:19 +0000 Received: from mars.blocktrron.ovh ([2001:41d0:401:3000::cbd] helo=mail.blocktrron.ovh) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l37Gm-000224-1C for openwrt-devel@lists.openwrt.org; Sat, 23 Jan 2021 00:59:17 +0000 Received: from localhost.localdomain (p200300e53f07540090b3f01584654f50.dip0.t-ipconnect.de [IPv6:2003:e5:3f07:5400:90b3:f015:8465:4f50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 39B0A2F080 for ; Sat, 23 Jan 2021 01:59:11 +0100 (CET) From: David Bauer To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/2] ath79: add support for Ubiquiti UniFi AP Outdoor+ Date: Sat, 23 Jan 2021 01:58:54 +0100 Message-Id: <20210123005854.576853-2-mail@david-bauer.net> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210123005854.576853-1-mail@david-bauer.net> References: <20210123005854.576853-1-mail@david-bauer.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210122_195916_290662_373E87CE X-CRM114-Status: GOOD ( 17.60 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Hardware -------- Atheros AR7241 16M SPI-NOR 64M DDR2 Atheros AR9283 2T2R b/g/n 2x Fast Ethernet (built-in) Installation ------------ Transfer the Firmware update to the device using SCP. Install using fwupdate.real -m -d Signed-off-by: David Bauer --- .../dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts | 102 ++++++++++++++++++ target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 45 +------- target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi | 52 +++++++++ .../generic/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 3 +- target/linux/ath79/image/generic-ubnt.mk | 30 ++++-- 6 files changed, 180 insertions(+), 55 deletions(-) create mode 100644 target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts create mode 100644 target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts new file mode 100644 index 0000000000..936850b7df --- /dev/null +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7241_ubnt_unifi.dtsi" + +/ { + compatible = "ubnt,unifi-ap-outdoor-plus", "qca,ar7241"; + model = "Ubiquiti UniFi AP Outdoor+"; + + aliases { + led-boot = &led_white; + led-failsafe = &led_white; + led-running = &led_white; + led-upgrade = &led_white; + }; + + leds { + compatible = "gpio-leds"; + + led_white: white { + label = "blue"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + blue { + label = "white"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xf60000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x300000>; + /* Can be resized w/o issues. + * U-Boot can load kernel from the + * entirety of the "firmware" partition space. + */ + }; + + partition@300000 { + label = "rootfs"; + reg = <0x300000 0xc60000>; + }; + }; + + partition@fb0000 { + label = "cfg"; + reg = <0xfb0000 0x40000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x6>; +}; + +&wifi { + ath9k,ubnt-hsr; +}; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index bdb4c61a48..287e8cc7db 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar7241.dtsi" - -#include -#include +#include "ar7241_ubnt_unifi.dtsi" / { compatible = "ubnt,unifi", "qca,ar7241"; @@ -14,23 +11,6 @@ led-failsafe = &led_dome_green; led-running = &led_dome_green; led-upgrade = &led_dome_green; - label-mac-device = &wifi; - }; - - extosc: ref { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <40000000>; - }; - - keys { - compatible = "gpio-keys"; - - reset { - linux,code = ; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; }; leds { @@ -48,14 +28,6 @@ }; }; -&uart { - status = "okay"; -}; - -&pll { - clocks = <&extosc>; -}; - &spi { status = "okay"; @@ -108,21 +80,6 @@ }; }; -&pcie { - status = "okay"; - - wifi: wifi@0,0 { - reg = <0x0000 0 0 0 0>; - qca,no-eeprom; - }; -}; - -ð0 { - status = "okay"; - - mtd-mac-address = <&art 0x0>; -}; - ð1 { compatible = "syscon", "simple-mfd"; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi new file mode 100644 index 0000000000..7bf79f7465 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7241.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = &wifi; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <40000000>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pll { + clocks = <&extosc>; +}; + +&pcie { + status = "okay"; + + wifi: wifi@0,0 { + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + 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 0c08871f99..9db4799e52 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 @@ -107,7 +107,8 @@ ath79_setup_interfaces() alfa-network,n5q|\ devolo,dvl1200e|\ devolo,dvl1750e|\ - ocedo,ursus) + ocedo,ursus|\ + ubnt,unifi-ap-outdoor-plus) ucidef_set_interface_lan "eth0 eth1" ;; avm,fritz4020|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index d50d8d9f82..552eb406ab 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -74,7 +74,8 @@ case "$FIRMWARE" in avm,fritz300e) caldata_extract_reverse "urloader" 0x1541 0x440 ;; - buffalo,wzr-hp-g302h-a1a0) + buffalo,wzr-hp-g302h-a1a0|\ + ubnt,unifi-ap-outdoor-plus) caldata_extract "art" 0x1000 0xeb8 ;; buffalo,wzr-hp-g450h|\ diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 91a18d3d35..733d803d7a 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -120,6 +120,18 @@ define Device/ubnt-xw UBNT_VERSION := 6.0.4 endef +define Device/ubnt-unifi-jffs2 + $(Device/ubnt) + KERNEL_SIZE := 3072k + IMAGE_SIZE := 15744k + UBNT_TYPE := BZ + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0 + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\ + pad-rootfs | append-metadata | check-size + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2 +endef + define Device/ubnt-acb $(Device/ubnt) IMAGE_SIZE := 15744k @@ -420,19 +432,19 @@ define Device/ubnt_unifiac-pro endef TARGET_DEVICES += ubnt_unifiac-pro +define Device/ubnt_unifi-ap-outdoor-plus + $(Device/ubnt-bz) + $(Device/ubnt-unifi-jffs2) + DEVICE_MODEL := UniFi AP Outdoor+ + SUPPORTED_DEVICES += unifi-outdoor-plus +endef +TARGET_DEVICES += ubnt_unifi-ap-outdoor-plus + define Device/ubnt_unifi-ap-pro + $(Device/ubnt-unifi-jffs2) SOC := ar9344 - DEVICE_VENDOR := Ubiquiti DEVICE_MODEL := UniFi AP Pro - UBNT_TYPE := BZ UBNT_CHIP := ar934x - KERNEL_SIZE := 3072k - IMAGE_SIZE := 15744k - KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0 - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\ - pad-rootfs | append-metadata | check-size - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2 SUPPORTED_DEVICES += uap-pro endef TARGET_DEVICES += ubnt_unifi-ap-pro