Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * (C) Copyright 2020 Chen-Yu Tsai <wens@csie.org>
0004  *
0005  * Based on ./rk3328-rock64.dts, which is
0006  *
0007  * Copyright (c) 2017 PINE64
0008  */
0009 
0010 /dts-v1/;
0011 
0012 #include <dt-bindings/gpio/gpio.h>
0013 #include <dt-bindings/input/input.h>
0014 #include <dt-bindings/leds/common.h>
0015 #include <dt-bindings/pinctrl/rockchip.h>
0016 
0017 #include "rk3328.dtsi"
0018 
0019 / {
0020         model = "Radxa ROCK Pi E";
0021         compatible = "radxa,rockpi-e", "rockchip,rk3328";
0022 
0023         aliases {
0024                 mmc0 = &sdmmc;
0025                 mmc1 = &emmc;
0026         };
0027 
0028         chosen {
0029                 stdout-path = "serial2:1500000n8";
0030         };
0031 
0032         adc-keys {
0033                 compatible = "adc-keys";
0034                 io-channels = <&saradc 0>;
0035                 io-channel-names = "buttons";
0036                 keyup-threshold-microvolt = <1750000>;
0037 
0038                 /* This button is unpopulated out of the factory. */
0039                 button-recovery {
0040                         label = "Recovery";
0041                         linux,code = <KEY_VENDOR>;
0042                         press-threshold-microvolt = <10000>;
0043                 };
0044         };
0045 
0046         gmac_clkin: external-gmac-clock {
0047                 compatible = "fixed-clock";
0048                 clock-frequency = <125000000>;
0049                 clock-output-names = "gmac_clkin";
0050                 #clock-cells = <0>;
0051         };
0052 
0053         leds {
0054                 compatible = "gpio-leds";
0055                 pinctrl-0 = <&led_pin>;
0056                 pinctrl-names = "default";
0057 
0058                 led-0 {
0059                         color = <LED_COLOR_ID_BLUE>;
0060                         gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>;
0061                         linux,default-trigger = "heartbeat";
0062                 };
0063         };
0064 
0065         vcc_sd: sdmmc-regulator {
0066                 compatible = "regulator-fixed";
0067                 gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
0068                 pinctrl-names = "default";
0069                 pinctrl-0 = <&sdmmc0m1_pin>;
0070                 regulator-name = "vcc_sd";
0071                 regulator-boot-on;
0072                 vin-supply = <&vcc_io>;
0073         };
0074 
0075         vcc_host_5v: vcc-host-5v-regulator {
0076                 compatible = "regulator-fixed";
0077                 gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
0078                 pinctrl-names = "default";
0079                 pinctrl-0 = <&usb30_host_drv>;
0080                 enable-active-high;
0081                 regulator-name = "vcc_host_5v";
0082                 regulator-always-on;
0083                 regulator-boot-on;
0084                 vin-supply = <&vcc_sys>;
0085         };
0086 
0087         vcc_sys: vcc-sys {
0088                 compatible = "regulator-fixed";
0089                 regulator-name = "vcc_sys";
0090                 regulator-always-on;
0091                 regulator-boot-on;
0092                 regulator-min-microvolt = <5000000>;
0093                 regulator-max-microvolt = <5000000>;
0094         };
0095 
0096         vcc_wifi: vcc-wifi-regulator {
0097                 compatible = "regulator-fixed";
0098                 gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
0099                 pinctrl-names = "default";
0100                 pinctrl-0 = <&wifi_en>;
0101                 regulator-name = "vcc_wifi";
0102                 regulator-always-on;
0103                 regulator-boot-on;
0104                 vin-supply = <&vcc_io>;
0105         };
0106 };
0107 
0108 &analog_sound {
0109         status = "okay";
0110 };
0111 
0112 &codec {
0113         status = "okay";
0114 };
0115 
0116 &cpu0 {
0117         cpu-supply = <&vdd_arm>;
0118 };
0119 
0120 &cpu1 {
0121         cpu-supply = <&vdd_arm>;
0122 };
0123 
0124 &cpu2 {
0125         cpu-supply = <&vdd_arm>;
0126 };
0127 
0128 &cpu3 {
0129         cpu-supply = <&vdd_arm>;
0130 };
0131 
0132 &emmc {
0133         bus-width = <8>;
0134         cap-mmc-highspeed;
0135         mmc-ddr-1_8v;
0136         mmc-hs200-1_8v;
0137         non-removable;
0138         pinctrl-names = "default";
0139         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
0140         vmmc-supply = <&vcc_io>;
0141         vqmmc-supply = <&vcc18_emmc>;
0142         status = "okay";
0143 };
0144 
0145 &gmac2io {
0146         assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
0147         assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
0148         clock_in_out = "input";
0149         phy-handle = <&rtl8211e>;
0150         phy-mode = "rgmii";
0151         phy-supply = <&vcc_io>;
0152         pinctrl-names = "default";
0153         pinctrl-0 = <&rgmiim1_pins>;
0154         snps,aal;
0155         snps,rxpbl = <0x4>;
0156         snps,txpbl = <0x4>;
0157         tx_delay = <0x26>;
0158         rx_delay = <0x11>;
0159         status = "okay";
0160 
0161         mdio {
0162                 compatible = "snps,dwmac-mdio";
0163                 #address-cells = <1>;
0164                 #size-cells = <0>;
0165 
0166                 rtl8211e: ethernet-phy@1 {
0167                         reg = <1>;
0168                         pinctrl-0 = <&eth_phy_int_pin>, <&eth_phy_reset_pin>;
0169                         pinctrl-names = "default";
0170                         interrupt-parent = <&gpio1>;
0171                         interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
0172                         reset-assert-us = <10000>;
0173                         reset-deassert-us = <50000>;
0174                         reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
0175                 };
0176         };
0177 };
0178 
0179 &gmac2phy {
0180         status = "okay";
0181 };
0182 
0183 &i2c1 {
0184         status = "okay";
0185 
0186         rk805: pmic@18 {
0187                 compatible = "rockchip,rk805";
0188                 reg = <0x18>;
0189                 interrupt-parent = <&gpio2>;
0190                 interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
0191                 #clock-cells = <1>;
0192                 clock-output-names = "xin32k", "rk805-clkout2";
0193                 gpio-controller;
0194                 #gpio-cells = <2>;
0195                 pinctrl-names = "default";
0196                 pinctrl-0 = <&pmic_int_l>;
0197                 rockchip,system-power-controller;
0198                 wakeup-source;
0199 
0200                 vcc1-supply = <&vcc_sys>;
0201                 vcc2-supply = <&vcc_sys>;
0202                 vcc3-supply = <&vcc_sys>;
0203                 vcc4-supply = <&vcc_sys>;
0204                 vcc5-supply = <&vcc_io>;
0205                 vcc6-supply = <&vcc_sys>;
0206 
0207                 regulators {
0208                         vdd_log: DCDC_REG1 {
0209                                 regulator-name = "vdd_log";
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 = <1000000>;
0219                                 };
0220                         };
0221 
0222                         vdd_arm: DCDC_REG2 {
0223                                 regulator-name = "vdd_arm";
0224                                 regulator-always-on;
0225                                 regulator-boot-on;
0226                                 regulator-min-microvolt = <712500>;
0227                                 regulator-max-microvolt = <1450000>;
0228                                 regulator-ramp-delay = <12500>;
0229 
0230                                 regulator-state-mem {
0231                                         regulator-on-in-suspend;
0232                                         regulator-suspend-microvolt = <950000>;
0233                                 };
0234                         };
0235 
0236                         vcc_ddr: DCDC_REG3 {
0237                                 regulator-name = "vcc_ddr";
0238                                 regulator-always-on;
0239                                 regulator-boot-on;
0240 
0241                                 regulator-state-mem {
0242                                         regulator-on-in-suspend;
0243                                 };
0244                         };
0245 
0246                         vcc_io: DCDC_REG4 {
0247                                 regulator-name = "vcc_io";
0248                                 regulator-always-on;
0249                                 regulator-boot-on;
0250                                 regulator-min-microvolt = <3300000>;
0251                                 regulator-max-microvolt = <3300000>;
0252 
0253                                 regulator-state-mem {
0254                                         regulator-on-in-suspend;
0255                                         regulator-suspend-microvolt = <3300000>;
0256                                 };
0257                         };
0258 
0259                         vcc_18: LDO_REG1 {
0260                                 regulator-name = "vcc_18";
0261                                 regulator-always-on;
0262                                 regulator-boot-on;
0263                                 regulator-min-microvolt = <1800000>;
0264                                 regulator-max-microvolt = <1800000>;
0265 
0266                                 regulator-state-mem {
0267                                         regulator-on-in-suspend;
0268                                         regulator-suspend-microvolt = <1800000>;
0269                                 };
0270                         };
0271 
0272                         vcc18_emmc: LDO_REG2 {
0273                                 regulator-name = "vcc18_emmc";
0274                                 regulator-always-on;
0275                                 regulator-boot-on;
0276                                 regulator-min-microvolt = <1800000>;
0277                                 regulator-max-microvolt = <1800000>;
0278 
0279                                 regulator-state-mem {
0280                                         regulator-on-in-suspend;
0281                                         regulator-suspend-microvolt = <1800000>;
0282                                 };
0283                         };
0284 
0285                         vdd_10: LDO_REG3 {
0286                                 regulator-name = "vdd_10";
0287                                 regulator-always-on;
0288                                 regulator-boot-on;
0289                                 regulator-min-microvolt = <1000000>;
0290                                 regulator-max-microvolt = <1000000>;
0291 
0292                                 regulator-state-mem {
0293                                         regulator-on-in-suspend;
0294                                         regulator-suspend-microvolt = <1000000>;
0295                                 };
0296                         };
0297                 };
0298         };
0299 };
0300 
0301 &i2s1 {
0302         status = "okay";
0303 };
0304 
0305 &io_domains {
0306         pmuio-supply = <&vcc_io>;
0307         vccio1-supply = <&vcc_io>;
0308         vccio2-supply = <&vcc18_emmc>;
0309         vccio3-supply = <&vcc_io>;
0310         vccio4-supply = <&vcc_io>;
0311         vccio5-supply = <&vcc_io>;
0312         vccio6-supply = <&vcc_io>;
0313         status = "okay";
0314 };
0315 
0316 &pinctrl {
0317         ephy {
0318                 eth_phy_int_pin: eth-phy-int-pin {
0319                         rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_down>;
0320                 };
0321 
0322                 eth_phy_reset_pin: eth-phy-reset-pin {
0323                         rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
0324                 };
0325         };
0326 
0327         leds {
0328                 led_pin: led-pin {
0329                         rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
0330                 };
0331         };
0332 
0333         pmic {
0334                 pmic_int_l: pmic-int-l {
0335                         rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
0336                 };
0337         };
0338 
0339         usb3 {
0340                 usb30_host_drv: usb30-host-drv {
0341                         rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
0342                 };
0343         };
0344 
0345         wifi {
0346                 wifi_en: wifi-en {
0347                         rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
0348                 };
0349         };
0350 };
0351 
0352 &sdmmc {
0353         bus-width = <4>;
0354         cap-sd-highspeed;
0355         disable-wp;
0356         pinctrl-names = "default";
0357         pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
0358         vmmc-supply = <&vcc_sd>;
0359         status = "okay";
0360 };
0361 
0362 &saradc {
0363         vref-supply = <&vcc_18>;
0364         status = "okay";
0365 };
0366 
0367 &tsadc {
0368         status = "okay";
0369 };
0370 
0371 &u2phy {
0372         status = "okay";
0373 };
0374 
0375 &u2phy_host {
0376         status = "okay";
0377 };
0378 
0379 &uart2 {
0380         status = "okay";
0381 };
0382 
0383 &usbdrd3 {
0384         dr_mode = "host";
0385         status = "okay";
0386 };
0387 
0388 &usb_host0_ehci {
0389         status = "okay";
0390 };