<div dir="ltr">This is actually broken in a few minor ways. I'll be following up with a fixed up v3 shortly.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 29, 2020 at 3:36 AM Russell Senior <<a href="mailto:russell@personaltelco.net">russell@personaltelco.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
The Ubiquiti Bullet M2HP come in two flavors, based on ar7240 and<br>
ar7241. Both are supported by ar71xx, despite the different SoCs. The<br>
ath79 target, however, currently supports only the ar7241. The ar7240<br>
version apparently has a differently wired ethernet interface and the<br>
ar7241-based image comes up on the ar7240-based versions without a<br>
working ethernet interface.<br>
<br>
This is an attempt to support both flavors of ubnt-bullet-m,<br>
separately.<br>
<br>
Changes since v1:<br>
<br>
* renamed -v0 and -v1 to -ar7240 and -ar7241, respectively, as<br>
  suggested.<br>
<br>
* abstracted ar7241_ubnt_outdoor-xm.dtsi to ar724x_ubnt_outdoor-xm.dtsi,<br>
  so that it could be shared between ar7240 and ar7241. Included the new<br>
  ar724x file in the terminal dts files rather than chain them.<br>
<br>
<br>
There is a further opportunity to share a<br>
target/linux/ath79/dts/ar724x_ubnt_xm.dtsi file, as<br>
target/linux/ath79/dts/ar7240_ubnt_xm.dtsi and<br>
target/linux/ath79/dts/ar7241_ubnt_xm.dtsi differ in one line only.<br>
<br>
Interested in feedback.<br>
<br>
Tested on the AR7240 flavor.<br>
<br>
Signed-off-by: Russell Senior <<a href="mailto:russell@personaltelco.net" target="_blank">russell@personaltelco.net</a>><br>
<br>
<br>
---<br>
 .../ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts | 21 ++++<br>
 target/linux/ath79/dts/ar7240_ubnt_xm.dtsi    | 99 +++++++++++++++++++<br>
 ...-m.dts => ar7241_ubnt_bullet-m-ar7241.dts} |  1 +<br>
 ...tdoor.dtsi => ar724x_ubnt_xm_outdoor.dtsi} |  2 -<br>
 .../generic/base-files/etc/board.d/01_leds    |  3 +-<br>
 .../generic/base-files/etc/board.d/02_network |  3 +-<br>
 .../etc/hotplug.d/firmware/10-ath9k-eeprom    |  3 +-<br>
 target/linux/ath79/image/<a href="http://generic-ubnt.mk" rel="noreferrer" target="_blank">generic-ubnt.mk</a>      | 17 +++-<br>
 8 files changed, 140 insertions(+), 9 deletions(-)<br>
 create mode 100644 target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts<br>
 create mode 100644 target/linux/ath79/dts/ar7240_ubnt_xm.dtsi<br>
 rename target/linux/ath79/dts/{ar7241_ubnt_bullet-m.dts => ar7241_ubnt_bullet-m-ar7241.dts} (88%)<br>
 rename target/linux/ath79/dts/{ar7241_ubnt_xm_outdoor.dtsi => ar724x_ubnt_xm_outdoor.dtsi} (94%)<br>
<br>
diff --git a/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts<br>
new file mode 100644<br>
index 0000000000..5fb24b36c8<br>
--- /dev/null<br>
+++ b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts<br>
@@ -0,0 +1,21 @@<br>
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT<br>
+/dts-v1/;<br>
+<br>
+#include "ar7240_ubnt_xm.dtsi"<br>
+#include "ar724x_ubnt_xm_outdoor.dtsi"<br>
+<br>
+/ {<br>
+       compatible = "ubnt,bullet-m-ar7240", "ubnt,xm", "qca,ar7240";<br>
+       model = "Ubiquiti Bullet M AR7240";<br>
+};<br>
+<br>
+&eth0 {<br>
+       fixed-link {<br>
+               speed = <100>;<br>
+               full-duplex;<br>
+       };<br>
+};<br>
+<br>
+&eth1 {<br>
+       compatible = "syscon", "simple-mfd";<br>
+};<br>
diff --git a/target/linux/ath79/dts/ar7240_ubnt_xm.dtsi b/target/linux/ath79/dts/ar7240_ubnt_xm.dtsi<br>
new file mode 100644<br>
index 0000000000..7165ce5668<br>
--- /dev/null<br>
+++ b/target/linux/ath79/dts/ar7240_ubnt_xm.dtsi<br>
@@ -0,0 +1,99 @@<br>
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT<br>
+<br>
+#include <dt-bindings/gpio/gpio.h><br>
+#include <dt-bindings/input/input.h><br>
+<br>
+#include "ar7240.dtsi"<br>
+<br>
+/ {<br>
+       compatible = "ubnt,xm", "qca,ar7240";<br>
+       model = "Ubiquiti Networks XM (rev 1.0) board";<br>
+<br>
+       keys {<br>
+               compatible = "gpio-keys";<br>
+<br>
+               reset {<br>
+                       linux,code = <KEY_RESTART>;<br>
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;<br>
+                       debounce-interval = <60>;<br>
+               };<br>
+       };<br>
+};<br>
+<br>
+&uart {<br>
+       status = "okay";<br>
+};<br>
+<br>
+&spi {<br>
+       status = "okay";<br>
+<br>
+       num-cs = <1>;<br>
+<br>
+       flash@0 {<br>
+               compatible = "jedec,spi-nor";<br>
+               reg = <0>;<br>
+               spi-max-frequency = <25000000>;<br>
+<br>
+               partitions {<br>
+                       compatible = "fixed-partitions";<br>
+                       #address-cells = <1>;<br>
+                       #size-cells = <1>;<br>
+<br>
+                       partition@0 {<br>
+                               label = "u-boot";<br>
+                               reg = <0x000000 0x040000>;<br>
+                               read-only;<br>
+                       };<br>
+<br>
+                       partition@40000 {<br>
+                               label = "u-boot-env";<br>
+                               reg = <0x040000 0x010000>;<br>
+                       };<br>
+<br>
+                       partition@50000 {<br>
+                               compatible = "denx,uimage";<br>
+                               label = "firmware";<br>
+                               reg = <0x050000 0x750000>;<br>
+                       };<br>
+<br>
+                       partition@7a0000 {<br>
+                               label = "board_config";<br>
+                               reg = <0x7a0000 0x010000>;<br>
+                               read-only;<br>
+                       };<br>
+<br>
+                       partition@7b0000 {<br>
+                               label = "cfg";<br>
+                               reg = <0x7b0000 0x040000>;<br>
+                               read-only;<br>
+                       };<br>
+<br>
+                       art: partition@7f0000 {<br>
+                               label = "art";<br>
+                               reg = <0x7f0000 0x010000>;<br>
+                               read-only;<br>
+                       };<br>
+               };<br>
+       };<br>
+};<br>
+<br>
+&pcie {<br>
+       status = "okay";<br>
+<br>
+       wifi: wifi@0,0 {<br>
+               reg = <0x0000 0 0 0 0>;<br>
+               qca,no-eeprom;<br>
+       };<br>
+};<br>
+<br>
+&eth0 {<br>
+       status = "okay";<br>
+<br>
+       mtd-mac-address = <&art 0x0>;<br>
+};<br>
+<br>
+&eth1 {<br>
+       status = "okay";<br>
+<br>
+       mtd-mac-address = <&art 0x6>;<br>
+};<br>
diff --git a/target/linux/ath79/dts/ar7241_ubnt_bullet-m.dts b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts<br>
similarity index 88%<br>
rename from target/linux/ath79/dts/ar7241_ubnt_bullet-m.dts<br>
rename to target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts<br>
index e16b5fa0be..dec97ab6d8 100644<br>
--- a/target/linux/ath79/dts/ar7241_ubnt_bullet-m.dts<br>
+++ b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts<br>
@@ -1,6 +1,7 @@<br>
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT<br>
 /dts-v1/;<br>
<br>
+#include "ar7241_ubnt_xm.dtsi"<br>
 #include "ar7241_ubnt_xm_outdoor.dtsi"<br>
<br>
 / {<br>
diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm_outdoor.dtsi<br>
similarity index 94%<br>
rename from target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi<br>
rename to target/linux/ath79/dts/ar724x_ubnt_xm_outdoor.dtsi<br>
index 75116edc51..a28f8fbcd4 100644<br>
--- a/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi<br>
+++ b/target/linux/ath79/dts/ar724x_ubnt_xm_outdoor.dtsi<br>
@@ -1,7 +1,5 @@<br>
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT<br>
<br>
-#include "ar7241_ubnt_xm.dtsi"<br>
-<br>
 / {<br>
        aliases {<br>
                led-boot = &led_link4;<br>
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<br>
index 6668e15a74..857d607668 100755<br>
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds<br>
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds<br>
@@ -242,7 +242,8 @@ tplink,tl-wr842n-v2)<br>
 trendnet,tew-823dru)<br>
        ucidef_set_led_netdev "wan" "WAN" "trendnet:green:planet" "eth0"<br>
        ;;<br>
-ubnt,bullet-m|\<br>
+ubnt,bullet-m-ar7240|\<br>
+ubnt,bullet-m-ar7241|\<br>
 ubnt,bullet-m-xw|\<br>
 ubnt,nanostation-loco-m|\<br>
 ubnt,nanostation-loco-m-xw|\<br>
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<br>
index ef58d9e124..3a1f3d733b 100755<br>
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network<br>
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network<br>
@@ -41,7 +41,8 @@ ath79_setup_interfaces()<br>
        tplink,re450-v1|\<br>
        tplink,re450-v2|\<br>
        tplink,tl-wr902ac-v1|\<br>
-       ubnt,bullet-m|\<br>
+       ubnt,bullet-m-ar7240|\<br>
+       ubnt,bullet-m-ar7241|\<br>
        ubnt,bullet-m-xw|\<br>
        ubnt,lap-120|\<br>
        ubnt,litebeam-ac-gen2|\<br>
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<br>
index 96f9d5c0d2..d90abe2981 100644<br>
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom<br>
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom<br>
@@ -89,7 +89,8 @@ case "$FIRMWARE" in<br>
        tplink,tl-wr2543-v1|\<br>
        tplink,tl-wr842n-v1|\<br>
        ubnt,airrouter|\<br>
-       ubnt,bullet-m|\<br>
+       ubnt,bullet-m-ar7240|\<br>
+       ubnt,bullet-m-ar7241|\<br>
        ubnt,nanostation-loco-m|\<br>
        ubnt,nanostation-m|\<br>
        ubnt,picostation-m|\<br>
diff --git a/target/linux/ath79/image/<a href="http://generic-ubnt.mk" rel="noreferrer" target="_blank">generic-ubnt.mk</a> b/target/linux/ath79/image/<a href="http://generic-ubnt.mk" rel="noreferrer" target="_blank">generic-ubnt.mk</a><br>
index a4aff09fec..44ce4d9b06 100644<br>
--- a/target/linux/ath79/image/<a href="http://generic-ubnt.mk" rel="noreferrer" target="_blank">generic-ubnt.mk</a><br>
+++ b/target/linux/ath79/image/<a href="http://generic-ubnt.mk" rel="noreferrer" target="_blank">generic-ubnt.mk</a><br>
@@ -113,13 +113,22 @@ define Device/ubnt_airrouter<br>
 endef<br>
 TARGET_DEVICES += ubnt_airrouter<br>
<br>
-define Device/ubnt_bullet-m<br>
+define Device/ubnt_bullet-m-ar7240<br>
   $(Device/ubnt-xm)<br>
-  DEVICE_MODEL := Bullet-M<br>
+  SOC := ar7240<br>
+  DEVICE_MODEL := Bullet-M AR7240<br>
   DEVICE_PACKAGES += rssileds<br>
-  SUPPORTED_DEVICES += bullet-m<br>
+  SUPPORTED_DEVICES += bullet-m-ar7240<br>
+endef<br>
+TARGET_DEVICES += ubnt_bullet-m-ar7240<br>
+<br>
+define Device/ubnt_bullet-m-ar7241<br>
+  $(Device/ubnt-xm)<br>
+  DEVICE_MODEL := Bullet-M AR7241<br>
+  DEVICE_PACKAGES += rssileds<br>
+  SUPPORTED_DEVICES += bullet-m-ar7241<br>
 endef<br>
-TARGET_DEVICES += ubnt_bullet-m<br>
+TARGET_DEVICES += ubnt_bullet-m-ar7241<br>
<br>
 define Device/ubnt_bullet-m-xw<br>
   $(Device/ubnt-xw)<br>
-- <br>
2.25.1<br>
<br>
<br>
-- <br>
Russell Senior, President<br>
<a href="mailto:russell@personaltelco.net" target="_blank">russell@personaltelco.net</a><br>
<br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div>