Re: [OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240 version of the ubiquiti bullet

2020-02-27 Thread Russell Senior
Sorry for the accidental sidetrack to private mail. Returning the thread to
the mailing list.

On Thu, Feb 27, 2020 at 5:16 AM Adrian Schmutzler 
wrote:

> Hi,
> > What happens if you flash the "wrong" image? Do you see any chance to
> have one of the images as "default" without suffix or would this make
> things worse?
> >
> > Currently only the ar7241 is supported in ath79. If you flash an ar7241
> image on an ar7240 device, the wireless works but the ethernet does not. I
> have not tried the other way around, but I'd expect the same thing. I >
> don't actually have ready access to an ar7241-based ubnt-bullet-m to try an
> ar7240 image on to confirm that expectation.
>
> I have a Picostation M2HP (XM) where I could technically try an ar7240
> bullet-m image. However, I do not think we will learn much from that, as
> essentially the difference between ar7240.dtsi and ar7241.dtsi are a few
> compatibles and that mdio1 is used instead of mdio0, so I'd expect similar
> results to what you described for the opposite case.
> My main reason for the question was damage assessment, but with Wifi
> disabled by default and Ethernet broken one would still need TFTP for
> recovery as this sounds to me.
>
> I also briefly considered providing a mixed ar7240/ar7241 support as for
> ar71xx, but I quickly quit on that as it's hard to achieve and terribly
> ugly.
>
> So, I still do not have a better idea than the different names/variants at
> the moment.
>

Yeah. I am not seeing a particularly better path either, although I dislike
the duplication of the dtsi's.


>
> Best
>
> Adrian
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240 version of the ubiquiti bullet

2020-02-27 Thread Adrian Schmutzler
> > What's the base for the v0/v1 distinction? Is that visible to the user 
> > somehow?
> > I fear that meaningful naming will be the biggest problem here...
> 
> v0 and v1 mostly come from the need to distinguish between them. You could 
> think of the digit as the least significant digit of the SoC. We could make 
> them -7240 and -7241 instead of -v0 and -v1 to be slightly clearer what the 
> names mean, but that seemed ugly. And, no, as far as I know, the SoC is not 
> indicated on the exterior of the device at all. The user will have to figure 
> out the right version to use somehow.

That's what I feared. I do not like the -v0/-v1 very much because this is 
somewhat "reserved" by hardware revisions as TP-Link uses them, and will have 
everyone looking for a printed version on the device. So, I'd actually prefer 
-ar7240/-ar7241 suffixes (which will also clearly state what's the difference) 
unless we can find some identifier from Ubiquiti.

What happens if you flash the "wrong" image? Do you see any chance to have one 
of the images as "default" without suffix or would this make things worse? 

Best

Adrian 


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240 version of the ubiquiti bullet

2020-02-27 Thread Russell Senior
On Wed, Feb 26, 2020 at 5:19 AM Adrian Schmutzler 
wrote:

> Hi,
>
> > -Original Message-
> > From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
> > Behalf Of Russell Senior
> > Sent: Mittwoch, 26. Februar 2020 11:20
> > To: openwrt-devel@lists.openwrt.org
> > Subject: [OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240
> version
> > of the ubiquiti bullet
> >
> >
> > The Ubiquiti Bullet M2HP come in two flavors, based on ar7240 and
> > ar7241. Both are supported by ar71xx, despite the different SoCs. The
> > ath79 target, however, currently supports only the ar7241. The ar7240
> > version apparently has a differently wired ethernet interface and the
> > ar7241-based image comes up on the ar7240-based versions without a
> > working ethernet interface.
> >
> > This is an attempt to support both flavors of ubnt-bullet-m,
> > separately. Some of the choices I made may be considered dubious and/or
> > harmful.
>
> Interesting. Do you have any indications whether this will also affect the
> Loco
> M and Picostation XM devices?
>

I have some Loco's deployed (all of them are AR7241) but no picostations,
so I don't know about the latter.


>
> What's the base for the v0/v1 distinction? Is that visible to the user
> somehow?
> I fear that meaningful naming will be the biggest problem here...
>

v0 and v1 mostly come from the need to distinguish between them. You could
think of the digit as the least significant digit of the SoC. We could make
them -7240 and -7241 instead of -v0 and -v1 to be slightly clearer what the
names mean, but that seemed ugly. And, no, as far as I know, the SoC is not
indicated on the exterior of the device at all. The user will have to
figure out the right version to use somehow.


>
> Best
>
> Adrian
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240 version of the ubiquiti bullet

2020-02-26 Thread Adrian Schmutzler
Hi,

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
> Behalf Of Russell Senior
> Sent: Mittwoch, 26. Februar 2020 11:20
> To: openwrt-devel@lists.openwrt.org
> Subject: [OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240 version
> of the ubiquiti bullet
> 
> 
> The Ubiquiti Bullet M2HP come in two flavors, based on ar7240 and
> ar7241. Both are supported by ar71xx, despite the different SoCs. The
> ath79 target, however, currently supports only the ar7241. The ar7240
> version apparently has a differently wired ethernet interface and the
> ar7241-based image comes up on the ar7240-based versions without a
> working ethernet interface.
> 
> This is an attempt to support both flavors of ubnt-bullet-m,
> separately. Some of the choices I made may be considered dubious and/or
> harmful.

Interesting. Do you have any indications whether this will also affect the Loco
M and Picostation XM devices?

What's the base for the v0/v1 distinction? Is that visible to the user somehow?
I fear that meaningful naming will be the biggest problem here...

Best

Adrian 


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH RFC] ath79: add support for the ar7240 version of the ubiquiti bullet

2020-02-26 Thread Russell Senior


The Ubiquiti Bullet M2HP come in two flavors, based on ar7240 and
ar7241. Both are supported by ar71xx, despite the different SoCs. The
ath79 target, however, currently supports only the ar7241. The ar7240
version apparently has a differently wired ethernet interface and the
ar7241-based image comes up on the ar7240-based versions without a
working ethernet interface.

This is an attempt to support both flavors of ubnt-bullet-m,
separately. Some of the choices I made may be considered dubious and/or
harmful.

Interested in feedback.

Tested on the AR7240 flavor.

Signed-off-by: Russell Senior 
---
 target/linux/ath79/dts/ar7240_ubnt_xm.dtsi| 99 +++
 .../ath79/dts/ar7240_ubnt_xm_outdoor.dtsi | 35 +++
 .../ath79/dts/ar7241_ubnt_bullet-m-v0.dts | 13 +++
 ...llet-m.dts => ar7241_ubnt_bullet-m-v1.dts} |  4 +-
 .../generic/base-files/etc/board.d/01_leds|  3 +-
 .../generic/base-files/etc/board.d/02_network |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom|  3 +-
 target/linux/ath79/image/generic-ubnt.mk  | 16 ++-
 8 files changed, 167 insertions(+), 9 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7240_ubnt_xm.dtsi
 create mode 100644 target/linux/ath79/dts/ar7240_ubnt_xm_outdoor.dtsi
 create mode 100644 target/linux/ath79/dts/ar7241_ubnt_bullet-m-v0.dts
 rename target/linux/ath79/dts/{ar7241_ubnt_bullet-m.dts => 
ar7241_ubnt_bullet-m-v1.dts} (63%)

diff --git a/target/linux/ath79/dts/ar7240_ubnt_xm.dtsi 
b/target/linux/ath79/dts/ar7240_ubnt_xm.dtsi
new file mode 100644
index 00..7165ce5668
--- /dev/null
+++ b/target/linux/ath79/dts/ar7240_ubnt_xm.dtsi
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include 
+#include 
+
+#include "ar7240.dtsi"
+
+/ {
+   compatible = "ubnt,xm", "qca,ar7240";
+   model = "Ubiquiti Networks XM (rev 1.0) board";
+
+   keys {
+   compatible = "gpio-keys";
+
+   reset {
+   linux,code = ;
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   debounce-interval = <60>;
+   };
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+
+   num-cs = <1>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+   partition@5 {
+   compatible = "denx,uimage";
+   label = "firmware";
+   reg = <0x05 0x75>;
+   };
+
+   partition@7a {
+   label = "board_config";
+   reg = <0x7a 0x01>;
+   read-only;
+   };
+
+   partition@7b {
+   label = "cfg";
+   reg = <0x7b 0x04>;
+   read-only;
+   };
+
+   art: partition@7f {
+   label = "art";
+   reg = <0x7f 0x01>;
+   read-only;
+   };
+   };
+   };
+};
+
+ {
+   status = "okay";
+
+   wifi: wifi@0,0 {
+   reg = <0x 0 0 0 0>;
+   qca,no-eeprom;
+   };
+};
+
+ {
+   status = "okay";
+
+   mtd-mac-address = < 0x0>;
+};
+
+ {
+   status = "okay";
+
+   mtd-mac-address = < 0x6>;
+};
diff --git a/target/linux/ath79/dts/ar7240_ubnt_xm_outdoor.dtsi 
b/target/linux/ath79/dts/ar7240_ubnt_xm_outdoor.dtsi
new file mode 100644
index 00..c9178d8762
--- /dev/null
+++ b/target/linux/ath79/dts/ar7240_ubnt_xm_outdoor.dtsi
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar7240_ubnt_xm.dtsi"
+
+/ {
+   aliases {
+   led-boot = _link4;
+   led-failsafe = _link4;
+   label-mac-device = 
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   link1 {
+   label = "ubnt:red:link1";
+   gpios = < 0 GPIO_ACTIVE_HIGH>;
+   };
+
+   link2 {
+   label = "ubnt:orange:link2";
+   gpios = < 1