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 718d1597af03dc2ebbf01cffccc997741c876eea..199bd909c4008451667d877f8131efa1c9233bd4 100644 (file)
        };
 };
 
-&sata {
-       status = "okay";
-};
-
 &usb2_phy2 {
        pinctrl-0 = <&usb2_pins>;
        pinctrl-names = "default";
index d75fb9a9d3e4309da720500f5ec7caae34fe23e6..74de36703bc02b906732e46e51a2717bb9a44657 100644 (file)
        };
 };
 
-&sata {
-       status = "okay";
-};
-
 &usb2_phy2 {
        pinctrl-0 = <&usb2_pins>;
        pinctrl-names = "default";
index fb8734ea5bc37b498bebf2e48c64163268552c17..e9d421d7fcbbc40490c7a9d1a8910292c7e9fbd6 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 68e54ead31b451ca14fe4ad4e3cf2ab28f357324..4602ebf5d28945d2deffc86f8018a424175f2bb0 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 729756c24c7479a3474cfac18dccd86d70cf0635..a1d3c8d531cfe9ef88eeb697ff41ce8d84b79304 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 ad69da362a72ef99d73876cd19c3d01ddd9af856..08df75606430bd4af88760025ee799dac2b46ec0 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 6f3af2e809586e9b51f5ad698a30bdf6c8ca81fe..848563d9354682f2494837528bd2d7adf6f87acd 100644 (file)
        status = "okay";
 };
 
+#ifdef SOC_HAS_SATA
+&sata {
+       status = "okay";
+};
+#endif /* SOC_HAS_SATA */
+
 &scif1 {
        pinctrl-0 = <&scif1_pins>;
        pinctrl-names = "default";
index 717d42758cbc4b399e6dc9b4af0333a62fdda5ca..3f7f6cf4a3338125eb9923645edb89ea2643cd0d 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 */