diff mbox series

[3/4] arm64: dts: renesas: salvator-x(s): Factor out USB ch2 parts

Message ID ebc434502fc899b1f9d9640f560c3eaab6bb0927.1623087028.git.geert+renesas@glider.be (mailing list archive)
State New
Delegated to: Geert Uytterhoeven
Headers show
Series arm64: dts: renesas: salvator-x(s): Factor out common optional parts | expand

Commit Message

Geert Uytterhoeven June 7, 2021, 5:39 p.m. UTC
Move the common parts related to the third USB2 interface on
Salvator-X(S) boards to salvator-common.dtsi, to reduce current and
avoid future duplication of board descriptions.

As this interface is not present on all SoCs that can be found on
Salvator-X(S), but only on R-Car H3, its descriptions are protected by
the preprocessor symbol SOC_HAS_USB2_CH2, defined in r8a77951.dtsi.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 .../boot/dts/renesas/r8a77950-salvator-x.dts  | 22 -----------------
 .../boot/dts/renesas/r8a77951-salvator-x.dts  | 22 -----------------
 .../boot/dts/renesas/r8a77951-salvator-xs.dts | 20 ----------------
 arch/arm64/boot/dts/renesas/r8a77951.dtsi     |  1 +
 .../boot/dts/renesas/salvator-common.dtsi     | 24 +++++++++++++++++++
 5 files changed, 25 insertions(+), 64 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
index 199bd909c4008451..c6ca61a8ed40eb9d 100644
--- a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
@@ -47,25 +47,3 @@  &du {
 	clock-names = "du.0", "du.1", "du.2", "du.3",
 		      "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
 };
-
-&ehci2 {
-	status = "okay";
-};
-
-&ohci2 {
-	status = "okay";
-};
-
-&pfc {
-	usb2_pins: usb2 {
-		groups = "usb2";
-		function = "usb2";
-	};
-};
-
-&usb2_phy2 {
-	pinctrl-0 = <&usb2_pins>;
-	pinctrl-names = "default";
-
-	status = "okay";
-};
diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
index 74de36703bc02b90..d8e655ba81bd5939 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
@@ -47,25 +47,3 @@  &du {
 	clock-names = "du.0", "du.1", "du.2", "du.3",
 		      "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
 };
-
-&ehci2 {
-	status = "okay";
-};
-
-&ohci2 {
-	status = "okay";
-};
-
-&pfc {
-	usb2_pins: usb2 {
-		groups = "usb2";
-		function = "usb2";
-	};
-};
-
-&usb2_phy2 {
-	pinctrl-0 = <&usb2_pins>;
-	pinctrl-names = "default";
-
-	status = "okay";
-};
diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
index e9d421d7fcbbc404..bdea6f84ddb5cccd 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
@@ -48,10 +48,6 @@  &du {
 		      "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
 };
 
-&ehci2 {
-	status = "okay";
-};
-
 &ehci3 {
 	dr_mode = "otg";
 	status = "okay";
@@ -62,21 +58,12 @@  &hsusb3 {
 	status = "okay";
 };
 
-&ohci2 {
-	status = "okay";
-};
-
 &ohci3 {
 	dr_mode = "otg";
 	status = "okay";
 };
 
 &pfc {
-	usb2_pins: usb2 {
-		groups = "usb2";
-		function = "usb2";
-	};
-
 	/*
 	 * - On Salvator-X[S], GP6_3[01] are connected to ADV7482 as irq pins
 	 *   (when SW31 is the default setting on Salvator-XS).
@@ -95,13 +82,6 @@  usb2_ch3_pins: usb2_ch3 {
 	};
 };
 
-&usb2_phy2 {
-	pinctrl-0 = <&usb2_pins>;
-	pinctrl-names = "default";
-
-	status = "okay";
-};
-
 &usb2_phy3 {
 	pinctrl-0 = <&usb2_ch3_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
index 4602ebf5d28945d2..fd3180ddc7bff452 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
@@ -13,6 +13,7 @@ 
 
 #define SOC_HAS_HDMI1
 #define SOC_HAS_SATA
+#define SOC_HAS_USB2_CH2
 
 / {
 	compatible = "renesas,r8a7795";
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index 11bca200cf3d8ad5..de959f28ad6ce27b 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -1029,3 +1029,27 @@  &xhci0 {
 
 	status = "okay";
 };
+
+#ifdef SOC_HAS_USB2_CH2
+&ehci2 {
+	status = "okay";
+};
+
+&ohci2 {
+	status = "okay";
+};
+
+&pfc {
+	usb2_pins: usb2 {
+		groups = "usb2";
+		function = "usb2";
+	};
+};
+
+&usb2_phy2 {
+	pinctrl-0 = <&usb2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};
+#endif /* SOC_HAS_USB2_CH2 */