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