ath79: generalize ubnt_xm dtsi for ar7240 and ar7241
authorRussell Senior <russell@personaltelco.net>
Wed, 11 Mar 2020 01:06:02 +0000 (18:06 -0700)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 18 Mar 2020 12:45:57 +0000 (13:45 +0100)
* Prepare to support the AR7240 variant of ubiquiti bullet m, by
  reorganizing the related dtsi files.

* Distribute SOC variable across ubnt-xm devices.

Signed-off-by: Russell Senior <russell@personaltelco.net>
target/linux/ath79/dts/ar7241_ubnt_airrouter.dts
target/linux/ath79/dts/ar7241_ubnt_bullet-m.dts
target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts
target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts
target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts
target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts
target/linux/ath79/dts/ar7241_ubnt_xm.dtsi [deleted file]
target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi [deleted file]
target/linux/ath79/dts/ar724x_ubnt_xm.dtsi [new file with mode: 0644]
target/linux/ath79/dts/ar724x_ubnt_xm_outdoor.dtsi [new file with mode: 0644]
target/linux/ath79/image/generic-ubnt.mk

index ad2762e20cfda46ac440fc3abb20b2497c3cfbea..dd2421da8e8424e22e69eef1da96120c98935625 100644 (file)
@@ -1,7 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include "ar7241_ubnt_xm.dtsi"
+#include "ar7241.dtsi"
+#include "ar724x_ubnt_xm.dtsi"
 
 / {
        compatible = "ubnt,airrouter", "ubnt,xm", "qca,ar7241";
index e16b5fa0bef497d543c5031a0e01ebd46f269bcf..a43ed2afdcd4462d018a37254860791ff97a6a34 100644 (file)
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include "ar7241_ubnt_xm_outdoor.dtsi"
+#include "ar7241.dtsi"
+#include "ar724x_ubnt_xm.dtsi"
+#include "ar724x_ubnt_xm_outdoor.dtsi"
 
 / {
        compatible = "ubnt,bullet-m", "ubnt,xm", "qca,ar7241";
index 386b7c7073ae70f2de659e4d9e9467efbd356a28..60d5a21a2241c913ca9cb492384954c7b0529f57 100644 (file)
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include "ar7241_ubnt_xm_outdoor.dtsi"
+#include "ar7241.dtsi"
+#include "ar724x_ubnt_xm.dtsi"
+#include "ar724x_ubnt_xm_outdoor.dtsi"
 
 / {
        compatible = "ubnt,nanostation-loco-m", "ubnt,xm", "qca,ar7241";
index eebe65e53f809967a336d447fa41062d7694f061..82344bb5ea001e56e3e6eaddde31fc01d1a4ee33 100644 (file)
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include "ar7241_ubnt_xm_outdoor.dtsi"
+#include "ar7241.dtsi"
+#include "ar724x_ubnt_xm.dtsi"
+#include "ar724x_ubnt_xm_outdoor.dtsi"
 
 / {
        compatible = "ubnt,nanostation-m", "ubnt,xm", "qca,ar7241";
index e2376a1b9251a7472118fc9eba359503ce3636ec..d05aca3e67389e1f133e11c37ccf9e40723d9297 100644 (file)
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include "ar7241_ubnt_xm_outdoor.dtsi"
+#include "ar7241.dtsi"
+#include "ar724x_ubnt_xm.dtsi"
+#include "ar724x_ubnt_xm_outdoor.dtsi"
 
 / {
        compatible = "ubnt,picostation-m", "ubnt,xm", "qca,ar7241";
index 35f5205b411ff4ed94b213763fcb2959d5ed4440..9e342177e23546a76bcb9d5d1f0ed036e20e5d1f 100644 (file)
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /dts-v1/;
 
-#include "ar7241_ubnt_xm_outdoor.dtsi"
+#include "ar7241.dtsi"
+#include "ar724x_ubnt_xm.dtsi"
+#include "ar724x_ubnt_xm_outdoor.dtsi"
 
 / {
        compatible = "ubnt,rocket-m", "ubnt,xm", "qca,ar7241";
diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
deleted file mode 100644 (file)
index e2b653b..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-
-#include "ar7241.dtsi"
-
-/ {
-       compatible = "ubnt,xm", "qca,ar7241";
-       model = "Ubiquiti Networks XM (rev 1.0) board";
-
-       keys {
-               compatible = "gpio-keys";
-
-               reset {
-                       linux,code = <KEY_RESTART>;
-                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-                       debounce-interval = <60>;
-               };
-       };
-};
-
-&uart {
-       status = "okay";
-};
-
-&spi {
-       status = "okay";
-
-       num-cs = <1>;
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <25000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x000000 0x040000>;
-                               read-only;
-                       };
-
-                       partition@40000 {
-                               label = "u-boot-env";
-                               reg = <0x040000 0x010000>;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x050000 0x750000>;
-                       };
-
-                       partition@7a0000 {
-                               label = "board_config";
-                               reg = <0x7a0000 0x010000>;
-                               read-only;
-                       };
-
-                       partition@7b0000 {
-                               label = "cfg";
-                               reg = <0x7b0000 0x040000>;
-                               read-only;
-                       };
-
-                       art: partition@7f0000 {
-                               label = "art";
-                               reg = <0x7f0000 0x010000>;
-                               read-only;
-                       };
-               };
-       };
-};
-
-&pcie {
-       status = "okay";
-
-       wifi: wifi@0,0 {
-               reg = <0x0000 0 0 0 0>;
-               qca,no-eeprom;
-       };
-};
-
-&eth0 {
-       status = "okay";
-
-       mtd-mac-address = <&art 0x0>;
-};
-
-&eth1 {
-       status = "okay";
-
-       mtd-mac-address = <&art 0x6>;
-};
diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi b/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi
deleted file mode 100644 (file)
index 75116ed..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-
-#include "ar7241_ubnt_xm.dtsi"
-
-/ {
-       aliases {
-               led-boot = &led_link4;
-               led-failsafe = &led_link4;
-               label-mac-device = &wifi;
-       };
-
-       leds {
-               compatible = "gpio-leds";
-
-               link1 {
-                       label = "ubnt:red:link1";
-                       gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
-               };
-
-               link2 {
-                       label = "ubnt:orange:link2";
-                       gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
-               };
-
-               link3 {
-                       label = "ubnt:green:link3";
-                       gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
-               };
-
-               led_link4: link4 {
-                       label = "ubnt:green:link4";
-                       gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
-               };
-       };
-};
diff --git a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi
new file mode 100644 (file)
index 0000000..b36b0d4
--- /dev/null
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <60>;
+               };
+       };
+};
+
+&uart {
+       status = "okay";
+};
+
+&spi {
+       status = "okay";
+
+       num-cs = <1>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x000000 0x040000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               label = "u-boot-env";
+                               reg = <0x040000 0x010000>;
+                       };
+
+                       partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               reg = <0x050000 0x750000>;
+                       };
+
+                       partition@7a0000 {
+                               label = "board_config";
+                               reg = <0x7a0000 0x010000>;
+                               read-only;
+                       };
+
+                       partition@7b0000 {
+                               label = "cfg";
+                               reg = <0x7b0000 0x040000>;
+                               read-only;
+                       };
+
+                       art: partition@7f0000 {
+                               label = "art";
+                               reg = <0x7f0000 0x010000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&pcie {
+       status = "okay";
+
+       wifi: wifi@0,0 {
+               reg = <0x0000 0 0 0 0>;
+               qca,no-eeprom;
+       };
+};
+
+&eth0 {
+       status = "okay";
+
+       mtd-mac-address = <&art 0x0>;
+};
+
+&eth1 {
+       status = "okay";
+
+       mtd-mac-address = <&art 0x6>;
+};
diff --git a/target/linux/ath79/dts/ar724x_ubnt_xm_outdoor.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm_outdoor.dtsi
new file mode 100644 (file)
index 0000000..a28f8fb
--- /dev/null
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/ {
+       aliases {
+               led-boot = &led_link4;
+               led-failsafe = &led_link4;
+               label-mac-device = &wifi;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               link1 {
+                       label = "ubnt:red:link1";
+                       gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+               };
+
+               link2 {
+                       label = "ubnt:orange:link2";
+                       gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+               };
+
+               link3 {
+                       label = "ubnt:green:link3";
+                       gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_link4: link4 {
+                       label = "ubnt:green:link4";
+                       gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
index a4aff09feca528a7721af35500905452000097f5..aad177bf4a6138db443bd4eee6023a43468c8dbd 100644 (file)
@@ -71,7 +71,6 @@ endef
 
 define Device/ubnt-xm
   $(Device/ubnt)
-  SOC := ar7241
   DEVICE_VARIANT := XM
   DEVICE_PACKAGES += kmod-usb-ohci
   IMAGE_SIZE := 7448k
@@ -108,6 +107,7 @@ TARGET_DEVICES += ubnt_acb-isp
 
 define Device/ubnt_airrouter
   $(Device/ubnt-xm)
+  SOC := ar7241
   DEVICE_MODEL := AirRouter
   SUPPORTED_DEVICES += airrouter
 endef
@@ -115,6 +115,7 @@ TARGET_DEVICES += ubnt_airrouter
 
 define Device/ubnt_bullet-m
   $(Device/ubnt-xm)
+  SOC := ar7241
   DEVICE_MODEL := Bullet-M
   DEVICE_PACKAGES += rssileds
   SUPPORTED_DEVICES += bullet-m
@@ -181,6 +182,7 @@ TARGET_DEVICES += ubnt_nanostation-ac-loco
 
 define Device/ubnt_nanostation-loco-m
   $(Device/ubnt-xm)
+  SOC := ar7241
   DEVICE_MODEL := Nanostation Loco M
   DEVICE_PACKAGES += rssileds
   SUPPORTED_DEVICES += bullet-m
@@ -197,6 +199,7 @@ TARGET_DEVICES += ubnt_nanostation-loco-m-xw
 
 define Device/ubnt_nanostation-m
   $(Device/ubnt-xm)
+  SOC := ar7241
   DEVICE_MODEL := Nanostation M
   DEVICE_PACKAGES += rssileds
   SUPPORTED_DEVICES += nanostation-m
@@ -213,6 +216,7 @@ TARGET_DEVICES += ubnt_nanostation-m-xw
 
 define Device/ubnt_picostation-m
   $(Device/ubnt-xm)
+  SOC := ar7241
   DEVICE_MODEL := Picostation M
   DEVICE_PACKAGES += rssileds
   SUPPORTED_DEVICES += bullet-m
@@ -221,6 +225,7 @@ TARGET_DEVICES += ubnt_picostation-m
 
 define Device/ubnt_rocket-m
   $(Device/ubnt-xm)
+  SOC := ar7241
   DEVICE_MODEL := Rocket-M
   DEVICE_PACKAGES += rssileds
   SUPPORTED_DEVICES += rocket-m