Merge tag 'dm-pull-1apr20' of git://git.denx.de/u-boot-dm
[oweals/u-boot.git] / arch / arm / dts / stm32mp157a-avenger96.dts
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  */
6
7 /dts-v1/;
8
9 #include "stm32mp157c.dtsi"
10 #include "stm32mp157xac-pinctrl.dtsi"
11 #include <dt-bindings/gpio/gpio.h>
12 #include <dt-bindings/mfd/st,stpmic1.h>
13
14 / {
15         model = "Arrow Electronics STM32MP157A Avenger96 board";
16         compatible = "arrow,stm32mp157a-avenger96", "st,stm32mp157";
17
18         aliases {
19                 eeprom0 = &eeprom0;
20                 ethernet0 = &ethernet0;
21                 mmc0 = &sdmmc1;
22                 serial0 = &uart4;
23                 serial1 = &uart7;
24                 spi0 = &qspi;
25         };
26
27         chosen {
28                 stdout-path = "serial0:115200n8";
29         };
30
31         memory@c0000000 {
32                 device_type = "memory";
33                 reg = <0xc0000000 0x40000000>;
34         };
35
36         led {
37                 compatible = "gpio-leds";
38                 led1 {
39                         label = "green:user1";
40                         gpios = <&gpioz 7 GPIO_ACTIVE_HIGH>;
41                         linux,default-trigger = "heartbeat";
42                         default-state = "off";
43                 };
44
45                 led2 {
46                         label = "green:user2";
47                         gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>;
48                         linux,default-trigger = "mmc0";
49                         default-state = "off";
50                 };
51
52                 led3 {
53                         label = "green:user3";
54                         gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
55                         linux,default-trigger = "mmc1";
56                         default-state = "off";
57                 };
58
59                 led4 {
60                         label = "green:user3";
61                         gpios = <&gpiog 1 GPIO_ACTIVE_HIGH>;
62                         linux,default-trigger = "none";
63                         default-state = "off";
64                         panic-indicator;
65                 };
66
67                 led5 {
68                         label = "yellow:wifi";
69                         gpios = <&gpioz 3 GPIO_ACTIVE_HIGH>;
70                         linux,default-trigger = "phy0tx";
71                         default-state = "off";
72                 };
73
74                 led6 {
75                         label = "blue:bt";
76                         gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
77                         linux,default-trigger = "bluetooth-power";
78                         default-state = "off";
79                 };
80         };
81
82         sd_switch: regulator-sd_switch {
83                 compatible = "regulator-gpio";
84                 regulator-name = "sd_switch";
85                 regulator-min-microvolt = <1800000>;
86                 regulator-max-microvolt = <2900000>;
87                 regulator-type = "voltage";
88                 regulator-always-on;
89
90                 gpios = <&gpioi 5 GPIO_ACTIVE_HIGH>;
91                 gpios-states = <0>;
92                 states = <1800000 0x1>,
93                          <2900000 0x0>;
94         };
95
96         /* Enpirion EP3A8LQI U2 on the DHCOR */
97         vdd_io: regulator-buck-io {
98                 compatible = "regulator-fixed";
99                 regulator-name = "buck-io";
100                 regulator-min-microvolt = <1800000>;
101                 regulator-max-microvolt = <1800000>;
102                 regulator-always-on;
103                 regulator-boot-on;
104                 vin-supply = <&vdd>;
105         };
106 };
107
108 &ethernet0 {
109         status = "okay";
110         pinctrl-0 = <&ethernet0_rgmii_pins_b>;
111         pinctrl-1 = <&ethernet0_rgmii_pins_sleep_b>;
112         pinctrl-names = "default", "sleep";
113         phy-mode = "rgmii";
114         max-speed = <1000>;
115         phy-handle = <&phy0>;
116         phy-reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
117
118         mdio0 {
119                 #address-cells = <1>;
120                 #size-cells = <0>;
121                 compatible = "snps,dwmac-mdio";
122                 phy0: ethernet-phy@7 {
123                         reg = <7>;
124                 };
125         };
126 };
127
128 &i2c1 {
129         pinctrl-names = "default";
130         pinctrl-0 = <&i2c1_pins_b>;
131         i2c-scl-rising-time-ns = <185>;
132         i2c-scl-falling-time-ns = <20>;
133         status = "okay";
134         /delete-property/dmas;
135         /delete-property/dma-names;
136 };
137
138 &i2c2 {
139         pinctrl-names = "default";
140         pinctrl-0 = <&i2c2_pins_b1 &i2c2_pins_b2>;
141         i2c-scl-rising-time-ns = <185>;
142         i2c-scl-falling-time-ns = <20>;
143         status = "okay";
144         /delete-property/dmas;
145         /delete-property/dma-names;
146 };
147
148 &i2c4 {
149         pinctrl-names = "default";
150         pinctrl-0 = <&i2c4_pins_a>;
151         i2c-scl-rising-time-ns = <185>;
152         i2c-scl-falling-time-ns = <20>;
153         status = "okay";
154         /delete-property/dmas;
155         /delete-property/dma-names;
156
157         pmic: stpmic@33 {
158                 compatible = "st,stpmic1";
159                 reg = <0x33>;
160                 interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;
161                 interrupt-controller;
162                 #interrupt-cells = <2>;
163                 status = "okay";
164
165                 st,main-control-register = <0x04>;
166                 st,vin-control-register = <0xc0>;
167                 st,usb-control-register = <0x30>;
168
169                 regulators {
170                         compatible = "st,stpmic1-regulators";
171
172                         ldo1-supply = <&v3v3>;
173                         ldo2-supply = <&v3v3>;
174                         ldo3-supply = <&vdd_ddr>;
175                         ldo5-supply = <&v3v3>;
176                         ldo6-supply = <&v3v3>;
177                         pwr_sw1-supply = <&bst_out>;
178                         pwr_sw2-supply = <&bst_out>;
179
180                         vddcore: buck1 {
181                                 regulator-name = "vddcore";
182                                 regulator-min-microvolt = <800000>;
183                                 regulator-max-microvolt = <1350000>;
184                                 regulator-always-on;
185                                 regulator-initial-mode = <0>;
186                                 regulator-over-current-protection;
187                         };
188
189                         vdd_ddr: buck2 {
190                                 regulator-name = "vdd_ddr";
191                                 regulator-min-microvolt = <1350000>;
192                                 regulator-max-microvolt = <1350000>;
193                                 regulator-always-on;
194                                 regulator-initial-mode = <0>;
195                                 regulator-over-current-protection;
196                         };
197
198                         vdd: buck3 {
199                                 regulator-name = "vdd";
200                                 regulator-min-microvolt = <2900000>;
201                                 regulator-max-microvolt = <2900000>;
202                                 regulator-always-on;
203                                 st,mask_reset;
204                                 regulator-initial-mode = <0>;
205                                 regulator-over-current-protection;
206                         };
207
208                         v3v3: buck4 {
209                                 regulator-name = "v3v3";
210                                 regulator-min-microvolt = <3300000>;
211                                 regulator-max-microvolt = <3300000>;
212                                 regulator-always-on;
213                                 regulator-over-current-protection;
214                                 regulator-initial-mode = <0>;
215                         };
216
217                         vdda: ldo1 {
218                                 regulator-name = "vdda";
219                                 regulator-min-microvolt = <2900000>;
220                                 regulator-max-microvolt = <2900000>;
221                                 interrupts = <IT_CURLIM_LDO1 0>;
222                                 interrupt-parent = <&pmic>;
223                         };
224
225                         v2v8: ldo2 {
226                                 regulator-name = "v2v8";
227                                 regulator-min-microvolt = <2800000>;
228                                 regulator-max-microvolt = <2800000>;
229                                 interrupts = <IT_CURLIM_LDO2 0>;
230                                 interrupt-parent = <&pmic>;
231                         };
232
233                         vtt_ddr: ldo3 {
234                                 regulator-name = "vtt_ddr";
235                                 regulator-min-microvolt = <500000>;
236                                 regulator-max-microvolt = <750000>;
237                                 regulator-always-on;
238                                 regulator-over-current-protection;
239                         };
240
241                         vdd_usb: ldo4 {
242                                 regulator-name = "vdd_usb";
243                                 regulator-min-microvolt = <3300000>;
244                                 regulator-max-microvolt = <3300000>;
245                                 interrupts = <IT_CURLIM_LDO4 0>;
246                                 interrupt-parent = <&pmic>;
247                         };
248
249                         vdd_sd: ldo5 {
250                                 regulator-name = "vdd_sd";
251                                 regulator-min-microvolt = <2900000>;
252                                 regulator-max-microvolt = <2900000>;
253                                 interrupts = <IT_CURLIM_LDO5 0>;
254                                 interrupt-parent = <&pmic>;
255                                 regulator-boot-on;
256                         };
257
258                         v1v8: ldo6 {
259                                 regulator-name = "v1v8";
260                                 regulator-min-microvolt = <1800000>;
261                                 regulator-max-microvolt = <1800000>;
262                                 interrupts = <IT_CURLIM_LDO6 0>;
263                                 interrupt-parent = <&pmic>;
264                                 regulator-enable-ramp-delay = <300000>;
265                         };
266
267                         vref_ddr: vref_ddr {
268                                 regulator-name = "vref_ddr";
269                                 regulator-always-on;
270                                 regulator-over-current-protection;
271                         };
272
273                         bst_out: boost {
274                                 regulator-name = "bst_out";
275                                 interrupts = <IT_OCP_BOOST 0>;
276                                 interrupt-parent = <&pmic>;
277                         };
278
279                         vbus_otg: pwr_sw1 {
280                                 regulator-name = "vbus_otg";
281                                 interrupts = <IT_OCP_OTG 0>;
282                                 interrupt-parent = <&pmic>;
283                                 regulator-active-discharge = <1>;
284                         };
285
286                         vbus_sw: pwr_sw2 {
287                                 regulator-name = "vbus_sw";
288                                 interrupts = <IT_OCP_SWOUT 0>;
289                                 interrupt-parent = <&pmic>;
290                                 regulator-active-discharge = <1>;
291                         };
292                 };
293
294                 onkey {
295                         compatible = "st,stpmic1-onkey";
296                         interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 1>;
297                         interrupt-names = "onkey-falling", "onkey-rising";
298                         status = "okay";
299                 };
300
301                 watchdog {
302                         compatible = "st,stpmic1-wdt";
303                         status = "disabled";
304                 };
305         };
306
307         eeprom0: eeprom@53 {
308                 compatible = "atmel,24c02";
309                 reg = <0x53>;
310                 pagesize = <16>;
311         };
312 };
313
314 &iwdg2 {
315         timeout-sec = <32>;
316         status = "okay";
317 };
318
319 &pwr_regulators {
320         vdd-supply = <&vdd_io>;
321         vdd_3v3_usbfs-supply = <&vdd_usb>;
322 };
323
324 &qspi {
325         pinctrl-names = "default", "sleep";
326         pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>;
327         pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>;
328         reg = <0x58003000 0x1000>, <0x70000000 0x200000>;
329         #address-cells = <1>;
330         #size-cells = <0>;
331         status = "okay";
332
333         flash0: spi-flash@0 {
334                 compatible = "jedec,spi-nor";
335                 reg = <0>;
336                 spi-rx-bus-width = <4>;
337                 spi-max-frequency = <108000000>;
338                 #address-cells = <1>;
339                 #size-cells = <1>;
340         };
341 };
342
343 &rng1 {
344         status = "okay";
345 };
346
347 &rtc {
348         status = "okay";
349 };
350
351 &sdmmc1 {
352         pinctrl-names = "default", "opendrain", "sleep";
353         pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_b>;
354         pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_b>;
355         pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_b>;
356         cd-gpios = <&gpioi 8 GPIO_ACTIVE_LOW>;
357         disable-wp;
358         st,sig-dir;
359         st,neg-edge;
360         st,use-ckin;
361         sd-uhs-sdr104;
362         bus-width = <4>;
363         vmmc-supply = <&vdd_sd>;
364         vqmmc-supply = <&sd_switch>;
365         status = "okay";
366 };
367
368 &sdmmc2 {
369         pinctrl-names = "default";
370         pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_b>;
371         non-removable;
372         no-sd;
373         no-sdio;
374         st,neg-edge;
375         bus-width = <8>;
376         vmmc-supply = <&v3v3>;
377         mmc-ddr-3_3v;
378         status = "okay";
379 };
380
381 &spi2 {
382         pinctrl-names = "default";
383         pinctrl-0 = <&spi2_pins_a>;
384         status = "okay";
385 };
386
387 &uart4 {
388         /* On Low speed expansion header */
389         label = "LS-UART1";
390         pinctrl-names = "default";
391         pinctrl-0 = <&uart4_pins_b>;
392         status = "okay";
393 };
394
395 &uart7 {
396         /* On Low speed expansion header */
397         label = "LS-UART0";
398         pinctrl-names = "default";
399         pinctrl-0 = <&uart7_pins_a>;
400         status = "okay";
401 };
402
403 &usbh_ehci {
404         phys = <&usbphyc_port0>;
405         phy-names = "usb";
406         status = "okay";
407 };
408
409 &usbotg_hs {
410         dr_mode = "peripheral";
411         phys = <&usbphyc_port1 0>;
412         phy-names = "usb2-phy";
413         status = "okay";
414 };
415
416 &usbphyc {
417         status = "okay";
418 };
419
420 &usbphyc_port0 {
421         phy-supply = <&vdd_usb>;
422 };
423
424 &usbphyc_port1 {
425         phy-supply = <&vdd_usb>;
426 };