blob: 5a3292699640ad308baa6bafb36923b78feda67c [file] [log] [blame]
Eugen Hristev32f36cf2023-02-22 11:05:12 +02001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2023 Collabora Ltd.
4 */
5
6#include "rk3588-u-boot.dtsi"
Eugen Hristeva856b1a2023-05-15 12:59:45 +03007#include <dt-bindings/pinctrl/rockchip.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/gpio/gpio.h>
Eugen Hristev41bbad82023-05-29 13:01:35 +030010#include <dt-bindings/usb/pd.h>
Eugen Hristev32f36cf2023-02-22 11:05:12 +020011
12/ {
13 aliases {
Jonas Karlmanced8be02023-04-18 16:46:41 +000014 mmc1 = &sdmmc;
Jonas Karlmanadb78942023-05-18 15:39:30 +000015 spi0 = &sfc;
Eugen Hristev32f36cf2023-02-22 11:05:12 +020016 };
17
18 chosen {
Jonas Karlmanced8be02023-04-18 16:46:41 +000019 u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
Eugen Hristev32f36cf2023-02-22 11:05:12 +020020 };
Eugen Hristeva856b1a2023-05-15 12:59:45 +030021
Eugen Hristev41bbad82023-05-29 13:01:35 +030022 vcc12v_dcin: vcc12v-dcin-regulator {
23 compatible = "regulator-fixed";
24 regulator-name = "vcc12v_dcin";
25 regulator-always-on;
26 regulator-boot-on;
27 regulator-min-microvolt = <12000000>;
28 regulator-max-microvolt = <12000000>;
29 };
30
31 vcc5v0_usbdcin: vcc5v0-usbdcin {
32 compatible = "regulator-fixed";
33 regulator-name = "vcc5v0_usbdcin";
34 regulator-always-on;
35 regulator-boot-on;
36 regulator-min-microvolt = <5000000>;
37 regulator-max-microvolt = <5000000>;
38 vin-supply = <&vcc12v_dcin>;
39 };
40
Eugen Hristeva856b1a2023-05-15 12:59:45 +030041 vcc5v0_host: vcc5v0-host-regulator {
42 compatible = "regulator-fixed";
43 regulator-name = "vcc5v0_host";
44 regulator-min-microvolt = <5000000>;
45 regulator-max-microvolt = <5000000>;
46 enable-active-high;
47 gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>;
48 pinctrl-names = "default";
49 pinctrl-0 = <&vcc5v0_host_en>;
50 vin-supply = <&vcc5v0_sys>;
51 };
Eugen Hristev41bbad82023-05-29 13:01:35 +030052
53 vcc5v0_usb: vcc5v0-usb {
54 compatible = "regulator-fixed";
55 regulator-name = "vcc5v0_usb";
56 regulator-always-on;
57 regulator-boot-on;
58 regulator-min-microvolt = <5000000>;
59 regulator-max-microvolt = <5000000>;
60 vin-supply = <&vcc5v0_usbdcin>;
61 };
62
63 vbus5v0_typec: vbus5v0-typec {
64 compatible = "regulator-fixed";
65 regulator-name = "vbus5v0_typec";
66 regulator-min-microvolt = <5000000>;
67 regulator-max-microvolt = <5000000>;
68 enable-active-high;
69 gpio = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
70 vin-supply = <&vcc5v0_usb>;
71 pinctrl-names = "default";
72 pinctrl-0 = <&typec5v_pwren>;
73 };
Eugen Hristeva856b1a2023-05-15 12:59:45 +030074};
75
Christopher Obbard6abdb9c2023-05-17 13:01:01 +030076&combphy0_ps {
77 status = "okay";
78};
79
Jonas Karlman90e924d2023-05-17 18:26:39 +000080&emmc_bus8 {
81 bootph-all;
82};
83
84&emmc_clk {
85 bootph-all;
86};
87
88&emmc_cmd {
89 bootph-all;
90};
91
92&emmc_data_strobe {
93 bootph-all;
94};
95
96&emmc_rstnout {
97 bootph-all;
98};
99
Jonas Karlmanadb78942023-05-18 15:39:30 +0000100&fspim2_pins {
101 bootph-all;
102};
103
Christopher Obbard6abdb9c2023-05-17 13:01:01 +0300104&pcie2x1l2 {
105 pinctrl-names = "default";
106 pinctrl-0 = <&pcie2x1l2_pins &pcie_reset_h>;
107 reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
108 status = "okay";
109};
110
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300111&pinctrl {
Eugen Hristevb98429b2023-05-15 16:44:02 +0300112 bootph-all;
113
Christopher Obbard6abdb9c2023-05-17 13:01:01 +0300114 pcie {
115 pcie_reset_h: pcie-reset-h {
116 rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
117 };
118
119 pcie2x1l2_pins: pcie2x1l2-pins {
120 rockchip,pins = <3 RK_PC7 4 &pcfg_pull_none>,
121 <3 RK_PD0 4 &pcfg_pull_none>;
122 };
123 };
124
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300125 usb {
126 vcc5v0_host_en: vcc5v0-host-en {
127 rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
128 };
129 };
Eugen Hristev41bbad82023-05-29 13:01:35 +0300130
131 usb-typec {
132 usbc0_int: usbc0-int {
133 rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>;
134 };
135
136 typec5v_pwren: typec5v-pwren {
137 rockchip,pins = <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
138 };
139 };
Eugen Hristev32f36cf2023-02-22 11:05:12 +0200140};
141
Jonas Karlman90e924d2023-05-17 18:26:39 +0000142&pcfg_pull_none {
143 bootph-all;
144};
145
Eugen Hristevb98429b2023-05-15 16:44:02 +0300146&pcfg_pull_up_drv_level_2 {
147 bootph-all;
148};
149
150&pcfg_pull_up {
151 bootph-all;
152};
153
Eugen Hristev32f36cf2023-02-22 11:05:12 +0200154&sdmmc {
155 bus-width = <4>;
Eugen Hristev32f36cf2023-02-22 11:05:12 +0200156 status = "okay";
157};
Jonas Karlmanced8be02023-04-18 16:46:41 +0000158
Eugen Hristevb98429b2023-05-15 16:44:02 +0300159&sdmmc_bus4 {
160 bootph-all;
161};
162
163&sdmmc_clk {
164 bootph-all;
165};
166
167&sdmmc_cmd {
168 bootph-all;
169};
170
171&sdmmc_det {
172 bootph-all;
173};
174
Jonas Karlmanced8be02023-04-18 16:46:41 +0000175&sdhci {
176 cap-mmc-highspeed;
177 mmc-ddr-1_8v;
178 mmc-hs200-1_8v;
179 pinctrl-names = "default";
180 pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe &emmc_rstnout>;
181};
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300182
Jonas Karlmanadb78942023-05-18 15:39:30 +0000183&sfc {
184 bootph-pre-ram;
185 u-boot,spl-sfc-no-dma;
186 pinctrl-names = "default";
187 pinctrl-0 = <&fspim2_pins>;
188 #address-cells = <1>;
189 #size-cells = <0>;
190 status = "okay";
191
192 flash@0 {
193 bootph-pre-ram;
194 compatible = "jedec,spi-nor";
195 reg = <0>;
196 spi-max-frequency = <24000000>;
197 spi-rx-bus-width = <4>;
198 spi-tx-bus-width = <1>;
199 };
200};
201
Jonas Karlman90e924d2023-05-17 18:26:39 +0000202&uart2m0_xfer {
203 bootph-all;
204};
205
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300206&usb_host0_ehci {
207 companion = <&usb_host0_ohci>;
208 phys = <&u2phy2_host>;
209 phy-names = "usb2-phy";
210 status = "okay";
211};
212
213&usb_host0_ohci {
214 phys = <&u2phy2_host>;
215 phy-names = "usb2-phy";
216 status = "okay";
217};
218
219&usb2phy2_grf {
220 status = "okay";
221};
222
Eugen Hristev41bbad82023-05-29 13:01:35 +0300223&u2phy0 {
224 status = "okay";
225};
226
227&u2phy0_otg {
228 rockchip,typec-vbus-det;
229 status = "okay";
230};
231
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300232&u2phy2 {
233 resets = <&cru SRST_OTGPHY_U2_0>, <&cru SRST_P_USB2PHY_U2_0_GRF0>;
234 reset-names = "phy", "apb";
235 clock-output-names = "usb480m_phy2";
236 status = "okay";
237};
238
239&u2phy2_host {
240 phy-supply = <&vcc5v0_host>;
241 status = "okay";
242};
243
244&usb_host1_ehci {
245 companion = <&usb_host1_ohci>;
246 phys = <&u2phy3_host>;
247 phy-names = "usb2-phy";
248 status = "okay";
249};
250
251&usb_host1_ohci {
252 phys = <&u2phy3_host>;
253 phy-names = "usb2-phy";
254 status = "okay";
255};
256
257&usb2phy3_grf {
258 status = "okay";
259};
260
261&u2phy3 {
262 resets = <&cru SRST_OTGPHY_U2_1>, <&cru SRST_P_USB2PHY_U2_1_GRF0>;
263 reset-names = "phy", "apb";
264 clock-output-names = "usb480m_phy3";
265 status = "okay";
266};
267
268&u2phy3_host {
269 phy-supply = <&vcc5v0_host>;
270 status = "okay";
271};
272
Eugen Hristev41bbad82023-05-29 13:01:35 +0300273&usbdp_phy0 {
274 orientation-switch;
275 svid = <0xff01>;
276 sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
277 sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
278 status = "okay";
279
280 port {
281 #address-cells = <1>;
282 #size-cells = <0>;
283 usbdp_phy0_orientation_switch: endpoint@0 {
284 reg = <0>;
285 remote-endpoint = <&usbc0_orien_sw>;
286 };
287
288 usbdp_phy0_dp_altmode_mux: endpoint@1 {
289 reg = <1>;
290 remote-endpoint = <&dp_altmode_mux>;
291 };
292 };
293};
294
295&usbdp_phy0_u3 {
296 status = "okay";
297};
298
299&usbdrd3_0 {
300 status = "okay";
301};
302
303&usbdrd_dwc3_0 {
304 dr_mode = "otg";
305 usb-role-switch;
306
307 port {
308 #address-cells = <1>;
309 #size-cells = <0>;
310 dwc3_0_role_switch: endpoint@0 {
311 reg = <0>;
312 remote-endpoint = <&usbc0_role_sw>;
313 };
314 };
315};
316
317&usbdp_phy1 {
318 rockchip,dp-lane-mux = <2 3>;
319 status = "okay";
320};
321
322&usbdp_phy1_u3 {
323 status = "okay";
324};
325
326&usbdrd3_1 {
327 status = "okay";
328};
329
330&u2phy1 {
331 status = "okay";
332};
333
334&u2phy1_otg {
335 status = "okay";
336};
337
338&i2c4 {
339 pinctrl-0 = <&i2c4m1_xfer>;
340 status = "okay";
341
342 usbc0: fusb302@22 {
343 compatible = "fcs,fusb302";
344 reg = <0x22>;
345 interrupt-parent = <&gpio3>;
346 interrupts = <RK_PB4 IRQ_TYPE_LEVEL_LOW>;
347 pinctrl-names = "default";
348 pinctrl-0 = <&usbc0_int>;
349 vbus-supply = <&vbus5v0_typec>;
350 status = "okay";
351
352 ports {
353 #address-cells = <1>;
354 #size-cells = <0>;
355
356 port@0 {
357 reg = <0>;
358 usbc0_role_sw: endpoint@0 {
359 remote-endpoint = <&dwc3_0_role_switch>;
360 };
361 };
362 };
363
364 usb_con: connector {
365 compatible = "usb-c-connector";
366 label = "USB-C";
367 data-role = "dual";
368 power-role = "dual";
369 try-power-role = "sink";
370 op-sink-microwatt = <1000000>;
371 sink-pdos =
372 <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
373 source-pdos =
374 <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
375
376 altmodes {
377 #address-cells = <1>;
378 #size-cells = <0>;
379
380 altmode@0 {
381 reg = <0>;
382 svid = <0xff01>;
383 vdo = <0xffffffff>;
384 };
385 };
386
387 ports {
388 #address-cells = <1>;
389 #size-cells = <0>;
390
391 port@0 {
392 reg = <0>;
393 usbc0_orien_sw: endpoint {
394 remote-endpoint = <&usbdp_phy0_orientation_switch>;
395 };
396 };
397
398 port@1 {
399 reg = <1>;
400 dp_altmode_mux: endpoint {
401 remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
402 };
403 };
404 };
405 };
406 };
407};
408