GNU Linux-libre 5.4.274-gnu1
[releases.git] / arch / arm / boot / 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                 ethernet0 = &ethernet0;
20                 mmc0 = &sdmmc1;
21                 serial0 = &uart4;
22                 serial1 = &uart7;
23         };
24
25         chosen {
26                 stdout-path = "serial0:115200n8";
27         };
28
29         memory@c0000000 {
30                 device_type = "memory";
31                 reg = <0xc0000000 0x40000000>;
32         };
33
34         led {
35                 compatible = "gpio-leds";
36                 led1 {
37                         label = "green:user1";
38                         gpios = <&gpioz 7 GPIO_ACTIVE_HIGH>;
39                         linux,default-trigger = "heartbeat";
40                         default-state = "off";
41                 };
42
43                 led2 {
44                         label = "green:user2";
45                         gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>;
46                         linux,default-trigger = "mmc0";
47                         default-state = "off";
48                 };
49
50                 led3 {
51                         label = "green:user3";
52                         gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
53                         linux,default-trigger = "mmc1";
54                         default-state = "off";
55                 };
56
57                 led4 {
58                         label = "green:user3";
59                         gpios = <&gpiog 1 GPIO_ACTIVE_HIGH>;
60                         linux,default-trigger = "none";
61                         default-state = "off";
62                         panic-indicator;
63                 };
64
65                 led5 {
66                         label = "yellow:wifi";
67                         gpios = <&gpioz 3 GPIO_ACTIVE_HIGH>;
68                         linux,default-trigger = "phy0tx";
69                         default-state = "off";
70                 };
71
72                 led6 {
73                         label = "blue:bt";
74                         gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
75                         linux,default-trigger = "bluetooth-power";
76                         default-state = "off";
77                 };
78         };
79 };
80
81 &ethernet0 {
82         status = "okay";
83         pinctrl-0 = <&ethernet0_rgmii_pins_a>;
84         pinctrl-1 = <&ethernet0_rgmii_pins_sleep_a>;
85         pinctrl-names = "default", "sleep";
86         phy-mode = "rgmii";
87         max-speed = <1000>;
88         phy-handle = <&phy0>;
89
90         mdio0 {
91                 #address-cells = <1>;
92                 #size-cells = <0>;
93                 compatible = "snps,dwmac-mdio";
94                 reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
95                 reset-delay-us = <1000>;
96
97                 phy0: ethernet-phy@7 {
98                         reg = <7>;
99                 };
100         };
101 };
102
103 &i2c1 {
104         pinctrl-names = "default";
105         pinctrl-0 = <&i2c1_pins_b>;
106         i2c-scl-rising-time-ns = <185>;
107         i2c-scl-falling-time-ns = <20>;
108         status = "okay";
109         /delete-property/dmas;
110         /delete-property/dma-names;
111 };
112
113 &i2c2 {
114         pinctrl-names = "default";
115         pinctrl-0 = <&i2c2_pins_b1 &i2c2_pins_b2>;
116         i2c-scl-rising-time-ns = <185>;
117         i2c-scl-falling-time-ns = <20>;
118         status = "okay";
119         /delete-property/dmas;
120         /delete-property/dma-names;
121 };
122
123 &i2c4 {
124         pinctrl-names = "default";
125         pinctrl-0 = <&i2c4_pins_a>;
126         i2c-scl-rising-time-ns = <185>;
127         i2c-scl-falling-time-ns = <20>;
128         status = "okay";
129         /delete-property/dmas;
130         /delete-property/dma-names;
131
132         pmic: stpmic@33 {
133                 compatible = "st,stpmic1";
134                 reg = <0x33>;
135                 interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;
136                 interrupt-controller;
137                 #interrupt-cells = <2>;
138                 status = "okay";
139
140                 st,main-control-register = <0x04>;
141                 st,vin-control-register = <0xc0>;
142                 st,usb-control-register = <0x30>;
143
144                 regulators {
145                         compatible = "st,stpmic1-regulators";
146
147                         ldo1-supply = <&v3v3>;
148                         ldo2-supply = <&v3v3>;
149                         ldo3-supply = <&vdd_ddr>;
150                         ldo5-supply = <&v3v3>;
151                         ldo6-supply = <&v3v3>;
152                         pwr_sw1-supply = <&bst_out>;
153                         pwr_sw2-supply = <&bst_out>;
154
155                         vddcore: buck1 {
156                                 regulator-name = "vddcore";
157                                 regulator-min-microvolt = <1200000>;
158                                 regulator-max-microvolt = <1350000>;
159                                 regulator-always-on;
160                                 regulator-initial-mode = <0>;
161                                 regulator-over-current-protection;
162                         };
163
164                         vdd_ddr: buck2 {
165                                 regulator-name = "vdd_ddr";
166                                 regulator-min-microvolt = <1350000>;
167                                 regulator-max-microvolt = <1350000>;
168                                 regulator-always-on;
169                                 regulator-initial-mode = <0>;
170                                 regulator-over-current-protection;
171                         };
172
173                         vdd: buck3 {
174                                 regulator-name = "vdd";
175                                 regulator-min-microvolt = <3300000>;
176                                 regulator-max-microvolt = <3300000>;
177                                 regulator-always-on;
178                                 st,mask_reset;
179                                 regulator-initial-mode = <0>;
180                                 regulator-over-current-protection;
181                         };
182
183                         v3v3: buck4 {
184                                 regulator-name = "v3v3";
185                                 regulator-min-microvolt = <3300000>;
186                                 regulator-max-microvolt = <3300000>;
187                                 regulator-always-on;
188                                 regulator-over-current-protection;
189                                 regulator-initial-mode = <0>;
190                         };
191
192                         vdda: ldo1 {
193                                 regulator-name = "vdda";
194                                 regulator-min-microvolt = <2900000>;
195                                 regulator-max-microvolt = <2900000>;
196                                 interrupts = <IT_CURLIM_LDO1 0>;
197                                 interrupt-parent = <&pmic>;
198                         };
199
200                         v2v8: ldo2 {
201                                 regulator-name = "v2v8";
202                                 regulator-min-microvolt = <2800000>;
203                                 regulator-max-microvolt = <2800000>;
204                                 interrupts = <IT_CURLIM_LDO2 0>;
205                                 interrupt-parent = <&pmic>;
206                         };
207
208                         vtt_ddr: ldo3 {
209                                 regulator-name = "vtt_ddr";
210                                 regulator-min-microvolt = <500000>;
211                                 regulator-max-microvolt = <750000>;
212                                 regulator-always-on;
213                                 regulator-over-current-protection;
214                         };
215
216                         vdd_usb: ldo4 {
217                                 regulator-name = "vdd_usb";
218                                 regulator-min-microvolt = <3300000>;
219                                 regulator-max-microvolt = <3300000>;
220                                 interrupts = <IT_CURLIM_LDO4 0>;
221                                 interrupt-parent = <&pmic>;
222                         };
223
224                         vdd_sd: ldo5 {
225                                 regulator-name = "vdd_sd";
226                                 regulator-min-microvolt = <2900000>;
227                                 regulator-max-microvolt = <2900000>;
228                                 interrupts = <IT_CURLIM_LDO5 0>;
229                                 interrupt-parent = <&pmic>;
230                                 regulator-boot-on;
231                         };
232
233                         v1v8: ldo6 {
234                                 regulator-name = "v1v8";
235                                 regulator-min-microvolt = <1800000>;
236                                 regulator-max-microvolt = <1800000>;
237                                 interrupts = <IT_CURLIM_LDO6 0>;
238                                 interrupt-parent = <&pmic>;
239                                 regulator-enable-ramp-delay = <300000>;
240                         };
241
242                         vref_ddr: vref_ddr {
243                                 regulator-name = "vref_ddr";
244                                 regulator-always-on;
245                                 regulator-over-current-protection;
246                         };
247
248                         bst_out: boost {
249                                 regulator-name = "bst_out";
250                                 interrupts = <IT_OCP_BOOST 0>;
251                                 interrupt-parent = <&pmic>;
252                         };
253
254                         vbus_otg: pwr_sw1 {
255                                 regulator-name = "vbus_otg";
256                                 interrupts = <IT_OCP_OTG 0>;
257                                 interrupt-parent = <&pmic>;
258                                 regulator-active-discharge;
259                         };
260
261                         vbus_sw: pwr_sw2 {
262                                 regulator-name = "vbus_sw";
263                                 interrupts = <IT_OCP_SWOUT 0>;
264                                 interrupt-parent = <&pmic>;
265                                 regulator-active-discharge;
266                         };
267                 };
268
269                 onkey {
270                         compatible = "st,stpmic1-onkey";
271                         interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 1>;
272                         interrupt-names = "onkey-falling", "onkey-rising";
273                         status = "okay";
274                 };
275
276                 watchdog {
277                         compatible = "st,stpmic1-wdt";
278                         status = "disabled";
279                 };
280         };
281 };
282
283 &iwdg2 {
284         timeout-sec = <32>;
285         status = "okay";
286 };
287
288 &rng1 {
289         status = "okay";
290 };
291
292 &rtc {
293         status = "okay";
294 };
295
296 &sdmmc1 {
297         pinctrl-names = "default", "opendrain", "sleep";
298         pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
299         pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
300         pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
301         broken-cd;
302         st,sig-dir;
303         st,neg-edge;
304         st,use-ckin;
305         bus-width = <4>;
306         vmmc-supply = <&vdd_sd>;
307         status = "okay";
308 };
309
310 &uart4 {
311         /* On Low speed expansion header */
312         label = "LS-UART1";
313         pinctrl-names = "default";
314         pinctrl-0 = <&uart4_pins_b>;
315         status = "okay";
316 };
317
318 &uart7 {
319         /* On Low speed expansion header */
320         label = "LS-UART0";
321         pinctrl-names = "default";
322         pinctrl-0 = <&uart7_pins_a>;
323         status = "okay";
324 };