b7bf36b802dcb47d897fb36997f07423fd9107f5
[platform/kernel/linux-starfive.git] / arch / arm / boot / dts / stm32mp135f-dk.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2 /*
3  * Copyright (C) STMicroelectronics 2021 - All Rights Reserved
4  * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
5  */
6
7 /dts-v1/;
8
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/leds/common.h>
12 #include "stm32mp135.dtsi"
13 #include "stm32mp13xf.dtsi"
14 #include "stm32mp13-pinctrl.dtsi"
15
16 / {
17         model = "STMicroelectronics STM32MP135F-DK Discovery Board";
18         compatible = "st,stm32mp135f-dk", "st,stm32mp135";
19
20         aliases {
21                 serial0 = &uart4;
22         };
23
24         memory@c0000000 {
25                 device_type = "memory";
26                 reg = <0xc0000000 0x20000000>;
27         };
28
29         reserved-memory {
30                 #address-cells = <1>;
31                 #size-cells = <1>;
32                 ranges;
33
34                 optee@dd000000 {
35                         reg = <0xdd000000 0x3000000>;
36                         no-map;
37                 };
38         };
39
40         gpio-keys {
41                 compatible = "gpio-keys";
42
43                 user-pa13 {
44                         label = "User-PA13";
45                         linux,code = <BTN_1>;
46                         gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
47                 };
48         };
49
50         leds {
51                 compatible = "gpio-leds";
52
53                 led-blue {
54                         function = LED_FUNCTION_HEARTBEAT;
55                         color = <LED_COLOR_ID_BLUE>;
56                         gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
57                         linux,default-trigger = "heartbeat";
58                         default-state = "off";
59                 };
60         };
61
62         v3v3_sw: v3v3-sw {
63                 compatible = "regulator-fixed";
64                 regulator-name = "v3v3_sw";
65                 regulator-min-microvolt = <3300000>;
66                 regulator-max-microvolt = <3300000>;
67                 regulator-always-on;
68         };
69
70         vdd_adc: vdd-adc {
71                 compatible = "regulator-fixed";
72                 regulator-name = "vdd_adc";
73                 regulator-min-microvolt = <3300000>;
74                 regulator-max-microvolt = <3300000>;
75                 regulator-always-on;
76         };
77
78         vdd_sd: vdd-sd {
79                 compatible = "regulator-fixed";
80                 regulator-name = "vdd_sd";
81                 regulator-min-microvolt = <2900000>;
82                 regulator-max-microvolt = <2900000>;
83                 regulator-always-on;
84         };
85
86         vdd_usb: vdd-usb {
87                 compatible = "regulator-fixed";
88                 regulator-name = "vdd_usb";
89                 regulator-min-microvolt = <3300000>;
90                 regulator-max-microvolt = <3300000>;
91                 regulator-always-on;
92         };
93 };
94
95 &adc_1 {
96         pinctrl-names = "default";
97         pinctrl-0 = <&adc1_usb_cc_pins_a>;
98         vdda-supply = <&vdd_adc>;
99         vref-supply = <&vdd_adc>;
100         status = "okay";
101         adc1: adc@0 {
102                 status = "okay";
103                 /*
104                  * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in6 & in12.
105                  * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
106                  * 5 * (5.1 + 47kOhms) * 5pF => 1.3us.
107                  * Use arbitrary margin here (e.g. 5us).
108                  */
109                 channel@6 {
110                         reg = <6>;
111                         st,min-sample-time-ns = <5000>;
112                 };
113                 channel@12 {
114                         reg = <12>;
115                         st,min-sample-time-ns = <5000>;
116                 };
117         };
118 };
119
120 &i2c1 {
121         pinctrl-names = "default", "sleep";
122         pinctrl-0 = <&i2c1_pins_a>;
123         pinctrl-1 = <&i2c1_sleep_pins_a>;
124         i2c-scl-rising-time-ns = <96>;
125         i2c-scl-falling-time-ns = <3>;
126         clock-frequency = <1000000>;
127         status = "okay";
128         /* spare dmas for other usage */
129         /delete-property/dmas;
130         /delete-property/dma-names;
131
132         typec@53 {
133                 compatible = "st,stm32g0-typec";
134                 reg = <0x53>;
135                 /* Alert pin on PI2 */
136                 interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
137                 interrupt-parent = <&gpioi>;
138                 /* Internal pull-up on PI2 */
139                 pinctrl-names = "default";
140                 pinctrl-0 = <&stm32g0_intn_pins_a>;
141                 firmware-name = "stm32g0-ucsi.mp135f-dk.fw";
142                 connector {
143                         compatible = "usb-c-connector";
144                         label = "USB-C";
145
146                         port {
147                                 con_usb_c_g0_ep: endpoint {
148                                         remote-endpoint = <&usbotg_hs_ep>;
149                                 };
150                         };
151                 };
152         };
153 };
154
155 &i2c5 {
156         pinctrl-names = "default", "sleep";
157         pinctrl-0 = <&i2c5_pins_a>;
158         pinctrl-1 = <&i2c5_sleep_pins_a>;
159         i2c-scl-rising-time-ns = <170>;
160         i2c-scl-falling-time-ns = <5>;
161         clock-frequency = <400000>;
162         status = "okay";
163         /* spare dmas for other usage */
164         /delete-property/dmas;
165         /delete-property/dma-names;
166 };
167
168 &iwdg2 {
169         timeout-sec = <32>;
170         status = "okay";
171 };
172
173 &rtc {
174         status = "okay";
175 };
176
177 &sdmmc1 {
178         pinctrl-names = "default", "opendrain", "sleep";
179         pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_clk_pins_a>;
180         pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_clk_pins_a>;
181         pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
182         cd-gpios = <&gpioh 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
183         disable-wp;
184         st,neg-edge;
185         bus-width = <4>;
186         vmmc-supply = <&vdd_sd>;
187         status = "okay";
188 };
189
190 &spi5 {
191         pinctrl-names = "default", "sleep";
192         pinctrl-0 = <&spi5_pins_a>;
193         pinctrl-1 = <&spi5_sleep_pins_a>;
194         status = "disabled";
195 };
196
197 &uart4 {
198         pinctrl-names = "default";
199         pinctrl-0 = <&uart4_pins_a>;
200         status = "okay";
201 };
202
203 &usbh_ehci {
204         phys = <&usbphyc_port0>;
205         status = "okay";
206         #address-cells = <1>;
207         #size-cells = <0>;
208         /* onboard HUB */
209         hub@1 {
210                 compatible = "usb424,2514";
211                 reg = <1>;
212                 vdd-supply = <&v3v3_sw>;
213         };
214 };
215
216 &usbotg_hs {
217         phys = <&usbphyc_port1 0>;
218         phy-names = "usb2-phy";
219         usb-role-switch;
220         status = "okay";
221         port {
222                 usbotg_hs_ep: endpoint {
223                         remote-endpoint = <&con_usb_c_g0_ep>;
224                 };
225         };
226 };
227
228 &usbphyc {
229         status = "okay";
230 };
231
232 &usbphyc_port0 {
233         phy-supply = <&vdd_usb>;
234         st,current-boost-microamp = <1000>;
235         st,decrease-hs-slew-rate;
236         st,tune-hs-dc-level = <2>;
237         st,enable-hs-rftime-reduction;
238         st,trim-hs-current = <11>;
239         st,trim-hs-impedance = <2>;
240         st,tune-squelch-level = <1>;
241         st,enable-hs-rx-gain-eq;
242         st,no-hs-ftime-ctrl;
243         st,no-lsfs-sc;
244 };
245
246 &usbphyc_port1 {
247         phy-supply = <&vdd_usb>;
248         st,current-boost-microamp = <1000>;
249         st,decrease-hs-slew-rate;
250         st,tune-hs-dc-level = <2>;
251         st,enable-hs-rftime-reduction;
252         st,trim-hs-current = <11>;
253         st,trim-hs-impedance = <2>;
254         st,tune-squelch-level = <1>;
255         st,enable-hs-rx-gain-eq;
256         st,no-hs-ftime-ctrl;
257         st,no-lsfs-sc;
258 };