Eugen Hristev | 3bf8e40 | 2023-02-22 11:05:12 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* |
| 3 | * Copyright (c) 2023 Collabora Ltd. |
| 4 | */ |
| 5 | |
| 6 | #include "rk3588-u-boot.dtsi" |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 7 | #include <dt-bindings/pinctrl/rockchip.h> |
| 8 | #include <dt-bindings/input/input.h> |
| 9 | #include <dt-bindings/gpio/gpio.h> |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 10 | #include <dt-bindings/usb/pd.h> |
Eugen Hristev | 3bf8e40 | 2023-02-22 11:05:12 +0200 | [diff] [blame] | 11 | |
| 12 | / { |
Eugen Hristev | 3bf8e40 | 2023-02-22 11:05:12 +0200 | [diff] [blame] | 13 | chosen { |
Jonas Karlman | b564aa2 | 2023-04-18 16:46:41 +0000 | [diff] [blame] | 14 | u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci; |
Eugen Hristev | 3bf8e40 | 2023-02-22 11:05:12 +0200 | [diff] [blame] | 15 | }; |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 16 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 17 | vcc12v_dcin: vcc12v-dcin-regulator { |
| 18 | compatible = "regulator-fixed"; |
| 19 | regulator-name = "vcc12v_dcin"; |
| 20 | regulator-always-on; |
| 21 | regulator-boot-on; |
| 22 | regulator-min-microvolt = <12000000>; |
| 23 | regulator-max-microvolt = <12000000>; |
| 24 | }; |
| 25 | |
| 26 | vcc5v0_usbdcin: vcc5v0-usbdcin { |
| 27 | compatible = "regulator-fixed"; |
| 28 | regulator-name = "vcc5v0_usbdcin"; |
| 29 | regulator-always-on; |
| 30 | regulator-boot-on; |
| 31 | regulator-min-microvolt = <5000000>; |
| 32 | regulator-max-microvolt = <5000000>; |
| 33 | vin-supply = <&vcc12v_dcin>; |
| 34 | }; |
| 35 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 36 | vcc5v0_usb: vcc5v0-usb { |
| 37 | compatible = "regulator-fixed"; |
| 38 | regulator-name = "vcc5v0_usb"; |
| 39 | regulator-always-on; |
| 40 | regulator-boot-on; |
| 41 | regulator-min-microvolt = <5000000>; |
| 42 | regulator-max-microvolt = <5000000>; |
| 43 | vin-supply = <&vcc5v0_usbdcin>; |
| 44 | }; |
| 45 | |
| 46 | vbus5v0_typec: vbus5v0-typec { |
| 47 | compatible = "regulator-fixed"; |
| 48 | regulator-name = "vbus5v0_typec"; |
| 49 | regulator-min-microvolt = <5000000>; |
| 50 | regulator-max-microvolt = <5000000>; |
| 51 | enable-active-high; |
| 52 | gpio = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>; |
| 53 | vin-supply = <&vcc5v0_usb>; |
| 54 | pinctrl-names = "default"; |
| 55 | pinctrl-0 = <&typec5v_pwren>; |
| 56 | }; |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 57 | }; |
| 58 | |
Christopher Obbard | bfbef68 | 2023-05-17 13:01:01 +0300 | [diff] [blame] | 59 | &combphy0_ps { |
| 60 | status = "okay"; |
| 61 | }; |
| 62 | |
Jonas Karlman | fd6e425 | 2023-05-18 15:39:30 +0000 | [diff] [blame] | 63 | &fspim2_pins { |
| 64 | bootph-all; |
| 65 | }; |
| 66 | |
Christopher Obbard | bfbef68 | 2023-05-17 13:01:01 +0300 | [diff] [blame] | 67 | &pcie2x1l2 { |
| 68 | pinctrl-names = "default"; |
| 69 | pinctrl-0 = <&pcie2x1l2_pins &pcie_reset_h>; |
| 70 | reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>; |
| 71 | status = "okay"; |
| 72 | }; |
| 73 | |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 74 | &pinctrl { |
Christopher Obbard | bfbef68 | 2023-05-17 13:01:01 +0300 | [diff] [blame] | 75 | pcie { |
| 76 | pcie_reset_h: pcie-reset-h { |
| 77 | rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; |
| 78 | }; |
| 79 | |
| 80 | pcie2x1l2_pins: pcie2x1l2-pins { |
| 81 | rockchip,pins = <3 RK_PC7 4 &pcfg_pull_none>, |
| 82 | <3 RK_PD0 4 &pcfg_pull_none>; |
| 83 | }; |
| 84 | }; |
| 85 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 86 | usb-typec { |
| 87 | usbc0_int: usbc0-int { |
| 88 | rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; |
| 89 | }; |
| 90 | |
| 91 | typec5v_pwren: typec5v-pwren { |
| 92 | rockchip,pins = <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; |
| 93 | }; |
| 94 | }; |
Eugen Hristev | 3bf8e40 | 2023-02-22 11:05:12 +0200 | [diff] [blame] | 95 | }; |
| 96 | |
Jonas Karlman | b564aa2 | 2023-04-18 16:46:41 +0000 | [diff] [blame] | 97 | &sdhci { |
| 98 | cap-mmc-highspeed; |
| 99 | mmc-ddr-1_8v; |
| 100 | mmc-hs200-1_8v; |
Jonas Karlman | b564aa2 | 2023-04-18 16:46:41 +0000 | [diff] [blame] | 101 | }; |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 102 | |
Jonas Karlman | fd6e425 | 2023-05-18 15:39:30 +0000 | [diff] [blame] | 103 | &sfc { |
| 104 | bootph-pre-ram; |
| 105 | u-boot,spl-sfc-no-dma; |
| 106 | pinctrl-names = "default"; |
| 107 | pinctrl-0 = <&fspim2_pins>; |
| 108 | #address-cells = <1>; |
| 109 | #size-cells = <0>; |
| 110 | status = "okay"; |
| 111 | |
| 112 | flash@0 { |
| 113 | bootph-pre-ram; |
| 114 | compatible = "jedec,spi-nor"; |
| 115 | reg = <0>; |
| 116 | spi-max-frequency = <24000000>; |
| 117 | spi-rx-bus-width = <4>; |
| 118 | spi-tx-bus-width = <1>; |
| 119 | }; |
| 120 | }; |
| 121 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 122 | &u2phy0 { |
| 123 | status = "okay"; |
| 124 | }; |
| 125 | |
| 126 | &u2phy0_otg { |
| 127 | rockchip,typec-vbus-det; |
| 128 | status = "okay"; |
| 129 | }; |
| 130 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 131 | &u2phy1 { |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 132 | status = "okay"; |
| 133 | }; |
| 134 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 135 | &u2phy1_otg { |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 136 | status = "okay"; |
| 137 | }; |
| 138 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 139 | &usb2phy2_grf { |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 140 | status = "okay"; |
| 141 | }; |
| 142 | |
| 143 | &usb2phy3_grf { |
| 144 | status = "okay"; |
| 145 | }; |
| 146 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 147 | &usb_host0_ehci { |
| 148 | companion = <&usb_host0_ohci>; |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 149 | }; |
| 150 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 151 | &usb_host1_ehci { |
| 152 | companion = <&usb_host1_ohci>; |
Eugen Hristev | 9ceef3d | 2023-05-15 12:59:45 +0300 | [diff] [blame] | 153 | }; |
| 154 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 155 | &usbdp_phy0 { |
| 156 | orientation-switch; |
| 157 | svid = <0xff01>; |
| 158 | sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; |
| 159 | sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; |
| 160 | status = "okay"; |
| 161 | |
| 162 | port { |
| 163 | #address-cells = <1>; |
| 164 | #size-cells = <0>; |
| 165 | usbdp_phy0_orientation_switch: endpoint@0 { |
| 166 | reg = <0>; |
| 167 | remote-endpoint = <&usbc0_orien_sw>; |
| 168 | }; |
| 169 | |
| 170 | usbdp_phy0_dp_altmode_mux: endpoint@1 { |
| 171 | reg = <1>; |
| 172 | remote-endpoint = <&dp_altmode_mux>; |
| 173 | }; |
| 174 | }; |
| 175 | }; |
| 176 | |
| 177 | &usbdp_phy0_u3 { |
| 178 | status = "okay"; |
| 179 | }; |
| 180 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 181 | &usbdp_phy1 { |
| 182 | rockchip,dp-lane-mux = <2 3>; |
| 183 | status = "okay"; |
| 184 | }; |
| 185 | |
| 186 | &usbdp_phy1_u3 { |
| 187 | status = "okay"; |
| 188 | }; |
| 189 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 190 | &usbdrd3_0 { |
| 191 | status = "okay"; |
| 192 | }; |
| 193 | |
FUKAUMI Naoki | 74273f1 | 2023-09-05 20:47:35 +0900 | [diff] [blame^] | 194 | &usbdrd3_1 { |
| 195 | status = "okay"; |
| 196 | }; |
| 197 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 198 | &usbdrd_dwc3_0 { |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 199 | usb-role-switch; |
| 200 | |
| 201 | port { |
| 202 | #address-cells = <1>; |
| 203 | #size-cells = <0>; |
| 204 | dwc3_0_role_switch: endpoint@0 { |
| 205 | reg = <0>; |
| 206 | remote-endpoint = <&usbc0_role_sw>; |
| 207 | }; |
| 208 | }; |
| 209 | }; |
| 210 | |
Eugen Hristev | 32961c0 | 2023-05-29 13:01:35 +0300 | [diff] [blame] | 211 | &i2c4 { |
| 212 | pinctrl-0 = <&i2c4m1_xfer>; |
| 213 | status = "okay"; |
| 214 | |
| 215 | usbc0: fusb302@22 { |
| 216 | compatible = "fcs,fusb302"; |
| 217 | reg = <0x22>; |
| 218 | interrupt-parent = <&gpio3>; |
| 219 | interrupts = <RK_PB4 IRQ_TYPE_LEVEL_LOW>; |
| 220 | pinctrl-names = "default"; |
| 221 | pinctrl-0 = <&usbc0_int>; |
| 222 | vbus-supply = <&vbus5v0_typec>; |
| 223 | status = "okay"; |
| 224 | |
| 225 | ports { |
| 226 | #address-cells = <1>; |
| 227 | #size-cells = <0>; |
| 228 | |
| 229 | port@0 { |
| 230 | reg = <0>; |
| 231 | usbc0_role_sw: endpoint@0 { |
| 232 | remote-endpoint = <&dwc3_0_role_switch>; |
| 233 | }; |
| 234 | }; |
| 235 | }; |
| 236 | |
| 237 | usb_con: connector { |
| 238 | compatible = "usb-c-connector"; |
| 239 | label = "USB-C"; |
| 240 | data-role = "dual"; |
| 241 | power-role = "dual"; |
| 242 | try-power-role = "sink"; |
| 243 | op-sink-microwatt = <1000000>; |
| 244 | sink-pdos = |
| 245 | <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>; |
| 246 | source-pdos = |
| 247 | <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; |
| 248 | |
| 249 | altmodes { |
| 250 | #address-cells = <1>; |
| 251 | #size-cells = <0>; |
| 252 | |
| 253 | altmode@0 { |
| 254 | reg = <0>; |
| 255 | svid = <0xff01>; |
| 256 | vdo = <0xffffffff>; |
| 257 | }; |
| 258 | }; |
| 259 | |
| 260 | ports { |
| 261 | #address-cells = <1>; |
| 262 | #size-cells = <0>; |
| 263 | |
| 264 | port@0 { |
| 265 | reg = <0>; |
| 266 | usbc0_orien_sw: endpoint { |
| 267 | remote-endpoint = <&usbdp_phy0_orientation_switch>; |
| 268 | }; |
| 269 | }; |
| 270 | |
| 271 | port@1 { |
| 272 | reg = <1>; |
| 273 | dp_altmode_mux: endpoint { |
| 274 | remote-endpoint = <&usbdp_phy0_dp_altmode_mux>; |
| 275 | }; |
| 276 | }; |
| 277 | }; |
| 278 | }; |
| 279 | }; |
| 280 | }; |