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