1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the RZ/G2L SMARC EVK common parts
4 *
5 * Copyright (C) 2021 Renesas Electronics Corp.
6 */
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
10
11/*
12 * SSI-WM8978
13 *
14 * This command is required when Playback/Capture
15 *
16 *	amixer cset name='Left Input Mixer L2 Switch' on
17 *	amixer cset name='Right Input Mixer R2 Switch' on
18 *	amixer cset name='Headphone Playback Volume' 100
19 *	amixer cset name='PCM Volume' 100%
20 *	amixer cset name='Input PGA Volume' 25
21 *
22 */
23
24/ {
25	aliases {
26		serial0 = &scif0;
27		i2c0 = &i2c0;
28		i2c1 = &i2c1;
29		i2c3 = &i2c3;
30	};
31
32	chosen {
33		bootargs = "ignore_loglevel";
34		stdout-path = "serial0:115200n8";
35	};
36
37	audio_mclock: audio_mclock {
38		compatible = "fixed-clock";
39		#clock-cells = <0>;
40		clock-frequency = <11289600>;
41	};
42
43	snd_rzg2l: sound {
44		compatible = "simple-audio-card";
45		simple-audio-card,format = "i2s";
46		simple-audio-card,bitclock-master = <&cpu_dai>;
47		simple-audio-card,frame-master = <&cpu_dai>;
48		simple-audio-card,mclk-fs = <256>;
49
50		cpu_dai: simple-audio-card,cpu {
51			sound-dai = <&ssi0>;
52		};
53
54		codec_dai: simple-audio-card,codec {
55			clocks = <&audio_mclock>;
56			sound-dai = <&wm8978>;
57		};
58	};
59
60	usb0_vbus_otg: regulator-usb0-vbus-otg {
61		compatible = "regulator-fixed";
62
63		regulator-name = "USB0_VBUS_OTG";
64		regulator-min-microvolt = <5000000>;
65		regulator-max-microvolt = <5000000>;
66	};
67};
68
69&audio_clk1{
70	clock-frequency = <11289600>;
71};
72
73&audio_clk2{
74	clock-frequency = <12288000>;
75};
76
77&ehci0 {
78	dr_mode = "otg";
79	status = "okay";
80};
81
82&ehci1 {
83	status = "okay";
84};
85
86&extal_clk {
87	clock-frequency = <24000000>;
88};
89
90&hsusb {
91	dr_mode = "otg";
92	status = "okay";
93};
94
95&i2c0 {
96	pinctrl-0 = <&i2c0_pins>;
97	pinctrl-names = "default";
98
99	status = "okay";
100};
101
102&i2c1 {
103	pinctrl-0 = <&i2c1_pins>;
104	pinctrl-names = "default";
105
106	status = "okay";
107};
108
109&i2c3 {
110	pinctrl-0 = <&i2c3_pins>;
111	pinctrl-names = "default";
112	clock-frequency = <400000>;
113
114	status = "okay";
115
116	wm8978: codec@1a {
117		compatible = "wlf,wm8978";
118		#sound-dai-cells = <0>;
119		reg = <0x1a>;
120	};
121};
122
123&ohci0 {
124	dr_mode = "otg";
125	status = "okay";
126};
127
128&ohci1 {
129	status = "okay";
130};
131
132&phyrst {
133	status = "okay";
134};
135
136&pinctrl {
137	pinctrl-0 = <&sound_clk_pins>;
138	pinctrl-names = "default";
139
140	i2c0_pins: i2c0 {
141		pins = "RIIC0_SDA", "RIIC0_SCL";
142		input-enable;
143	};
144
145	i2c1_pins: i2c1 {
146		pins = "RIIC1_SDA", "RIIC1_SCL";
147		input-enable;
148	};
149
150	i2c3_pins: i2c3 {
151		pinmux = <RZG2L_PORT_PINMUX(18, 0, 3)>, /* SDA */
152			 <RZG2L_PORT_PINMUX(18, 1, 3)>; /* SCL */
153	};
154
155	scif0_pins: scif0 {
156		pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>,	/* TxD */
157			 <RZG2L_PORT_PINMUX(38, 1, 1)>;	/* RxD */
158	};
159
160	sound_clk_pins: sound_clk {
161		pins = "AUDIO_CLK1", "AUDIO_CLK2";
162		input-enable;
163	};
164
165	ssi0_pins: ssi0 {
166		pinmux = <RZG2L_PORT_PINMUX(45, 0, 1)>, /* BCK */
167			 <RZG2L_PORT_PINMUX(45, 1, 1)>, /* RCK */
168			 <RZG2L_PORT_PINMUX(45, 2, 1)>, /* TXD */
169			 <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
170	};
171
172	usb0_pins: usb0 {
173		pinmux = <RZG2L_PORT_PINMUX(4, 0, 1)>, /* VBUS */
174			 <RZG2L_PORT_PINMUX(5, 0, 1)>, /* OVC */
175			 <RZG2L_PORT_PINMUX(5, 1, 1)>; /* OTG_ID */
176	};
177
178	usb1_pins: usb1 {
179		pinmux = <RZG2L_PORT_PINMUX(42, 0, 1)>, /* VBUS */
180			 <RZG2L_PORT_PINMUX(42, 1, 1)>; /* OVC */
181	};
182};
183
184&scif0 {
185	pinctrl-0 = <&scif0_pins>;
186	pinctrl-names = "default";
187	status = "okay";
188};
189
190&ssi0 {
191	pinctrl-0 = <&ssi0_pins>;
192	pinctrl-names = "default";
193
194	status = "okay";
195};
196
197&usb2_phy0 {
198	pinctrl-0 = <&usb0_pins>;
199	pinctrl-names = "default";
200
201	vbus-supply = <&usb0_vbus_otg>;
202	status = "okay";
203};
204
205&usb2_phy1 {
206	pinctrl-0 = <&usb1_pins>;
207	pinctrl-names = "default";
208
209	status = "okay";
210};
211