ath79: add support for Ubiquiti PowerBeam M2 (XW)
authorRussell Senior <russell@personaltelco.net>
Fri, 13 Aug 2021 05:57:41 +0000 (22:57 -0700)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 22 Aug 2021 20:41:52 +0000 (22:41 +0200)
This patch adds support for the Ubiquiti PowerBeam M2 (XW), e.g. PBE-M2-400,
a 802.11n wireless with a feed+dish form factor. This device was previously
supported by the ar71xx loco-m-xw firmware.

Specifications:
 - Atheros AR9342 SoC
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet port, 24 Vdc PoE-in
 - Power and LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1)

Flashing via stock GUI:
 - Downgrade to AirOS v5.5.x (latest available is 5.5.10-u2) first (see
   https://openwrt.org/toh/ubiquiti/powerbeam installation instructions)
 - Upload the factory image via AirOS web GUI.

Flashing via TFTP:
 - Use a pointy tool (e.g., unbent paperclip) to keep the
   reset button pressed.
 - Power on the device (keep reset button pressed).
 - Keep pressing until LEDs flash alternatively LED1+LED3 =>
   LED2+LED4 => LED1+LED3, etc.
 - Release reset button.
 - The device starts a TFTP server at 192.168.1.20.
 - Set a static IP on the computer (e.g., 192.168.1.21/24).
 - Upload via tftp the factory image:
    $ tftp 192.168.1.20
    tftp> bin
    tftp> trace
    tftp> put openwrt-ath79-generic-ubnt_powerbeam-m2-xw-squashfs-factory.bin

WARNING: so far, no non-destructive method has been discovered for
opening the enclosure to reach the serial console. Internal photos
are available here: https://fcc.io/SWX-NBM2HP

Signed-off-by: Russell Senior <russell@personaltelco.net>
target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts [new file with mode: 0644]
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/image/generic-ubnt.mk

diff --git a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts
new file mode 100644 (file)
index 0000000..046715b
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9342_ubnt_xw.dtsi"
+
+/ {
+       compatible = "ubnt,powerbeam-m2-xw", "ubnt,xw", "qca,ar9342";
+       model = "Ubiquiti PowerBeam M2 (XW)";
+};
+
+&mdio0 {
+       status = "okay";
+
+       phy-mask = <4>;
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+
+       /* default for ar934x, except for 1000M and 10M */
+       pll-data = <0x02000000 0x00000101 0x00001313>;
+
+       phy-mode = "rgmii-id";
+       phy-handle = <&phy1>;
+
+       gmac-config {
+               device = <&gmac>;
+               rxd-delay = <3>;
+               rxdv-delay = <3>;
+       };
+};
index 5707bbac4ee3b5194b79399e9d9470544733eb0f..8715a57213c5bc44f3085506b985cfd6c8ca4bbe 100644 (file)
@@ -406,6 +406,7 @@ ubnt,nanostation-loco-m-xw|\
 ubnt,nanostation-m|\
 ubnt,nanostation-m-xw|\
 ubnt,picostation-m|\
+ubnt,powerbeam-m2-xw|\
 ubnt,powerbeam-m5-xw|\
 ubnt,powerbridge-m|\
 ubnt,rocket-m)
index 780068790c3d3c4d147f8e440278bfab7565a1fb..fba6d5667487a9ae1e253dea92a9bd63f7347805 100644 (file)
@@ -86,6 +86,7 @@ ath79_setup_interfaces()
        ubnt,picostation-m|\
        ubnt,powerbeam-5ac-500|\
        ubnt,powerbeam-5ac-gen2|\
+       ubnt,powerbeam-m2-xw|\
        ubnt,powerbeam-m5-xw|\
        ubnt,powerbridge-m|\
        ubnt,rocket-5ac-lite|\
index 547af632f62bc0a071aa2fad67c6a063e26eddac..3888e1652b9e6f9ec1c1e0cb4f332757f439cdd7 100644 (file)
@@ -328,6 +328,14 @@ define Device/ubnt_powerbeam-5ac-gen2
 endef
 TARGET_DEVICES += ubnt_powerbeam-5ac-gen2
 
+define Device/ubnt_powerbeam-m2-xw
+  $(Device/ubnt-xw)
+  DEVICE_MODEL := PowerBeam M2
+  DEVICE_PACKAGES += rssileds
+  SUPPORTED_DEVICES += loco-m-xw
+endef
+TARGET_DEVICES += ubnt_powerbeam-m2-xw
+
 define Device/ubnt_powerbeam-m5-xw
   $(Device/ubnt-xw)
   DEVICE_MODEL := PowerBeam M5