0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
0004 */
0005
0006 #include "rk3288.dtsi"
0007 #include <dt-bindings/input/input.h>
0008 #include <dt-bindings/clock/rockchip,rk808.h>
0009
0010 / {
0011 chosen {
0012 stdout-path = "serial2:115200n8";
0013 };
0014
0015 memory {
0016 reg = <0x0 0x0 0x0 0x80000000>;
0017 device_type = "memory";
0018 };
0019
0020 ext_gmac: external-gmac-clock {
0021 compatible = "fixed-clock";
0022 #clock-cells = <0>;
0023 clock-frequency = <125000000>;
0024 clock-output-names = "ext_gmac";
0025 };
0026
0027 gpio-keys {
0028 compatible = "gpio-keys";
0029 autorepeat;
0030
0031 pinctrl-names = "default";
0032 pinctrl-0 = <&pwrbtn>;
0033
0034 button {
0035 gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
0036 linux,code = <KEY_POWER>;
0037 label = "GPIO Key Power";
0038 linux,input-type = <1>;
0039 wakeup-source;
0040 debounce-interval = <100>;
0041 };
0042 };
0043
0044 gpio-leds {
0045 compatible = "gpio-leds";
0046
0047 act_led: led-0 {
0048 gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
0049 linux,default-trigger = "mmc0";
0050 };
0051
0052 heartbeat_led: led-1 {
0053 gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
0054 linux,default-trigger = "heartbeat";
0055 };
0056
0057 pwr_led: led-2 {
0058 gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
0059 linux,default-trigger = "default-on";
0060 };
0061 };
0062
0063 sdio_pwrseq: sdio-pwrseq {
0064 compatible = "mmc-pwrseq-simple";
0065 clocks = <&rk808 RK808_CLKOUT1>;
0066 clock-names = "ext_clock";
0067 pinctrl-names = "default";
0068 pinctrl-0 = <&wifi_enable>;
0069 reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>,
0070 <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
0071 };
0072
0073 sound {
0074 compatible = "simple-audio-card";
0075 simple-audio-card,format = "i2s";
0076 simple-audio-card,name = "rockchip,tinker-codec";
0077 simple-audio-card,mclk-fs = <512>;
0078
0079 simple-audio-card,codec {
0080 sound-dai = <&hdmi>;
0081 };
0082
0083 simple-audio-card,cpu {
0084 sound-dai = <&i2s>;
0085 };
0086 };
0087
0088 vcc_sys: vsys-regulator {
0089 compatible = "regulator-fixed";
0090 regulator-name = "vcc_sys";
0091 regulator-min-microvolt = <5000000>;
0092 regulator-max-microvolt = <5000000>;
0093 regulator-always-on;
0094 regulator-boot-on;
0095 };
0096
0097 vcc_sd: sdmmc-regulator {
0098 compatible = "regulator-fixed";
0099 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
0100 pinctrl-names = "default";
0101 pinctrl-0 = <&sdmmc_pwr>;
0102 regulator-name = "vcc_sd";
0103 regulator-min-microvolt = <3300000>;
0104 regulator-max-microvolt = <3300000>;
0105 startup-delay-us = <100000>;
0106 vin-supply = <&vcc_io>;
0107 };
0108 };
0109
0110 &cpu0 {
0111 cpu0-supply = <&vdd_cpu>;
0112 };
0113
0114 &cpu_opp_table {
0115 opp-1704000000 {
0116 opp-hz = /bits/ 64 <1704000000>;
0117 opp-microvolt = <1350000>;
0118 };
0119 opp-1800000000 {
0120 opp-hz = /bits/ 64 <1800000000>;
0121 opp-microvolt = <1400000>;
0122 };
0123 };
0124
0125 &gmac {
0126 assigned-clocks = <&cru SCLK_MAC>;
0127 assigned-clock-parents = <&ext_gmac>;
0128 clock_in_out = "input";
0129 phy-mode = "rgmii";
0130 phy-supply = <&vcc33_lan>;
0131 pinctrl-names = "default";
0132 pinctrl-0 = <&rgmii_pins>;
0133 snps,reset-gpio = <&gpio4 7 0>;
0134 snps,reset-active-low;
0135 snps,reset-delays-us = <0 10000 1000000>;
0136 tx_delay = <0x30>;
0137 rx_delay = <0x10>;
0138 status = "okay";
0139 };
0140
0141 &gpu {
0142 mali-supply = <&vdd_gpu>;
0143 status = "okay";
0144 };
0145
0146 &hdmi {
0147 ddc-i2c-bus = <&i2c5>;
0148 status = "okay";
0149 };
0150
0151 &i2c0 {
0152 clock-frequency = <400000>;
0153 status = "okay";
0154
0155 rk808: pmic@1b {
0156 compatible = "rockchip,rk808";
0157 reg = <0x1b>;
0158 interrupt-parent = <&gpio0>;
0159 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
0160 #clock-cells = <1>;
0161 clock-output-names = "xin32k", "rk808-clkout2";
0162 dvs-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
0163 <&gpio0 12 GPIO_ACTIVE_HIGH>;
0164 pinctrl-names = "default";
0165 pinctrl-0 = <&pmic_int &global_pwroff &dvs_1 &dvs_2>;
0166 rockchip,system-power-controller;
0167 wakeup-source;
0168
0169 vcc1-supply = <&vcc_sys>;
0170 vcc2-supply = <&vcc_sys>;
0171 vcc3-supply = <&vcc_sys>;
0172 vcc4-supply = <&vcc_sys>;
0173 vcc6-supply = <&vcc_sys>;
0174 vcc7-supply = <&vcc_sys>;
0175 vcc8-supply = <&vcc_io>;
0176 vcc9-supply = <&vcc_io>;
0177 vcc10-supply = <&vcc_io>;
0178 vcc11-supply = <&vcc_sys>;
0179 vcc12-supply = <&vcc_io>;
0180 vddio-supply = <&vcc_io>;
0181
0182 regulators {
0183 vdd_cpu: DCDC_REG1 {
0184 regulator-always-on;
0185 regulator-boot-on;
0186 regulator-min-microvolt = <750000>;
0187 regulator-max-microvolt = <1400000>;
0188 regulator-name = "vdd_arm";
0189 regulator-ramp-delay = <6000>;
0190 regulator-state-mem {
0191 regulator-off-in-suspend;
0192 };
0193 };
0194
0195 vdd_gpu: DCDC_REG2 {
0196 regulator-always-on;
0197 regulator-boot-on;
0198 regulator-min-microvolt = <850000>;
0199 regulator-max-microvolt = <1250000>;
0200 regulator-name = "vdd_gpu";
0201 regulator-ramp-delay = <6000>;
0202 regulator-state-mem {
0203 regulator-on-in-suspend;
0204 regulator-suspend-microvolt = <1000000>;
0205 };
0206 };
0207
0208 vcc_ddr: DCDC_REG3 {
0209 regulator-always-on;
0210 regulator-boot-on;
0211 regulator-name = "vcc_ddr";
0212 regulator-state-mem {
0213 regulator-on-in-suspend;
0214 };
0215 };
0216
0217 vcc_io: DCDC_REG4 {
0218 regulator-always-on;
0219 regulator-boot-on;
0220 regulator-min-microvolt = <3300000>;
0221 regulator-max-microvolt = <3300000>;
0222 regulator-name = "vcc_io";
0223 regulator-state-mem {
0224 regulator-on-in-suspend;
0225 regulator-suspend-microvolt = <3300000>;
0226 };
0227 };
0228
0229 vcc18_ldo1: LDO_REG1 {
0230 regulator-always-on;
0231 regulator-boot-on;
0232 regulator-min-microvolt = <1800000>;
0233 regulator-max-microvolt = <1800000>;
0234 regulator-name = "vcc18_ldo1";
0235 regulator-state-mem {
0236 regulator-on-in-suspend;
0237 regulator-suspend-microvolt = <1800000>;
0238 };
0239 };
0240
0241 vcc33_mipi: LDO_REG2 {
0242 regulator-always-on;
0243 regulator-boot-on;
0244 regulator-min-microvolt = <3300000>;
0245 regulator-max-microvolt = <3300000>;
0246 regulator-name = "vcc33_mipi";
0247 regulator-state-mem {
0248 regulator-off-in-suspend;
0249 };
0250 };
0251
0252 vdd_10: LDO_REG3 {
0253 regulator-always-on;
0254 regulator-boot-on;
0255 regulator-min-microvolt = <1000000>;
0256 regulator-max-microvolt = <1000000>;
0257 regulator-name = "vdd_10";
0258 regulator-state-mem {
0259 regulator-on-in-suspend;
0260 regulator-suspend-microvolt = <1000000>;
0261 };
0262 };
0263
0264 vcc18_codec: LDO_REG4 {
0265 regulator-always-on;
0266 regulator-boot-on;
0267 regulator-min-microvolt = <1800000>;
0268 regulator-max-microvolt = <1800000>;
0269 regulator-name = "vcc18_codec";
0270 regulator-state-mem {
0271 regulator-on-in-suspend;
0272 regulator-suspend-microvolt = <1800000>;
0273 };
0274 };
0275
0276 vccio_sd: LDO_REG5 {
0277 regulator-always-on;
0278 regulator-boot-on;
0279 regulator-min-microvolt = <1800000>;
0280 regulator-max-microvolt = <3300000>;
0281 regulator-name = "vccio_sd";
0282 regulator-state-mem {
0283 regulator-on-in-suspend;
0284 regulator-suspend-microvolt = <3300000>;
0285 };
0286 };
0287
0288 vdd10_lcd: LDO_REG6 {
0289 regulator-always-on;
0290 regulator-boot-on;
0291 regulator-min-microvolt = <1000000>;
0292 regulator-max-microvolt = <1000000>;
0293 regulator-name = "vdd10_lcd";
0294 regulator-state-mem {
0295 regulator-on-in-suspend;
0296 regulator-suspend-microvolt = <1000000>;
0297 };
0298 };
0299
0300 vcc_18: LDO_REG7 {
0301 regulator-always-on;
0302 regulator-boot-on;
0303 regulator-min-microvolt = <1800000>;
0304 regulator-max-microvolt = <1800000>;
0305 regulator-name = "vcc_18";
0306 regulator-state-mem {
0307 regulator-on-in-suspend;
0308 regulator-suspend-microvolt = <1800000>;
0309 };
0310 };
0311
0312 vcc18_lcd: LDO_REG8 {
0313 regulator-always-on;
0314 regulator-boot-on;
0315 regulator-min-microvolt = <1800000>;
0316 regulator-max-microvolt = <1800000>;
0317 regulator-name = "vcc18_lcd";
0318 regulator-state-mem {
0319 regulator-on-in-suspend;
0320 regulator-suspend-microvolt = <1800000>;
0321 };
0322 };
0323
0324 vcc33_sd: SWITCH_REG1 {
0325 regulator-always-on;
0326 regulator-boot-on;
0327 regulator-name = "vcc33_sd";
0328 regulator-state-mem {
0329 regulator-on-in-suspend;
0330 };
0331 };
0332
0333 vcc33_lan: SWITCH_REG2 {
0334 regulator-always-on;
0335 regulator-boot-on;
0336 regulator-name = "vcc33_lan";
0337 regulator-state-mem {
0338 regulator-on-in-suspend;
0339 };
0340 };
0341 };
0342 };
0343 };
0344
0345 &i2c2 {
0346 status = "okay";
0347 };
0348
0349 &i2c5 {
0350 status = "okay";
0351 };
0352
0353 &i2s {
0354 #sound-dai-cells = <0>;
0355 status = "okay";
0356 };
0357
0358 &io_domains {
0359 status = "okay";
0360
0361 sdcard-supply = <&vccio_sd>;
0362 wifi-supply = <&vcc_18>;
0363 };
0364
0365 &pinctrl {
0366 pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
0367 drive-strength = <8>;
0368 };
0369
0370 pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
0371 bias-pull-up;
0372 drive-strength = <8>;
0373 };
0374
0375 backlight {
0376 bl_en: bl-en {
0377 rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
0378 };
0379 };
0380
0381 buttons {
0382 pwrbtn: pwrbtn {
0383 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
0384 };
0385 };
0386
0387 eth_phy {
0388 eth_phy_pwr: eth-phy-pwr {
0389 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
0390 };
0391 };
0392
0393 pmic {
0394 pmic_int: pmic-int {
0395 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
0396 };
0397
0398 dvs_1: dvs-1 {
0399 rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_down>;
0400 };
0401
0402 dvs_2: dvs-2 {
0403 rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
0404 };
0405 };
0406
0407 sdmmc {
0408 sdmmc_bus4: sdmmc-bus4 {
0409 rockchip,pins = <6 RK_PC0 1 &pcfg_pull_up_drv_8ma>,
0410 <6 RK_PC1 1 &pcfg_pull_up_drv_8ma>,
0411 <6 RK_PC2 1 &pcfg_pull_up_drv_8ma>,
0412 <6 RK_PC3 1 &pcfg_pull_up_drv_8ma>;
0413 };
0414
0415 sdmmc_clk: sdmmc-clk {
0416 rockchip,pins = <6 RK_PC4 1 &pcfg_pull_none_drv_8ma>;
0417 };
0418
0419 sdmmc_cmd: sdmmc-cmd {
0420 rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>;
0421 };
0422
0423 sdmmc_pwr: sdmmc-pwr {
0424 rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
0425 };
0426 };
0427
0428 usb {
0429 host_vbus_drv: host-vbus-drv {
0430 rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
0431 };
0432
0433 pwr_3g: pwr-3g {
0434 rockchip,pins = <7 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
0435 };
0436 };
0437
0438 sdio {
0439 wifi_enable: wifi-enable {
0440 rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,
0441 <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
0442 };
0443 };
0444 };
0445
0446 &pwm0 {
0447 status = "okay";
0448 };
0449
0450 &saradc {
0451 vref-supply = <&vcc18_ldo1>;
0452 status = "okay";
0453 };
0454
0455 &sdmmc {
0456 bus-width = <4>;
0457 cap-mmc-highspeed;
0458 cap-sd-highspeed;
0459 broken-cd;
0460 disable-wp; /* wp not hooked up */
0461 pinctrl-names = "default";
0462 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
0463 status = "okay";
0464 vmmc-supply = <&vcc33_sd>;
0465 vqmmc-supply = <&vccio_sd>;
0466 };
0467
0468 &sdio0 {
0469 bus-width = <4>;
0470 cap-sd-highspeed;
0471 cap-sdio-irq;
0472 keep-power-in-suspend;
0473 max-frequency = <50000000>;
0474 mmc-pwrseq = <&sdio_pwrseq>;
0475 non-removable;
0476 pinctrl-names = "default";
0477 pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
0478 sd-uhs-sdr12;
0479 sd-uhs-sdr25;
0480 sd-uhs-sdr50;
0481 vmmc-supply = <&vcc_io>;
0482 vqmmc-supply = <&vcc_18>;
0483 status = "okay";
0484 };
0485
0486 &tsadc {
0487 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
0488 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
0489 status = "okay";
0490 };
0491
0492 &uart0 {
0493 status = "okay";
0494 };
0495
0496 &uart1 {
0497 status = "okay";
0498 };
0499
0500 &uart2 {
0501 status = "okay";
0502 };
0503
0504 &uart3 {
0505 status = "okay";
0506 };
0507
0508 &uart4 {
0509 status = "okay";
0510 };
0511
0512 &usbphy {
0513 status = "okay";
0514 };
0515
0516 &usb_host0_ehci {
0517 status = "okay";
0518 };
0519
0520 &usb_host1 {
0521 status = "okay";
0522 };
0523
0524 &usb_otg {
0525 status = "okay";
0526 };
0527
0528 &vopb {
0529 status = "okay";
0530 };
0531
0532 &vopb_mmu {
0533 status = "okay";
0534 };
0535
0536 &vopl {
0537 status = "okay";
0538 };
0539
0540 &vopl_mmu {
0541 status = "okay";
0542 };
0543
0544 &wdt {
0545 status = "okay";
0546 };