RE: [PATCH 2/2] ath79: add support for Ubiquiti UniFi AP Outdoor+

2021-01-23 Thread Adrian Schmutzler
Hi,

two comments below.

> + leds {
> + compatible = "gpio-leds";
> +
> + led_white: white {
> + label = "blue";
> + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
> + };
> +
> + blue {
> + label = "white";
> + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
> + };

Labels and nodes are swapped?

[...]

> --- 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)

I found it rather confusing to mix these two includes here. I'd personally 
prefer to just use ubnt-unifi-jffs2 here (like for the ap-pro) and add the 
other few surviving variables from ubnt-bz here directly. This is also more 
consistent with ap-pro and should thus be quicker to grasp ...

Best

Adrian

> +  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
> --
> 2.30.0
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/2] ath79: add support for Ubiquiti UniFi AP Outdoor+

2021-01-22 Thread David Bauer
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 00..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 = <5000>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   uboot: partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x4>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "firmware";
+   reg = <0x5 0xf6>;
+
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "kernel";
+   reg = <0x0 0x30>;
+   /* Can be resized w/o issues.
+* U-Boot can load kernel from the
+* entirety of the "firmware" partition 
space.
+*/
+   };
+
+   partition@30 {
+   label = "rootfs";
+   reg = <0x30 0xc6>;
+   };
+   };
+
+   partition@fb {
+   label = "cfg";
+   reg = <0xfb 0x4>;
+   read-only;
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x1>;
+   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;
-