ath79: Add support for Ubiquiti NanoBeam AC Gen2
authorNick Hainke <vincent@systemli.org>
Sun, 25 Oct 2020 13:51:55 +0000 (14:51 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 18 Nov 2020 20:13:46 +0000 (21:13 +0100)
CPU:         Atheros AR9342 rev 3 SoC
RAM:         64 MB DDR2
Flash:       16 MB NOR SPI
WLAN 2.4GHz: Atheros AR9342 v3 (ath9k)
WLAN 5.0GHz: QCA988X
Ports:       2x GbE

Flashing procedure is identical to other ubnt devices.
https://openwrt.org/toh/ubiquiti/common

Flashing through factory firmware
1. Ensure firmware version v8.7.0 is installed.
   Up/downgrade to this exact version.
2. Patch fwupdate.real binary using
   `hexdump -Cv /bin/ubntbox | sed 's/14 40 fe 27/00 00 00 00/g' | \
    hexdump -R > /tmp/fwupdate.real`
3. Make the patched fwupdate.real binary executable using
   `chmod +x /tmp/fwupdate.real`
4. Copy the squashfs factory image to /tmp on the device
5. Flash OpenWrt using `/tmp/fwupdate.real -m <squashfs-factory image>`
6. Wait for the device to reboot
(copied from Ubiquiti NanoBeam AC and modified)

To keep it consistent, we will add the gen1 variant to
the nanobeam ac gen1.

Signed-off-by: Nick Hainke <vincent@systemli.org>
target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac-gen2.dts [new file with mode: 0644]
target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/image/generic-ubnt.mk

diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac-gen2.dts b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac-gen2.dts
new file mode 100644 (file)
index 0000000..08f3d2c
--- /dev/null
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "ar9342_ubnt_wa_2port.dtsi"
+
+/ {
+       compatible = "ubnt,nanobeam-ac-gen2", "ubnt,wa", "qca,ar9342";
+       model = "Ubiquiti NanoBeam AC Gen2 (WA)";
+
+       aliases {
+               led-boot = &led_rssi3;
+               led-failsafe = &led_rssi3;
+               led-upgrade = &led_rssi3;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               rssi0 {
+                       label = "blue:rssi0";
+                       gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi1 {
+                       label = "blue:rssi1";
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi2 {
+                       label = "blue:rssi2";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               led_rssi3: rssi3 {
+                       label = "blue:rssi3";
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
index dc2537a77e3837811a5223339a4051a2b3e379cb..b32a200b11353abb7ac8d12336d31b562b00c8b6 100644 (file)
@@ -4,7 +4,7 @@
 
 / {
        compatible = "ubnt,nanobeam-ac", "ubnt,wa", "qca,ar9342";
-       model = "Ubiquiti NanoBeam AC (WA)";
+       model = "Ubiquiti NanoBeam AC Gen1 (WA)";
 
        aliases {
                led-boot = &led_rssi3;
index 227e64678d6353f503e80d390cf9182047a1b716..08ca2a839830200402f2a578b22403ec3a7604f8 100755 (executable)
@@ -362,6 +362,7 @@ ubnt,rocket-m)
        ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:link4" "wlan0" "76" "100"
        ;;
 ubnt,nanobeam-ac|\
+ubnt,nanobeam-ac-gen2|\
 ubnt,nanostation-ac|\
 ubnt,powerbeam-5ac-gen2)
        ucidef_set_rssimon "wlan0" "200000" "1"
index a587cfac96883b15b1e2a8254e68787d24372e77..58518a8273ea0ef36cdca8145afaea8206370e44 100755 (executable)
@@ -248,6 +248,7 @@ ath79_setup_interfaces()
        qxwlan,e1700ac-v2-16m|\
        qxwlan,e750g-v8-8m|\
        qxwlan,e750g-v8-16m|\
+       ubnt,nanobeam-ac-gen2|\
        ubnt,nanostation-ac|\
        yuncore,a782|\
        yuncore,xd4200)
@@ -582,6 +583,7 @@ ath79_setup_macs()
                label_mac=$wan_mac
                ;;
        ubnt,litebeam-ac-gen2|\
+       ubnt,nanobeam-ac-gen2|\
        ubnt,powerbeam-5ac-500|\
        ubnt,powerbeam-5ac-gen2)
                label_mac=$(mtd_get_mac_binary art 0x5006)
index d390fdfbe23375da7e65ce15596f6238f05f3b87..8ec0af53d41a631e9ed6d96ab19d4c4486affdc5 100755 (executable)
@@ -76,6 +76,7 @@ tplink,wbs510-v2)
 ubnt,aircube-isp)
        ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11"
        ;;
+ubnt,nanobeam-ac-gen2|\
 ubnt,nanostation-ac)
        ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3"
        ;;
index 1e205468b7a057c45b637fcd5beda75b8605e6ac..83ffc8f8627fb999dd4375f27cbc7d6c2c191f9e 100644 (file)
@@ -33,6 +33,7 @@ case "$FIRMWARE" in
        ubnt,lap-120|\
        ubnt,litebeam-ac-gen2|\
        ubnt,nanobeam-ac|\
+       ubnt,nanobeam-ac-gen2|\
        ubnt,nanostation-ac|\
        ubnt,nanostation-ac-loco|\
        ubnt,powerbeam-5ac-500|\
index cd67ea29041df411d5be1def6e4128bf35e22eb4..6e12c34d850994e09173c2fcf3bb5bf041adefcc 100644 (file)
@@ -190,10 +190,19 @@ TARGET_DEVICES += ubnt_litebeam-ac-gen2
 define Device/ubnt_nanobeam-ac
   $(Device/ubnt-wa)
   DEVICE_MODEL := NanoBeam AC
+  DEVICE_VARIANT := Gen1
   DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
 endef
 TARGET_DEVICES += ubnt_nanobeam-ac
 
+define Device/ubnt_nanobeam-ac-gen2
+  $(Device/ubnt-wa)
+  DEVICE_MODEL := NanoBeam AC
+  DEVICE_VARIANT := Gen2
+  DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
+endef
+TARGET_DEVICES += ubnt_nanobeam-ac-gen2
+
 define Device/ubnt_nanobridge-m
   $(Device/ubnt-xm)
   SOC := ar7241