treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / arm / boot / dts / stm32mp157a-dk1.dts
blob984a47cbd13dfe73360baef0c1cf658fb8a15f84
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2 /*
3  * Copyright (C) STMicroelectronics 2019 - All Rights Reserved
4  * Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
5  */
7 /dts-v1/;
9 #include "stm32mp157c.dtsi"
10 #include "stm32mp157xac-pinctrl.dtsi"
11 #include <dt-bindings/gpio/gpio.h>
12 #include <dt-bindings/mfd/st,stpmic1.h>
14 / {
15         model = "STMicroelectronics STM32MP157A-DK1 Discovery Board";
16         compatible = "st,stm32mp157a-dk1", "st,stm32mp157";
18         aliases {
19                 ethernet0 = &ethernet0;
20                 serial0 = &uart4;
21         };
23         chosen {
24                 stdout-path = "serial0:115200n8";
25         };
27         memory@c0000000 {
28                 device_type = "memory";
29                 reg = <0xc0000000 0x20000000>;
30         };
32         reserved-memory {
33                 #address-cells = <1>;
34                 #size-cells = <1>;
35                 ranges;
37                 mcuram2: mcuram2@10000000 {
38                         compatible = "shared-dma-pool";
39                         reg = <0x10000000 0x40000>;
40                         no-map;
41                 };
43                 vdev0vring0: vdev0vring0@10040000 {
44                         compatible = "shared-dma-pool";
45                         reg = <0x10040000 0x1000>;
46                         no-map;
47                 };
49                 vdev0vring1: vdev0vring1@10041000 {
50                         compatible = "shared-dma-pool";
51                         reg = <0x10041000 0x1000>;
52                         no-map;
53                 };
55                 vdev0buffer: vdev0buffer@10042000 {
56                         compatible = "shared-dma-pool";
57                         reg = <0x10042000 0x4000>;
58                         no-map;
59                 };
61                 mcuram: mcuram@30000000 {
62                         compatible = "shared-dma-pool";
63                         reg = <0x30000000 0x40000>;
64                         no-map;
65                 };
67                 retram: retram@38000000 {
68                         compatible = "shared-dma-pool";
69                         reg = <0x38000000 0x10000>;
70                         no-map;
71                 };
73                 gpu_reserved: gpu@d4000000 {
74                         reg = <0xd4000000 0x4000000>;
75                         no-map;
76                 };
77         };
79         led {
80                 compatible = "gpio-leds";
81                 blue {
82                         label = "heartbeat";
83                         gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
84                         linux,default-trigger = "heartbeat";
85                         default-state = "off";
86                 };
87         };
89         sound {
90                 compatible = "audio-graph-card";
91                 label = "STM32MP1-DK";
92                 routing =
93                         "Playback" , "MCLK",
94                         "Capture" , "MCLK",
95                         "MICL" , "Mic Bias";
96                 dais = <&sai2a_port &sai2b_port &i2s2_port>;
97                 status = "okay";
98         };
101 &adc {
102         pinctrl-names = "default";
103         pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_cc_pins_a>;
104         vdd-supply = <&vdd>;
105         vdda-supply = <&vdd>;
106         vref-supply = <&vrefbuf>;
107         status = "disabled";
108         adc1: adc@0 {
109                 /*
110                  * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19.
111                  * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
112                  * 5 * (56 + 47kOhms) * 5pF => 2.5us.
113                  * Use arbitrary margin here (e.g. 5us).
114                  */
115                 st,min-sample-time-nsecs = <5000>;
116                 /* AIN connector, USB Type-C CC1 & CC2 */
117                 st,adc-channels = <0 1 6 13 18 19>;
118                 status = "okay";
119         };
120         adc2: adc@100 {
121                 /* AIN connector, USB Type-C CC1 & CC2 */
122                 st,adc-channels = <0 1 2 6 18 19>;
123                 st,min-sample-time-nsecs = <5000>;
124                 status = "okay";
125         };
128 &cec {
129         pinctrl-names = "default", "sleep";
130         pinctrl-0 = <&cec_pins_b>;
131         pinctrl-1 = <&cec_pins_sleep_b>;
132         status = "okay";
135 &ethernet0 {
136         status = "okay";
137         pinctrl-0 = <&ethernet0_rgmii_pins_a>;
138         pinctrl-1 = <&ethernet0_rgmii_pins_sleep_a>;
139         pinctrl-names = "default", "sleep";
140         phy-mode = "rgmii-id";
141         max-speed = <1000>;
142         phy-handle = <&phy0>;
144         mdio0 {
145                 #address-cells = <1>;
146                 #size-cells = <0>;
147                 compatible = "snps,dwmac-mdio";
148                 phy0: ethernet-phy@0 {
149                         reg = <0>;
150                 };
151         };
154 &gpu {
155         contiguous-area = <&gpu_reserved>;
156         status = "okay";
159 &i2c1 {
160         pinctrl-names = "default", "sleep";
161         pinctrl-0 = <&i2c1_pins_a>;
162         pinctrl-1 = <&i2c1_pins_sleep_a>;
163         i2c-scl-rising-time-ns = <100>;
164         i2c-scl-falling-time-ns = <7>;
165         status = "okay";
166         /delete-property/dmas;
167         /delete-property/dma-names;
169         hdmi-transmitter@39 {
170                 compatible = "sil,sii9022";
171                 reg = <0x39>;
172                 iovcc-supply = <&v3v3_hdmi>;
173                 cvcc12-supply = <&v1v2_hdmi>;
174                 reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
175                 interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
176                 interrupt-parent = <&gpiog>;
177                 #sound-dai-cells = <0>;
178                 status = "okay";
180                 ports {
181                         #address-cells = <1>;
182                         #size-cells = <0>;
184                         port@0 {
185                                 reg = <0>;
186                                 sii9022_in: endpoint {
187                                         remote-endpoint = <&ltdc_ep0_out>;
188                                 };
189                         };
191                         port@3 {
192                                 reg = <3>;
193                                 sii9022_tx_endpoint: endpoint {
194                                         remote-endpoint = <&i2s2_endpoint>;
195                                 };
196                         };
197                 };
198         };
200         cs42l51: cs42l51@4a {
201                 compatible = "cirrus,cs42l51";
202                 reg = <0x4a>;
203                 #sound-dai-cells = <0>;
204                 VL-supply = <&v3v3>;
205                 VD-supply = <&v1v8_audio>;
206                 VA-supply = <&v1v8_audio>;
207                 VAHP-supply = <&v1v8_audio>;
208                 reset-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>;
209                 clocks = <&sai2a>;
210                 clock-names = "MCLK";
211                 status = "okay";
213                 cs42l51_port: port {
214                         #address-cells = <1>;
215                         #size-cells = <0>;
217                         cs42l51_tx_endpoint: endpoint@0 {
218                                 reg = <0>;
219                                 remote-endpoint = <&sai2a_endpoint>;
220                                 frame-master;
221                                 bitclock-master;
222                         };
224                         cs42l51_rx_endpoint: endpoint@1 {
225                                 reg = <1>;
226                                 remote-endpoint = <&sai2b_endpoint>;
227                                 frame-master;
228                                 bitclock-master;
229                         };
230                 };
231         };
234 &i2c4 {
235         pinctrl-names = "default";
236         pinctrl-0 = <&i2c4_pins_a>;
237         i2c-scl-rising-time-ns = <185>;
238         i2c-scl-falling-time-ns = <20>;
239         status = "okay";
240         /* spare dmas for other usage */
241         /delete-property/dmas;
242         /delete-property/dma-names;
244         pmic: stpmic@33 {
245                 compatible = "st,stpmic1";
246                 reg = <0x33>;
247                 interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
248                 interrupt-controller;
249                 #interrupt-cells = <2>;
250                 status = "okay";
252                 regulators {
253                         compatible = "st,stpmic1-regulators";
254                         ldo1-supply = <&v3v3>;
255                         ldo3-supply = <&vdd_ddr>;
256                         ldo6-supply = <&v3v3>;
257                         pwr_sw1-supply = <&bst_out>;
258                         pwr_sw2-supply = <&bst_out>;
260                         vddcore: buck1 {
261                                 regulator-name = "vddcore";
262                                 regulator-min-microvolt = <1200000>;
263                                 regulator-max-microvolt = <1350000>;
264                                 regulator-always-on;
265                                 regulator-initial-mode = <0>;
266                                 regulator-over-current-protection;
267                         };
269                         vdd_ddr: buck2 {
270                                 regulator-name = "vdd_ddr";
271                                 regulator-min-microvolt = <1350000>;
272                                 regulator-max-microvolt = <1350000>;
273                                 regulator-always-on;
274                                 regulator-initial-mode = <0>;
275                                 regulator-over-current-protection;
276                         };
278                         vdd: buck3 {
279                                 regulator-name = "vdd";
280                                 regulator-min-microvolt = <3300000>;
281                                 regulator-max-microvolt = <3300000>;
282                                 regulator-always-on;
283                                 st,mask-reset;
284                                 regulator-initial-mode = <0>;
285                                 regulator-over-current-protection;
286                         };
288                         v3v3: buck4 {
289                                 regulator-name = "v3v3";
290                                 regulator-min-microvolt = <3300000>;
291                                 regulator-max-microvolt = <3300000>;
292                                 regulator-always-on;
293                                 regulator-over-current-protection;
294                                 regulator-initial-mode = <0>;
295                         };
297                         v1v8_audio: ldo1 {
298                                 regulator-name = "v1v8_audio";
299                                 regulator-min-microvolt = <1800000>;
300                                 regulator-max-microvolt = <1800000>;
301                                 regulator-always-on;
302                                 interrupts = <IT_CURLIM_LDO1 0>;
303                         };
305                         v3v3_hdmi: ldo2 {
306                                 regulator-name = "v3v3_hdmi";
307                                 regulator-min-microvolt = <3300000>;
308                                 regulator-max-microvolt = <3300000>;
309                                 regulator-always-on;
310                                 interrupts = <IT_CURLIM_LDO2 0>;
311                         };
313                         vtt_ddr: ldo3 {
314                                 regulator-name = "vtt_ddr";
315                                 regulator-min-microvolt = <500000>;
316                                 regulator-max-microvolt = <750000>;
317                                 regulator-always-on;
318                                 regulator-over-current-protection;
319                         };
321                         vdd_usb: ldo4 {
322                                 regulator-name = "vdd_usb";
323                                 regulator-min-microvolt = <3300000>;
324                                 regulator-max-microvolt = <3300000>;
325                                 interrupts = <IT_CURLIM_LDO4 0>;
326                         };
328                         vdda: ldo5 {
329                                 regulator-name = "vdda";
330                                 regulator-min-microvolt = <2900000>;
331                                 regulator-max-microvolt = <2900000>;
332                                 interrupts = <IT_CURLIM_LDO5 0>;
333                                 regulator-boot-on;
334                         };
336                         v1v2_hdmi: ldo6 {
337                                 regulator-name = "v1v2_hdmi";
338                                 regulator-min-microvolt = <1200000>;
339                                 regulator-max-microvolt = <1200000>;
340                                 regulator-always-on;
341                                 interrupts = <IT_CURLIM_LDO6 0>;
342                         };
344                         vref_ddr: vref_ddr {
345                                 regulator-name = "vref_ddr";
346                                 regulator-always-on;
347                                 regulator-over-current-protection;
348                         };
350                          bst_out: boost {
351                                 regulator-name = "bst_out";
352                                 interrupts = <IT_OCP_BOOST 0>;
353                          };
355                         vbus_otg: pwr_sw1 {
356                                 regulator-name = "vbus_otg";
357                                 interrupts = <IT_OCP_OTG 0>;
358                          };
360                          vbus_sw: pwr_sw2 {
361                                 regulator-name = "vbus_sw";
362                                 interrupts = <IT_OCP_SWOUT 0>;
363                                 regulator-active-discharge = <1>;
364                          };
365                 };
367                 onkey {
368                         compatible = "st,stpmic1-onkey";
369                         interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
370                         interrupt-names = "onkey-falling", "onkey-rising";
371                         power-off-time-sec = <10>;
372                         status = "okay";
373                 };
375                 watchdog {
376                         compatible = "st,stpmic1-wdt";
377                         status = "disabled";
378                 };
379         };
382 &i2s2 {
383         clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
384         clock-names = "pclk", "i2sclk", "x8k", "x11k";
385         pinctrl-names = "default", "sleep";
386         pinctrl-0 = <&i2s2_pins_a>;
387         pinctrl-1 = <&i2s2_pins_sleep_a>;
388         status = "okay";
390         i2s2_port: port {
391                 i2s2_endpoint: endpoint {
392                         remote-endpoint = <&sii9022_tx_endpoint>;
393                         format = "i2s";
394                         mclk-fs = <256>;
395                 };
396         };
399 &ipcc {
400         status = "okay";
403 &iwdg2 {
404         timeout-sec = <32>;
405         status = "okay";
408 &ltdc {
409         pinctrl-names = "default", "sleep";
410         pinctrl-0 = <&ltdc_pins_a>;
411         pinctrl-1 = <&ltdc_pins_sleep_a>;
412         status = "okay";
414         port {
415                 #address-cells = <1>;
416                 #size-cells = <0>;
418                 ltdc_ep0_out: endpoint@0 {
419                         reg = <0>;
420                         remote-endpoint = <&sii9022_in>;
421                 };
422         };
425 &m4_rproc {
426         memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
427                         <&vdev0vring1>, <&vdev0buffer>;
428         mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
429         mbox-names = "vq0", "vq1", "shutdown";
430         interrupt-parent = <&exti>;
431         interrupts = <68 1>;
432         status = "okay";
435 &pwr_regulators {
436         vdd-supply = <&vdd>;
437         vdd_3v3_usbfs-supply = <&vdd_usb>;
440 &rng1 {
441         status = "okay";
444 &rtc {
445         status = "okay";
448 &sai2 {
449         clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
450         clock-names = "pclk", "x8k", "x11k";
451         pinctrl-names = "default", "sleep";
452         pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
453         pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
454         status = "okay";
456         sai2a: audio-controller@4400b004 {
457                 #clock-cells = <0>;
458                 dma-names = "tx";
459                 clocks = <&rcc SAI2_K>;
460                 clock-names = "sai_ck";
461                 status = "okay";
463                 sai2a_port: port {
464                         sai2a_endpoint: endpoint {
465                                 remote-endpoint = <&cs42l51_tx_endpoint>;
466                                 format = "i2s";
467                                 mclk-fs = <256>;
468                                 dai-tdm-slot-num = <2>;
469                                 dai-tdm-slot-width = <32>;
470                         };
471                 };
472         };
474         sai2b: audio-controller@4400b024 {
475                 dma-names = "rx";
476                 st,sync = <&sai2a 2>;
477                 clocks = <&rcc SAI2_K>, <&sai2a>;
478                 clock-names = "sai_ck", "MCLK";
479                 status = "okay";
481                 sai2b_port: port {
482                         sai2b_endpoint: endpoint {
483                                 remote-endpoint = <&cs42l51_rx_endpoint>;
484                                 format = "i2s";
485                                 mclk-fs = <256>;
486                                 dai-tdm-slot-num = <2>;
487                                 dai-tdm-slot-width = <32>;
488                         };
489                 };
490         };
493 &sdmmc1 {
494         pinctrl-names = "default", "opendrain", "sleep";
495         pinctrl-0 = <&sdmmc1_b4_pins_a>;
496         pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
497         pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
498         broken-cd;
499         st,neg-edge;
500         bus-width = <4>;
501         vmmc-supply = <&v3v3>;
502         status = "okay";
505 &uart4 {
506         pinctrl-names = "default";
507         pinctrl-0 = <&uart4_pins_a>;
508         status = "okay";
511 &vrefbuf {
512         regulator-min-microvolt = <2500000>;
513         regulator-max-microvolt = <2500000>;
514         vdda-supply = <&vdd>;
515         status = "okay";