arm64: dts: renesas: salvator-x(s): Factor out SATA parts
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 7 Jun 2021 17:39:03 +0000 (19:39 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 19 Jul 2021 08:51:34 +0000 (10:51 +0200)
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>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/87f91290ec7b523aa508e920a169ecaddccc9144.1623087028.git.geert+renesas@glider.be
arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
arch/arm64/boot/dts/renesas/r8a77951.dtsi
arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts
arch/arm64/boot/dts/renesas/r8a77965.dtsi
arch/arm64/boot/dts/renesas/salvator-common.dtsi
arch/arm64/boot/dts/renesas/salvator-xs.dtsi

index 718d159..199bd90 100644 (file)
        };
 };
 
-&sata {
-       status = "okay";
-};
-
 &usb2_phy2 {
        pinctrl-0 = <&usb2_pins>;
        pinctrl-names = "default";
index d75fb9a..74de367 100644 (file)
        };
 };
 
-&sata {
-       status = "okay";
-};
-
 &usb2_phy2 {
        pinctrl-0 = <&usb2_pins>;
        pinctrl-names = "default";
index fb8734e..e9d421d 100644 (file)
        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";
        };
 };
 
-/* 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";
index 68e54ea..4602ebf 100644 (file)
@@ -12,6 +12,7 @@
 #define CPG_AUDIO_CLK_I                R8A7795_CLK_S0D4
 
 #define SOC_HAS_HDMI1
+#define SOC_HAS_SATA
 
 / {
        compatible = "renesas,r8a7795";
index 729756c..a1d3c8d 100644 (file)
        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";
-};
index ad69da3..08df756 100644 (file)
@@ -14,6 +14,8 @@
 
 #define CPG_AUDIO_CLK_I                R8A77965_CLK_S0D4
 
+#define SOC_HAS_SATA
+
 / {
        compatible = "renesas,r8a77965";
        #address-cells = <2>;
index 6f3af2e..848563d 100644 (file)
        status = "okay";
 };
 
+#ifdef SOC_HAS_SATA
+&sata {
+       status = "okay";
+};
+#endif /* SOC_HAS_SATA */
+
 &scif1 {
        pinctrl-0 = <&scif1_pins>;
        pinctrl-names = "default";
index 717d427..3f7f6cf 100644 (file)
                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 */