1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Based on rk3328-nanopi-r2s.dts, which is: 4 * Copyright (c) 2020 David Bauer <mail@david-bauer.net> 5 */ 6 7/dts-v1/; 8 9#include <dt-bindings/gpio/gpio.h> 10#include <dt-bindings/leds/common.h> 11#include "rk3328.dtsi" 12 13/ { 14 aliases { 15 ethernet0 = &gmac2io; 16 ethernet1 = &rtl8153; 17 mmc0 = &sdmmc; 18 }; 19 20 chosen { 21 stdout-path = "serial2:1500000n8"; 22 }; 23 24 gmac_clk: gmac-clock { 25 compatible = "fixed-clock"; 26 clock-frequency = <125000000>; 27 clock-output-names = "gmac_clkin"; 28 #clock-cells = <0>; 29 }; 30 31 leds { 32 compatible = "gpio-leds"; 33 pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; 34 pinctrl-names = "default"; 35 36 led-0 { 37 function = LED_FUNCTION_LAN; 38 color = <LED_COLOR_ID_GREEN>; 39 gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; 40 }; 41 42 led-1 { 43 function = LED_FUNCTION_STATUS; 44 color = <LED_COLOR_ID_RED>; 45 gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; 46 linux,default-trigger = "heartbeat"; 47 }; 48 49 led-2 { 50 function = LED_FUNCTION_WAN; 51 color = <LED_COLOR_ID_GREEN>; 52 gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>; 53 }; 54 }; 55 56 vcc_sd: regulator-sdmmc { 57 compatible = "regulator-fixed"; 58 gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; 59 pinctrl-0 = <&sdmmc0m1_pin>; 60 pinctrl-names = "default"; 61 regulator-name = "vcc_sd"; 62 regulator-boot-on; 63 vin-supply = <&vcc_io>; 64 }; 65 66 vcc_sys: regulator-vcc-sys { 67 compatible = "regulator-fixed"; 68 regulator-name = "vcc_sys"; 69 regulator-always-on; 70 regulator-boot-on; 71 regulator-min-microvolt = <5000000>; 72 regulator-max-microvolt = <5000000>; 73 }; 74 75 vdd_5v_lan: regulator-vdd-5v-lan { 76 compatible = "regulator-fixed"; 77 enable-active-high; 78 gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>; 79 pinctrl-0 = <&lan_vdd_pin>; 80 pinctrl-names = "default"; 81 regulator-name = "vdd_5v_lan"; 82 regulator-always-on; 83 regulator-boot-on; 84 vin-supply = <&vcc_sys>; 85 }; 86}; 87 88&cpu0 { 89 cpu-supply = <&vdd_arm>; 90}; 91 92&cpu1 { 93 cpu-supply = <&vdd_arm>; 94}; 95 96&cpu2 { 97 cpu-supply = <&vdd_arm>; 98}; 99 100&cpu3 { 101 cpu-supply = <&vdd_arm>; 102}; 103 104&display_subsystem { 105 status = "disabled"; 106}; 107 108&gmac2io { 109 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; 110 assigned-clock-parents = <&gmac_clk>, <&gmac_clk>; 111 clock_in_out = "input"; 112 phy-mode = "rgmii"; 113 phy-supply = <&vcc_io>; 114 pinctrl-0 = <&rgmiim1_pins>; 115 pinctrl-names = "default"; 116 snps,aal; 117 118 mdio { 119 compatible = "snps,dwmac-mdio"; 120 #address-cells = <1>; 121 #size-cells = <0>; 122 }; 123}; 124 125&i2c1 { 126 status = "okay"; 127 128 rk805: pmic@18 { 129 compatible = "rockchip,rk805"; 130 reg = <0x18>; 131 interrupt-parent = <&gpio1>; 132 interrupts = <24 IRQ_TYPE_LEVEL_LOW>; 133 #clock-cells = <1>; 134 clock-output-names = "xin32k", "rk805-clkout2"; 135 gpio-controller; 136 #gpio-cells = <2>; 137 pinctrl-0 = <&pmic_int_l>; 138 pinctrl-names = "default"; 139 system-power-controller; 140 wakeup-source; 141 142 vcc1-supply = <&vcc_sys>; 143 vcc2-supply = <&vcc_sys>; 144 vcc3-supply = <&vcc_sys>; 145 vcc4-supply = <&vcc_sys>; 146 vcc5-supply = <&vcc_io>; 147 vcc6-supply = <&vcc_sys>; 148 149 regulators { 150 vdd_log: DCDC_REG1 { 151 regulator-name = "vdd_log"; 152 regulator-always-on; 153 regulator-boot-on; 154 regulator-min-microvolt = <712500>; 155 regulator-max-microvolt = <1450000>; 156 regulator-ramp-delay = <12500>; 157 158 regulator-state-mem { 159 regulator-on-in-suspend; 160 regulator-suspend-microvolt = <1000000>; 161 }; 162 }; 163 164 vdd_arm: DCDC_REG2 { 165 regulator-name = "vdd_arm"; 166 regulator-always-on; 167 regulator-boot-on; 168 regulator-min-microvolt = <712500>; 169 regulator-max-microvolt = <1450000>; 170 regulator-ramp-delay = <12500>; 171 172 regulator-state-mem { 173 regulator-on-in-suspend; 174 regulator-suspend-microvolt = <950000>; 175 }; 176 }; 177 178 vcc_ddr: DCDC_REG3 { 179 regulator-name = "vcc_ddr"; 180 regulator-always-on; 181 regulator-boot-on; 182 183 regulator-state-mem { 184 regulator-on-in-suspend; 185 }; 186 }; 187 188 vcc_io: DCDC_REG4 { 189 regulator-name = "vcc_io"; 190 regulator-always-on; 191 regulator-boot-on; 192 regulator-min-microvolt = <3300000>; 193 regulator-max-microvolt = <3300000>; 194 195 regulator-state-mem { 196 regulator-on-in-suspend; 197 regulator-suspend-microvolt = <3300000>; 198 }; 199 }; 200 201 vcc_18: LDO_REG1 { 202 regulator-name = "vcc_18"; 203 regulator-always-on; 204 regulator-boot-on; 205 regulator-min-microvolt = <1800000>; 206 regulator-max-microvolt = <1800000>; 207 208 regulator-state-mem { 209 regulator-on-in-suspend; 210 regulator-suspend-microvolt = <1800000>; 211 }; 212 }; 213 214 vcc18_emmc: LDO_REG2 { 215 regulator-name = "vcc18_emmc"; 216 regulator-always-on; 217 regulator-boot-on; 218 regulator-min-microvolt = <1800000>; 219 regulator-max-microvolt = <1800000>; 220 221 regulator-state-mem { 222 regulator-on-in-suspend; 223 regulator-suspend-microvolt = <1800000>; 224 }; 225 }; 226 227 vdd_10: LDO_REG3 { 228 regulator-name = "vdd_10"; 229 regulator-always-on; 230 regulator-boot-on; 231 regulator-min-microvolt = <1000000>; 232 regulator-max-microvolt = <1000000>; 233 234 regulator-state-mem { 235 regulator-on-in-suspend; 236 regulator-suspend-microvolt = <1000000>; 237 }; 238 }; 239 }; 240 }; 241}; 242 243&io_domains { 244 pmuio-supply = <&vcc_io>; 245 vccio1-supply = <&vcc_io>; 246 vccio2-supply = <&vcc18_emmc>; 247 vccio3-supply = <&vcc_io>; 248 vccio4-supply = <&vcc_io>; 249 vccio5-supply = <&vcc_io>; 250 vccio6-supply = <&vcc_io>; 251 status = "okay"; 252}; 253 254&pinctrl { 255 gmac2io { 256 eth_phy_reset_pin: eth-phy-reset-pin { 257 rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; 258 }; 259 }; 260 261 leds { 262 lan_led_pin: lan-led-pin { 263 rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; 264 }; 265 266 sys_led_pin: sys-led-pin { 267 rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; 268 }; 269 270 wan_led_pin: wan-led-pin { 271 rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; 272 }; 273 }; 274 275 lan { 276 lan_vdd_pin: lan-vdd-pin { 277 rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; 278 }; 279 }; 280 281 pmic { 282 pmic_int_l: pmic-int-l { 283 rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; 284 }; 285 }; 286}; 287 288&pwm2 { 289 status = "okay"; 290}; 291 292&sdmmc { 293 bus-width = <4>; 294 cap-sd-highspeed; 295 disable-wp; 296 pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; 297 pinctrl-names = "default"; 298 vmmc-supply = <&vcc_sd>; 299 status = "okay"; 300}; 301 302&spi0 { 303 status = "okay"; 304 305 flash@0 { 306 compatible = "jedec,spi-nor"; 307 reg = <0>; 308 spi-max-frequency = <50000000>; 309 }; 310}; 311 312&tsadc { 313 rockchip,hw-tshut-mode = <0>; 314 rockchip,hw-tshut-polarity = <0>; 315 status = "okay"; 316}; 317 318&u2phy { 319 status = "okay"; 320}; 321 322&u2phy_host { 323 status = "okay"; 324}; 325 326&u2phy_otg { 327 status = "okay"; 328}; 329 330&uart2 { 331 status = "okay"; 332}; 333 334&usb20_otg { 335 dr_mode = "host"; 336 status = "okay"; 337}; 338 339&usbdrd3 { 340 dr_mode = "host"; 341 status = "okay"; 342 #address-cells = <1>; 343 #size-cells = <0>; 344 345 /* Second port is for USB 3.0 */ 346 rtl8153: device@2 { 347 compatible = "usbbda,8153"; 348 reg = <2>; 349 }; 350}; 351 352&usb_host0_ehci { 353 status = "okay"; 354}; 355 356&usb_host0_ohci { 357 status = "okay"; 358}; 359