1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Kingfisher (ULCB extension) board
4 *
5 * Copyright (C) 2017 Renesas Electronics Corp.
6 * Copyright (C) 2017 Cogent Embedded, Inc.
7 */
8
9/ {
10	aliases {
11		serial1 = &hscif0;
12		serial2 = &scif1;
13		mmc2 = &sdhi3;
14	};
15
16	clksndsel: clksndsel {
17		#clock-cells = <0>;
18		compatible = "gpio-mux-clock";
19		clocks = <&cs2000>, <&audio_clk_a>; /* clk8snd, clksnd */
20		select-gpios = <&gpio_exp_75 13 GPIO_ACTIVE_HIGH>;
21	};
22
23	hdmi1-out {
24		compatible = "hdmi-connector";
25		type = "a";
26
27		port {
28			hdmi1_con: endpoint {
29				remote-endpoint = <&adv7513_out>;
30			};
31		};
32	};
33
34	accel_3v3: regulator-acc-3v3 {
35		compatible = "regulator-fixed";
36		regulator-name = "accel-3v3";
37		regulator-min-microvolt = <3300000>;
38		regulator-max-microvolt = <3300000>;
39	};
40
41	hdmi_1v8: regulator-hdmi-1v8 {
42		compatible = "regulator-fixed";
43		regulator-name = "hdmi-1v8";
44		regulator-min-microvolt = <1800000>;
45		regulator-max-microvolt = <1800000>;
46	};
47
48	hdmi_3v3: regulator-hdmi-3v3 {
49		compatible = "regulator-fixed";
50		regulator-name = "hdmi-3v3";
51		regulator-min-microvolt = <3300000>;
52		regulator-max-microvolt = <3300000>;
53	};
54
55	snd_3p3v: regulator-snd_3p3v {
56		compatible = "regulator-fixed";
57		regulator-name = "snd-3.3v";
58		regulator-min-microvolt = <3300000>;
59		regulator-max-microvolt = <3300000>;
60	};
61
62	snd_vcc5v: regulator-snd_vcc5v {
63		compatible = "regulator-fixed";
64		regulator-name = "snd-vcc5v";
65		regulator-min-microvolt = <5000000>;
66		regulator-max-microvolt = <5000000>;
67	};
68
69	wlan_en: regulator-wlan_en {
70		compatible = "regulator-fixed";
71		regulator-name = "wlan-en-regulator";
72
73		regulator-min-microvolt = <3300000>;
74		regulator-max-microvolt = <3300000>;
75
76		gpio = <&gpio_exp_74 4 GPIO_ACTIVE_HIGH>;
77		startup-delay-us = <70000>;
78		enable-active-high;
79	};
80};
81
82&can0 {
83	pinctrl-0 = <&can0_pins>;
84	pinctrl-names = "default";
85	status = "okay";
86};
87
88&can1 {
89	pinctrl-0 = <&can1_pins>;
90	pinctrl-names = "default";
91	status = "okay";
92};
93
94&du {
95	ports {
96		port@0 {
97			du_out_rgb: endpoint {
98				remote-endpoint = <&adv7513_in>;
99			};
100		};
101	};
102};
103
104&ehci0 {
105	dr_mode = "otg";
106	status = "okay";
107};
108
109&hscif0 {
110	pinctrl-0 = <&hscif0_pins>;
111	pinctrl-names = "default";
112	uart-has-rtscts;
113
114	status = "okay";
115};
116
117&hsusb {
118	dr_mode = "otg";
119	status = "okay";
120};
121
122&i2c2 {
123	i2cmux2: i2c-mux@71 {
124		compatible = "nxp,pca9548";
125		#address-cells = <1>;
126		#size-cells = <0>;
127		reg = <0x71>;
128		reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
129
130		/* HDMIoSDA, HDMIoSCL */
131		i2c@4 {
132			#address-cells = <1>;
133			#size-cells = <0>;
134			reg = <4>;
135
136			hdmi@3d {
137				compatible = "adi,adv7513";
138				reg = <0x3d>;
139
140				pinctrl-0 = <&hdmi1_pins>;
141				pinctrl-names = "default";
142
143				interrupt-parent = <&gpio2>;
144				interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
145
146				clocks = <&cs2000>;
147				clock-names = "cec";
148
149				pd-gpios = <&gpio_exp_75 5 GPIO_ACTIVE_LOW>;
150
151				avdd-supply = <&hdmi_1v8>;
152				dvdd-supply = <&hdmi_1v8>;
153				pvdd-supply = <&hdmi_1v8>;
154				dvdd-3v-supply = <&hdmi_3v3>;
155				bgvdd-supply = <&hdmi_1v8>;
156
157				adi,input-depth = <8>;
158				adi,input-colorspace = "rgb";
159				adi,input-clock = "1x";
160
161				ports {
162					#address-cells = <1>;
163					#size-cells = <0>;
164
165					port@0 {
166						reg = <0>;
167						adv7513_in: endpoint {
168							remote-endpoint = <&du_out_rgb>;
169						};
170					};
171
172					port@1 {
173						reg = <1>;
174						adv7513_out: endpoint {
175							remote-endpoint = <&hdmi1_con>;
176						};
177					};
178				};
179			};
180		};
181
182		/* Audio_SDA, Audio_SCL */
183		i2c@7 {
184			#address-cells = <1>;
185			#size-cells = <0>;
186			reg = <7>;
187
188			accelerometer@1d {
189				compatible = "st,lsm9ds0-imu";
190				reg = <0x1d>;
191
192				vdd-supply = <&accel_3v3>;
193				vddio-supply = <&accel_3v3>;
194			};
195
196			pcm3168a: audio-codec@44 {
197				#sound-dai-cells = <0>;
198				compatible = "ti,pcm3168a";
199				reg = <0x44>;
200				clocks = <&clksndsel>;
201				clock-names = "scki";
202
203				VDD1-supply = <&snd_3p3v>;
204				VDD2-supply = <&snd_3p3v>;
205				VCCAD1-supply = <&snd_vcc5v>;
206				VCCAD2-supply = <&snd_vcc5v>;
207				VCCDA1-supply = <&snd_vcc5v>;
208				VCCDA2-supply = <&snd_vcc5v>;
209			};
210
211			gyroscope@6b {
212				compatible = "st,lsm9ds0-gyro";
213				reg = <0x6b>;
214
215				vdd-supply = <&accel_3v3>;
216				vddio-supply = <&accel_3v3>;
217			};
218		};
219	};
220
221	/* U11 */
222	gpio_exp_74: gpio@74 {
223		compatible = "ti,tca9539";
224		reg = <0x74>;
225		gpio-controller;
226		#gpio-cells = <2>;
227		interrupt-controller;
228		interrupt-parent = <&gpio6>;
229		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
230
231		audio-out-off-hog {
232			gpio-hog;
233			gpios = <0 GPIO_ACTIVE_HIGH>; /* P00 */
234			output-high;
235			line-name = "Audio_Out_OFF";
236		};
237
238		hub-pwen-hog {
239			gpio-hog;
240			gpios = <6 GPIO_ACTIVE_HIGH>;
241			output-high;
242			line-name = "HUB pwen";
243		};
244
245		hub-rst-hog {
246			gpio-hog;
247			gpios = <7 GPIO_ACTIVE_HIGH>;
248			output-high;
249			line-name = "HUB rst";
250		};
251
252		otg-extlpn-hog {
253			gpio-hog;
254			gpios = <9 GPIO_ACTIVE_HIGH>;
255			output-high;
256			line-name = "OTG EXTLPn";
257		};
258
259		otg-offvbusn-hog {
260			gpio-hog;
261			gpios = <8 GPIO_ACTIVE_HIGH>;
262			output-low;
263			line-name = "OTG OFFVBUSn";
264		};
265
266		sd-wifi-mux-hog {
267			gpio-hog;
268			gpios = <5 GPIO_ACTIVE_HIGH>;
269			output-low;	/* Connect WL1837 */
270			line-name = "SD WiFi mux";
271		};
272
273		snd-rst-hog {
274			gpio-hog;
275			gpios = <15 GPIO_ACTIVE_HIGH>; /* P17 */
276			output-high;
277			line-name = "SND_RST";
278		};
279	};
280
281	/* U5 */
282	gpio_exp_75: gpio@75 {
283		compatible = "ti,tca9539";
284		reg = <0x75>;
285		gpio-controller;
286		#gpio-cells = <2>;
287		interrupt-controller;
288		interrupt-parent = <&gpio6>;
289		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
290	};
291};
292
293&i2c4 {
294	i2cmux4: i2c-mux@71 {
295		compatible = "nxp,pca9548";
296		#address-cells = <1>;
297		#size-cells = <0>;
298		reg = <0x71>;
299		reset-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>;
300	};
301
302	gpio_exp_76: gpio@76 {
303		compatible = "ti,tca9539";
304		reg = <0x76>;
305		gpio-controller;
306		#gpio-cells = <2>;
307		interrupt-controller;
308		interrupt-parent = <&gpio7>;
309		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
310	};
311
312	gpio_exp_77: gpio@77 {
313		compatible = "ti,tca9539";
314		reg = <0x77>;
315		gpio-controller;
316		#gpio-cells = <2>;
317		interrupt-controller;
318		interrupt-parent = <&gpio5>;
319		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
320	};
321};
322
323&ohci0 {
324	dr_mode = "otg";
325	status = "okay";
326};
327
328&pcie_bus_clk {
329	clock-frequency = <100000000>;
330};
331
332&pciec0 {
333	status = "okay";
334};
335
336&pciec1 {
337	status = "okay";
338};
339
340&pfc {
341	can0_pins: can0 {
342		groups = "can0_data_a";
343		function = "can0";
344	};
345
346	can1_pins: can1 {
347		groups = "can1_data";
348		function = "can1";
349	};
350
351	hdmi1_pins: hdmi1 {
352		adv7513-interrupt {
353			pins = "GP_2_14";
354			bias-pull-up;
355		};
356
357		du {
358			groups = "du_rgb888", "du_sync", "du_clk_out_0",
359				 "du_disp";
360			function = "du";
361		};
362	};
363
364	hscif0_pins: hscif0 {
365		groups = "hscif0_data", "hscif0_ctrl";
366		function = "hscif0";
367	};
368
369	scif1_pins: scif1 {
370		groups = "scif1_data_b", "scif1_ctrl";
371		function = "scif1";
372	};
373
374	sdhi3_pins: sdhi3 {
375		groups = "sdhi3_data4", "sdhi3_ctrl";
376		function = "sdhi3";
377		power-source = <3300>;
378	};
379
380	sound_pcm_pins: sound-pcm {
381		groups = "ssi349_ctrl", "ssi3_data", "ssi4_data";
382		function = "ssi";
383	};
384
385	usb0_pins: usb0 {
386		groups = "usb0";
387		function = "usb0";
388	};
389};
390
391&rcar_sound {
392	pinctrl-0 = <&sound_pins
393		     &sound_clk_pins
394		     &sound_pcm_pins>;
395};
396
397&scif1 {
398	pinctrl-0 = <&scif1_pins>;
399	pinctrl-names = "default";
400	uart-has-rtscts;
401
402	status = "okay";
403};
404
405&sdhi3 {
406	pinctrl-0 = <&sdhi3_pins>;
407	pinctrl-names = "default";
408
409	vmmc-supply = <&wlan_en>;
410	vqmmc-supply = <&wlan_en>;
411	bus-width = <4>;
412	no-1-8-v;
413	non-removable;
414	cap-power-off-card;
415	keep-power-in-suspend;
416	max-frequency = <26000000>;
417	status = "okay";
418
419	#address-cells = <1>;
420	#size-cells = <0>;
421	wlcore: wlcore@2 {
422		compatible = "ti,wl1837";
423		reg = <2>;
424		interrupt-parent = <&gpio1>;
425		interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
426	};
427};
428
429&ssi4 {
430	shared-pin;
431};
432
433&usb2_phy0 {
434	pinctrl-0 = <&usb0_pins>;
435	pinctrl-names = "default";
436
437	status = "okay";
438};
439
440&xhci0 {
441	status = "okay";
442};
443
444/*
445 * For sound-test.
446 *
447 * We can switch Audio Card for testing
448 * see also ulcb.dtsi
449 *
450 * #include "ulcb-kf-simple-audio-card.dtsi"
451 * #include "ulcb-kf-simple-audio-card-mix+split.dtsi"
452 * #include "ulcb-kf-audio-graph-card.dtsi"
453 * #include "ulcb-kf-audio-graph-card-mix+split.dtsi"
454 * #include "ulcb-kf-audio-graph-card2-mix+split.dtsi"
455 */
456#include "ulcb-kf-audio-graph-card2.dtsi"
457