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