GNU Linux-libre 6.1.90-gnu
[releases.git] / arch / arm / boot / dts / stm32mp15xx-dhcor-avenger96.dtsi
1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2 /*
3  * Copyright (C) Linaro Ltd 2019 - All Rights Reserved
4  * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
5  * Copyright (C) 2020 Marek Vasut <marex@denx.de>
6  */
7
8 /* Avenger96 uses DHCOR SoM configured for 1V8 IO operation */
9 #include "stm32mp15xx-dhcor-io1v8.dtsi"
10
11 / {
12         aliases {
13                 ethernet0 = &ethernet0;
14                 mmc0 = &sdmmc1;
15                 serial0 = &uart4;
16                 serial1 = &uart7;
17                 serial2 = &usart2;
18                 spi0 = &qspi;
19         };
20
21         /* XTal Q1 */
22         cec_clock: clk-cec-fixed {
23                 #clock-cells = <0>;
24                 compatible = "fixed-clock";
25                 clock-frequency = <24000000>;
26         };
27
28         chosen {
29                 stdout-path = "serial0:115200n8";
30         };
31
32         hdmi-out {
33                 compatible = "hdmi-connector";
34                 type = "a";
35
36                 port {
37                         hdmi_con: endpoint {
38                                 remote-endpoint = <&adv7513_out>;
39                         };
40                 };
41         };
42
43         led {
44                 compatible = "gpio-leds";
45                 led1 {
46                         label = "green:user0";
47                         gpios = <&gpioz 7 GPIO_ACTIVE_HIGH>;
48                         linux,default-trigger = "heartbeat";
49                         default-state = "off";
50                 };
51
52                 led2 {
53                         label = "green:user1";
54                         gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>;
55                         linux,default-trigger = "mmc0";
56                         default-state = "off";
57                 };
58
59                 led3 {
60                         label = "green:user2";
61                         gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
62                         linux,default-trigger = "mmc1";
63                         default-state = "off";
64                 };
65
66                 led4 {
67                         label = "green:user3";
68                         gpios = <&gpiog 1 GPIO_ACTIVE_HIGH>;
69                         linux,default-trigger = "none";
70                         default-state = "off";
71                         panic-indicator;
72                 };
73         };
74
75         sd_switch: regulator-sd_switch {
76                 compatible = "regulator-gpio";
77                 regulator-name = "sd_switch";
78                 regulator-min-microvolt = <1800000>;
79                 regulator-max-microvolt = <2900000>;
80                 regulator-type = "voltage";
81                 regulator-always-on;
82
83                 gpios = <&gpioi 5 GPIO_ACTIVE_HIGH>;
84                 gpios-states = <0>;
85                 states = <1800000 0x1>,
86                          <2900000 0x0>;
87         };
88
89         sound {
90                 compatible = "audio-graph-card";
91                 label = "STM32-AV96-HDMI";
92                 dais = <&sai2a_port>;
93                 status = "okay";
94         };
95
96         wlan_pwr: regulator-wlan {
97                 compatible = "regulator-fixed";
98
99                 regulator-name = "wl-reg";
100                 regulator-min-microvolt = <3300000>;
101                 regulator-max-microvolt = <3300000>;
102
103                 gpio = <&gpioz 3 GPIO_ACTIVE_HIGH>;
104                 enable-active-high;
105         };
106 };
107
108 &adc {
109         pinctrl-names = "default";
110         pinctrl-0 = <&adc12_ain_pins_b>;
111         vdd-supply = <&vdd>;
112         vdda-supply = <&vdda>;
113         vref-supply = <&vdda>;
114         status = "okay";
115 };
116
117 &adc1 {
118         channel@0 {
119                 reg = <0>;
120                 st,min-sample-time-ns = <5000>;
121         };
122
123         channel@1 {
124                 reg = <1>;
125                 st,min-sample-time-ns = <5000>;
126         };
127
128         channel@6 {
129                 reg = <6>;
130                 st,min-sample-time-ns = <5000>;
131         };
132 };
133
134 &adc2 {
135         channel@0 {
136                 reg = <0>;
137                 st,min-sample-time-ns = <5000>;
138         };
139
140         channel@1 {
141                 reg = <1>;
142                 st,min-sample-time-ns = <5000>;
143         };
144
145         channel@2 {
146                 reg = <2>;
147                 st,min-sample-time-ns = <5000>;
148         };
149 };
150
151 &dcmi {
152         pinctrl-names = "default", "sleep";
153         pinctrl-0 = <&dcmi_pins_c>;
154         pinctrl-1 = <&dcmi_sleep_pins_c>;
155         status = "disabled";
156
157         port {
158                 dcmi_0: endpoint {
159                         remote-endpoint = <&stmipi_2>;
160                         bus-type = <5>;
161                         bus-width = <8>;
162                         pclk-sample = <0>;
163                 };
164         };
165 };
166
167 &ethernet0 {
168         status = "okay";
169         pinctrl-0 = <&ethernet0_rgmii_pins_c>;
170         pinctrl-1 = <&ethernet0_rgmii_sleep_pins_c>;
171         pinctrl-names = "default", "sleep";
172         phy-mode = "rgmii";
173         max-speed = <1000>;
174         phy-handle = <&phy0>;
175
176         mdio {
177                 #address-cells = <1>;
178                 #size-cells = <0>;
179                 compatible = "snps,dwmac-mdio";
180                 reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
181                 reset-delay-us = <1000>;
182                 reset-post-delay-us = <1000>;
183
184                 phy0: ethernet-phy@7 {
185                         reg = <7>;
186
187                         rxc-skew-ps = <1500>;
188                         rxdv-skew-ps = <540>;
189                         rxd0-skew-ps = <420>;
190                         rxd1-skew-ps = <420>;
191                         rxd2-skew-ps = <420>;
192                         rxd3-skew-ps = <420>;
193
194                         txc-skew-ps = <1440>;
195                         txen-skew-ps = <540>;
196                         txd0-skew-ps = <420>;
197                         txd1-skew-ps = <420>;
198                         txd2-skew-ps = <420>;
199                         txd3-skew-ps = <420>;
200                 };
201         };
202 };
203
204 &gpioa {
205         gpio-line-names = "", "", "", "",
206                           "", "", "", "",
207                           "", "", "", "AV96-K",
208                           "AV96-I", "", "AV96-A", "";
209 };
210
211 &gpiob {
212         gpio-line-names = "", "", "", "",
213                           "", "AV96-J", "", "",
214                           "", "", "", "AV96-B",
215                           "", "AV96-L", "", "";
216 };
217
218 &gpioc {
219         gpio-line-names = "", "", "", "AV96-C",
220                           "", "", "", "",
221                           "", "", "", "",
222                           "", "", "", "";
223 };
224
225 &gpiod {
226         gpio-line-names = "", "", "", "",
227                           "", "", "", "",
228                           "AV96-D", "", "", "",
229                           "", "", "AV96-E", "AV96-F";
230 };
231
232 &gpiof {
233         gpio-line-names = "", "", "", "",
234                           "", "", "", "",
235                           "", "", "", "",
236                           "AV96-G", "AV96-H", "", "";
237 };
238
239 &i2c1 { /* X6 I2C1 */
240         pinctrl-names = "default";
241         pinctrl-0 = <&i2c1_pins_b>;
242         i2c-scl-rising-time-ns = <185>;
243         i2c-scl-falling-time-ns = <20>;
244         status = "okay";
245         /delete-property/dmas;
246         /delete-property/dma-names;
247 };
248
249 &i2c2 { /* X6 I2C2 */
250         pinctrl-names = "default";
251         pinctrl-0 = <&i2c2_pins_c>;
252         i2c-scl-rising-time-ns = <185>;
253         i2c-scl-falling-time-ns = <20>;
254         status = "okay";
255         /delete-property/dmas;
256         /delete-property/dma-names;
257 };
258
259 &i2c4 {
260         stmipi: stmipi@14 {
261                 compatible = "st,st-mipid02";
262                 pinctrl-names = "default", "sleep";
263                 pinctrl-0 = <&mco1_pins_a>;
264                 pinctrl-1 = <&mco1_sleep_pins_a>;
265                 reg = <0x14>;
266                 clocks = <&rcc CK_MCO1>;
267                 clock-names = "xclk";
268                 assigned-clocks = <&rcc CK_MCO1>;
269                 assigned-clock-parents = <&rcc CK_HSE>;
270                 assigned-clock-rates = <24000000>;
271                 VDDE-supply = <&v1v8>;
272                 VDDIN-supply = <&v1v8>;
273                 reset-gpios = <&gpioz 0 GPIO_ACTIVE_LOW>;
274                 status = "disabled";
275
276                 ports {
277                         #address-cells = <1>;
278                         #size-cells = <0>;
279
280                         port@0 {
281                                 reg = <0>;
282                                 stmipi_0: endpoint {
283                                 };
284                         };
285
286                         port@2 {
287                                 reg = <2>;
288                                 stmipi_2: endpoint {
289                                         bus-width = <8>;
290                                         hsync-active = <0>;
291                                         vsync-active = <0>;
292                                         pclk-sample = <0>;
293                                         remote-endpoint = <&dcmi_0>;
294                                 };
295                         };
296                 };
297         };
298
299         hdmi-transmitter@3d {
300                 compatible = "adi,adv7513";
301                 reg = <0x3d>, <0x4d>, <0x2d>, <0x5d>;
302                 reg-names = "main", "edid", "cec", "packet";
303                 clocks = <&cec_clock>;
304                 clock-names = "cec";
305
306                 avdd-supply = <&v3v3>;
307                 dvdd-supply = <&v3v3>;
308                 pvdd-supply = <&v3v3>;
309                 dvdd-3v-supply = <&v3v3>;
310                 bgvdd-supply = <&v3v3>;
311
312                 interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
313                 interrupt-parent = <&gpiog>;
314
315                 status = "okay";
316
317                 adi,input-depth = <8>;
318                 adi,input-colorspace = "rgb";
319                 adi,input-clock = "1x";
320
321                 ports {
322                         #address-cells = <1>;
323                         #size-cells = <0>;
324
325                         port@0 {
326                                 reg = <0>;
327                                 adv7513_in: endpoint {
328                                         remote-endpoint = <&ltdc_ep0_out>;
329                                 };
330                         };
331
332                         port@1 {
333                                 reg = <1>;
334                                 adv7513_out: endpoint {
335                                         remote-endpoint = <&hdmi_con>;
336                                 };
337                         };
338
339                         port@2 {
340                                 reg = <2>;
341                                 adv7513_i2s0: endpoint {
342                                         remote-endpoint = <&sai2a_endpoint>;
343                                 };
344                         };
345                 };
346         };
347
348         dh_mac_eeprom: eeprom@53 {
349                 compatible = "atmel,24c02";
350                 reg = <0x53>;
351                 pagesize = <16>;
352         };
353 };
354
355 &ltdc {
356         pinctrl-names = "default", "sleep";
357         pinctrl-0 = <&ltdc_pins_d>;
358         pinctrl-1 = <&ltdc_sleep_pins_d>;
359         status = "okay";
360
361         port {
362                 #address-cells = <1>;
363                 #size-cells = <0>;
364
365                 ltdc_ep0_out: endpoint@0 {
366                         reg = <0>;
367                         remote-endpoint = <&adv7513_in>;
368                 };
369         };
370 };
371
372 &sai2 {
373         clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
374         pinctrl-names = "default", "sleep";
375         pinctrl-0 = <&sai2a_pins_c>;
376         pinctrl-1 = <&sai2a_sleep_pins_c>;
377         clock-names = "pclk", "x8k", "x11k";
378         status = "okay";
379
380         sai2a: audio-controller@4400b004 {
381                 #clock-cells = <0>;
382                 dma-names = "tx";
383                 clocks = <&rcc SAI2_K>;
384                 clock-names = "sai_ck";
385                 status = "okay";
386
387                 sai2a_port: port {
388                         sai2a_endpoint: endpoint {
389                                 remote-endpoint = <&adv7513_i2s0>;
390                                 format = "i2s";
391                                 mclk-fs = <256>;
392                         };
393                 };
394         };
395 };
396
397 &sdmmc1 {
398         pinctrl-names = "default", "opendrain", "sleep";
399         pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_b>;
400         pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_b>;
401         pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_b>;
402         cd-gpios = <&gpioi 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
403         disable-wp;
404         st,sig-dir;
405         st,neg-edge;
406         st,use-ckin;
407         bus-width = <4>;
408         vmmc-supply = <&vdd_sd>;
409         vqmmc-supply = <&sd_switch>;
410         status = "okay";
411 };
412
413 &sdmmc2 {
414         pinctrl-names = "default", "opendrain", "sleep";
415         pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_c>;
416         pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_c>;
417         pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_c>;
418         bus-width = <8>;
419         mmc-ddr-1_8v;
420         no-sd;
421         no-sdio;
422         non-removable;
423         st,neg-edge;
424         vmmc-supply = <&v3v3>;
425         vqmmc-supply = <&vdd_io>;
426         status = "okay";
427 };
428
429 &sdmmc3 {
430         pinctrl-names = "default", "opendrain", "sleep";
431         pinctrl-0 = <&sdmmc3_b4_pins_b>;
432         pinctrl-1 = <&sdmmc3_b4_od_pins_b>;
433         pinctrl-2 = <&sdmmc3_b4_sleep_pins_b>;
434         broken-cd;
435         non-removable;
436         st,neg-edge;
437         bus-width = <4>;
438         vmmc-supply = <&wlan_pwr>;
439         status = "okay";
440
441         #address-cells = <1>;
442         #size-cells = <0>;
443         brcmf: bcrmf@1 {
444                 reg = <1>;
445                 compatible = "brcm,bcm4329-fmac";
446         };
447 };
448
449 &spi2 {
450         pinctrl-names = "default";
451         pinctrl-0 = <&spi2_pins_a>;
452         cs-gpios = <&gpioi 0 0>;
453         status = "disabled";
454         /delete-property/dmas;
455         /delete-property/dma-names;
456 };
457
458 &uart4 {
459         /* On Low speed expansion header */
460         label = "LS-UART1";
461         pinctrl-names = "default";
462         pinctrl-0 = <&uart4_pins_b>;
463         /delete-property/dmas;
464         /delete-property/dma-names;
465         status = "okay";
466 };
467
468 &uart7 {
469         /* On Low speed expansion header */
470         label = "LS-UART0";
471         pinctrl-names = "default";
472         pinctrl-0 = <&uart7_pins_a>;
473         uart-has-rtscts;
474         /delete-property/dmas;
475         /delete-property/dma-names;
476         status = "okay";
477 };
478
479 /* Bluetooth */
480 &usart2 {
481         pinctrl-names = "default", "sleep";
482         pinctrl-0 = <&usart2_pins_a>;
483         pinctrl-1 = <&usart2_sleep_pins_a>;
484         st,hw-flow-ctrl;
485         /delete-property/dmas;
486         /delete-property/dma-names;
487         status = "okay";
488
489         bluetooth {
490                 compatible = "brcm,bcm43438-bt";
491                 max-speed = <3000000>;
492                 shutdown-gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
493         };
494 };
495
496 &usbh_ehci {
497         phys = <&usbphyc_port0>;
498         phy-names = "usb";
499         status = "okay";
500 };
501
502 &usbotg_hs {
503         pinctrl-0 = <&usbotg_hs_pins_a>;
504         pinctrl-names = "default";
505         phy-names = "usb2-phy";
506         phys = <&usbphyc_port1 0>;
507         status = "okay";
508         vbus-supply = <&vbus_otg>;
509 };
510
511 &usbphyc {
512         status = "okay";
513 };
514
515 &usbphyc_port0 {
516         phy-supply = <&vdd_usb>;
517 };
518
519 &usbphyc_port1 {
520         phy-supply = <&vdd_usb>;
521 };