blob: 1b2fcbb0bb1179657e8938f96a92039a17436f37 [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;
Eugen Hristev32f36cf2023-02-22 11:05:12 +020015 };
16
17 chosen {
Jonas Karlmanced8be02023-04-18 16:46:41 +000018 u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
Eugen Hristev32f36cf2023-02-22 11:05:12 +020019 };
Eugen Hristeva856b1a2023-05-15 12:59:45 +030020
Eugen Hristev41bbad82023-05-29 13:01:35 +030021 vcc12v_dcin: vcc12v-dcin-regulator {
22 compatible = "regulator-fixed";
23 regulator-name = "vcc12v_dcin";
24 regulator-always-on;
25 regulator-boot-on;
26 regulator-min-microvolt = <12000000>;
27 regulator-max-microvolt = <12000000>;
28 };
29
30 vcc5v0_usbdcin: vcc5v0-usbdcin {
31 compatible = "regulator-fixed";
32 regulator-name = "vcc5v0_usbdcin";
33 regulator-always-on;
34 regulator-boot-on;
35 regulator-min-microvolt = <5000000>;
36 regulator-max-microvolt = <5000000>;
37 vin-supply = <&vcc12v_dcin>;
38 };
39
Eugen Hristeva856b1a2023-05-15 12:59:45 +030040 vcc5v0_host: vcc5v0-host-regulator {
41 compatible = "regulator-fixed";
42 regulator-name = "vcc5v0_host";
43 regulator-min-microvolt = <5000000>;
44 regulator-max-microvolt = <5000000>;
45 enable-active-high;
46 gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>;
47 pinctrl-names = "default";
48 pinctrl-0 = <&vcc5v0_host_en>;
49 vin-supply = <&vcc5v0_sys>;
50 };
Eugen Hristev41bbad82023-05-29 13:01:35 +030051
52 vcc5v0_usb: vcc5v0-usb {
53 compatible = "regulator-fixed";
54 regulator-name = "vcc5v0_usb";
55 regulator-always-on;
56 regulator-boot-on;
57 regulator-min-microvolt = <5000000>;
58 regulator-max-microvolt = <5000000>;
59 vin-supply = <&vcc5v0_usbdcin>;
60 };
61
62 vbus5v0_typec: vbus5v0-typec {
63 compatible = "regulator-fixed";
64 regulator-name = "vbus5v0_typec";
65 regulator-min-microvolt = <5000000>;
66 regulator-max-microvolt = <5000000>;
67 enable-active-high;
68 gpio = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
69 vin-supply = <&vcc5v0_usb>;
70 pinctrl-names = "default";
71 pinctrl-0 = <&typec5v_pwren>;
72 };
Eugen Hristeva856b1a2023-05-15 12:59:45 +030073};
74
Christopher Obbard6abdb9c2023-05-17 13:01:01 +030075&combphy0_ps {
76 status = "okay";
77};
78
Jonas Karlmanadb78942023-05-18 15:39:30 +000079&fspim2_pins {
80 bootph-all;
81};
82
Christopher Obbard6abdb9c2023-05-17 13:01:01 +030083&pcie2x1l2 {
84 pinctrl-names = "default";
85 pinctrl-0 = <&pcie2x1l2_pins &pcie_reset_h>;
86 reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
87 status = "okay";
88};
89
Eugen Hristeva856b1a2023-05-15 12:59:45 +030090&pinctrl {
Christopher Obbard6abdb9c2023-05-17 13:01:01 +030091 pcie {
92 pcie_reset_h: pcie-reset-h {
93 rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
94 };
95
96 pcie2x1l2_pins: pcie2x1l2-pins {
97 rockchip,pins = <3 RK_PC7 4 &pcfg_pull_none>,
98 <3 RK_PD0 4 &pcfg_pull_none>;
99 };
100 };
101
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300102 usb {
103 vcc5v0_host_en: vcc5v0-host-en {
104 rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
105 };
106 };
Eugen Hristev41bbad82023-05-29 13:01:35 +0300107
108 usb-typec {
109 usbc0_int: usbc0-int {
110 rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>;
111 };
112
113 typec5v_pwren: typec5v-pwren {
114 rockchip,pins = <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
115 };
116 };
Eugen Hristev32f36cf2023-02-22 11:05:12 +0200117};
118
119&sdmmc {
120 bus-width = <4>;
Eugen Hristev32f36cf2023-02-22 11:05:12 +0200121 status = "okay";
122};
Jonas Karlmanced8be02023-04-18 16:46:41 +0000123
124&sdhci {
125 cap-mmc-highspeed;
126 mmc-ddr-1_8v;
127 mmc-hs200-1_8v;
128 pinctrl-names = "default";
129 pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe &emmc_rstnout>;
130};
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300131
Jonas Karlmanadb78942023-05-18 15:39:30 +0000132&sfc {
133 bootph-pre-ram;
134 u-boot,spl-sfc-no-dma;
135 pinctrl-names = "default";
136 pinctrl-0 = <&fspim2_pins>;
137 #address-cells = <1>;
138 #size-cells = <0>;
139 status = "okay";
140
141 flash@0 {
142 bootph-pre-ram;
143 compatible = "jedec,spi-nor";
144 reg = <0>;
145 spi-max-frequency = <24000000>;
146 spi-rx-bus-width = <4>;
147 spi-tx-bus-width = <1>;
148 };
149};
150
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300151&usb_host0_ehci {
152 companion = <&usb_host0_ohci>;
153 phys = <&u2phy2_host>;
154 phy-names = "usb2-phy";
155 status = "okay";
156};
157
158&usb_host0_ohci {
159 phys = <&u2phy2_host>;
160 phy-names = "usb2-phy";
161 status = "okay";
162};
163
164&usb2phy2_grf {
165 status = "okay";
166};
167
Eugen Hristev41bbad82023-05-29 13:01:35 +0300168&u2phy0 {
169 status = "okay";
170};
171
172&u2phy0_otg {
173 rockchip,typec-vbus-det;
174 status = "okay";
175};
176
Eugen Hristeva856b1a2023-05-15 12:59:45 +0300177&u2phy2 {
178 resets = <&cru SRST_OTGPHY_U2_0>, <&cru SRST_P_USB2PHY_U2_0_GRF0>;
179 reset-names = "phy", "apb";
180 clock-output-names = "usb480m_phy2";
181 status = "okay";
182};
183
184&u2phy2_host {
185 phy-supply = <&vcc5v0_host>;
186 status = "okay";
187};
188
189&usb_host1_ehci {
190 companion = <&usb_host1_ohci>;
191 phys = <&u2phy3_host>;
192 phy-names = "usb2-phy";
193 status = "okay";
194};
195
196&usb_host1_ohci {
197 phys = <&u2phy3_host>;
198 phy-names = "usb2-phy";
199 status = "okay";
200};
201
202&usb2phy3_grf {
203 status = "okay";
204};
205
206&u2phy3 {
207 resets = <&cru SRST_OTGPHY_U2_1>, <&cru SRST_P_USB2PHY_U2_1_GRF0>;
208 reset-names = "phy", "apb";
209 clock-output-names = "usb480m_phy3";
210 status = "okay";
211};
212
213&u2phy3_host {
214 phy-supply = <&vcc5v0_host>;
215 status = "okay";
216};
217
Eugen Hristev41bbad82023-05-29 13:01:35 +0300218&usbdp_phy0 {
219 orientation-switch;
220 svid = <0xff01>;
221 sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
222 sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
223 status = "okay";
224
225 port {
226 #address-cells = <1>;
227 #size-cells = <0>;
228 usbdp_phy0_orientation_switch: endpoint@0 {
229 reg = <0>;
230 remote-endpoint = <&usbc0_orien_sw>;
231 };
232
233 usbdp_phy0_dp_altmode_mux: endpoint@1 {
234 reg = <1>;
235 remote-endpoint = <&dp_altmode_mux>;
236 };
237 };
238};
239
240&usbdp_phy0_u3 {
241 status = "okay";
242};
243
244&usbdrd3_0 {
245 status = "okay";
246};
247
248&usbdrd_dwc3_0 {
249 dr_mode = "otg";
250 usb-role-switch;
251
252 port {
253 #address-cells = <1>;
254 #size-cells = <0>;
255 dwc3_0_role_switch: endpoint@0 {
256 reg = <0>;
257 remote-endpoint = <&usbc0_role_sw>;
258 };
259 };
260};
261
262&usbdp_phy1 {
263 rockchip,dp-lane-mux = <2 3>;
264 status = "okay";
265};
266
267&usbdp_phy1_u3 {
268 status = "okay";
269};
270
271&usbdrd3_1 {
272 status = "okay";
273};
274
275&u2phy1 {
276 status = "okay";
277};
278
279&u2phy1_otg {
280 status = "okay";
281};
282
283&i2c4 {
284 pinctrl-0 = <&i2c4m1_xfer>;
285 status = "okay";
286
287 usbc0: fusb302@22 {
288 compatible = "fcs,fusb302";
289 reg = <0x22>;
290 interrupt-parent = <&gpio3>;
291 interrupts = <RK_PB4 IRQ_TYPE_LEVEL_LOW>;
292 pinctrl-names = "default";
293 pinctrl-0 = <&usbc0_int>;
294 vbus-supply = <&vbus5v0_typec>;
295 status = "okay";
296
297 ports {
298 #address-cells = <1>;
299 #size-cells = <0>;
300
301 port@0 {
302 reg = <0>;
303 usbc0_role_sw: endpoint@0 {
304 remote-endpoint = <&dwc3_0_role_switch>;
305 };
306 };
307 };
308
309 usb_con: connector {
310 compatible = "usb-c-connector";
311 label = "USB-C";
312 data-role = "dual";
313 power-role = "dual";
314 try-power-role = "sink";
315 op-sink-microwatt = <1000000>;
316 sink-pdos =
317 <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
318 source-pdos =
319 <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
320
321 altmodes {
322 #address-cells = <1>;
323 #size-cells = <0>;
324
325 altmode@0 {
326 reg = <0>;
327 svid = <0xff01>;
328 vdo = <0xffffffff>;
329 };
330 };
331
332 ports {
333 #address-cells = <1>;
334 #size-cells = <0>;
335
336 port@0 {
337 reg = <0>;
338 usbc0_orien_sw: endpoint {
339 remote-endpoint = <&usbdp_phy0_orientation_switch>;
340 };
341 };
342
343 port@1 {
344 reg = <1>;
345 dp_altmode_mux: endpoint {
346 remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
347 };
348 };
349 };
350 };
351 };
352};
353