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