Linux-Renesas-SoC Archive on lore.kernel.org
 help / color / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-renesas-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH 2/4] arm64: dts: renesas: salvator-x(s): Factor out SATA parts
Date: Mon,  7 Jun 2021 19:39:03 +0200
Message-ID: <87f91290ec7b523aa508e920a169ecaddccc9144.1623087028.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1623087028.git.geert+renesas@glider.be>

Move the common parts related to the SATA interface on Salvator-X(S)
boards to salvator-common.dtsi and salvator-xs.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 and M3-N, its descriptions are
protected by the preprocessor symbol SOC_HAS_SATA, defined in
r8a77951.dtsi and r8a77965.dtsi.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
After this, the SATA device node in r8a77965-salvator-x.dtb is no longer
disabled.  However, I'm not sure if SATA is actually supported on the
(rare) combination of a Salvator-X board with an R-Car M3-N SiP.
Perhaps it should be kept disabled, by undefining SOC_HAS_SATA in
arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dts, right after the
inclusion of r8a77965.dtsi?
---
 .../arm64/boot/dts/renesas/r8a77950-salvator-x.dts |  4 ----
 .../arm64/boot/dts/renesas/r8a77951-salvator-x.dts |  4 ----
 .../boot/dts/renesas/r8a77951-salvator-xs.dts      | 14 --------------
 arch/arm64/boot/dts/renesas/r8a77951.dtsi          |  1 +
 .../boot/dts/renesas/r8a77965-salvator-xs.dts      | 14 --------------
 arch/arm64/boot/dts/renesas/r8a77965.dtsi          |  2 ++
 arch/arm64/boot/dts/renesas/salvator-common.dtsi   |  6 ++++++
 arch/arm64/boot/dts/renesas/salvator-xs.dtsi       | 13 +++++++++++++
 8 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
index 718d1597af03dc2e..199bd909c4008451 100644
--- a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
@@ -63,10 +63,6 @@ usb2_pins: usb2 {
 	};
 };
 
-&sata {
-	status = "okay";
-};
-
 &usb2_phy2 {
 	pinctrl-0 = <&usb2_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
index d75fb9a9d3e4309d..74de36703bc02b90 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
@@ -63,10 +63,6 @@ usb2_pins: usb2 {
 	};
 };
 
-&sata {
-	status = "okay";
-};
-
 &usb2_phy2 {
 	pinctrl-0 = <&usb2_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
index fb8734ea5bc37b49..e9d421d7fcbbc404 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
@@ -71,15 +71,6 @@ &ohci3 {
 	status = "okay";
 };
 
-&pca9654 {
-	pcie-sata-switch-hog {
-		gpio-hog;
-		gpios = <7 GPIO_ACTIVE_HIGH>;
-		output-low; /* enable SATA by default */
-		line-name = "PCIE/SATA switch";
-	};
-};
-
 &pfc {
 	usb2_pins: usb2 {
 		groups = "usb2";
@@ -104,11 +95,6 @@ usb2_ch3_pins: usb2_ch3 {
 	};
 };
 
-/* SW12-7 must be set 'Off' (MD12 set to 1) which is not the default! */
-&sata {
-	status = "okay";
-};
-
 &usb2_phy2 {
 	pinctrl-0 = <&usb2_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
index 68e54ead31b451ca..4602ebf5d28945d2 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
@@ -12,6 +12,7 @@
 #define CPG_AUDIO_CLK_I		R8A7795_CLK_S0D4
 
 #define SOC_HAS_HDMI1
+#define SOC_HAS_SATA
 
 / {
 	compatible = "renesas,r8a7795";
diff --git a/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts
index 729756c24c7479a3..a1d3c8d531cfe9ef 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts
@@ -30,17 +30,3 @@ &du {
 	clock-names = "du.0", "du.1", "du.3",
 		      "dclkin.0", "dclkin.1", "dclkin.3";
 };
-
-&pca9654 {
-	pcie-sata-switch-hog {
-		gpio-hog;
-		gpios = <7 GPIO_ACTIVE_HIGH>;
-		output-low; /* enable SATA by default */
-		line-name = "PCIE/SATA switch";
-	};
-};
-
-/* SW12-7 must be set 'Off' (MD12 set to 1) which is not the default! */
-&sata {
-	status = "okay";
-};
diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index ad69da362a72ef99..08df75606430bd4a 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -14,6 +14,8 @@
 
 #define CPG_AUDIO_CLK_I		R8A77965_CLK_S0D4
 
+#define SOC_HAS_SATA
+
 / {
 	compatible = "renesas,r8a77965";
 	#address-cells = <2>;
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index ea1d8693a38eacbb..11bca200cf3d8ad5 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -876,6 +876,12 @@ &rwdt {
 	status = "okay";
 };
 
+#ifdef SOC_HAS_SATA
+&sata {
+	status = "okay";
+};
+#endif /* SOC_HAS_SATA */
+
 &scif1 {
 	pinctrl-0 = <&scif1_pins>;
 	pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/renesas/salvator-xs.dtsi b/arch/arm64/boot/dts/renesas/salvator-xs.dtsi
index 717d42758cbc4b39..3f7f6cf4a3338125 100644
--- a/arch/arm64/boot/dts/renesas/salvator-xs.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-xs.dtsi
@@ -27,3 +27,16 @@ versaclock6: clock-generator@6a {
 		clock-names = "xin";
 	};
 };
+
+#ifdef SOC_HAS_SATA
+&pca9654 {
+	pcie-sata-switch-hog {
+		gpio-hog;
+		gpios = <7 GPIO_ACTIVE_HIGH>;
+		output-low; /* enable SATA by default */
+		line-name = "PCIE/SATA switch";
+	};
+};
+
+/* SW12-7 must be set 'Off' (MD12 set to 1) which is not the default! */
+#endif /* SOC_HAS_SATA */
-- 
2.25.1


  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 17:39 [PATCH 0/4] arm64: dts: renesas: salvator-x(s): Factor out common optional parts Geert Uytterhoeven
2021-06-07 17:39 ` [PATCH 1/4] arm64: dts: renesas: salvator-x(s): Factor out HDMI1 parts Geert Uytterhoeven
2021-06-07 17:39 ` Geert Uytterhoeven [this message]
2021-06-07 17:39 ` [PATCH 3/4] arm64: dts: renesas: salvator-x(s): Factor out USB ch2 parts Geert Uytterhoeven
2021-06-07 17:39 ` [PATCH 4/4] arm64: dts: renesas: salvator-xs: Factor out USB ch3 parts Geert Uytterhoeven
2021-06-08 11:17 ` [PATCH 0/4] arm64: dts: renesas: salvator-x(s): Factor out common optional parts Niklas Söderlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87f91290ec7b523aa508e920a169ecaddccc9144.1623087028.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Renesas-SoC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \
		linux-renesas-soc@vger.kernel.org
	public-inbox-index linux-renesas-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git