0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
0004 */
0005
0006 #include <dt-bindings/pwm/pwm.h>
0007 #include "rk3399.dtsi"
0008 #include "rk3399-opp.dtsi"
0009
0010 / {
0011 aliases {
0012 mmc0 = &sdhci;
0013 };
0014
0015 leds {
0016 compatible = "gpio-leds";
0017 pinctrl-names = "default";
0018 pinctrl-0 = <&module_led_pin>;
0019
0020 module_led: led-0 {
0021 label = "module_led";
0022 gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>;
0023 linux,default-trigger = "heartbeat";
0024 panic-indicator;
0025 };
0026 };
0027
0028 extcon_usb3: extcon-usb3 {
0029 compatible = "linux,extcon-usb-gpio";
0030 id-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
0031 pinctrl-names = "default";
0032 pinctrl-0 = <&usb3_id>;
0033 };
0034
0035 clkin_gmac: external-gmac-clock {
0036 compatible = "fixed-clock";
0037 clock-frequency = <125000000>;
0038 clock-output-names = "clkin_gmac";
0039 #clock-cells = <0>;
0040 };
0041
0042 vcc1v2_phy: vcc1v2-phy {
0043 compatible = "regulator-fixed";
0044 regulator-name = "vcc1v2_phy";
0045 regulator-always-on;
0046 regulator-boot-on;
0047 regulator-min-microvolt = <1200000>;
0048 regulator-max-microvolt = <1200000>;
0049 vin-supply = <&vcc5v0_sys>;
0050 };
0051
0052 vcc3v3_sys: vcc3v3-sys {
0053 compatible = "regulator-fixed";
0054 regulator-name = "vcc3v3_sys";
0055 regulator-always-on;
0056 regulator-boot-on;
0057 regulator-min-microvolt = <3300000>;
0058 regulator-max-microvolt = <3300000>;
0059 vin-supply = <&vcc5v0_sys>;
0060 };
0061
0062 vcc5v0_host: vcc5v0-host-regulator {
0063 compatible = "regulator-fixed";
0064 gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
0065 pinctrl-names = "default";
0066 pinctrl-0 = <&vcc5v0_host_en>;
0067 regulator-name = "vcc5v0_host";
0068 regulator-always-on;
0069 vin-supply = <&vcc5v0_sys>;
0070 };
0071
0072 vcc5v0_sys: vcc5v0-sys {
0073 compatible = "regulator-fixed";
0074 regulator-name = "vcc5v0_sys";
0075 regulator-always-on;
0076 regulator-boot-on;
0077 regulator-min-microvolt = <5000000>;
0078 regulator-max-microvolt = <5000000>;
0079 };
0080
0081 vdd_log: vdd-log {
0082 compatible = "pwm-regulator";
0083 pwms = <&pwm2 0 25000 1>;
0084 pwm-supply = <&vcc5v0_sys>;
0085 regulator-name = "vdd_log";
0086 regulator-min-microvolt = <800000>;
0087 regulator-max-microvolt = <1400000>;
0088 regulator-always-on;
0089 regulator-boot-on;
0090 };
0091 };
0092
0093 &cpu_b0 {
0094 cpu-supply = <&vdd_cpu_b>;
0095 };
0096
0097 &cpu_b1 {
0098 cpu-supply = <&vdd_cpu_b>;
0099 };
0100
0101 &cpu_l0 {
0102 cpu-supply = <&vdd_cpu_l>;
0103 };
0104
0105 &cpu_l1 {
0106 cpu-supply = <&vdd_cpu_l>;
0107 };
0108
0109 &cpu_l2 {
0110 cpu-supply = <&vdd_cpu_l>;
0111 };
0112
0113 &cpu_l3 {
0114 cpu-supply = <&vdd_cpu_l>;
0115 };
0116
0117 &emmc_phy {
0118 status = "okay";
0119 drive-impedance-ohm = <33>;
0120 };
0121
0122 &gmac {
0123 assigned-clocks = <&cru SCLK_RMII_SRC>;
0124 assigned-clock-parents = <&clkin_gmac>;
0125 clock_in_out = "input";
0126 phy-supply = <&vcc1v2_phy>;
0127 phy-mode = "rgmii";
0128 pinctrl-names = "default";
0129 pinctrl-0 = <&rgmii_pins>;
0130 snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
0131 snps,reset-active-low;
0132 snps,reset-delays-us = <0 10000 50000>;
0133 tx_delay = <0x10>;
0134 rx_delay = <0x10>;
0135 status = "okay";
0136 };
0137
0138 &gpu {
0139 mali-supply = <&vdd_gpu>;
0140 status = "okay";
0141 };
0142
0143 &i2c0 {
0144 status = "okay";
0145 i2c-scl-rising-time-ns = <168>;
0146 i2c-scl-falling-time-ns = <4>;
0147 clock-frequency = <400000>;
0148
0149 rk808: pmic@1b {
0150 compatible = "rockchip,rk808";
0151 reg = <0x1b>;
0152 interrupt-parent = <&gpio1>;
0153 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
0154 #clock-cells = <1>;
0155 clock-output-names = "xin32k", "rk808-clkout2";
0156 pinctrl-names = "default";
0157 pinctrl-0 = <&pmic_int_l>;
0158 rockchip,system-power-controller;
0159 wakeup-source;
0160
0161 vcc1-supply = <&vcc5v0_sys>;
0162 vcc2-supply = <&vcc5v0_sys>;
0163 vcc3-supply = <&vcc5v0_sys>;
0164 vcc4-supply = <&vcc5v0_sys>;
0165 vcc6-supply = <&vcc5v0_sys>;
0166 vcc7-supply = <&vcc5v0_sys>;
0167 vcc8-supply = <&vcc3v3_sys>;
0168 vcc9-supply = <&vcc5v0_sys>;
0169 vcc10-supply = <&vcc5v0_sys>;
0170 vcc11-supply = <&vcc5v0_sys>;
0171 vcc12-supply = <&vcc3v3_sys>;
0172 vddio-supply = <&vcc1v8_pmu>;
0173
0174 regulators {
0175 vdd_center: DCDC_REG1 {
0176 regulator-name = "vdd_center";
0177 regulator-min-microvolt = <750000>;
0178 regulator-max-microvolt = <1350000>;
0179 regulator-ramp-delay = <6001>;
0180 regulator-always-on;
0181 regulator-boot-on;
0182 regulator-state-mem {
0183 regulator-off-in-suspend;
0184 };
0185 };
0186
0187 vdd_cpu_l: DCDC_REG2 {
0188 regulator-name = "vdd_cpu_l";
0189 regulator-min-microvolt = <750000>;
0190 regulator-max-microvolt = <1350000>;
0191 regulator-ramp-delay = <6001>;
0192 regulator-always-on;
0193 regulator-boot-on;
0194 regulator-state-mem {
0195 regulator-off-in-suspend;
0196 };
0197 };
0198
0199 vcc_ddr: DCDC_REG3 {
0200 regulator-name = "vcc_ddr";
0201 regulator-always-on;
0202 regulator-boot-on;
0203 regulator-state-mem {
0204 regulator-on-in-suspend;
0205 };
0206 };
0207
0208 vcc_1v8: DCDC_REG4 {
0209 regulator-name = "vcc_1v8";
0210 regulator-min-microvolt = <1800000>;
0211 regulator-max-microvolt = <1800000>;
0212 regulator-always-on;
0213 regulator-boot-on;
0214 regulator-state-mem {
0215 regulator-on-in-suspend;
0216 regulator-suspend-microvolt = <1800000>;
0217 };
0218 };
0219
0220 vcc_ldo1: LDO_REG1 {
0221 regulator-name = "vcc_ldo1";
0222 regulator-min-microvolt = <1800000>;
0223 regulator-max-microvolt = <1800000>;
0224 regulator-boot-on;
0225 regulator-state-mem {
0226 regulator-off-in-suspend;
0227 };
0228 };
0229
0230 vcc1v8_hdmi: LDO_REG2 {
0231 regulator-name = "vcc1v8_hdmi";
0232 regulator-min-microvolt = <1800000>;
0233 regulator-max-microvolt = <1800000>;
0234 regulator-always-on;
0235 regulator-boot-on;
0236 regulator-state-mem {
0237 regulator-off-in-suspend;
0238 };
0239 };
0240
0241 vcc1v8_pmu: LDO_REG3 {
0242 regulator-name = "vcc1v8_pmu";
0243 regulator-min-microvolt = <1800000>;
0244 regulator-max-microvolt = <1800000>;
0245 regulator-always-on;
0246 regulator-boot-on;
0247 regulator-state-mem {
0248 regulator-on-in-suspend;
0249 regulator-suspend-microvolt = <1800000>;
0250 };
0251 };
0252
0253 vcc_sd: LDO_REG4 {
0254 regulator-name = "vcc_sd";
0255 regulator-min-microvolt = <1800000>;
0256 regulator-max-microvolt = <3000000>;
0257 regulator-always-on;
0258 regulator-boot-on;
0259 regulator-state-mem {
0260 regulator-on-in-suspend;
0261 regulator-suspend-microvolt = <3000000>;
0262 };
0263 };
0264
0265 vcc_ldo5: LDO_REG5 {
0266 regulator-name = "vcc_ldo5";
0267 regulator-min-microvolt = <3000000>;
0268 regulator-max-microvolt = <3000000>;
0269 regulator-boot-on;
0270 regulator-state-mem {
0271 regulator-off-in-suspend;
0272 };
0273 };
0274
0275 vcc_ldo6: LDO_REG6 {
0276 regulator-name = "vcc_ldo6";
0277 regulator-min-microvolt = <1500000>;
0278 regulator-max-microvolt = <1500000>;
0279 regulator-boot-on;
0280 regulator-state-mem {
0281 regulator-off-in-suspend;
0282 };
0283 };
0284
0285 vcc0v9_hdmi: LDO_REG7 {
0286 regulator-name = "vcc0v9_hdmi";
0287 regulator-min-microvolt = <900000>;
0288 regulator-max-microvolt = <900000>;
0289 regulator-always-on;
0290 regulator-boot-on;
0291 regulator-state-mem {
0292 regulator-off-in-suspend;
0293 };
0294 };
0295
0296 vcc_efuse: LDO_REG8 {
0297 regulator-name = "vcc_efuse";
0298 regulator-min-microvolt = <1800000>;
0299 regulator-max-microvolt = <1800000>;
0300 regulator-always-on;
0301 regulator-boot-on;
0302 regulator-state-mem {
0303 regulator-off-in-suspend;
0304 };
0305 };
0306
0307 vcc3v3_s3: SWITCH_REG1 {
0308 regulator-name = "vcc3v3_s3";
0309 regulator-always-on;
0310 regulator-boot-on;
0311 regulator-state-mem {
0312 regulator-off-in-suspend;
0313 };
0314 };
0315
0316 vcc3v3_s0: SWITCH_REG2 {
0317 regulator-name = "vcc3v3_s0";
0318 regulator-always-on;
0319 regulator-boot-on;
0320 regulator-state-mem {
0321 regulator-off-in-suspend;
0322 };
0323 };
0324 };
0325 };
0326
0327 vdd_gpu: regulator@60 {
0328 compatible = "fcs,fan53555";
0329 reg = <0x60>;
0330 fcs,suspend-voltage-selector = <1>;
0331 regulator-name = "vdd_gpu";
0332 regulator-min-microvolt = <600000>;
0333 regulator-max-microvolt = <1230000>;
0334 regulator-ramp-delay = <1000>;
0335 regulator-always-on;
0336 regulator-boot-on;
0337 vin-supply = <&vcc5v0_sys>;
0338 };
0339 };
0340
0341 &i2c7 {
0342 status = "okay";
0343 clock-frequency = <400000>;
0344
0345 fan: fan@18 {
0346 compatible = "ti,amc6821";
0347 reg = <0x18>;
0348 #cooling-cells = <2>;
0349 };
0350
0351 rtc_twi: rtc@6f {
0352 compatible = "isil,isl1208";
0353 reg = <0x6f>;
0354 };
0355 };
0356
0357 &i2c8 {
0358 status = "okay";
0359 clock-frequency = <400000>;
0360
0361 vdd_cpu_b: regulator@60 {
0362 compatible = "fcs,fan53555";
0363 reg = <0x60>;
0364 vin-supply = <&vcc5v0_sys>;
0365 regulator-name = "vdd_cpu_b";
0366 regulator-min-microvolt = <600000>;
0367 regulator-max-microvolt = <1230000>;
0368 regulator-ramp-delay = <1000>;
0369 fcs,suspend-voltage-selector = <1>;
0370 regulator-always-on;
0371 regulator-boot-on;
0372 };
0373 };
0374
0375 &i2s0 {
0376 pinctrl-0 = <&i2s0_2ch_bus>;
0377 rockchip,playback-channels = <2>;
0378 rockchip,capture-channels = <2>;
0379 status = "okay";
0380 };
0381
0382 /*
0383 * As Q7 does not specify neither a global nor a RX clock for I2S these
0384 * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO.
0385 * Therefore we have to redefine the i2s0_2ch_bus definition to prevent
0386 * conflicts.
0387 */
0388 &i2s0_2ch_bus {
0389 rockchip,pins =
0390 <3 RK_PD0 1 &pcfg_pull_none>,
0391 <3 RK_PD2 1 &pcfg_pull_none>,
0392 <3 RK_PD3 1 &pcfg_pull_none>,
0393 <3 RK_PD7 1 &pcfg_pull_none>;
0394 };
0395
0396 &io_domains {
0397 status = "okay";
0398 bt656-supply = <&vcc_1v8>;
0399 audio-supply = <&vcc_1v8>;
0400 sdmmc-supply = <&vcc_sd>;
0401 gpio1830-supply = <&vcc_1v8>;
0402 };
0403
0404 &pmu_io_domains {
0405 status = "okay";
0406 pmu1830-supply = <&vcc_1v8>;
0407 };
0408
0409 &pwm2 {
0410 status = "okay";
0411 };
0412
0413 &pinctrl {
0414 i2c8 {
0415 i2c8_xfer_a: i2c8-xfer {
0416 rockchip,pins =
0417 <1 RK_PC4 1 &pcfg_pull_up>,
0418 <1 RK_PC5 1 &pcfg_pull_up>;
0419 };
0420 };
0421
0422 leds {
0423 module_led_pin: module-led-pin {
0424 rockchip,pins =
0425 <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
0426 };
0427 };
0428
0429 pmic {
0430 pmic_int_l: pmic-int-l {
0431 rockchip,pins =
0432 <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
0433 };
0434 };
0435
0436 usb2 {
0437 vcc5v0_host_en: vcc5v0-host-en {
0438 rockchip,pins =
0439 <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
0440 };
0441 };
0442
0443 usb3 {
0444 usb3_id: usb3-id {
0445 rockchip,pins =
0446 <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
0447 };
0448 };
0449 };
0450
0451 &sdhci {
0452 /*
0453 * Signal integrity isn't great at 200MHz but 100MHz has proven stable
0454 * enough.
0455 */
0456 max-frequency = <100000000>;
0457
0458 bus-width = <8>;
0459 mmc-hs400-1_8v;
0460 mmc-hs400-enhanced-strobe;
0461 non-removable;
0462 status = "okay";
0463 };
0464
0465 &sdmmc {
0466 vqmmc-supply = <&vcc_sd>;
0467 };
0468
0469 &spi1 {
0470 status = "okay";
0471
0472 norflash: flash@0 {
0473 compatible = "jedec,spi-nor";
0474 reg = <0>;
0475 spi-max-frequency = <50000000>;
0476 };
0477 };
0478
0479 &tcphy1 {
0480 status = "okay";
0481 };
0482
0483 &tsadc {
0484 rockchip,hw-tshut-mode = <1>;
0485 rockchip,hw-tshut-polarity = <1>;
0486 status = "okay";
0487 };
0488
0489 &u2phy1 {
0490 status = "okay";
0491
0492 u2phy1_otg: otg-port {
0493 status = "okay";
0494 };
0495
0496 u2phy1_host: host-port {
0497 phy-supply = <&vcc5v0_host>;
0498 status = "okay";
0499 };
0500 };
0501
0502 &usbdrd3_1 {
0503 status = "okay";
0504 };
0505
0506 &usbdrd_dwc3_1 {
0507 status = "okay";
0508 dr_mode = "host";
0509 };
0510
0511 &usb_host1_ehci {
0512 status = "okay";
0513 };
0514
0515 &usb_host1_ohci {
0516 status = "okay";
0517 };