Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dts: renesas: salvator-xs: Factor out USB ch3 parts

Move the parts related to the fourth USB2 interface on Salvator-XS
boards to salvator-xs.dtsi, to 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 ES2.0+, its descriptions are
protected by the preprocessor symbol SOC_HAS_USB2_CH3, defined in
r8a77951.dtsi, and undefined in r8a77950.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/411df1adfd64ee82e5a0d1603df85d657fd4f8c0.1623087028.git.geert+renesas@glider.be

+46 -41
+2
arch/arm64/boot/dts/renesas/r8a77950.dtsi
··· 7 7 8 8 #include "r8a77951.dtsi" 9 9 10 + #undef SOC_HAS_USB2_CH3 11 + 10 12 &audma0 { 11 13 iommus = <&ipmmu_mp1 0>, <&ipmmu_mp1 1>, 12 14 <&ipmmu_mp1 2>, <&ipmmu_mp1 3>,
-41
arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
··· 47 47 clock-names = "du.0", "du.1", "du.2", "du.3", 48 48 "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3"; 49 49 }; 50 - 51 - &ehci3 { 52 - dr_mode = "otg"; 53 - status = "okay"; 54 - }; 55 - 56 - &hsusb3 { 57 - dr_mode = "otg"; 58 - status = "okay"; 59 - }; 60 - 61 - &ohci3 { 62 - dr_mode = "otg"; 63 - status = "okay"; 64 - }; 65 - 66 - &pfc { 67 - /* 68 - * - On Salvator-X[S], GP6_3[01] are connected to ADV7482 as irq pins 69 - * (when SW31 is the default setting on Salvator-XS). 70 - * - If SW31 is the default setting, you cannot use USB2.0 ch3 on 71 - * r8a77951 with Salvator-XS. 72 - * Hence the SW31 setting must be changed like 2) below. 73 - * 1) Default setting of SW31: ON-ON-OFF-OFF-OFF-OFF: 74 - * - Connect GP6_3[01] to ADV7842. 75 - * 2) Changed setting of SW31: OFF-OFF-ON-ON-ON-ON: 76 - * - Connect GP6_3[01] to BD082065 (USB2.0 ch3's host power). 77 - * - Connect GP6_{04,21} to ADV7842. 78 - */ 79 - usb2_ch3_pins: usb2_ch3 { 80 - groups = "usb2_ch3"; 81 - function = "usb2_ch3"; 82 - }; 83 - }; 84 - 85 - &usb2_phy3 { 86 - pinctrl-0 = <&usb2_ch3_pins>; 87 - pinctrl-names = "default"; 88 - 89 - status = "okay"; 90 - };
+1
arch/arm64/boot/dts/renesas/r8a77951.dtsi
··· 14 14 #define SOC_HAS_HDMI1 15 15 #define SOC_HAS_SATA 16 16 #define SOC_HAS_USB2_CH2 17 + #define SOC_HAS_USB2_CH3 17 18 18 19 / { 19 20 compatible = "renesas,r8a7795";
+43
arch/arm64/boot/dts/renesas/salvator-xs.dtsi
··· 40 40 41 41 /* SW12-7 must be set 'Off' (MD12 set to 1) which is not the default! */ 42 42 #endif /* SOC_HAS_SATA */ 43 + 44 + #ifdef SOC_HAS_USB2_CH3 45 + &ehci3 { 46 + dr_mode = "otg"; 47 + status = "okay"; 48 + }; 49 + 50 + &hsusb3 { 51 + dr_mode = "otg"; 52 + status = "okay"; 53 + }; 54 + 55 + &ohci3 { 56 + dr_mode = "otg"; 57 + status = "okay"; 58 + }; 59 + 60 + &pfc { 61 + /* 62 + * - On Salvator-X[S], GP6_3[01] are connected to ADV7482 as irq pins 63 + * (when SW31 is the default setting on Salvator-XS). 64 + * - If SW31 is the default setting, you cannot use USB2.0 ch3 on 65 + * r8a77951 with Salvator-XS. 66 + * Hence the SW31 setting must be changed like 2) below. 67 + * 1) Default setting of SW31: ON-ON-OFF-OFF-OFF-OFF: 68 + * - Connect GP6_3[01] to ADV7842. 69 + * 2) Changed setting of SW31: OFF-OFF-ON-ON-ON-ON: 70 + * - Connect GP6_3[01] to BD082065 (USB2.0 ch3's host power). 71 + * - Connect GP6_{04,21} to ADV7842. 72 + */ 73 + usb2_ch3_pins: usb2_ch3 { 74 + groups = "usb2_ch3"; 75 + function = "usb2_ch3"; 76 + }; 77 + }; 78 + 79 + &usb2_phy3 { 80 + pinctrl-0 = <&usb2_ch3_pins>; 81 + pinctrl-names = "default"; 82 + 83 + status = "okay"; 84 + }; 85 + #endif /* SOC_HAS_USB2_CH3 */