1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Salvator-X 2nd version board with R-Car H3 ES2.0+
4 *
5 * Copyright (C) 2015-2017 Renesas Electronics Corp.
6 */
7
8/dts-v1/;
9#include "r8a77951.dtsi"
10#include "salvator-xs.dtsi"
11
12/ {
13	model = "Renesas Salvator-X 2nd version board based on r8a77951";
14	compatible = "renesas,salvator-xs", "renesas,r8a7795";
15
16	memory@48000000 {
17		device_type = "memory";
18		/* first 128MB is reserved for secure area. */
19		reg = <0x0 0x48000000 0x0 0x38000000>;
20	};
21
22	memory@500000000 {
23		device_type = "memory";
24		reg = <0x5 0x00000000 0x0 0x40000000>;
25	};
26
27	memory@600000000 {
28		device_type = "memory";
29		reg = <0x6 0x00000000 0x0 0x40000000>;
30	};
31
32	memory@700000000 {
33		device_type = "memory";
34		reg = <0x7 0x00000000 0x0 0x40000000>;
35	};
36};
37
38&du {
39	clocks = <&cpg CPG_MOD 724>,
40		 <&cpg CPG_MOD 723>,
41		 <&cpg CPG_MOD 722>,
42		 <&cpg CPG_MOD 721>,
43		 <&versaclock6 1>,
44		 <&x21_clk>,
45		 <&x22_clk>,
46		 <&versaclock6 2>;
47	clock-names = "du.0", "du.1", "du.2", "du.3",
48		      "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
49};
50
51&ehci2 {
52	status = "okay";
53};
54
55&ehci3 {
56	dr_mode = "otg";
57	status = "okay";
58};
59
60&hdmi1 {
61	status = "okay";
62
63	ports {
64		port@1 {
65			reg = <1>;
66			rcar_dw_hdmi1_out: endpoint {
67				remote-endpoint = <&hdmi1_con>;
68			};
69		};
70		port@2 {
71			reg = <2>;
72			dw_hdmi1_snd_in: endpoint {
73				remote-endpoint = <&rsnd_endpoint2>;
74			};
75		};
76	};
77};
78
79&hdmi1_con {
80	remote-endpoint = <&rcar_dw_hdmi1_out>;
81};
82
83&hsusb3 {
84	dr_mode = "otg";
85	status = "okay";
86};
87
88&ohci2 {
89	status = "okay";
90};
91
92&ohci3 {
93	dr_mode = "otg";
94	status = "okay";
95};
96
97&pca9654 {
98	pcie-sata-switch-hog {
99		gpio-hog;
100		gpios = <7 GPIO_ACTIVE_HIGH>;
101		output-low; /* enable SATA by default */
102		line-name = "PCIE/SATA switch";
103	};
104};
105
106&pfc {
107	usb2_pins: usb2 {
108		groups = "usb2";
109		function = "usb2";
110	};
111
112	/*
113	 * - On Salvator-X[S], GP6_3[01] are connected to ADV7482 as irq pins
114	 *   (when SW31 is the default setting on Salvator-XS).
115	 * - If SW31 is the default setting, you cannot use USB2.0 ch3 on
116	 *   r8a77951 with Salvator-XS.
117	 *   Hence the SW31 setting must be changed like 2) below.
118	 *   1) Default setting of SW31: ON-ON-OFF-OFF-OFF-OFF:
119	 *	- Connect GP6_3[01] to ADV7842.
120	 *   2) Changed setting of SW31: OFF-OFF-ON-ON-ON-ON:
121	 *	- Connect GP6_3[01] to BD082065 (USB2.0 ch3's host power).
122	 *	- Connect GP6_{04,21} to ADV7842.
123	 */
124	usb2_ch3_pins: usb2_ch3 {
125		groups = "usb2_ch3";
126		function = "usb2_ch3";
127	};
128};
129
130&rcar_sound {
131	ports {
132		/* rsnd_port0/1 are described in salvator-common.dtsi */
133		rsnd_port2: port@2 {
134			reg = <2>;
135			rsnd_endpoint2: endpoint {
136				remote-endpoint = <&dw_hdmi1_snd_in>;
137
138				dai-format = "i2s";
139				bitclock-master = <&rsnd_endpoint2>;
140				frame-master = <&rsnd_endpoint2>;
141
142				playback = <&ssi3>;
143			};
144		};
145	};
146};
147
148/* SW12-7 must be set 'Off' (MD12 set to 1) which is not the default! */
149&sata {
150	status = "okay";
151};
152
153&sound_card {
154	dais = <&rsnd_port0	/* ak4613 */
155		&rsnd_port1	/* HDMI0  */
156		&rsnd_port2>;	/* HDMI1  */
157};
158
159&usb2_phy2 {
160	pinctrl-0 = <&usb2_pins>;
161	pinctrl-names = "default";
162
163	status = "okay";
164};
165
166&usb2_phy3 {
167	pinctrl-0 = <&usb2_ch3_pins>;
168	pinctrl-names = "default";
169
170	status = "okay";
171};
172