• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2/*
3 * Copyright (C) 2019-2020 Marek Vasut <marex@denx.de>
4 */
5
6#include <dt-bindings/input/input.h>
7#include <dt-bindings/pwm/pwm.h>
8
9/ {
10	aliases {
11		serial0 = &uart4;
12		serial1 = &usart3;
13		serial2 = &uart8;
14	};
15
16	chosen {
17		stdout-path = "serial0:115200n8";
18	};
19
20	clk_ext_audio_codec: clock-codec {
21		compatible = "fixed-clock";
22		#clock-cells = <0>;
23		clock-frequency = <24000000>;
24	};
25
26	display_bl: display-bl {
27		compatible = "pwm-backlight";
28		pwms = <&pwm2 3 500000 PWM_POLARITY_INVERTED>;
29		brightness-levels = <0 16 22 30 40 55 75 102 138 188 255>;
30		default-brightness-level = <8>;
31		enable-gpios = <&gpioi 0 GPIO_ACTIVE_HIGH>;
32		status = "okay";
33	};
34
35	gpio-keys-polled {
36		compatible = "gpio-keys-polled";
37		poll-interval = <20>;
38
39		/*
40		 * The EXTi IRQ line 3 is shared with ethernet,
41		 * so mark this as polled GPIO key.
42		 */
43		button-0 {
44			label = "TA1-GPIO-A";
45			linux,code = <KEY_A>;
46			gpios = <&gpiof 3 GPIO_ACTIVE_LOW>;
47		};
48
49		/*
50		 * The EXTi IRQ line 6 is shared with touchscreen,
51		 * so mark this as polled GPIO key.
52		 */
53		button-1 {
54			label = "TA2-GPIO-B";
55			linux,code = <KEY_B>;
56			gpios = <&gpiod 6 GPIO_ACTIVE_LOW>;
57		};
58
59		/*
60		 * The EXTi IRQ line 0 is shared with PMIC,
61		 * so mark this as polled GPIO key.
62		 */
63		button-2 {
64			label = "TA3-GPIO-C";
65			linux,code = <KEY_C>;
66			gpios = <&gpiog 0 GPIO_ACTIVE_LOW>;
67		};
68	};
69
70	gpio-keys {
71		compatible = "gpio-keys";
72
73		button-3 {
74			label = "TA4-GPIO-D";
75			linux,code = <KEY_D>;
76			gpios = <&gpiod 12 GPIO_ACTIVE_LOW>;
77			wakeup-source;
78		};
79	};
80
81	led {
82		compatible = "gpio-leds";
83
84		led-0 {
85			label = "green:led5";
86			gpios = <&gpioc 6 GPIO_ACTIVE_HIGH>;
87			default-state = "off";
88			status = "disabled";
89		};
90
91		led-1 {
92			label = "green:led6";
93			gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
94			default-state = "off";
95		};
96
97		led-2 {
98			label = "green:led7";
99			gpios = <&gpioi 2 GPIO_ACTIVE_HIGH>;
100			default-state = "off";
101		};
102
103		led-3 {
104			label = "green:led8";
105			gpios = <&gpioi 3 GPIO_ACTIVE_HIGH>;
106			default-state = "off";
107		};
108	};
109
110	panel {
111		compatible = "edt,etm0700g0edh6";
112		backlight = <&display_bl>;
113
114		port {
115			lcd_panel_in: endpoint {
116				remote-endpoint = <&lcd_display_out>;
117			};
118		};
119	};
120
121	sound {
122		compatible = "audio-graph-card";
123		routing =
124			"MIC_IN", "Capture",
125			"Capture", "Mic Bias",
126			"Playback", "HP_OUT";
127		dais = <&sai2a_port &sai2b_port>;
128		status = "okay";
129	};
130};
131
132&cec {
133	pinctrl-names = "default";
134	pinctrl-0 = <&cec_pins_a>;
135	status = "okay";
136};
137
138&i2c2 {	/* Header X22 */
139	pinctrl-names = "default";
140	pinctrl-0 = <&i2c2_pins_a>;
141	i2c-scl-rising-time-ns = <185>;
142	i2c-scl-falling-time-ns = <20>;
143	status = "okay";
144	/* spare dmas for other usage */
145	/delete-property/dmas;
146	/delete-property/dma-names;
147	status = "okay";
148};
149
150&i2c5 {	/* Header X21 */
151	pinctrl-names = "default";
152	pinctrl-0 = <&i2c5_pins_a>;
153	i2c-scl-rising-time-ns = <185>;
154	i2c-scl-falling-time-ns = <20>;
155	status = "okay";
156	/* spare dmas for other usage */
157	/delete-property/dmas;
158	/delete-property/dma-names;
159
160	sgtl5000: codec@a {
161		compatible = "fsl,sgtl5000";
162		reg = <0x0a>;
163		#sound-dai-cells = <0>;
164		clocks = <&clk_ext_audio_codec>;
165		VDDA-supply = <&v3v3>;
166		VDDIO-supply = <&vdd>;
167
168		sgtl5000_port: port {
169			#address-cells = <1>;
170			#size-cells = <0>;
171
172			sgtl5000_tx_endpoint: endpoint@0 {
173				reg = <0>;
174				remote-endpoint = <&sai2a_endpoint>;
175				frame-master = <&sgtl5000_tx_endpoint>;
176				bitclock-master = <&sgtl5000_tx_endpoint>;
177			};
178
179			sgtl5000_rx_endpoint: endpoint@1 {
180				reg = <1>;
181				remote-endpoint = <&sai2b_endpoint>;
182				frame-master = <&sgtl5000_rx_endpoint>;
183				bitclock-master = <&sgtl5000_rx_endpoint>;
184			};
185		};
186
187	};
188
189	touchscreen@38 {
190		compatible = "edt,edt-ft5406";
191		reg = <0x38>;
192		interrupt-parent = <&gpioc>;
193		interrupts = <6 IRQ_TYPE_EDGE_FALLING>; /* GPIO E */
194	};
195};
196
197&ltdc {
198	pinctrl-names = "default", "sleep";
199	pinctrl-0 = <&ltdc_pins_b>;
200	pinctrl-1 = <&ltdc_sleep_pins_b>;
201	status = "okay";
202
203	port {
204		lcd_display_out: endpoint {
205			remote-endpoint = <&lcd_panel_in>;
206		};
207	};
208};
209
210&sai2 {
211	clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
212	clock-names = "pclk", "x8k", "x11k";
213	pinctrl-names = "default", "sleep";
214	pinctrl-0 = <&sai2a_pins_b &sai2b_pins_b>;
215	pinctrl-1 = <&sai2a_sleep_pins_b &sai2b_sleep_pins_b>;
216	status = "okay";
217
218	sai2a: audio-controller@4400b004 {
219		#clock-cells = <0>;
220		dma-names = "tx";
221		clocks = <&rcc SAI2_K>;
222		clock-names = "sai_ck";
223		status = "okay";
224
225		sai2a_port: port {
226			sai2a_endpoint: endpoint {
227				remote-endpoint = <&sgtl5000_tx_endpoint>;
228				format = "i2s";
229				mclk-fs = <512>;
230				dai-tdm-slot-num = <2>;
231				dai-tdm-slot-width = <16>;
232			};
233		};
234	};
235
236	sai2b: audio-controller@4400b024 {
237		dma-names = "rx";
238		st,sync = <&sai2a 2>;
239		clocks = <&rcc SAI2_K>, <&sai2a>;
240		clock-names = "sai_ck", "MCLK";
241		status = "okay";
242
243		sai2b_port: port {
244			sai2b_endpoint: endpoint {
245				remote-endpoint = <&sgtl5000_rx_endpoint>;
246				format = "i2s";
247				mclk-fs = <512>;
248				dai-tdm-slot-num = <2>;
249				dai-tdm-slot-width = <16>;
250			};
251		};
252	};
253};
254
255&timers2 {
256	/* spare dmas for other usage (un-delete to enable pwm capture) */
257	/delete-property/dmas;
258	/delete-property/dma-names;
259	status = "okay";
260	pwm2: pwm {
261		pinctrl-0 = <&pwm2_pins_a>;
262		pinctrl-names = "default";
263		status = "okay";
264	};
265	timer@1 {
266		status = "okay";
267	};
268};
269
270&usart3 {
271	pinctrl-names = "default";
272	pinctrl-0 = <&usart3_pins_a>;
273	status = "okay";
274};
275
276&uart8 {
277	pinctrl-names = "default";
278	pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>;
279	uart-has-rtscts;
280	status = "okay";
281};
282
283&usbh_ehci {
284	phys = <&usbphyc_port0>;
285	status = "okay";
286};
287
288&usbotg_hs {
289	dr_mode = "otg";
290	pinctrl-0 = <&usbotg_hs_pins_a>;
291	pinctrl-names = "default";
292	phy-names = "usb2-phy";
293	phys = <&usbphyc_port1 0>;
294	vbus-supply = <&vbus_otg>;
295	status = "okay";
296};
297
298&usbphyc {
299	status = "okay";
300};
301
302&usbphyc_port0 {
303	phy-supply = <&vdd_usb>;
304	vdda1v1-supply = <&reg11>;
305	vdda1v8-supply = <&reg18>;
306};
307
308&usbphyc_port1 {
309	phy-supply = <&vdd_usb>;
310	vdda1v1-supply = <&reg11>;
311	vdda1v8-supply = <&reg18>;
312};
313