[openwrt/openwrt] ath79: create DTSI files for ubnt WA 1-/2-port devices

LEDE Commits lede-commits at lists.infradead.org
Tue Nov 3 12:34:24 EST 2020


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/28a211808aeb15e8ef8d92f4a71762640b181031

commit 28a211808aeb15e8ef8d92f4a71762640b181031
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Oct 25 12:58:30 2020 +0100

    ath79: create DTSI files for ubnt WA 1-/2-port devices
    
    The ar9342 Ubiquiti WA devices appear to only have two different
    network setups, based on the number of ethernet ports.
    Create DTSI files for them to consolidate duplicate definitions.
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
    [rephrase commit message/title]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ath79/dts/ar9342_ubnt_lap-120.dts     | 29 +--------------
 .../ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts     | 29 +--------------
 target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts | 29 +--------------
 .../ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts  | 29 +--------------
 .../linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts | 37 +------------------
 .../ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts   | 29 +--------------
 ..._ubnt_lap-120.dts => ar9342_ubnt_wa_1port.dtsi} | 10 +-----
 ...anostation-ac.dts => ar9342_ubnt_wa_2port.dtsi} | 42 +---------------------
 8 files changed, 8 insertions(+), 226 deletions(-)

diff --git a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts
index 4055bbd523..db639fcd7c 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts
@@ -1,39 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include "ar9342_ubnt_wa.dtsi"
+#include "ar9342_ubnt_wa_1port.dtsi"
 
 / {
 	compatible = "ubnt,lap-120", "ubnt,wa", "qca,ar9342";
 	model = "Ubiquiti LiteAP ac (LAP-120)";
 };
 
-&mdio0 {
-	status = "okay";
-
-	phy-mask = <4>;
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	/* default for ar934x, except for 1000M and 10M */
-	pll-data = <0x02000000 0x00000101 0x00001313>;
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-mode = "rgmii-id";
-	phy-handle = <&phy4>;
-
-	gmac-config {
-		device = <&gmac>;
-		rxd-delay = <3>;
-		rxdv-delay = <3>;
-	};
-};
-
 &wmac {
 	status = "disabled";
 };
diff --git a/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts b/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts
index 1affbb2994..d031aa8786 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts
@@ -1,39 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include "ar9342_ubnt_wa.dtsi"
+#include "ar9342_ubnt_wa_1port.dtsi"
 
 / {
 	compatible = "ubnt,litebeam-ac-gen2", "ubnt,wa", "qca,ar9342";
 	model = "Ubiquiti LiteBeam AC Gen2";
 };
 
-&mdio0 {
-	status = "okay";
-
-	phy-mask = <4>;
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	/* default for ar934x, except for 1000M and 10M */
-	pll-data = <0x02000000 0x00000101 0x00001313>;
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-mode = "rgmii-id";
-	phy-handle = <&phy4>;
-
-	gmac-config {
-		device = <&gmac>;
-		rxd-delay = <3>;
-		rxdv-delay = <3>;
-	};
-};
-
 &wmac {
 	status = "okay";
 
diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts
index 3dd1ba4532..dc2537a77e 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include "ar9342_ubnt_wa.dtsi"
+#include "ar9342_ubnt_wa_1port.dtsi"
 
 / {
 	compatible = "ubnt,nanobeam-ac", "ubnt,wa", "qca,ar9342";
@@ -36,30 +36,3 @@
 		};
 	};
 };
-
-&mdio0 {
-	status = "okay";
-
-	phy-mask = <4>;
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	/* default for ar934x, except for 1000M and 10M */
-	pll-data = <0x02000000 0x00000101 0x00001313>;
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-mode = "rgmii-id";
-	phy-handle = <&phy4>;
-
-	gmac-config {
-		device = <&gmac>;
-		rxd-delay = <3>;
-		rxdv-delay = <3>;
-	};
-};
diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts
index 7f689e0fe3..96d3775233 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts
@@ -1,39 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include "ar9342_ubnt_wa.dtsi"
+#include "ar9342_ubnt_wa_1port.dtsi"
 
 / {
 	compatible = "ubnt,nanostation-ac-loco", "ubnt,wa", "qca,ar9342";
 	model = "Ubiquiti Nanostation AC loco (WA)";
 };
 
-&mdio0 {
-	status = "okay";
-
-	phy-mask = <4>;
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	/* default for ar934x, except for 1000M and 10M */
-	pll-data = <0x02000000 0x00000101 0x00001313>;
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-mode = "rgmii-id";
-	phy-handle = <&phy4>;
-
-	gmac-config {
-		device = <&gmac>;
-		rxd-delay = <3>;
-		rxdv-delay = <3>;
-	};
-};
-
 &wmac {
 	status = "okay";
 
diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts
index 6114650ac5..2d90351331 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include "ar9342_ubnt_wa.dtsi"
+#include "ar9342_ubnt_wa_2port.dtsi"
 
 / {
 	compatible = "ubnt,nanostation-ac","ubnt,wa", "qca,ar9342";
@@ -37,41 +37,6 @@
 	};
 };
 
-&mdio0 {
-	status = "okay";
-
-	phy-mask = <4>;
-	phy0: ethernet-phy at 0 {
-		phy-mode = "rgmii";
-		reg = <0>;
-
-		qca,ar8327-initvals = <
-			0x04 0x07600000 /* PORT0 PAD MODE CTRL */
-			0x58 0xffb7ffb7 /* LED_CTRL2 */
-			0x5c 0x03ffff00 /* LED_CTRL3 */
-			0x7c 0x0000007e /* PORT0_STATUS */
-		>;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	/* default for ar934x, except for 1000M and 10M */
-	pll-data = <0x06000000 0x00000101 0x00001313>;
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-mode = "rgmii";
-	phy-handle = <&phy0>;
-
-	gmac-config {
-		device = <&gmac>;
-		rxd-delay = <2>;
-		rxdv-delay = <2>;
-	};
-};
-
 &wmac {
 	status = "okay";
 
diff --git a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts
index 7e4b9cd415..446c990846 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include "ar9342_ubnt_wa.dtsi"
+#include "ar9342_ubnt_wa_1port.dtsi"
 
 / {
 	compatible = "ubnt,powerbeam-5ac-gen2", "ubnt,wa", "qca,ar9342";
@@ -36,30 +36,3 @@
 		};
 	};
 };
-
-&mdio0 {
-	status = "okay";
-
-	phy-mask = <4>;
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	/* default for ar934x, except for 1000M and 10M */
-	pll-data = <0x02000000 0x00000101 0x00001313>;
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-mode = "rgmii-id";
-	phy-handle = <&phy4>;
-
-	gmac-config {
-		device = <&gmac>;
-		rxd-delay = <3>;
-		rxdv-delay = <3>;
-	};
-};
diff --git a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts b/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi
similarity index 76%
copy from target/linux/ath79/dts/ar9342_ubnt_lap-120.dts
copy to target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi
index 4055bbd523..918b69c1da 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi
@@ -2,15 +2,11 @@
 
 #include "ar9342_ubnt_wa.dtsi"
 
-/ {
-	compatible = "ubnt,lap-120", "ubnt,wa", "qca,ar9342";
-	model = "Ubiquiti LiteAP ac (LAP-120)";
-};
-
 &mdio0 {
 	status = "okay";
 
 	phy-mask = <4>;
+
 	phy4: ethernet-phy at 4 {
 		reg = <4>;
 	};
@@ -33,7 +29,3 @@
 		rxdv-delay = <3>;
 	};
 };
-
-&wmac {
-	status = "disabled";
-};
diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi
similarity index 50%
copy from target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts
copy to target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi
index 6114650ac5..f2e936bcc4 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi
@@ -2,45 +2,11 @@
 
 #include "ar9342_ubnt_wa.dtsi"
 
-/ {
-	compatible = "ubnt,nanostation-ac","ubnt,wa", "qca,ar9342";
-	model = "Ubiquiti Nanostation AC (WA)";
-
-	aliases {
-		led-boot = &led_rssi3;
-		led-failsafe = &led_rssi3;
-		led-upgrade = &led_rssi3;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		rssi0 {
-			label = "blue:rssi0";
-			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
-		};
-
-		rssi1 {
-			label = "blue:rssi1";
-			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-		};
-
-		rssi2 {
-			label = "blue:rssi2";
-			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-		};
-
-		led_rssi3: rssi3 {
-			label = "blue:rssi3";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
-	};
-};
-
 &mdio0 {
 	status = "okay";
 
 	phy-mask = <4>;
+
 	phy0: ethernet-phy at 0 {
 		phy-mode = "rgmii";
 		reg = <0>;
@@ -71,9 +37,3 @@
 		rxdv-delay = <2>;
 	};
 };
-
-&wmac {
-	status = "okay";
-
-	mtd-cal-data = <&art 0x1000>;
-};



More information about the lede-commits mailing list