Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2020 David Bauer <mail@david-bauer.net>
0004  */
0005 
0006 /dts-v1/;
0007 
0008 #include <dt-bindings/input/input.h>
0009 #include <dt-bindings/gpio/gpio.h>
0010 #include "rk3328.dtsi"
0011 
0012 / {
0013         model = "FriendlyElec NanoPi R2S";
0014         compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328";
0015 
0016         aliases {
0017                 ethernet1 = &rtl8153;
0018                 mmc0 = &sdmmc;
0019         };
0020 
0021         chosen {
0022                 stdout-path = "serial2:1500000n8";
0023         };
0024 
0025         gmac_clk: gmac-clock {
0026                 compatible = "fixed-clock";
0027                 clock-frequency = <125000000>;
0028                 clock-output-names = "gmac_clkin";
0029                 #clock-cells = <0>;
0030         };
0031 
0032         keys {
0033                 compatible = "gpio-keys";
0034                 pinctrl-0 = <&reset_button_pin>;
0035                 pinctrl-names = "default";
0036 
0037                 key-reset {
0038                         label = "reset";
0039                         gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
0040                         linux,code = <KEY_RESTART>;
0041                         debounce-interval = <50>;
0042                 };
0043         };
0044 
0045         leds {
0046                 compatible = "gpio-leds";
0047                 pinctrl-0 = <&lan_led_pin>,  <&sys_led_pin>, <&wan_led_pin>;
0048                 pinctrl-names = "default";
0049 
0050                 lan_led: led-0 {
0051                         gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
0052                         label = "nanopi-r2s:green:lan";
0053                 };
0054 
0055                 sys_led: led-1 {
0056                         gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
0057                         label = "nanopi-r2s:red:sys";
0058                         default-state = "on";
0059                 };
0060 
0061                 wan_led: led-2 {
0062                         gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
0063                         label = "nanopi-r2s:green:wan";
0064                 };
0065         };
0066 
0067         vcc_io_sdio: sdmmcio-regulator {
0068                 compatible = "regulator-gpio";
0069                 enable-active-high;
0070                 gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>;
0071                 pinctrl-0 = <&sdio_vcc_pin>;
0072                 pinctrl-names = "default";
0073                 regulator-name = "vcc_io_sdio";
0074                 regulator-always-on;
0075                 regulator-min-microvolt = <1800000>;
0076                 regulator-max-microvolt = <3300000>;
0077                 regulator-settling-time-us = <5000>;
0078                 regulator-type = "voltage";
0079                 startup-delay-us = <2000>;
0080                 states = <1800000 0x1>,
0081                          <3300000 0x0>;
0082                 vin-supply = <&vcc_io_33>;
0083         };
0084 
0085         vcc_sd: sdmmc-regulator {
0086                 compatible = "regulator-fixed";
0087                 gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
0088                 pinctrl-0 = <&sdmmc0m1_pin>;
0089                 pinctrl-names = "default";
0090                 regulator-name = "vcc_sd";
0091                 regulator-boot-on;
0092                 regulator-min-microvolt = <3300000>;
0093                 regulator-max-microvolt = <3300000>;
0094                 vin-supply = <&vcc_io_33>;
0095         };
0096 
0097         vdd_5v: vdd-5v {
0098                 compatible = "regulator-fixed";
0099                 regulator-name = "vdd_5v";
0100                 regulator-always-on;
0101                 regulator-boot-on;
0102                 regulator-min-microvolt = <5000000>;
0103                 regulator-max-microvolt = <5000000>;
0104         };
0105 
0106         vdd_5v_lan: vdd-5v-lan {
0107                 compatible = "regulator-fixed";
0108                 enable-active-high;
0109                 gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
0110                 pinctrl-0 = <&lan_vdd_pin>;
0111                 pinctrl-names = "default";
0112                 regulator-name = "vdd_5v_lan";
0113                 regulator-always-on;
0114                 regulator-boot-on;
0115                 vin-supply = <&vdd_5v>;
0116         };
0117 };
0118 
0119 &cpu0 {
0120         cpu-supply = <&vdd_arm>;
0121 };
0122 
0123 &cpu1 {
0124         cpu-supply = <&vdd_arm>;
0125 };
0126 
0127 &cpu2 {
0128         cpu-supply = <&vdd_arm>;
0129 };
0130 
0131 &cpu3 {
0132         cpu-supply = <&vdd_arm>;
0133 };
0134 
0135 &display_subsystem {
0136         status = "disabled";
0137 };
0138 
0139 &gmac2io {
0140         assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
0141         assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
0142         clock_in_out = "input";
0143         phy-handle = <&rtl8211e>;
0144         phy-mode = "rgmii";
0145         phy-supply = <&vcc_io_33>;
0146         pinctrl-0 = <&rgmiim1_pins>;
0147         pinctrl-names = "default";
0148         rx_delay = <0x18>;
0149         snps,aal;
0150         tx_delay = <0x24>;
0151         status = "okay";
0152 
0153         mdio {
0154                 compatible = "snps,dwmac-mdio";
0155                 #address-cells = <1>;
0156                 #size-cells = <0>;
0157 
0158                 rtl8211e: ethernet-phy@1 {
0159                         reg = <1>;
0160                         pinctrl-0 = <&eth_phy_reset_pin>;
0161                         pinctrl-names = "default";
0162                         reset-assert-us = <10000>;
0163                         reset-deassert-us = <50000>;
0164                         reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
0165                 };
0166         };
0167 };
0168 
0169 &i2c1 {
0170         status = "okay";
0171 
0172         rk805: pmic@18 {
0173                 compatible = "rockchip,rk805";
0174                 reg = <0x18>;
0175                 interrupt-parent = <&gpio1>;
0176                 interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
0177                 #clock-cells = <1>;
0178                 clock-output-names = "xin32k", "rk805-clkout2";
0179                 gpio-controller;
0180                 #gpio-cells = <2>;
0181                 pinctrl-0 = <&pmic_int_l>;
0182                 pinctrl-names = "default";
0183                 rockchip,system-power-controller;
0184                 wakeup-source;
0185 
0186                 vcc1-supply = <&vdd_5v>;
0187                 vcc2-supply = <&vdd_5v>;
0188                 vcc3-supply = <&vdd_5v>;
0189                 vcc4-supply = <&vdd_5v>;
0190                 vcc5-supply = <&vcc_io_33>;
0191                 vcc6-supply = <&vdd_5v>;
0192 
0193                 regulators {
0194                         vdd_log: DCDC_REG1 {
0195                                 regulator-name = "vdd_log";
0196                                 regulator-always-on;
0197                                 regulator-boot-on;
0198                                 regulator-min-microvolt = <712500>;
0199                                 regulator-max-microvolt = <1450000>;
0200                                 regulator-ramp-delay = <12500>;
0201 
0202                                 regulator-state-mem {
0203                                         regulator-on-in-suspend;
0204                                         regulator-suspend-microvolt = <1000000>;
0205                                 };
0206                         };
0207 
0208                         vdd_arm: DCDC_REG2 {
0209                                 regulator-name = "vdd_arm";
0210                                 regulator-always-on;
0211                                 regulator-boot-on;
0212                                 regulator-min-microvolt = <712500>;
0213                                 regulator-max-microvolt = <1450000>;
0214                                 regulator-ramp-delay = <12500>;
0215 
0216                                 regulator-state-mem {
0217                                         regulator-on-in-suspend;
0218                                         regulator-suspend-microvolt = <950000>;
0219                                 };
0220                         };
0221 
0222                         vcc_ddr: DCDC_REG3 {
0223                                 regulator-name = "vcc_ddr";
0224                                 regulator-always-on;
0225                                 regulator-boot-on;
0226 
0227                                 regulator-state-mem {
0228                                         regulator-on-in-suspend;
0229                                 };
0230                         };
0231 
0232                         vcc_io_33: DCDC_REG4 {
0233                                 regulator-name = "vcc_io_33";
0234                                 regulator-always-on;
0235                                 regulator-boot-on;
0236                                 regulator-min-microvolt = <3300000>;
0237                                 regulator-max-microvolt = <3300000>;
0238 
0239                                 regulator-state-mem {
0240                                         regulator-on-in-suspend;
0241                                         regulator-suspend-microvolt = <3300000>;
0242                                 };
0243                         };
0244 
0245                         vcc_18: LDO_REG1 {
0246                                 regulator-name = "vcc_18";
0247                                 regulator-always-on;
0248                                 regulator-boot-on;
0249                                 regulator-min-microvolt = <1800000>;
0250                                 regulator-max-microvolt = <1800000>;
0251 
0252                                 regulator-state-mem {
0253                                         regulator-on-in-suspend;
0254                                         regulator-suspend-microvolt = <1800000>;
0255                                 };
0256                         };
0257 
0258                         vcc18_emmc: LDO_REG2 {
0259                                 regulator-name = "vcc18_emmc";
0260                                 regulator-always-on;
0261                                 regulator-boot-on;
0262                                 regulator-min-microvolt = <1800000>;
0263                                 regulator-max-microvolt = <1800000>;
0264 
0265                                 regulator-state-mem {
0266                                         regulator-on-in-suspend;
0267                                         regulator-suspend-microvolt = <1800000>;
0268                                 };
0269                         };
0270 
0271                         vdd_10: LDO_REG3 {
0272                                 regulator-name = "vdd_10";
0273                                 regulator-always-on;
0274                                 regulator-boot-on;
0275                                 regulator-min-microvolt = <1000000>;
0276                                 regulator-max-microvolt = <1000000>;
0277 
0278                                 regulator-state-mem {
0279                                         regulator-on-in-suspend;
0280                                         regulator-suspend-microvolt = <1000000>;
0281                                 };
0282                         };
0283                 };
0284         };
0285 };
0286 
0287 &io_domains {
0288         pmuio-supply = <&vcc_io_33>;
0289         vccio1-supply = <&vcc_io_33>;
0290         vccio2-supply = <&vcc18_emmc>;
0291         vccio3-supply = <&vcc_io_sdio>;
0292         vccio4-supply = <&vcc_18>;
0293         vccio5-supply = <&vcc_io_33>;
0294         vccio6-supply = <&vcc_io_33>;
0295         status = "okay";
0296 };
0297 
0298 &pinctrl {
0299         button {
0300                 reset_button_pin: reset-button-pin {
0301                         rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
0302                 };
0303         };
0304 
0305         gmac2io {
0306                 eth_phy_reset_pin: eth-phy-reset-pin {
0307                         rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
0308                 };
0309         };
0310 
0311         leds {
0312                 lan_led_pin: lan-led-pin {
0313                         rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
0314                 };
0315 
0316                 sys_led_pin: sys-led-pin {
0317                         rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
0318                 };
0319 
0320                 wan_led_pin: wan-led-pin {
0321                         rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
0322                 };
0323         };
0324 
0325         lan {
0326                 lan_vdd_pin: lan-vdd-pin {
0327                         rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
0328                 };
0329         };
0330 
0331         pmic {
0332                 pmic_int_l: pmic-int-l {
0333                         rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
0334                 };
0335         };
0336 
0337         sd {
0338                 sdio_vcc_pin: sdio-vcc-pin {
0339                         rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
0340                 };
0341         };
0342 };
0343 
0344 &pwm2 {
0345         status = "okay";
0346 };
0347 
0348 &sdmmc {
0349         bus-width = <4>;
0350         cap-sd-highspeed;
0351         disable-wp;
0352         pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
0353         pinctrl-names = "default";
0354         sd-uhs-sdr12;
0355         sd-uhs-sdr25;
0356         sd-uhs-sdr50;
0357         sd-uhs-sdr104;
0358         vmmc-supply = <&vcc_sd>;
0359         vqmmc-supply = <&vcc_io_sdio>;
0360         status = "okay";
0361 };
0362 
0363 &tsadc {
0364         rockchip,hw-tshut-mode = <0>;
0365         rockchip,hw-tshut-polarity = <0>;
0366         status = "okay";
0367 };
0368 
0369 &u2phy {
0370         status = "okay";
0371 };
0372 
0373 &u2phy_host {
0374         status = "okay";
0375 };
0376 
0377 &u2phy_otg {
0378         status = "okay";
0379 };
0380 
0381 &uart2 {
0382         status = "okay";
0383 };
0384 
0385 &usb20_otg {
0386         status = "okay";
0387         dr_mode = "host";
0388 };
0389 
0390 &usbdrd3 {
0391         dr_mode = "host";
0392         status = "okay";
0393         #address-cells = <1>;
0394         #size-cells = <0>;
0395 
0396         /* Second port is for USB 3.0 */
0397         rtl8153: device@2 {
0398                 compatible = "usbbda,8153";
0399                 reg = <2>;
0400         };
0401 };
0402 
0403 &usb_host0_ehci {
0404         status = "okay";
0405 };
0406 
0407 &usb_host0_ohci {
0408         status = "okay";
0409 };