Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / dts / rk3399-firefly.dts
index 31e3ba8a4742bb4fb862859e3808288016f42aa4..d63faf38cc81a8e2b38ef282e204c4280256316a 100644 (file)
@@ -1,22 +1,20 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
- *
- * SPDX-License-Identifier:     GPL-2.0+
  */
 
 /dts-v1/;
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/pwm/pwm.h>
-#include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
-#include "rk3399-sdram-ddr3-1600.dtsi"
+#include "rk3399-opp.dtsi"
 
 / {
        model = "Firefly-RK3399 Board";
        compatible = "firefly,firefly-rk3399", "rockchip,rk3399";
 
        chosen {
-               stdout-path = &uart2;
-               u-boot,spl-boot-order = &sdhci, &sdmmc;
+               stdout-path = "serial2:1500000n8";
        };
 
        backlight: backlight {
                #clock-cells = <0>;
        };
 
+       dc_12v: dc-12v {
+               compatible = "regulator-fixed";
+               regulator-name = "dc_12v";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwrbtn>;
+
+               power {
+                       debounce-interval = <100>;
+                       gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+                       label = "GPIO Key Power";
+                       linux,code = <KEY_POWER>;
+                       wakeup-source;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>;
+
+               work-led {
+                       label = "work";
+                       default-state = "on";
+                       gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+               };
+
+               diy-led {
+                       label = "diy";
+                       default-state = "off";
+                       gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
        rt5640-sound {
                compatible = "simple-audio-card";
                simple-audio-card,name = "rockchip,rt5640-codec";
                reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
        };
 
+       /* switched by pmic_sleep */
+       vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc1v8_s3";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_1v8>;
+       };
+
        vcc3v3_pcie: vcc3v3-pcie-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
-               pinctrl-0 = <&pcie_drv>;
+               pinctrl-0 = <&pcie_pwr_en>;
                regulator-name = "vcc3v3_pcie";
                regulator-always-on;
                regulator-boot-on;
+               vin-supply = <&dc_12v>;
        };
 
        vcc3v3_sys: vcc3v3-sys {
                regulator-boot-on;
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_sys>;
        };
 
+       /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
        vcc5v0_host: vcc5v0-host-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
-               pinctrl-0 = <&host_vbus_drv>;
+               pinctrl-0 = <&vcc5v0_host_en>;
                regulator-name = "vcc5v0_host";
                regulator-always-on;
+               vin-supply = <&vcc_sys>;
        };
 
-       vcc5v0_sys: vcc5v0-sys {
+       vcc_sys: vcc-sys {
                compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_sys";
+               regulator-name = "vcc_sys";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-       };
-
-       vcc_phy: vcc-phy-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc_phy";
-               regulator-always-on;
-               regulator-boot-on;
+               vin-supply = <&dc_12v>;
        };
 
        vdd_log: vdd-log {
                regulator-boot-on;
                regulator-min-microvolt = <430000>;
                regulator-max-microvolt = <1400000>;
-               regulator-init-microvolt = <950000>;
-       };
-
-       vccadc_ref: vccadc-ref {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc1v8_sys";
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_sys>;
        };
 };
 
        assigned-clocks = <&cru SCLK_RMII_SRC>;
        assigned-clock-parents = <&clkin_gmac>;
        clock_in_out = "input";
-       phy-supply = <&vcc_phy>;
+       phy-supply = <&vcc_lan>;
        phy-mode = "rgmii";
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii_pins>;
        snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
        snps,reset-active-low;
        snps,reset-delays-us = <0 10000 50000>;
-       tx_delay = <0x33>;
-       rx_delay = <0x45>;
+       tx_delay = <0x28>;
+       rx_delay = <0x11>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c3>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_cec>;
        status = "okay";
 };
 
                rockchip,system-power-controller;
                wakeup-source;
 
-               vcc1-supply = <&vcc3v3_sys>;
-               vcc2-supply = <&vcc3v3_sys>;
-               vcc3-supply = <&vcc3v3_sys>;
-               vcc4-supply = <&vcc3v3_sys>;
-               vcc6-supply = <&vcc3v3_sys>;
-               vcc7-supply = <&vcc3v3_sys>;
+               vcc1-supply = <&vcc_sys>;
+               vcc2-supply = <&vcc_sys>;
+               vcc3-supply = <&vcc_sys>;
+               vcc4-supply = <&vcc_sys>;
+               vcc6-supply = <&vcc_sys>;
+               vcc7-supply = <&vcc_sys>;
                vcc8-supply = <&vcc3v3_sys>;
-               vcc9-supply = <&vcc3v3_sys>;
-               vcc10-supply = <&vcc3v3_sys>;
-               vcc11-supply = <&vcc3v3_sys>;
+               vcc9-supply = <&vcc_sys>;
+               vcc10-supply = <&vcc_sys>;
+               vcc11-supply = <&vcc_sys>;
                vcc12-supply = <&vcc3v3_sys>;
                vddio-supply = <&vcc1v8_pmu>;
 
                                };
                        };
 
-                       vcc3v0_tp: LDO_REG2 {
-                               regulator-name = "vcc3v0_tp";
+                       vcc2v8_dvp: LDO_REG2 {
+                               regulator-name = "vcc2v8_dvp";
                                regulator-always-on;
                                regulator-boot-on;
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3000000>;
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                                };
                        };
 
-                       vcc_sd: LDO_REG4 {
-                               regulator-name = "vcc_sd";
+                       vcc_sdio: LDO_REG4 {
+                               regulator-name = "vcc_sdio";
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
+                               regulator-max-microvolt = <3000000>;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
-                                       regulator-suspend-microvolt = <3300000>;
+                                       regulator-suspend-microvolt = <3000000>;
                                };
                        };
 
                                };
                        };
 
-                       vcc3v3_s3: SWITCH_REG1 {
+                       vcc3v3_s3: vcc_lan: SWITCH_REG1 {
                                regulator-name = "vcc3v3_s3";
                                regulator-always-on;
                                regulator-boot-on;
                regulator-ramp-delay = <1000>;
                regulator-always-on;
                regulator-boot-on;
-               vin-supply = <&vcc5v0_sys>;
+               vin-supply = <&vcc_sys>;
 
                regulator-state-mem {
                        regulator-off-in-suspend;
                regulator-ramp-delay = <1000>;
                regulator-always-on;
                regulator-boot-on;
-               vin-supply = <&vcc5v0_sys>;
+               vin-supply = <&vcc_sys>;
 
                regulator-state-mem {
                        regulator-off-in-suspend;
 &i2s0 {
        rockchip,playback-channels = <8>;
        rockchip,capture-channels = <8>;
-       #sound-dai-cells = <0>;
        status = "okay";
 };
 
 &i2s1 {
        rockchip,playback-channels = <2>;
        rockchip,capture-channels = <2>;
-       #sound-dai-cells = <0>;
        status = "okay";
 };
 
 &i2s2 {
-       #sound-dai-cells = <0>;
        status = "okay";
 };
 
 
        bt656-supply = <&vcc1v8_dvp>;
        audio-supply = <&vcca1v8_codec>;
-       sdmmc-supply = <&vcc_sd>;
+       sdmmc-supply = <&vcc_sdio>;
        gpio1830-supply = <&vcc_3v0>;
 };
 
        ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
        num-lanes = <4>;
        pinctrl-names = "default";
-       pinctrl-0 = <&pcie_clkreqn>;
+       pinctrl-0 = <&pcie_clkreqn_cpm>;
        status = "okay";
 };
 
        };
 
        pcie {
-               pcie_drv: pcie-drv {
+               pcie_pwr_en: pcie-pwr-en {
                        rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
 
        };
 
        usb2 {
-               host_vbus_drv: host-vbus-drv {
+               vcc5v0_host_en: vcc5v0-host-en {
                        rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
+
+       wifi {
+               wifi_host_wake_l: wifi-host-wake-l {
+                       rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       leds {
+               work_led_gpio: work_led-gpio {
+                       rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               diy_led_gpio: diy_led-gpio {
+                       rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &pwm0 {
 };
 
 &saradc {
-       vref-supply = <&vccadc_ref>;
+       vref-supply = <&vcca1v8_s3>;
+       status = "okay";
+};
+
+&sdio0 {
+       /* WiFi & BT combo module Ampak AP6356S */
+       bus-width = <4>;
+       cap-sdio-irq;
+       cap-sd-highspeed;
+       keep-power-in-suspend;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+       sd-uhs-sdr104;
+
+       /* Power supply */
+       vqmmc-supply = &vcc1v8_s3;      /* IO line */
+       vmmc-supply = &vcc_sdio;        /* card's power */
+
+       #address-cells = <1>;
+       #size-cells = <0>;
        status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+               interrupt-names = "host-wake";
+               brcm,drive-strength = <5>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_host_wake_l>;
+       };
 };
 
 &sdmmc {
-       u-boot,dm-pre-reloc;
        bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
        status = "okay";
 };
 
 &sdhci {
        bus-width = <8>;
-       keep-power-in-suspend;
        mmc-hs400-1_8v;
        mmc-hs400-enhanced-strobe;
        non-removable;
        status = "okay";
 };
 
+&tcphy0 {
+       status = "okay";
+};
+
+&tcphy1 {
+       status = "okay";
+};
+
 &tsadc {
        /* tshut mode 0:CRU 1:GPIO */
        rockchip,hw-tshut-mode = <1>;
 &usb_host1_ohci {
        status = "okay";
 };
+
+&usbdrd3_0 {
+       status = "okay";
+};
+
+&usbdrd_dwc3_0 {
+       status = "okay";
+       dr_mode = "otg";
+};
+
+&usbdrd3_1 {
+       status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+       status = "okay";
+       dr_mode = "host";
+};
+
+&vopb {
+       status = "okay";
+};
+
+&vopb_mmu {
+       status = "okay";
+};
+
+&vopl {
+       status = "okay";
+};
+
+&vopl_mmu {
+       status = "okay";
+};