ARM: dts: stm32: Add missing ethernet PHY reset on AV96
[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
97 &ethernet0 {
98         status = "okay";
99         pinctrl-0 = <&ethernet0_rgmii_pins_b>;
100         pinctrl-1 = <&ethernet0_rgmii_pins_sleep_b>;
101         pinctrl-names = "default", "sleep";
102         phy-mode = "rgmii";
103         max-speed = <1000>;
104         phy-handle = <&phy0>;
105         phy-reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
106
107         mdio0 {
108                 #address-cells = <1>;
109                 #size-cells = <0>;
110                 compatible = "snps,dwmac-mdio";
111                 phy0: ethernet-phy@7 {
112                         reg = <7>;
113                 };
114         };
115 };
116
117 &i2c1 {
118         pinctrl-names = "default";
119         pinctrl-0 = <&i2c1_pins_b>;
120         i2c-scl-rising-time-ns = <185>;
121         i2c-scl-falling-time-ns = <20>;
122         status = "okay";
123         /delete-property/dmas;
124         /delete-property/dma-names;
125 };
126
127 &i2c2 {
128         pinctrl-names = "default";
129         pinctrl-0 = <&i2c2_pins_b1 &i2c2_pins_b2>;
130         i2c-scl-rising-time-ns = <185>;
131         i2c-scl-falling-time-ns = <20>;
132         status = "okay";
133         /delete-property/dmas;
134         /delete-property/dma-names;
135 };
136
137 &i2c4 {
138         pinctrl-names = "default";
139         pinctrl-0 = <&i2c4_pins_a>;
140         i2c-scl-rising-time-ns = <185>;
141         i2c-scl-falling-time-ns = <20>;
142         status = "okay";
143         /delete-property/dmas;
144         /delete-property/dma-names;
145
146         pmic: stpmic@33 {
147                 compatible = "st,stpmic1";
148                 reg = <0x33>;
149                 interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;
150                 interrupt-controller;
151                 #interrupt-cells = <2>;
152                 status = "okay";
153
154                 st,main-control-register = <0x04>;
155                 st,vin-control-register = <0xc0>;
156                 st,usb-control-register = <0x30>;
157
158                 regulators {
159                         compatible = "st,stpmic1-regulators";
160
161                         ldo1-supply = <&v3v3>;
162                         ldo2-supply = <&v3v3>;
163                         ldo3-supply = <&vdd_ddr>;
164                         ldo5-supply = <&v3v3>;
165                         ldo6-supply = <&v3v3>;
166                         pwr_sw1-supply = <&bst_out>;
167                         pwr_sw2-supply = <&bst_out>;
168
169                         vddcore: buck1 {
170                                 regulator-name = "vddcore";
171                                 regulator-min-microvolt = <1200000>;
172                                 regulator-max-microvolt = <1350000>;
173                                 regulator-always-on;
174                                 regulator-initial-mode = <0>;
175                                 regulator-over-current-protection;
176                         };
177
178                         vdd_ddr: buck2 {
179                                 regulator-name = "vdd_ddr";
180                                 regulator-min-microvolt = <1350000>;
181                                 regulator-max-microvolt = <1350000>;
182                                 regulator-always-on;
183                                 regulator-initial-mode = <0>;
184                                 regulator-over-current-protection;
185                         };
186
187                         vdd: buck3 {
188                                 regulator-name = "vdd";
189                                 regulator-min-microvolt = <3300000>;
190                                 regulator-max-microvolt = <3300000>;
191                                 regulator-always-on;
192                                 st,mask_reset;
193                                 regulator-initial-mode = <0>;
194                                 regulator-over-current-protection;
195                         };
196
197                         v3v3: buck4 {
198                                 regulator-name = "v3v3";
199                                 regulator-min-microvolt = <3300000>;
200                                 regulator-max-microvolt = <3300000>;
201                                 regulator-always-on;
202                                 regulator-over-current-protection;
203                                 regulator-initial-mode = <0>;
204                         };
205
206                         vdda: ldo1 {
207                                 regulator-name = "vdda";
208                                 regulator-min-microvolt = <2900000>;
209                                 regulator-max-microvolt = <2900000>;
210                                 interrupts = <IT_CURLIM_LDO1 0>;
211                                 interrupt-parent = <&pmic>;
212                         };
213
214                         v2v8: ldo2 {
215                                 regulator-name = "v2v8";
216                                 regulator-min-microvolt = <2800000>;
217                                 regulator-max-microvolt = <2800000>;
218                                 interrupts = <IT_CURLIM_LDO2 0>;
219                                 interrupt-parent = <&pmic>;
220                         };
221
222                         vtt_ddr: ldo3 {
223                                 regulator-name = "vtt_ddr";
224                                 regulator-min-microvolt = <500000>;
225                                 regulator-max-microvolt = <750000>;
226                                 regulator-always-on;
227                                 regulator-over-current-protection;
228                         };
229
230                         vdd_usb: ldo4 {
231                                 regulator-name = "vdd_usb";
232                                 regulator-min-microvolt = <3300000>;
233                                 regulator-max-microvolt = <3300000>;
234                                 interrupts = <IT_CURLIM_LDO4 0>;
235                                 interrupt-parent = <&pmic>;
236                         };
237
238                         vdd_sd: ldo5 {
239                                 regulator-name = "vdd_sd";
240                                 regulator-min-microvolt = <2900000>;
241                                 regulator-max-microvolt = <2900000>;
242                                 interrupts = <IT_CURLIM_LDO5 0>;
243                                 interrupt-parent = <&pmic>;
244                                 regulator-boot-on;
245                         };
246
247                         v1v8: ldo6 {
248                                 regulator-name = "v1v8";
249                                 regulator-min-microvolt = <1800000>;
250                                 regulator-max-microvolt = <1800000>;
251                                 interrupts = <IT_CURLIM_LDO6 0>;
252                                 interrupt-parent = <&pmic>;
253                                 regulator-enable-ramp-delay = <300000>;
254                         };
255
256                         vref_ddr: vref_ddr {
257                                 regulator-name = "vref_ddr";
258                                 regulator-always-on;
259                                 regulator-over-current-protection;
260                         };
261
262                         bst_out: boost {
263                                 regulator-name = "bst_out";
264                                 interrupts = <IT_OCP_BOOST 0>;
265                                 interrupt-parent = <&pmic>;
266                         };
267
268                         vbus_otg: pwr_sw1 {
269                                 regulator-name = "vbus_otg";
270                                 interrupts = <IT_OCP_OTG 0>;
271                                 interrupt-parent = <&pmic>;
272                         };
273
274                         vbus_sw: pwr_sw2 {
275                                 regulator-name = "vbus_sw";
276                                 interrupts = <IT_OCP_SWOUT 0>;
277                                 interrupt-parent = <&pmic>;
278                                 regulator-active-discharge = <1>;
279                         };
280                 };
281
282                 onkey {
283                         compatible = "st,stpmic1-onkey";
284                         interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 1>;
285                         interrupt-names = "onkey-falling", "onkey-rising";
286                         status = "okay";
287                 };
288
289                 watchdog {
290                         compatible = "st,stpmic1-wdt";
291                         status = "disabled";
292                 };
293         };
294
295         eeprom0: eeprom@53 {
296                 compatible = "atmel,24c02";
297                 reg = <0x53>;
298                 pagesize = <16>;
299         };
300 };
301
302 &iwdg2 {
303         timeout-sec = <32>;
304         status = "okay";
305 };
306
307 &pwr_regulators {
308         vdd-supply = <&vdd>;
309         vdd_3v3_usbfs-supply = <&vdd_usb>;
310 };
311
312 &qspi {
313         pinctrl-names = "default", "sleep";
314         pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>;
315         pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>;
316         reg = <0x58003000 0x1000>, <0x70000000 0x200000>;
317         #address-cells = <1>;
318         #size-cells = <0>;
319         status = "okay";
320
321         flash0: spi-flash@0 {
322                 compatible = "jedec,spi-nor";
323                 reg = <0>;
324                 spi-rx-bus-width = <4>;
325                 spi-max-frequency = <108000000>;
326                 #address-cells = <1>;
327                 #size-cells = <1>;
328         };
329 };
330
331 &rng1 {
332         status = "okay";
333 };
334
335 &rtc {
336         status = "okay";
337 };
338
339 &sdmmc1 {
340         pinctrl-names = "default", "opendrain", "sleep";
341         pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_b>;
342         pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_b>;
343         pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_b>;
344         cd-gpios = <&gpioi 8 GPIO_ACTIVE_LOW>;
345         disable-wp;
346         st,sig-dir;
347         st,neg-edge;
348         st,use-ckin;
349         sd-uhs-sdr104;
350         bus-width = <4>;
351         vmmc-supply = <&vdd_sd>;
352         vqmmc-supply = <&sd_switch>;
353         status = "okay";
354 };
355
356 &sdmmc2 {
357         pinctrl-names = "default";
358         pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_b>;
359         non-removable;
360         no-sd;
361         no-sdio;
362         st,neg-edge;
363         bus-width = <8>;
364         vmmc-supply = <&v3v3>;
365         mmc-ddr-3_3v;
366         status = "okay";
367 };
368
369 &spi2 {
370         pinctrl-names = "default";
371         pinctrl-0 = <&spi2_pins_a>;
372         status = "okay";
373 };
374
375 &uart4 {
376         /* On Low speed expansion header */
377         label = "LS-UART1";
378         pinctrl-names = "default";
379         pinctrl-0 = <&uart4_pins_b>;
380         status = "okay";
381 };
382
383 &uart7 {
384         /* On Low speed expansion header */
385         label = "LS-UART0";
386         pinctrl-names = "default";
387         pinctrl-0 = <&uart7_pins_a>;
388         status = "okay";
389 };
390
391 &usbh_ehci {
392         phys = <&usbphyc_port0>;
393         phy-names = "usb";
394         status = "okay";
395 };
396
397 &usbotg_hs {
398         dr_mode = "peripheral";
399         phys = <&usbphyc_port1 0>;
400         phy-names = "usb2-phy";
401         status = "okay";
402 };
403
404 &usbphyc {
405         status = "okay";
406 };
407
408 &usbphyc_port0 {
409         phy-supply = <&vdd_usb>;
410 };
411
412 &usbphyc_port1 {
413         phy-supply = <&vdd_usb>;
414 };