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