[OpenWrt-Devel] [PATCHv2] ath79: add support for Ubiquiti AirRouter

Russell Senior russell at personaltelco.net
Mon Nov 26 16:19:24 EST 2018


On Mon, Nov 26, 2018 at 5:16 AM Mathias Kresin <dev at kresin.me> wrote:
>
> Hey Russell,
>
> thanks for your patch. Find my remarks inline.
>
> Mathias
>
> 26/11/2018 13:54, Russell Senior:
> >
> > Indoor low-power router with 2.4 GHz radio
> >
> > CPU:    Atheros AR7241 rev 1
> > RAM:    32 MB
> > Flash:  8 MB NOR SPI
> > Switch: Atheros AR7240
> > Ports:  1x WAN, 4x LAN 10/100 Ethernet
> > WLAN:   Atheros AR9285 (2.4 GHz)
> > USB:  1x USB2 host port
> >
> > Note: Ethernet WAN/LAN port naming is reversed from ar71xx.
> > WAN is eth0; LAN is eth1.1.
> >
> > UART settings: 115200, 8N1
> >
> >                  LEDs
> >       +--------------------------
> >       |
> >       |
> >       |
> >       |
> >       |
> >       |
> >       |
> >       |
> >      VCC      | x x
> >       RX      | * x
> >       | x x
> >       | x x
> >       TX      | * x
> >      GND      | * x
> >       |
> >       |
> >       |
> >       |
> >       +--------------------------
> >               ETHERNET PORTS
> >
> > Installation from Ubiquiti firmware, is as for other ubnt-xm AirOs devices.
> >
> > Signed-off-by: Russell Senior <russell at personaltelco.net>
> > ---
> >   .../ath79/base-files/etc/board.d/02_network   |  3 +-
> >   .../etc/hotplug.d/firmware/10-ath9k-eeprom    |  1 +
> >   .../linux/ath79/dts/ar7241_ubnt_airrouter.dts | 42 +++++++++++++++++++
> >   target/linux/ath79/image/generic-ubnt.mk      |  7 ++++
> >   4 files changed, 52 insertions(+), 1 deletion(-)
> >   create mode 100644 target/linux/ath79/dts/ar7241_ubnt_airrouter.dts
> >
> > diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
> > index 5f02c5769a..5fb0546d18 100755
> > --- a/target/linux/ath79/base-files/etc/board.d/02_network
> > +++ b/target/linux/ath79/base-files/etc/board.d/02_network
> > @@ -116,7 +116,8 @@ ath79_setup_interfaces()
> >       buffalo,whr-g301n|\
> >       tplink,tl-mr3220-v1|\
> >       tplink,tl-mr3420-v1|\
> > -     tplink,tl-wr841-v7)
> > +     tplink,tl-wr841-v7|\
> > +     ubnt,airrouter)
> >               ucidef_set_interface_wan "eth0"
> >               ucidef_add_switch "switch0" \
> >                       "0 at eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
> > diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
> > index 020abe2913..68f70174bb 100644
> > --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
> > +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
> > @@ -141,6 +141,7 @@ case "$FIRMWARE" in
> >       tplink,tl-wr741-v1|\
> >       tplink,tl-wr743nd-v1|\
> >       tplink,tl-wr841-v7|\
> > +     ubnt,airrouter|\
> >       ubnt,bullet-m|\
> >       ubnt,nano-m|\
> >       ubnt,rocket-m)
> > diff --git a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts
> > new file mode 100644
> > index 0000000000..eecdf28108
> > --- /dev/null
> > +++ b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts
> > @@ -0,0 +1,42 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
> > +/dts-v1/;
> > +
> > +#include "ar7241_ubnt_xm.dtsi"
> > +
> > +/ {
> > +     compatible = "ubnt,airrouter", "qca,ar7241";
> > +     model = "Ubiquiti AirRouter";
> > +
> > +     aliases {
> > +             led-boot = &globe;
> > +             led-failsafe = &globe;
> > +             led-running = &globe;
> > +             led-upgrade = &globe;
>
> Wouldn't be the power led the more appropriate led for boot status
> indication? I would expect the globe led to be some kind of wan
> connectivity indication.

There is a seperate LED that is associated with the WAN interface.

>
> > +     };
> > +
> > +     leds {
> > +             status = "disabled";
> > +     };
> > +
> > +     airrouter-leds {
> > +             compatible = "gpio-leds";
> > +
> > +             globe: globe {
> > +                     label = "ubnt:green:globe";
> > +                     gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
> > +             };
> > +
> > +             power {
> > +                     label = "ubnt:green:power";
> > +                     gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
> > +             };
> > +     };
> > +};
>
> Disabling the inherit led node and adding a new one makes it really hard
> to read and therefore to understand.
>
> Please do not include the ar7241_ubnt_xm.dtsi if it doesn't match. Maybe
> the ar7241_ubnt_xm.dtsi need to be split into multiple dtsi.

I think all of the outdoor ubnt-xm devices have LEDs intended to
reflect signal strength.  Would it make sense to create a dtsi for
ubnt_xm_outdoor, and include that appropriately?

>
> > +
> > +&usb_phy {
> > +        status = "okay";
> > +};
> > +
> > +&usb {
> > +        status = "okay";
> > +};
> > diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
> > index bb86c8b288..a6d9b06332 100644
> > --- a/target/linux/ath79/image/generic-ubnt.mk
> > +++ b/target/linux/ath79/image/generic-ubnt.mk
> > @@ -63,6 +63,13 @@ define Device/ubnt-wa
> >     ATH_SOC := ar9342
> >   endef
> >
> > +define Device/ubnt_airrouter
> > +  $(Device/ubnt-xm)
> > +  DEVICE_TITLE := Ubiquiti AirRouter
> > +  SUPPORTED_DEVICES += airrouter
> > +endef
> > +TARGET_DEVICES += ubnt_airrouter
> > +
> >   define Device/ubnt_bullet-m
> >     $(Device/ubnt-xm)
> >     DEVICE_TITLE := Ubiquiti Bullet-M
> >
>

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list