Hi!
I would like to port OpenWRT on the Ubiquiti UniFi AP Outdoor router. I know that the AP Outdoor Plus is already supported but I have no idea of the differences between the two routers.
It is my first time on porting OpenWRT on a new device so I will need some help.
First, to avoid to corrupt the flash for each attempt, I would prefer to load a ramdisk from tftp but I am not sure how to achieve that. I have read this wiki page but it is for flashing and not just for testing.
My first attempt was to flash the AP Outdoor Plus image via:
fwupdate.real -m openwrt-ar71xx-generic-ubnt-unifi-outdoor-plus-squashfs-factory.bin -d
But I have ended up with a corrupted flash and a device stuck in u-Boot.
I have managed to flash a stock Ubiquiti image BZ.ar7240.v3.7.58.6385.170508.0942.bin
using the Ubiquiti recovery procedure (tftp server via RESET press at boot).
So this time I would like to avoid the recovery process after each attempt.
I have added some bits to try to support my router by copying the changes needed by the Outdoor Plus. I have modified to flash layout to match the stock one, the leds need to be tested and I have no idea where the wifi firmware is located.
Patch
From a390cc519b37434c35fe72fd16dfb28c762257a8 Mon Sep 17 00:00:00 2001
From: Romain <romain@todo.com>
Date: Thu, 16 Dec 2021 16:27:53 +0100
Subject: [PATCH] ath79: add support for Ubiquiti UniFi AP Outdoor
---
.../dts/ar7241_ubnt_unifi-ap-outdoor.dts | 109 ++++++++++++++++++
.../generic/base-files/etc/board.d/02_network | 1 +
.../etc/hotplug.d/firmware/10-ath9k-eeprom | 3 +
target/linux/ath79/image/generic-ubnt.mk | 8 ++
4 files changed, 121 insertions(+)
create mode 100644 target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor.dts
diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor.dts
new file mode 100644
index 0000000000..b2704df505
--- /dev/null
+++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor.dts
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar7241_ubnt_unifi.dtsi"
+
+/ {
+ compatible = "ubnt,unifi-ap-outdoor", "qca,ar7241";
+ model = "Ubiquiti UniFi AP Outdoor";
+
+ aliases {
+ led-boot = &led_white;
+ led-failsafe = &led_white;
+ led-running = &led_blue;
+ led-upgrade = &led_blue;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_blue: blue {
+ label = "blue";
+ gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_white: white {
+ 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 = "kernel";
+ reg = <0x50000 0x100000>;
+ };
+
+ partition@150000 {
+ label = "rootfs";
+ reg = <0x150000 0x660000>;
+ };
+
+ partition@7B0000 {
+ label = "cfg";
+ reg = <0x7B0000 0x40000>;
+ read-only;
+ };
+
+ eeprom: partition@7F0000 {
+ label = "eeprom";
+ reg = <0x7F0000 0x10000>;
+ read-only;
+ };
+ };
+ };
+};
+
+ð0 {
+ nvmem-cells = <&macaddr_eeprom_0>;
+ nvmem-cell-names = "mac-address";
+};
+
+ð1 {
+ status = "okay";
+
+ nvmem-cells = <&macaddr_eeprom_6>;
+ nvmem-cell-names = "mac-address";
+};
+
+&wifi {
+ ubnt,hsr;
+};
+
+&eeprom {
+ compatible = "nvmem-cells";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_eeprom_0: macaddr@0 {
+ reg = <0x0 0x6>;
+ };
+
+ macaddr_eeprom_6: macaddr@6 {
+ reg = <0x6 0x6>;
+ };
+};
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 edd79b606e..14461b9f4a 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -117,6 +117,7 @@ ath79_setup_interfaces()
engenius,enstationac-v1|\
engenius,ews511ap|\
ocedo,ursus|\
+ ubnt,unifi-ap-outdoor|\
ubnt,unifi-ap-outdoor-plus)
ucidef_set_interface_lan "eth0 eth1"
;;
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 219e618cb9..4b720587a5 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
@@ -123,6 +123,9 @@ case "$FIRMWARE" in
ubnt,rocket-m)
caldata_extract "art" 0x1000 0x1000
;;
+ ubnt,unifi-ap-outdoor)
+ caldata_extract "eeprom" 0x1000 0xeb8
+ ;;
openmesh,mr600-v1|\
openmesh,mr600-v2)
caldata_extract "ART" 0x5000 0x440
diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
index 3888e1652b..a537b84fd7 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -457,6 +457,14 @@ define Device/ubnt_unifiac-pro
endef
TARGET_DEVICES += ubnt_unifiac-pro
+define Device/ubnt_unifi-ap-outdoor
+ $(Device/ubnt-bz)
+ $(Device/ubnt-unifi-jffs2)
+ DEVICE_MODEL := UniFi AP Outdoor
+ SUPPORTED_DEVICES += unifi-ap-outdoor
+endef
+TARGET_DEVICES += ubnt_unifi-ap-outdoor
+
define Device/ubnt_unifi-ap-outdoor-plus
$(Device/ubnt-bz)
$(Device/ubnt-unifi-jffs2)
--
2.17.1
I have built a new OpenWRT image but now, how could I test it?
Thank you