stm32mp1: add stusb1600 support for DK1 and DK2 board
[oweals/u-boot.git] / arch / arm / dts / stm32mp157a-dk1.dts
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  */
6
7 /dts-v1/;
8
9 #include "stm32mp157c.dtsi"
10 #include "stm32mp157-pinctrl.dtsi"
11 #include <dt-bindings/gpio/gpio.h>
12 #include <dt-bindings/mfd/st,stpmic1.h>
13
14 / {
15         model = "STMicroelectronics STM32MP157A-DK1 Discovery Board";
16         compatible = "st,stm32mp157a-dk1", "st,stm32mp157";
17
18         aliases {
19                 ethernet0 = &ethernet0;
20                 serial0 = &uart4;
21         };
22
23         chosen {
24                 stdout-path = "serial0:115200n8";
25         };
26
27         memory@c0000000 {
28                 reg = <0xc0000000 0x20000000>;
29         };
30
31         led {
32                 compatible = "gpio-leds";
33                 blue {
34                         label = "heartbeat";
35                         gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
36                         linux,default-trigger = "heartbeat";
37                         default-state = "off";
38                 };
39         };
40 };
41
42 &ethernet0 {
43         status = "okay";
44         pinctrl-0 = <&ethernet0_rgmii_pins_a>;
45         pinctrl-1 = <&ethernet0_rgmii_pins_sleep_a>;
46         pinctrl-names = "default", "sleep";
47         phy-mode = "rgmii";
48         max-speed = <1000>;
49         phy-handle = <&phy0>;
50
51         mdio0 {
52                 #address-cells = <1>;
53                 #size-cells = <0>;
54                 compatible = "snps,dwmac-mdio";
55                 phy0: ethernet-phy@0 {
56                         reg = <0>;
57                 };
58         };
59 };
60
61 &i2c4 {
62         pinctrl-names = "default";
63         pinctrl-0 = <&i2c4_pins_a>;
64         i2c-scl-rising-time-ns = <185>;
65         i2c-scl-falling-time-ns = <20>;
66         status = "okay";
67         /delete-property/dmas;
68         /delete-property/dma-names;
69
70         typec: stusb1600@28 {
71                 compatible = "st,stusb1600";
72                 reg = <0x28>;
73                 interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
74                 interrupt-parent = <&gpioi>;
75                 pinctrl-names = "default";
76                 pinctrl-0 = <&stusb1600_pins_a>;
77
78                 status = "okay";
79
80                 typec_con: connector {
81                         compatible = "usb-c-connector";
82                         label = "USB-C";
83                         power-role = "sink";
84                         power-opmode = "default";
85                 };
86         };
87
88         pmic: stpmic@33 {
89                 compatible = "st,stpmic1";
90                 reg = <0x33>;
91                 interrupt-controller;
92                 #interrupt-cells = <2>;
93                 status = "okay";
94
95                 st,main-control-register = <0x04>;
96                 st,vin-control-register = <0xc0>;
97                 st,usb-control-register = <0x20>;
98
99                 regulators {
100                         compatible = "st,stpmic1-regulators";
101
102                         ldo1-supply = <&v3v3>;
103                         ldo3-supply = <&vdd_ddr>;
104                         ldo6-supply = <&v3v3>;
105                         pwr_sw1-supply = <&bst_out>;
106                         pwr_sw2-supply = <&bst_out>;
107
108                         vddcore: buck1 {
109                                 regulator-name = "vddcore";
110                                 regulator-min-microvolt = <1200000>;
111                                 regulator-max-microvolt = <1350000>;
112                                 regulator-always-on;
113                                 regulator-initial-mode = <0>;
114                                 regulator-over-current-protection;
115                         };
116
117                         vdd_ddr: buck2 {
118                                 regulator-name = "vdd_ddr";
119                                 regulator-min-microvolt = <1350000>;
120                                 regulator-max-microvolt = <1350000>;
121                                 regulator-always-on;
122                                 regulator-initial-mode = <0>;
123                                 regulator-over-current-protection;
124                         };
125
126                         vdd: buck3 {
127                                 regulator-name = "vdd";
128                                 regulator-min-microvolt = <3300000>;
129                                 regulator-max-microvolt = <3300000>;
130                                 regulator-always-on;
131                                 st,mask-reset;
132                                 regulator-initial-mode = <0>;
133                                 regulator-over-current-protection;
134                         };
135
136                         v3v3: buck4 {
137                                 regulator-name = "v3v3";
138                                 regulator-min-microvolt = <3300000>;
139                                 regulator-max-microvolt = <3300000>;
140                                 regulator-always-on;
141                                 regulator-over-current-protection;
142                                 regulator-initial-mode = <0>;
143                         };
144
145                         v1v8_audio: ldo1 {
146                                 regulator-name = "v1v8_audio";
147                                 regulator-min-microvolt = <1800000>;
148                                 regulator-max-microvolt = <1800000>;
149                                 regulator-always-on;
150                                 interrupts = <IT_CURLIM_LDO1 0>;
151                         };
152
153                         v3v3_hdmi: ldo2 {
154                                 regulator-name = "v3v3_hdmi";
155                                 regulator-min-microvolt = <3300000>;
156                                 regulator-max-microvolt = <3300000>;
157                                 regulator-always-on;
158                                 interrupts = <IT_CURLIM_LDO2 0>;
159                         };
160
161                         vtt_ddr: ldo3 {
162                                 regulator-name = "vtt_ddr";
163                                 regulator-min-microvolt = <500000>;
164                                 regulator-max-microvolt = <750000>;
165                                 regulator-always-on;
166                                 regulator-over-current-protection;
167                         };
168
169                         vdd_usb: ldo4 {
170                                 regulator-name = "vdd_usb";
171                                 regulator-min-microvolt = <3300000>;
172                                 regulator-max-microvolt = <3300000>;
173                                 interrupts = <IT_CURLIM_LDO4 0>;
174                         };
175
176                         vdda: ldo5 {
177                                 regulator-name = "vdda";
178                                 regulator-min-microvolt = <2900000>;
179                                 regulator-max-microvolt = <2900000>;
180                                 interrupts = <IT_CURLIM_LDO5 0>;
181                                 regulator-boot-on;
182                         };
183
184                         v1v2_hdmi: ldo6 {
185                                 regulator-name = "v1v2_hdmi";
186                                 regulator-min-microvolt = <1200000>;
187                                 regulator-max-microvolt = <1200000>;
188                                 regulator-always-on;
189                                 interrupts = <IT_CURLIM_LDO6 0>;
190
191                         };
192
193                         vref_ddr: vref_ddr {
194                                 regulator-name = "vref_ddr";
195                                 regulator-always-on;
196                                 regulator-over-current-protection;
197                         };
198
199                          bst_out: boost {
200                                 regulator-name = "bst_out";
201                                 interrupts = <IT_OCP_BOOST 0>;
202                          };
203
204                         vbus_otg: pwr_sw1 {
205                                 regulator-name = "vbus_otg";
206                                 interrupts = <IT_OCP_OTG 0>;
207                                 regulator-active-discharge;
208                          };
209
210                          vbus_sw: pwr_sw2 {
211                                 regulator-name = "vbus_sw";
212                                 interrupts = <IT_OCP_SWOUT 0>;
213                                 regulator-active-discharge;
214                          };
215                 };
216
217                 onkey {
218                         compatible = "st,stpmic1-onkey";
219                         interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 1>;
220                         interrupt-names = "onkey-falling", "onkey-rising";
221                         status = "okay";
222                 };
223
224                 watchdog {
225                         compatible = "st,stpmic1-wdt";
226                         status = "disabled";
227                 };
228         };
229 };
230
231 &iwdg2 {
232         timeout-sec = <32>;
233         status = "okay";
234 };
235
236 &pwr {
237         pwr-supply = <&vdd>;
238 };
239
240 &rng1 {
241         status = "okay";
242 };
243
244 &rtc {
245         status = "okay";
246 };
247
248 &sdmmc1 {
249         pinctrl-names = "default";
250         pinctrl-0 = <&sdmmc1_b4_pins_a>;
251         broken-cd;
252         st,neg-edge;
253         bus-width = <4>;
254         vmmc-supply = <&v3v3>;
255         status = "okay";
256 };
257
258 &uart4 {
259         pinctrl-names = "default";
260         pinctrl-0 = <&uart4_pins_a>;
261         status = "okay";
262 };
263
264 &usbh_ehci {
265         phys = <&usbphyc_port0>;
266         phy-names = "usb";
267         status = "okay";
268 };
269
270 &usbotg_hs {
271         dr_mode = "peripheral";
272         phys = <&usbphyc_port1 0>;
273         phy-names = "usb2-phy";
274         status = "okay";
275 };
276
277 &usbphyc {
278         status = "okay";
279 };
280
281 &usbphyc_port0 {
282         phy-supply = <&vdd_usb>;
283 };
284
285 &usbphyc_port1 {
286         phy-supply = <&vdd_usb>;
287 };
288
289 &vrefbuf {
290         regulator-min-microvolt = <2500000>;
291         regulator-max-microvolt = <2500000>;
292         vdda-supply = <&vdd>;
293         status = "okay";
294 };