1/*
2 * Device Tree Source for the Salvator-X board
3 *
4 * Copyright (C) 2016 Renesas Electronics Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2.  This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/dts-v1/;
12#include "r8a7796.dtsi"
13#include <dt-bindings/gpio/gpio.h>
14
15/ {
16	model = "Renesas Salvator-X board based on r8a7796";
17	compatible = "renesas,salvator-x", "renesas,r8a7796";
18
19	aliases {
20		serial0 = &scif2;
21		serial1 = &scif1;
22		ethernet0 = &avb;
23	};
24
25	chosen {
26		bootargs = "ignore_loglevel";
27		stdout-path = "serial0:115200n8";
28	};
29
30	memory@48000000 {
31		device_type = "memory";
32		/* first 128MB is reserved for secure area. */
33		reg = <0x0 0x48000000 0x0 0x78000000>;
34	};
35
36	memory@600000000 {
37		device_type = "memory";
38		reg = <0x6 0x00000000 0x0 0x80000000>;
39	};
40
41	reg_1p8v: regulator0 {
42		compatible = "regulator-fixed";
43		regulator-name = "fixed-1.8V";
44		regulator-min-microvolt = <1800000>;
45		regulator-max-microvolt = <1800000>;
46		regulator-boot-on;
47		regulator-always-on;
48	};
49
50	reg_3p3v: regulator1 {
51		compatible = "regulator-fixed";
52		regulator-name = "fixed-3.3V";
53		regulator-min-microvolt = <3300000>;
54		regulator-max-microvolt = <3300000>;
55		regulator-boot-on;
56		regulator-always-on;
57	};
58
59	vcc_sdhi0: regulator-vcc-sdhi0 {
60		compatible = "regulator-fixed";
61
62		regulator-name = "SDHI0 Vcc";
63		regulator-min-microvolt = <3300000>;
64		regulator-max-microvolt = <3300000>;
65
66		gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>;
67		enable-active-high;
68	};
69
70	vccq_sdhi0: regulator-vccq-sdhi0 {
71		compatible = "regulator-gpio";
72
73		regulator-name = "SDHI0 VccQ";
74		regulator-min-microvolt = <1800000>;
75		regulator-max-microvolt = <3300000>;
76
77		gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
78		gpios-states = <1>;
79		states = <3300000 1
80			  1800000 0>;
81	};
82
83	vcc_sdhi3: regulator-vcc-sdhi3 {
84		compatible = "regulator-fixed";
85
86		regulator-name = "SDHI3 Vcc";
87		regulator-min-microvolt = <3300000>;
88		regulator-max-microvolt = <3300000>;
89
90		gpio = <&gpio3 15 GPIO_ACTIVE_HIGH>;
91		enable-active-high;
92	};
93
94	vccq_sdhi3: regulator-vccq-sdhi3 {
95		compatible = "regulator-gpio";
96
97		regulator-name = "SDHI3 VccQ";
98		regulator-min-microvolt = <1800000>;
99		regulator-max-microvolt = <3300000>;
100
101		gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
102		gpios-states = <1>;
103		states = <3300000 1
104			  1800000 0>;
105	};
106};
107
108&pfc {
109	pinctrl-0 = <&scif_clk_pins>;
110	pinctrl-names = "default";
111
112	avb_pins: avb {
113		groups = "avb_mdc";
114		function = "avb";
115	};
116
117	scif1_pins: scif1 {
118		groups = "scif1_data_a", "scif1_ctrl";
119		function = "scif1";
120	};
121
122	scif2_pins: scif2 {
123		groups = "scif2_data_a";
124		function = "scif2";
125	};
126	scif_clk_pins: scif_clk {
127		groups = "scif_clk_a";
128		function = "scif_clk";
129	};
130
131	i2c2_pins: i2c2 {
132		groups = "i2c2_a";
133		function = "i2c2";
134	};
135
136	sdhi0_pins: sd0 {
137		groups = "sdhi0_data4", "sdhi0_ctrl";
138		function = "sdhi0";
139		power-source = <3300>;
140	};
141
142	sdhi0_pins_uhs: sd0_uhs {
143		groups = "sdhi0_data4", "sdhi0_ctrl";
144		function = "sdhi0";
145		power-source = <1800>;
146	};
147
148	sdhi2_pins: sd2 {
149		groups = "sdhi2_data8", "sdhi2_ctrl";
150		function = "sdhi2";
151		power-source = <3300>;
152	};
153
154	sdhi2_pins_uhs: sd2_uhs {
155		groups = "sdhi2_data8", "sdhi2_ctrl";
156		function = "sdhi2";
157		power-source = <1800>;
158	};
159
160	sdhi3_pins: sd3 {
161		groups = "sdhi3_data4", "sdhi3_ctrl";
162		function = "sdhi3";
163		power-source = <3300>;
164	};
165
166	sdhi3_pins_uhs: sd3_uhs {
167		groups = "sdhi3_data4", "sdhi3_ctrl";
168		function = "sdhi3";
169		power-source = <1800>;
170	};
171};
172
173&avb {
174	pinctrl-0 = <&avb_pins>;
175	pinctrl-names = "default";
176	renesas,no-ether-link;
177	phy-handle = <&phy0>;
178	status = "okay";
179
180	phy0: ethernet-phy@0 {
181		rxc-skew-ps = <1500>;
182		reg = <0>;
183		interrupt-parent = <&gpio2>;
184		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
185	};
186};
187
188&extal_clk {
189	clock-frequency = <16666666>;
190};
191
192&extalr_clk {
193	clock-frequency = <32768>;
194};
195
196&sdhi0 {
197	pinctrl-0 = <&sdhi0_pins>;
198	pinctrl-1 = <&sdhi0_pins_uhs>;
199	pinctrl-names = "default", "state_uhs";
200
201	vmmc-supply = <&vcc_sdhi0>;
202	vqmmc-supply = <&vccq_sdhi0>;
203	cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
204	wp-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
205	bus-width = <4>;
206	sd-uhs-sdr50;
207	status = "okay";
208};
209
210&sdhi2 {
211	/* used for on-board 8bit eMMC */
212	pinctrl-0 = <&sdhi2_pins>;
213	pinctrl-1 = <&sdhi2_pins_uhs>;
214	pinctrl-names = "default", "state_uhs";
215
216	vmmc-supply = <&reg_3p3v>;
217	vqmmc-supply = <&reg_1p8v>;
218	bus-width = <8>;
219	non-removable;
220	status = "okay";
221};
222
223&sdhi3 {
224	pinctrl-0 = <&sdhi3_pins>;
225	pinctrl-1 = <&sdhi3_pins_uhs>;
226	pinctrl-names = "default", "state_uhs";
227
228	vmmc-supply = <&vcc_sdhi3>;
229	vqmmc-supply = <&vccq_sdhi3>;
230	cd-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
231	wp-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
232	bus-width = <4>;
233	sd-uhs-sdr50;
234	status = "okay";
235};
236
237&scif1 {
238	pinctrl-0 = <&scif1_pins>;
239	pinctrl-names = "default";
240
241	uart-has-rtscts;
242	status = "okay";
243};
244
245&scif2 {
246	pinctrl-0 = <&scif2_pins>;
247	pinctrl-names = "default";
248	status = "okay";
249};
250
251&scif_clk {
252	clock-frequency = <14745600>;
253};
254
255&i2c2 {
256	pinctrl-0 = <&i2c2_pins>;
257	pinctrl-names = "default";
258
259	status = "okay";
260};
261
262&wdt0 {
263	timeout-sec = <60>;
264	status = "okay";
265};
266
267&i2c_dvfs {
268	status = "okay";
269};
270