• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright 2020, Compass Electronics Group, LLC
4 */
5
6#include <dt-bindings/gpio/gpio.h>
7#include <dt-bindings/input/input.h>
8
9/ {
10	backlight_lvds: backlight-lvds {
11		compatible = "pwm-backlight";
12		power-supply = <&reg_lcd>;
13		enable-gpios = <&gpio_exp1 3 GPIO_ACTIVE_LOW>;
14		pwms = <&pwm2 0 50000>;
15		brightness-levels = <0 4 8 16 32 64 128 255>;
16		default-brightness-level = <6>;
17	};
18
19	backlight_rgb: backlight-rgb {
20		compatible = "pwm-backlight";
21		power-supply = <&reg_lcd>;
22		enable-gpios = <&gpio_exp1 7 GPIO_ACTIVE_LOW>;
23		pwms = <&pwm0 0 50000>;
24		brightness-levels = <0 4 8 16 32 64 128 255>;
25		default-brightness-level = <6>;
26	};
27
28	hdmi0-out {
29		compatible = "hdmi-connector";
30		type = "a";
31
32		port {
33			hdmi0_con: endpoint {
34				remote-endpoint = <&rcar_dw_hdmi0_out>;
35			};
36		};
37	};
38
39	keys {
40		compatible = "gpio-keys";
41
42		key-1 {
43			gpios = <&gpio4 6 GPIO_ACTIVE_LOW>;
44			linux,code = <KEY_1>;
45			label = "Switch-1";
46			wakeup-source;
47			debounce-interval = <20>;
48		};
49		key-2 {
50			gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
51			linux,code = <KEY_2>;
52			label = "Switch-2";
53			wakeup-source;
54			debounce-interval = <20>;
55		};
56		key-3 {
57			gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
58			linux,code = <KEY_3>;
59			label = "Switch-3";
60			wakeup-source;
61			debounce-interval = <20>;
62		};
63		key-4 {
64			gpios = <&gpio5 20 GPIO_ACTIVE_LOW>;
65			linux,code = <KEY_4>;
66			label = "Switch-4";
67			wakeup-source;
68			debounce-interval = <20>;
69		};
70		key-5 {
71			gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
72			linux,code = <KEY_5>;
73			label = "Switch-4";
74			wakeup-source;
75			debounce-interval = <20>;
76		};
77	};
78
79	leds {
80		compatible = "gpio-leds";
81		pinctrl-0 = <&led_pins>;
82		pinctrl-names = "default";
83
84		led0 {
85			gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
86			label = "LED0";
87			linux,default-trigger = "heartbeat";
88		};
89		led1 {
90			gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
91			label = "LED1";
92		};
93		led2 {
94			gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
95			label = "LED2";
96		};
97		led3 {
98			gpios = <&gpio7 3 GPIO_ACTIVE_HIGH>;
99			label = "LED3";
100		};
101	};
102
103	lvds {
104		compatible = "panel-lvds";
105		power-supply = <&reg_lcd_reset>;
106		width-mm = <223>;
107		height-mm = <125>;
108		backlight = <&backlight_lvds>;
109		data-mapping = "vesa-24";
110
111		panel-timing {
112			/* 800x480@60Hz */
113			clock-frequency = <30000000>;
114			hactive = <800>;
115			vactive = <480>;
116			hsync-len = <48>;
117			hfront-porch = <40>;
118			hback-porch = <40>;
119			vfront-porch = <13>;
120			vback-porch = <29>;
121			vsync-len = <3>;
122			hsync-active = <1>;
123			vsync-active = <1>;
124			de-active = <1>;
125			pixelclk-active = <0>;
126		};
127
128		port {
129			panel_in: endpoint {
130				remote-endpoint = <&lvds0_out>;
131			};
132		};
133	};
134
135	rgb {
136		/* Different LCD with compatible timings */
137		compatible = "rocktech,rk070er9427";
138		backlight = <&backlight_rgb>;
139		enable-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
140		power-supply = <&reg_lcd>;
141		port {
142			rgb_panel: endpoint {
143				remote-endpoint = <&du_out_rgb>;
144			};
145		};
146	};
147
148	reg_audio: regulator-audio {
149		compatible = "regulator-fixed";
150		regulator-name = "audio-1.8V";
151		regulator-min-microvolt = <1800000>;
152		regulator-max-microvolt = <1800000>;
153		gpio = <&gpio_exp4 1 GPIO_ACTIVE_HIGH>;
154		enable-active-high;
155	};
156
157	reg_lcd: regulator-lcd {
158		compatible = "regulator-fixed";
159		regulator-name = "lcd_panel_pwr";
160		regulator-min-microvolt = <3300000>;
161		regulator-max-microvolt = <3300000>;
162		gpio = <&gpio_exp1 1 GPIO_ACTIVE_HIGH>;
163		enable-active-high;
164	};
165
166	reg_lcd_reset: regulator-lcd-reset {
167		compatible = "regulator-fixed";
168		regulator-name = "nLCD_RESET";
169		regulator-min-microvolt = <3300000>;
170		regulator-max-microvolt = <3300000>;
171		gpio = <&gpio5 3 GPIO_ACTIVE_HIGH>;
172		enable-active-high;
173		vin-supply = <&reg_lcd>;
174	};
175
176	reg_cam0: regulator-cam0 {
177		compatible = "regulator-fixed";
178		regulator-name = "reg_cam0";
179		regulator-min-microvolt = <1800000>;
180		regulator-max-microvolt = <1800000>;
181		gpio = <&gpio_exp2 2 GPIO_ACTIVE_HIGH>;
182		enable-active-high;
183	};
184
185	reg_cam1: regulator-cam1 {
186		compatible = "regulator-fixed";
187		regulator-name = "reg_cam1";
188		regulator-min-microvolt = <1800000>;
189		regulator-max-microvolt = <1800000>;
190		gpio = <&gpio_exp2 5 GPIO_ACTIVE_HIGH>;
191		enable-active-high;
192		startup-delay-us = <100000>;
193	};
194
195	sound_card {
196		compatible = "audio-graph-card";
197		label = "rcar-sound";
198		dais = <&rsnd_port0>, <&rsnd_port1>;
199	};
200
201	vccq_sdhi0: regulator-vccq-sdhi0 {
202		compatible = "regulator-gpio";
203
204		regulator-name = "SDHI0 VccQ";
205		regulator-min-microvolt = <1800000>;
206		regulator-max-microvolt = <3300000>;
207
208		gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
209		gpios-states = <1>;
210		states = <3300000 1>, <1800000 0>;
211		regulator-always-on;
212	};
213
214	/* External DU dot clocks */
215	x302_clk: x302-clock {
216		compatible = "fixed-clock";
217		#clock-cells = <0>;
218		clock-frequency = <33000000>;
219	};
220
221	x304_clk: x304-clock {
222		compatible = "fixed-clock";
223		#clock-cells = <0>;
224		clock-frequency = <25000000>;
225	};
226};
227
228&audio_clk_a {
229	clock-frequency = <24576000>;
230	assigned-clocks = <&versaclock6_bb 4>;
231	assigned-clock-rates = <24576000>;
232};
233
234&audio_clk_b {
235	clock-frequency = <22579200>;
236};
237
238&can0 {
239	pinctrl-0 = <&can0_pins>;
240	pinctrl-names = "default";
241	renesas,can-clock-select = <0x0>;
242	status = "okay";
243};
244
245&can1 {
246	pinctrl-0 = <&can1_pins>;
247	pinctrl-names = "default";
248	renesas,can-clock-select = <0x0>;
249	status = "okay";
250};
251
252&du {
253	pinctrl-0 = <&du_pins>;
254	pinctrl-names = "default";
255	status = "okay";
256
257	clocks = <&cpg CPG_MOD 724>,
258		<&cpg CPG_MOD 723>,
259		<&cpg CPG_MOD 722>,
260		<&versaclock5 1>,
261		<&x302_clk>,
262		<&versaclock5 2>;
263	clock-names = "du.0", "du.1", "du.2",
264		"dclkin.0", "dclkin.1", "dclkin.2";
265};
266
267&du_out_rgb {
268	remote-endpoint = <&rgb_panel>;
269};
270
271&ehci0 {
272	dr_mode = "otg";
273	status = "okay";
274	clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
275};
276
277&ehci1 {
278	status = "okay";
279	clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
280};
281
282&hdmi0 {
283	status = "okay";
284	ports {
285		#address-cells = <1>;
286		#size-cells = <0>;
287		port@0 {
288			reg = <0>;
289			dw_hdmi0_in: endpoint {
290				remote-endpoint = <&du_out_hdmi0>;
291			};
292		};
293		port@1 {
294			reg = <1>;
295			rcar_dw_hdmi0_out: endpoint {
296				remote-endpoint = <&hdmi0_con>;
297			};
298		};
299		port@2 {
300			reg = <2>;
301			dw_hdmi0_snd_in: endpoint {
302				remote-endpoint = <&rsnd_endpoint1>;
303			};
304		};
305	};
306};
307
308&hscif1 {
309	pinctrl-0 = <&hscif1_pins>;
310	pinctrl-names = "default";
311	uart-has-rtscts;
312	status = "okay";
313};
314
315&hsusb {
316	dr_mode = "otg";
317	status = "okay";
318};
319
320&i2c2 {
321	status = "okay";
322	clock-frequency = <100000>;
323	pinctrl-0 = <&i2c2_pins>;
324	pinctrl-names = "default";
325
326	gpio_exp2: gpio@21 {
327		compatible = "onnn,pca9654";
328		reg = <0x21>;
329		gpio-controller;
330		#gpio-cells = <2>;
331	};
332
333	gpio_exp3: gpio@22 {
334		compatible = "onnn,pca9654";
335		reg = <0x22>;
336		gpio-controller;
337		#gpio-cells = <2>;
338	};
339
340	gpio_exp4: gpio@23 {
341		compatible = "onnn,pca9654";
342		reg = <0x23>;
343		gpio-controller;
344		#gpio-cells = <2>;
345	};
346
347	versaclock6_bb: clock-controller@6a {
348		compatible = "idt,5p49v6965";
349		reg = <0x6a>;
350		#clock-cells = <1>;
351		clocks = <&x304_clk>;
352		clock-names = "xin";
353		/* CSI0_MCLK, CSI1_MCLK, AUDIO_CLKIN, USB_HUB_MCLK_BB */
354		assigned-clocks = <&versaclock6_bb 1>,
355				   <&versaclock6_bb 2>,
356				   <&versaclock6_bb 3>,
357				   <&versaclock6_bb 4>;
358		assigned-clock-rates =	<24000000>, <24000000>, <24000000>, <24576000>;
359	};
360};
361
362&i2c0 {
363	status = "okay";
364	clock-frequency = <400000>;
365
366	pinctrl-0 = <&i2c0_pins>;
367	pinctrl-names = "default";
368};
369
370&i2c5 {
371	status = "okay";
372	clock-frequency = <100000>;
373	pinctrl-0 = <&i2c5_pins>;
374	pinctrl-names = "default";
375
376	codec: wm8962@1a {
377		compatible = "wlf,wm8962";
378		reg = <0x1a>;
379		DCVDD-supply = <&reg_audio>;
380		DBVDD-supply = <&reg_audio>;
381		AVDD-supply = <&reg_audio>;
382		CPVDD-supply = <&reg_audio>;
383		MICVDD-supply = <&reg_audio>;
384		PLLVDD-supply = <&reg_audio>;
385		SPKVDD1-supply = <&reg_audio>;
386		SPKVDD2-supply = <&reg_audio>;
387		gpio-cfg = <
388			0x0000 /* 0:Default */
389			0x0000 /* 1:Default */
390			0x0000 /* 2:Default */
391			0x0000 /* 3:Default */
392			0x0000 /* 4:Default */
393			0x0000 /* 5:Default */
394		>;
395		port {
396			wm8962_endpoint: endpoint {
397				remote-endpoint = <&rsnd_endpoint0>;
398			};
399		};
400	};
401
402	touchscreen@26 {
403		compatible = "ilitek,ili2117";
404		reg = <0x26>;
405		interrupt-parent = <&gpio5>;
406		interrupts = <9 IRQ_TYPE_EDGE_RISING>;
407		wakeup-source;
408	};
409
410	hd3ss3220@47 {
411		compatible = "ti,hd3ss3220";
412		reg = <0x47>;
413		interrupt-parent = <&gpio6>;
414		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
415
416		connector {
417			compatible = "usb-c-connector";
418			label = "USB-C";
419			data-role = "dual";
420
421			ports {
422				#address-cells = <1>;
423				#size-cells = <0>;
424
425				port@1 {
426					reg = <1>;
427					hd3ss3220_ep: endpoint {
428						remote-endpoint = <&usb3_role_switch>;
429					};
430				};
431			};
432		};
433	};
434
435	gpio_exp1: gpio@70 {
436		compatible = "nxp,pca9538";
437		reg = <0x70>;
438		gpio-controller;
439		#gpio-cells = <2>;
440		gpio-line-names = "lcd_reset", "lcd_pwr", "lcd_select",
441				  "backlight-enable", "Touch_shdwn",
442				  "LCD_H_pol", "lcd_V_pol";
443	};
444};
445
446&lvds0 {
447	status = "okay";
448
449	ports {
450		port@1 {
451			lvds0_out: endpoint {
452				remote-endpoint = <&panel_in>;
453			};
454		};
455	};
456};
457
458&ohci0 {
459	dr_mode = "otg";
460	status = "okay";
461};
462
463&ohci1 {
464	status = "okay";
465};
466
467&pciec0 {
468	status = "okay";
469};
470
471&pciec1 {
472	status = "okay";
473};
474
475&pcie_bus_clk {
476	clock-frequency = <100000000>;
477};
478
479&pfc {
480	can0_pins: can0 {
481		groups = "can0_data_a";
482		function = "can0";
483	};
484
485	can1_pins: can1 {
486		groups = "can1_data";
487		function = "can1";
488	};
489
490	du_pins: du {
491		groups = "du_rgb888", "du_sync", "du_clk_out_1", "du_disp";
492		function = "du";
493	};
494
495	i2c2_pins: i2c2 {
496		groups = "i2c2_a";
497		function = "i2c2";
498	};
499
500	i2c5_pins: i2c5 {
501		groups = "i2c5";
502		function = "i2c5";
503	};
504
505	led_pins: leds {
506		/* GP_0_4 , AVS1, AVS2, GP_7_3 */
507		pins = "GP_0_4", "GP_7_0", "GP_7_1", "GP_7_3";
508		bias-pull-down;
509	};
510
511	pwm0_pins: pwm0 {
512		groups = "pwm0";
513		function = "pwm0";
514	};
515
516	pwm2_pins: pwm2 {
517		groups = "pwm2_a";
518		function = "pwm2_a";
519	};
520
521	sdhi0_pins: sd0 {
522		groups = "sdhi0_data4", "sdhi0_ctrl";
523		function = "sdhi0";
524		power-source = <3300>;
525	};
526
527	sdhi0_pins_uhs: sd0_uhs {
528		groups = "sdhi0_data4", "sdhi0_ctrl";
529		function = "sdhi0";
530		power-source = <1800>;
531	};
532
533	sound_pins: sound {
534		groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
535		function = "ssi";
536	};
537
538	sound_clk_pins: sound_clk {
539		groups = "audio_clk_a_a";
540		function = "audio_clk";
541	};
542
543	usb0_pins: usb0 {
544		mux {
545			groups = "usb0";
546			function = "usb0";
547		};
548	};
549
550	usb1_pins: usb1 {
551		mux {
552			groups = "usb1";
553			function = "usb1";
554		};
555	};
556
557	usb30_pins: usb30 {
558		mux {
559			groups = "usb30";
560			function = "usb30";
561		};
562	};
563};
564
565&pwm0 {
566	pinctrl-0 = <&pwm0_pins>;
567	pinctrl-names = "default";
568	status = "okay";
569};
570
571&pwm2 {
572	pinctrl-0 = <&pwm2_pins>;
573	pinctrl-names = "default";
574	status = "okay";
575};
576
577&rcar_sound {
578	pinctrl-0 = <&sound_pins &sound_clk_pins>;
579	pinctrl-names = "default";
580
581	/* Single DAI */
582	#sound-dai-cells = <0>;
583
584	/* audio_clkout0/1/2/3 */
585	#clock-cells = <1>;
586	clock-frequency = <11289600>;
587
588	status = "okay";
589
590	clocks = <&cpg CPG_MOD 1005>,
591		 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
592		 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
593		 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
594		 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
595		 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
596		 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
597		 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
598		 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
599		 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
600		 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
601		 <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
602		 <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
603		 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
604		 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
605		 <&cpg CPG_CORE R8A774A1_CLK_S0D4>;
606
607	ports {
608		#address-cells = <1>;
609		#size-cells = <0>;
610		rsnd_port0: port@0 {
611			reg = <0>;
612			rsnd_endpoint0: endpoint {
613				remote-endpoint = <&wm8962_endpoint>;
614
615				dai-format = "i2s";
616				bitclock-master = <&rsnd_endpoint0>;
617				frame-master = <&rsnd_endpoint0>;
618
619				playback = <&ssi1 &dvc1 &src1>;
620				capture = <&ssi0>;
621			};
622		};
623		rsnd_port1: port@1 {
624		    reg = <0x01>;
625			rsnd_endpoint1: endpoint {
626				remote-endpoint = <&dw_hdmi0_snd_in>;
627
628				dai-format = "i2s";
629				bitclock-master = <&rsnd_endpoint1>;
630				frame-master = <&rsnd_endpoint1>;
631
632				playback = <&ssi2>;
633			};
634		};
635	};
636};
637
638&rwdt {
639	status = "okay";
640	timeout-sec = <60>;
641};
642
643&scif0 {
644	pinctrl-0 = <&scif0_pins>;
645	pinctrl-names = "default";
646	status = "okay";
647};
648
649&scif5 {
650	pinctrl-0 = <&scif5_pins>;
651	pinctrl-names = "default";
652	status = "okay";
653};
654
655&scif_clk {
656	clock-frequency = <14745600>;
657};
658
659&sdhi0 {
660	pinctrl-0 = <&sdhi0_pins>;
661	pinctrl-1 = <&sdhi0_pins_uhs>;
662	pinctrl-names = "default", "state_uhs";
663	vmmc-supply = <&reg_3p3v>;
664	vqmmc-supply = <&vccq_sdhi0>;
665	cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
666	bus-width = <4>;
667	sd-uhs-sdr50;
668	sd-uhs-sdr104;
669	status = "okay";
670};
671
672&ssi1 {
673	shared-pin;
674};
675
676&tmu0 {
677	status = "okay";
678};
679
680&tmu1 {
681	status = "okay";
682};
683
684&tmu2 {
685	status = "okay";
686};
687
688&tmu3 {
689	status = "okay";
690};
691
692&tmu4 {
693	status = "okay";
694};
695
696&usb2_phy0 {
697	pinctrl-0 = <&usb0_pins>;
698	pinctrl-names = "default";
699	status = "okay";
700};
701
702&usb2_phy1 {
703	pinctrl-0 = <&usb1_pins>;
704	pinctrl-names = "default";
705	status = "okay";
706};
707
708&usb3_peri0 {
709	companion = <&xhci0>;
710	status = "okay";
711	usb-role-switch;
712
713	port {
714		usb3_role_switch: endpoint {
715			remote-endpoint = <&hd3ss3220_ep>;
716		};
717	};
718};
719
720&usb3_phy0 {
721	status = "okay";
722};
723
724&vin0 {
725	status = "okay";
726};
727&vin1 {
728	status = "okay";
729};
730&vin2 {
731	status = "okay";
732};
733&vin3 {
734	status = "okay";
735};
736&vin4 {
737	status = "okay";
738};
739&vin5 {
740	status = "okay";
741};
742&vin6 {
743	status = "okay";
744};
745&vin7 {
746	status = "okay";
747};
748
749&xhci0
750{
751	pinctrl-0 = <&usb30_pins>;
752	pinctrl-names = "default";
753	status = "okay";
754};
755