[PATCHv2] ath79: Add support for Ubiquiti Bullet AC

Adrian Schmutzler mail at adrianschmutzler.de
Wed Dec 16 11:20:24 EST 2020


Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Russell Senior
> Sent: Mittwoch, 16. Dezember 2020 12:01
> To: openwrt-devel at lists.openwrt.org
> Subject: [PATCHv2] ath79: Add support for Ubiquiti Bullet AC
> 
> 
> 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:       1x 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)
> 
> Flashing from serial console
> 1. Connect serial console (115200 baud)
> 2. Connect ethernet to a network with a TFTP server, through a
>    passive PoE injector.
> 3. Press a key to obtain a u-boot prompt 4. Set your TFTP server's ip address,
> with:
>    setenv serverip <tftp-server-address> 5. Set the Bullet AC's ip address,
> with:
>    setenv ipaddr <bullet-ac-address>
> 6. Set the boot file, with:
>    setenv bootfile <name-of-initramfs-binary-on-tftp-server>
> 7. Fetch the binary with tftp:
>    tftpboot
> 8. Boot the initramfs binary:
>    bootm
> 9. From the initramfs, fetch the sysupgrade binary, and flash it with
>    sysupgrade.
> 
> Phy0 is QCA988X which can tune either band (2.4 or 5GHz). Phy1 is AR9342,
> on which 5GHz is disabled.  It isn't currently known whether phy1 is routed to
> the N connector at all.
> 
> Signed-off-by: Russell Senior <russell at personaltelco.net>
> ---
> v2:
> - Make "Flashing through factory firmware" instructions actually work by
> changing UBNT_TYPE to 2WA
> ---
>  .../linux/ath79/dts/ar9342_ubnt_bullet-ac.dts | 38 +++++++++++++++++++
>  .../generic/base-files/etc/board.d/01_leds    |  1 +
>  .../generic/base-files/etc/board.d/02_network |  1 +
> .../etc/hotplug.d/firmware/11-ath10k-caldata  |  1 +
>  target/linux/ath79/image/generic-ubnt.mk      | 17 +++++++++
>  5 files changed, 58 insertions(+)
>  create mode 100644 target/linux/ath79/dts/ar9342_ubnt_bullet-ac.dts
> 
> diff --git a/target/linux/ath79/dts/ar9342_ubnt_bullet-ac.dts
> b/target/linux/ath79/dts/ar9342_ubnt_bullet-ac.dts
> new file mode 100644
> index 0000000000..be0b0792bb
> --- /dev/null
> +++ b/target/linux/ath79/dts/ar9342_ubnt_bullet-ac.dts
> @@ -0,0 +1,38 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +#include "ar9342_ubnt_wa_1port.dtsi"
> +
> +/ {
> +	compatible = "ubnt,bullet-ac", "ubnt,wa", "qca,ar9342";
> +	model = "Ubiquiti Bullet AC (2WA)";

would you provide some details about that odd "2WA"?

> +
> +	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>;
> +		};
> +	};
> +};
> diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
> b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
> index a0ed21e318..46d4650eac 100755
> --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
> +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
> @@ -366,6 +366,7 @@ ubnt,rocket-m)
>  	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH"
> "green:link3" "wlan0" "51" "100"
>  	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:link4" "wlan0" "76"
> "100"
>  	;;
> +ubnt,bullet-ac|\

This requires to move the block to keep sorting.

>  ubnt,nanobeam-ac|\
>  ubnt,nanobeam-ac-gen2|\
>  ubnt,nanostation-ac|\
> 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 905848a2ba..9293e5522b 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
> @@ -58,6 +58,7 @@ ath79_setup_interfaces()
>  	tplink,re450-v2|\
>  	tplink,re450-v3|\
>  	tplink,tl-wr902ac-v1|\
> +	ubnt,bullet-ac|\
>  	ubnt,bullet-m-ar7240|\
>  	ubnt,bullet-m-ar7241|\
>  	ubnt,bullet-m-xw|\
> diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-
> ath10k-caldata b/target/linux/ath79/generic/base-
> files/etc/hotplug.d/firmware/11-ath10k-caldata
> index 0d09cd3140..be62e52480 100644
> --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-
> ath10k-caldata
> +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-at
> +++ h10k-caldata
> @@ -26,6 +26,7 @@ case "$FIRMWARE" in
>  	qxwlan,e1700ac-v2-16m|\
>  	qxwlan,e600gac-v2-8m|\
>  	qxwlan,e600gac-v2-16m|\
> +	ubnt,bullet-ac|\
>  	ubnt,unifiac-lite|\
>  	ubnt,unifiac-lr|\
>  	ubnt,unifiac-mesh|\
> diff --git a/target/linux/ath79/image/generic-ubnt.mk
> b/target/linux/ath79/image/generic-ubnt.mk
> index c347bd1cf1..4c34aa5dfa 100644
> --- a/target/linux/ath79/image/generic-ubnt.mk
> +++ b/target/linux/ath79/image/generic-ubnt.mk
> @@ -67,6 +67,16 @@ define Device/ubnt-sw
>    KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
> endef
> 
> +define Device/ubnt-2wa

Strictly, the would need to be moved as well. But I'm not sure whether I insist here.

Best

Adrian

> +  $(Device/ubnt)
> +  SOC := ar9342
> +  IMAGE_SIZE := 15744k
> +  UBNT_BOARD := WA
> +  UBNT_CHIP := ar934x
> +  UBNT_TYPE := 2WA
> +  UBNT_VERSION := 8.5.3
> +endef
> +
>  define Device/ubnt-wa
>    $(Device/ubnt)
>    SOC := ar9342
> @@ -131,6 +141,13 @@ define Device/ubnt_airrouter  endef
> TARGET_DEVICES += ubnt_airrouter
> 
> +define Device/ubnt_bullet-ac
> +  $(Device/ubnt-2wa)
> +  DEVICE_MODEL := Bullet AC
> +  DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers
> +ath10k-firmware-qca988x-ct rssileds endef TARGET_DEVICES +=
> +ubnt_bullet-ac
> +
>  define Device/ubnt_bullet-m-ar7240
>    $(Device/ubnt-xm)
>    SOC := ar7240
> --
> 2.29.2
> 
> 
> 
> --
> Russell Senior, President
> russell at personaltelco.net
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20201216/79cb551d/attachment.sig>


More information about the openwrt-devel mailing list