1*724ba675SRob Herring// SPDX-License-Identifier: GPL-2.0
2*724ba675SRob Herring/*
3*724ba675SRob Herring * Device Tree Source for the iWave-RZ/G1H Qseven board
4*724ba675SRob Herring *
5*724ba675SRob Herring * Copyright (C) 2020 Renesas Electronics Corp.
6*724ba675SRob Herring */
7*724ba675SRob Herring
8*724ba675SRob Herring/*
9*724ba675SRob Herring * SSI-SGTL5000
10*724ba675SRob Herring *
11*724ba675SRob Herring * This command is required when Playback/Capture
12*724ba675SRob Herring *
13*724ba675SRob Herring *      amixer set "DVC Out" 100%
14*724ba675SRob Herring *      amixer set "DVC In" 100%
15*724ba675SRob Herring *
16*724ba675SRob Herring * You can use Mute
17*724ba675SRob Herring *
18*724ba675SRob Herring *      amixer set "DVC Out Mute" on
19*724ba675SRob Herring *      amixer set "DVC In Mute" on
20*724ba675SRob Herring *
21*724ba675SRob Herring * You can use Volume Ramp
22*724ba675SRob Herring *
23*724ba675SRob Herring *      amixer set "DVC Out Ramp Up Rate"   "0.125 dB/64 steps"
24*724ba675SRob Herring *      amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
25*724ba675SRob Herring *      amixer set "DVC Out Ramp" on
26*724ba675SRob Herring *      aplay xxx.wav &
27*724ba675SRob Herring *      amixer set "DVC Out"  80%  // Volume Down
28*724ba675SRob Herring *      amixer set "DVC Out" 100%  // Volume Up
29*724ba675SRob Herring */
30*724ba675SRob Herring
31*724ba675SRob Herring/dts-v1/;
32*724ba675SRob Herring#include "r8a7742-iwg21m.dtsi"
33*724ba675SRob Herring#include <dt-bindings/pwm/pwm.h>
34*724ba675SRob Herring
35*724ba675SRob Herring/ {
36*724ba675SRob Herring	model = "iWave Systems RainboW-G21D-Qseven board based on RZ/G1H";
37*724ba675SRob Herring	compatible = "iwave,g21d", "iwave,g21m", "renesas,r8a7742";
38*724ba675SRob Herring
39*724ba675SRob Herring	aliases {
40*724ba675SRob Herring		serial2 = &scifa2;
41*724ba675SRob Herring		serial4 = &scifb2;
42*724ba675SRob Herring		ethernet0 = &avb;
43*724ba675SRob Herring	};
44*724ba675SRob Herring
45*724ba675SRob Herring	chosen {
46*724ba675SRob Herring		bootargs = "ignore_loglevel root=/dev/mmcblk0p1 rw rootwait";
47*724ba675SRob Herring		stdout-path = "serial2:115200n8";
48*724ba675SRob Herring	};
49*724ba675SRob Herring
50*724ba675SRob Herring	audio_clock: audio_clock {
51*724ba675SRob Herring		compatible = "fixed-clock";
52*724ba675SRob Herring		#clock-cells = <0>;
53*724ba675SRob Herring		clock-frequency = <26000000>;
54*724ba675SRob Herring	};
55*724ba675SRob Herring
56*724ba675SRob Herring	lcd_backlight: backlight {
57*724ba675SRob Herring		compatible = "pwm-backlight";
58*724ba675SRob Herring		pwms = <&tpu 2 5000000 0>;
59*724ba675SRob Herring		brightness-levels = <0 4 8 16 32 64 128 255>;
60*724ba675SRob Herring		pinctrl-0 = <&backlight_pins>;
61*724ba675SRob Herring		pinctrl-names = "default";
62*724ba675SRob Herring		default-brightness-level = <7>;
63*724ba675SRob Herring		enable-gpios = <&gpio3 11 GPIO_ACTIVE_HIGH>;
64*724ba675SRob Herring	};
65*724ba675SRob Herring
66*724ba675SRob Herring	leds {
67*724ba675SRob Herring		compatible = "gpio-leds";
68*724ba675SRob Herring
69*724ba675SRob Herring		sdhi2_led {
70*724ba675SRob Herring			label = "sdio-led";
71*724ba675SRob Herring			gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>;
72*724ba675SRob Herring			linux,default-trigger = "mmc1";
73*724ba675SRob Herring		};
74*724ba675SRob Herring	};
75*724ba675SRob Herring
76*724ba675SRob Herring	lvds-receiver {
77*724ba675SRob Herring		compatible = "ti,ds90cf384a", "lvds-decoder";
78*724ba675SRob Herring		power-supply = <&vcc_3v3_tft1>;
79*724ba675SRob Herring
80*724ba675SRob Herring		ports {
81*724ba675SRob Herring			#address-cells = <1>;
82*724ba675SRob Herring			#size-cells = <0>;
83*724ba675SRob Herring
84*724ba675SRob Herring			port@0 {
85*724ba675SRob Herring				reg = <0>;
86*724ba675SRob Herring				lvds_receiver_in: endpoint {
87*724ba675SRob Herring					remote-endpoint = <&lvds0_out>;
88*724ba675SRob Herring				};
89*724ba675SRob Herring			};
90*724ba675SRob Herring			port@1 {
91*724ba675SRob Herring				reg = <1>;
92*724ba675SRob Herring				lvds_receiver_out: endpoint {
93*724ba675SRob Herring					remote-endpoint = <&panel_in>;
94*724ba675SRob Herring				};
95*724ba675SRob Herring			};
96*724ba675SRob Herring		};
97*724ba675SRob Herring	};
98*724ba675SRob Herring
99*724ba675SRob Herring	panel {
100*724ba675SRob Herring		compatible = "edt,etm0700g0dh6";
101*724ba675SRob Herring		backlight = <&lcd_backlight>;
102*724ba675SRob Herring		power-supply = <&vcc_3v3_tft1>;
103*724ba675SRob Herring
104*724ba675SRob Herring		port {
105*724ba675SRob Herring			panel_in: endpoint {
106*724ba675SRob Herring				remote-endpoint = <&lvds_receiver_out>;
107*724ba675SRob Herring			};
108*724ba675SRob Herring		};
109*724ba675SRob Herring	};
110*724ba675SRob Herring
111*724ba675SRob Herring	reg_1p5v: 1p5v {
112*724ba675SRob Herring		compatible = "regulator-fixed";
113*724ba675SRob Herring		regulator-name = "1P5V";
114*724ba675SRob Herring		regulator-min-microvolt = <1500000>;
115*724ba675SRob Herring		regulator-max-microvolt = <1500000>;
116*724ba675SRob Herring		regulator-always-on;
117*724ba675SRob Herring	};
118*724ba675SRob Herring
119*724ba675SRob Herring	rsnd_sgtl5000: sound {
120*724ba675SRob Herring		compatible = "simple-audio-card";
121*724ba675SRob Herring		simple-audio-card,format = "i2s";
122*724ba675SRob Herring		simple-audio-card,bitclock-master = <&sndcodec>;
123*724ba675SRob Herring		simple-audio-card,frame-master = <&sndcodec>;
124*724ba675SRob Herring
125*724ba675SRob Herring		sndcpu: simple-audio-card,cpu {
126*724ba675SRob Herring			sound-dai = <&rcar_sound>;
127*724ba675SRob Herring		};
128*724ba675SRob Herring
129*724ba675SRob Herring		sndcodec: simple-audio-card,codec {
130*724ba675SRob Herring			sound-dai = <&sgtl5000>;
131*724ba675SRob Herring		};
132*724ba675SRob Herring	};
133*724ba675SRob Herring
134*724ba675SRob Herring	vcc_3v3_tft1: regulator-panel {
135*724ba675SRob Herring		compatible = "regulator-fixed";
136*724ba675SRob Herring
137*724ba675SRob Herring		regulator-name = "vcc-3v3-tft1";
138*724ba675SRob Herring		regulator-min-microvolt = <3300000>;
139*724ba675SRob Herring		regulator-max-microvolt = <3300000>;
140*724ba675SRob Herring		enable-active-high;
141*724ba675SRob Herring		startup-delay-us = <500>;
142*724ba675SRob Herring		gpio = <&gpio5 28 GPIO_ACTIVE_HIGH>;
143*724ba675SRob Herring	};
144*724ba675SRob Herring
145*724ba675SRob Herring	vcc_sdhi2: regulator-vcc-sdhi2 {
146*724ba675SRob Herring		compatible = "regulator-fixed";
147*724ba675SRob Herring
148*724ba675SRob Herring		regulator-name = "SDHI2 Vcc";
149*724ba675SRob Herring		regulator-min-microvolt = <3300000>;
150*724ba675SRob Herring		regulator-max-microvolt = <3300000>;
151*724ba675SRob Herring
152*724ba675SRob Herring		gpio = <&gpio1 27 GPIO_ACTIVE_LOW>;
153*724ba675SRob Herring	};
154*724ba675SRob Herring
155*724ba675SRob Herring	vccq_sdhi2: regulator-vccq-sdhi2 {
156*724ba675SRob Herring		compatible = "regulator-gpio";
157*724ba675SRob Herring
158*724ba675SRob Herring		regulator-name = "SDHI2 VccQ";
159*724ba675SRob Herring		regulator-min-microvolt = <1800000>;
160*724ba675SRob Herring		regulator-max-microvolt = <3300000>;
161*724ba675SRob Herring
162*724ba675SRob Herring		gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
163*724ba675SRob Herring		gpios-states = <1>;
164*724ba675SRob Herring		states = <3300000 1>, <1800000 0>;
165*724ba675SRob Herring	};
166*724ba675SRob Herring};
167*724ba675SRob Herring
168*724ba675SRob Herring&avb {
169*724ba675SRob Herring	pinctrl-0 = <&avb_pins>;
170*724ba675SRob Herring	pinctrl-names = "default";
171*724ba675SRob Herring
172*724ba675SRob Herring	phy-handle = <&phy3>;
173*724ba675SRob Herring	phy-mode = "gmii";
174*724ba675SRob Herring	renesas,no-ether-link;
175*724ba675SRob Herring	status = "okay";
176*724ba675SRob Herring
177*724ba675SRob Herring	phy3: ethernet-phy@3 {
178*724ba675SRob Herring		compatible = "ethernet-phy-id0022.1622",
179*724ba675SRob Herring			     "ethernet-phy-ieee802.3-c22";
180*724ba675SRob Herring		reg = <3>;
181*724ba675SRob Herring		micrel,led-mode = <1>;
182*724ba675SRob Herring	};
183*724ba675SRob Herring};
184*724ba675SRob Herring
185*724ba675SRob Herring&i2c2 {
186*724ba675SRob Herring	pinctrl-0 = <&i2c2_pins>;
187*724ba675SRob Herring	pinctrl-names = "default";
188*724ba675SRob Herring
189*724ba675SRob Herring	status = "okay";
190*724ba675SRob Herring	clock-frequency = <400000>;
191*724ba675SRob Herring
192*724ba675SRob Herring	sgtl5000: codec@a {
193*724ba675SRob Herring		compatible = "fsl,sgtl5000";
194*724ba675SRob Herring		#sound-dai-cells = <0>;
195*724ba675SRob Herring		reg = <0x0a>;
196*724ba675SRob Herring		clocks = <&audio_clock>;
197*724ba675SRob Herring		VDDA-supply = <&reg_3p3v>;
198*724ba675SRob Herring		VDDIO-supply = <&reg_3p3v>;
199*724ba675SRob Herring		VDDD-supply = <&reg_1p5v>;
200*724ba675SRob Herring	};
201*724ba675SRob Herring
202*724ba675SRob Herring	touch: touchpanel@38 {
203*724ba675SRob Herring		compatible = "edt,edt-ft5406";
204*724ba675SRob Herring		reg = <0x38>;
205*724ba675SRob Herring		interrupt-parent = <&gpio0>;
206*724ba675SRob Herring		interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
207*724ba675SRob Herring		/* GP1_29 is also shared with audio codec reset pin */
208*724ba675SRob Herring		reset-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
209*724ba675SRob Herring		vcc-supply = <&vcc_3v3_tft1>;
210*724ba675SRob Herring	};
211*724ba675SRob Herring};
212*724ba675SRob Herring
213*724ba675SRob Herring&can1 {
214*724ba675SRob Herring	pinctrl-0 = <&can1_pins>;
215*724ba675SRob Herring	pinctrl-names = "default";
216*724ba675SRob Herring
217*724ba675SRob Herring	status = "okay";
218*724ba675SRob Herring};
219*724ba675SRob Herring
220*724ba675SRob Herring&cmt0 {
221*724ba675SRob Herring	status = "okay";
222*724ba675SRob Herring};
223*724ba675SRob Herring
224*724ba675SRob Herring&du {
225*724ba675SRob Herring	status = "okay";
226*724ba675SRob Herring};
227*724ba675SRob Herring
228*724ba675SRob Herring&gpio0 {
229*724ba675SRob Herring	touch-interrupt-hog {
230*724ba675SRob Herring		gpio-hog;
231*724ba675SRob Herring		gpios = <24 GPIO_ACTIVE_LOW>;
232*724ba675SRob Herring		input;
233*724ba675SRob Herring	};
234*724ba675SRob Herring};
235*724ba675SRob Herring
236*724ba675SRob Herring&gpio1 {
237*724ba675SRob Herring	can-trx-en-hog {
238*724ba675SRob Herring		gpio-hog;
239*724ba675SRob Herring		gpios = <28 GPIO_ACTIVE_HIGH>;
240*724ba675SRob Herring		output-low;
241*724ba675SRob Herring		line-name = "can-trx-en-gpio";
242*724ba675SRob Herring	};
243*724ba675SRob Herring};
244*724ba675SRob Herring
245*724ba675SRob Herring&hsusb {
246*724ba675SRob Herring	pinctrl-0 = <&usb0_pins>;
247*724ba675SRob Herring	pinctrl-names = "default";
248*724ba675SRob Herring	status = "okay";
249*724ba675SRob Herring};
250*724ba675SRob Herring
251*724ba675SRob Herring&lvds0 {
252*724ba675SRob Herring	status = "okay";
253*724ba675SRob Herring	ports {
254*724ba675SRob Herring		port@1 {
255*724ba675SRob Herring			lvds0_out: endpoint {
256*724ba675SRob Herring				remote-endpoint = <&lvds_receiver_in>;
257*724ba675SRob Herring			};
258*724ba675SRob Herring		};
259*724ba675SRob Herring	};
260*724ba675SRob Herring};
261*724ba675SRob Herring
262*724ba675SRob Herring&msiof0 {
263*724ba675SRob Herring	pinctrl-0 = <&msiof0_pins>;
264*724ba675SRob Herring	pinctrl-names = "default";
265*724ba675SRob Herring	cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
266*724ba675SRob Herring
267*724ba675SRob Herring	status = "okay";
268*724ba675SRob Herring
269*724ba675SRob Herring	flash1: flash@0 {
270*724ba675SRob Herring		compatible = "sst,sst25vf016b", "jedec,spi-nor";
271*724ba675SRob Herring		reg = <0>;
272*724ba675SRob Herring		spi-max-frequency = <50000000>;
273*724ba675SRob Herring		m25p,fast-read;
274*724ba675SRob Herring
275*724ba675SRob Herring		partitions {
276*724ba675SRob Herring			compatible = "fixed-partitions";
277*724ba675SRob Herring			#address-cells = <1>;
278*724ba675SRob Herring			#size-cells = <1>;
279*724ba675SRob Herring
280*724ba675SRob Herring			partition@0 {
281*724ba675SRob Herring				label = "user";
282*724ba675SRob Herring				reg = <0x00000000 0x00200000>;
283*724ba675SRob Herring			};
284*724ba675SRob Herring		};
285*724ba675SRob Herring	};
286*724ba675SRob Herring};
287*724ba675SRob Herring
288*724ba675SRob Herring&pci0 {
289*724ba675SRob Herring	pinctrl-0 = <&usb0_pins>;
290*724ba675SRob Herring	pinctrl-names = "default";
291*724ba675SRob Herring	/* Disable hsusb to enable USB2.0 host mode support on J2 */
292*724ba675SRob Herring	/* status = "okay"; */
293*724ba675SRob Herring};
294*724ba675SRob Herring
295*724ba675SRob Herring&pci1 {
296*724ba675SRob Herring	pinctrl-0 = <&usb1_pins>;
297*724ba675SRob Herring	pinctrl-names = "default";
298*724ba675SRob Herring	status = "okay";
299*724ba675SRob Herring};
300*724ba675SRob Herring
301*724ba675SRob Herring&pci2 {
302*724ba675SRob Herring	/* Disable xhci to enable USB2.0 host mode support on J23 bottom port */
303*724ba675SRob Herring	/* status = "okay"; */
304*724ba675SRob Herring};
305*724ba675SRob Herring
306*724ba675SRob Herring&pcie_bus_clk {
307*724ba675SRob Herring	clock-frequency = <100000000>;
308*724ba675SRob Herring};
309*724ba675SRob Herring
310*724ba675SRob Herring&pciec {
311*724ba675SRob Herring	/* SW2[6] determines which connector is activated
312*724ba675SRob Herring	 * ON = PCIe X4 (connector-J7)
313*724ba675SRob Herring	 * OFF = mini-PCIe (connector-J26)
314*724ba675SRob Herring	 */
315*724ba675SRob Herring	status = "okay";
316*724ba675SRob Herring};
317*724ba675SRob Herring
318*724ba675SRob Herring&pfc {
319*724ba675SRob Herring	avb_pins: avb {
320*724ba675SRob Herring		groups = "avb_mdio", "avb_gmii";
321*724ba675SRob Herring		function = "avb";
322*724ba675SRob Herring	};
323*724ba675SRob Herring
324*724ba675SRob Herring	backlight_pins: backlight {
325*724ba675SRob Herring		groups = "tpu0_to2";
326*724ba675SRob Herring		function = "tpu0";
327*724ba675SRob Herring	};
328*724ba675SRob Herring
329*724ba675SRob Herring	can1_pins: can1 {
330*724ba675SRob Herring		groups = "can1_data_b";
331*724ba675SRob Herring		function = "can1";
332*724ba675SRob Herring	};
333*724ba675SRob Herring
334*724ba675SRob Herring	i2c2_pins: i2c2 {
335*724ba675SRob Herring		groups = "i2c2_b";
336*724ba675SRob Herring		function = "i2c2";
337*724ba675SRob Herring	};
338*724ba675SRob Herring
339*724ba675SRob Herring	msiof0_pins: msiof0 {
340*724ba675SRob Herring		groups = "msiof0_clk", "msiof0_sync", "msiof0_tx", "msiof0_rx";
341*724ba675SRob Herring		function = "msiof0";
342*724ba675SRob Herring	};
343*724ba675SRob Herring
344*724ba675SRob Herring	scifa2_pins: scifa2 {
345*724ba675SRob Herring		groups = "scifa2_data_c";
346*724ba675SRob Herring		function = "scifa2";
347*724ba675SRob Herring	};
348*724ba675SRob Herring
349*724ba675SRob Herring	scifb2_pins: scifb2 {
350*724ba675SRob Herring		groups = "scifb2_data", "scifb2_ctrl";
351*724ba675SRob Herring		function = "scifb2";
352*724ba675SRob Herring	};
353*724ba675SRob Herring
354*724ba675SRob Herring	sdhi2_pins: sd2 {
355*724ba675SRob Herring		groups = "sdhi2_data4", "sdhi2_ctrl";
356*724ba675SRob Herring		function = "sdhi2";
357*724ba675SRob Herring		power-source = <3300>;
358*724ba675SRob Herring	};
359*724ba675SRob Herring
360*724ba675SRob Herring	sdhi2_pins_uhs: sd2_uhs {
361*724ba675SRob Herring		groups = "sdhi2_data4", "sdhi2_ctrl";
362*724ba675SRob Herring		function = "sdhi2";
363*724ba675SRob Herring		power-source = <1800>;
364*724ba675SRob Herring	};
365*724ba675SRob Herring
366*724ba675SRob Herring	sound_pins: sound {
367*724ba675SRob Herring		groups = "ssi34_ctrl", "ssi3_data", "ssi4_data";
368*724ba675SRob Herring		function = "ssi";
369*724ba675SRob Herring	};
370*724ba675SRob Herring
371*724ba675SRob Herring	usb0_pins: usb0 {
372*724ba675SRob Herring		groups = "usb0";
373*724ba675SRob Herring		function = "usb0";
374*724ba675SRob Herring	};
375*724ba675SRob Herring
376*724ba675SRob Herring	usb1_pins: usb1 {
377*724ba675SRob Herring		groups = "usb1_pwen";
378*724ba675SRob Herring		function = "usb1";
379*724ba675SRob Herring	};
380*724ba675SRob Herring};
381*724ba675SRob Herring
382*724ba675SRob Herring&rcar_sound {
383*724ba675SRob Herring	pinctrl-0 = <&sound_pins>;
384*724ba675SRob Herring	pinctrl-names = "default";
385*724ba675SRob Herring	status = "okay";
386*724ba675SRob Herring
387*724ba675SRob Herring	/* Single DAI */
388*724ba675SRob Herring	#sound-dai-cells = <0>;
389*724ba675SRob Herring
390*724ba675SRob Herring	rcar_sound,dai {
391*724ba675SRob Herring		dai0 {
392*724ba675SRob Herring			playback = <&ssi4>, <&src4>, <&dvc1>;
393*724ba675SRob Herring			capture = <&ssi3>, <&src3>, <&dvc0>;
394*724ba675SRob Herring		};
395*724ba675SRob Herring	};
396*724ba675SRob Herring};
397*724ba675SRob Herring
398*724ba675SRob Herring&rwdt {
399*724ba675SRob Herring	timeout-sec = <60>;
400*724ba675SRob Herring	status = "okay";
401*724ba675SRob Herring};
402*724ba675SRob Herring
403*724ba675SRob Herring&scifa2 {
404*724ba675SRob Herring	pinctrl-0 = <&scifa2_pins>;
405*724ba675SRob Herring	pinctrl-names = "default";
406*724ba675SRob Herring
407*724ba675SRob Herring	status = "okay";
408*724ba675SRob Herring};
409*724ba675SRob Herring
410*724ba675SRob Herring&scifb2 {
411*724ba675SRob Herring	pinctrl-0 = <&scifb2_pins>;
412*724ba675SRob Herring	pinctrl-names = "default";
413*724ba675SRob Herring
414*724ba675SRob Herring	uart-has-rtscts;
415*724ba675SRob Herring	status = "okay";
416*724ba675SRob Herring};
417*724ba675SRob Herring
418*724ba675SRob Herring&sdhi2 {
419*724ba675SRob Herring	pinctrl-0 = <&sdhi2_pins>;
420*724ba675SRob Herring	pinctrl-1 = <&sdhi2_pins_uhs>;
421*724ba675SRob Herring	pinctrl-names = "default", "state_uhs";
422*724ba675SRob Herring
423*724ba675SRob Herring	vmmc-supply = <&vcc_sdhi2>;
424*724ba675SRob Herring	vqmmc-supply = <&vccq_sdhi2>;
425*724ba675SRob Herring	cd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
426*724ba675SRob Herring	wp-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
427*724ba675SRob Herring	sd-uhs-sdr50;
428*724ba675SRob Herring	status = "okay";
429*724ba675SRob Herring};
430*724ba675SRob Herring
431*724ba675SRob Herring&ssi4 {
432*724ba675SRob Herring	shared-pin;
433*724ba675SRob Herring};
434*724ba675SRob Herring
435*724ba675SRob Herring&tpu {
436*724ba675SRob Herring	status = "okay";
437*724ba675SRob Herring};
438*724ba675SRob Herring
439*724ba675SRob Herring&usbphy {
440*724ba675SRob Herring	status = "okay";
441*724ba675SRob Herring};
442*724ba675SRob Herring
443*724ba675SRob Herring&xhci {
444*724ba675SRob Herring	status = "okay";
445*724ba675SRob Herring};
446