ARM: dts: rockchip: rk3288 hevc using same clk freqs as android
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288.dtsi
index f5032a0a548bc2ff3e832884f130bdb0b4603af0..d23c920fe7b6c93bc9b6e15ffd546496e867851e 100644 (file)
@@ -45,6 +45,7 @@
 #include <dt-bindings/clock/rk3288-cru.h>
 #include <dt-bindings/thermal/thermal.h>
 #include <dt-bindings/power/rk3288-power.h>
+#include <dt-bindings/soc/rockchip_boot-mode.h>
 #include "skeleton.dtsi"
 
 / {
                interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
                reg = <0xff0f0000 0x4000>;
                status = "disabled";
+               supports-emmc;
        };
 
        saradc: saradc@ff100000 {
                        "aclk_mac", "pclk_mac";
                resets = <&cru SRST_MAC>;
                reset-names = "stmmaceth";
+               max-speed = <100>;
                status = "disabled";
        };
 
                reg = <0xff720000 0x1000>;
        };
 
+       qos_gpu_r: qos@ffaa0000 {
+               compatible = "syscon";
+               reg = <0xffaa0000 0x20>;
+       };
+
+       qos_gpu_w: qos@ffaa0080 {
+               compatible = "syscon";
+               reg = <0xffaa0080 0x20>;
+       };
+
+       qos_vio1_vop: qos@ffad0000 {
+               compatible = "syscon";
+               reg = <0xffad0000 0x20>;
+       };
+
+       qos_vio1_isp_w0: qos@ffad0100 {
+               compatible = "syscon";
+               reg = <0xffad0100 0x20>;
+       };
+
+       qos_vio1_isp_w1: qos@ffad0180 {
+               compatible = "syscon";
+               reg = <0xffad0180 0x20>;
+       };
+
+       qos_vio0_vop: qos@ffad0400 {
+               compatible = "syscon";
+               reg = <0xffad0400 0x20>;
+       };
+
+       qos_vio0_vip: qos@ffad0480 {
+               compatible = "syscon";
+               reg = <0xffad0480 0x20>;
+       };
+
+       qos_vio0_iep: qos@ffad0500 {
+               compatible = "syscon";
+               reg = <0xffad0500 0x20>;
+       };
+
+       qos_vio2_rga_r: qos@ffad0800 {
+               compatible = "syscon";
+               reg = <0xffad0800 0x20>;
+       };
+
+       qos_vio2_rga_w: qos@ffad0880 {
+               compatible = "syscon";
+               reg = <0xffad0880 0x20>;
+       };
+
+       qos_vio1_isp_r: qos@ffad0900 {
+               compatible = "syscon";
+               reg = <0xffad0900 0x20>;
+       };
+
+       qos_video: qos@ffae0000 {
+               compatible = "syscon";
+               reg = <0xffae0000 0x20>;
+       };
+
+       qos_hevc_r: qos@ffaf0000 {
+               compatible = "syscon";
+               reg = <0xffaf0000 0x20>;
+       };
+
+       qos_hevc_w: qos@ffaf0080 {
+               compatible = "syscon";
+               reg = <0xffaf0080 0x20>;
+       };
+
        pmu: power-management@ff730000 {
                compatible = "rockchip,rk3288-pmu", "syscon", "simple-mfd";
                reg = <0xff730000 0x100>;
                                         <&cru SCLK_ISP_JPE>,
                                         <&cru SCLK_ISP>,
                                         <&cru SCLK_RGA>;
+                               pm_qos = <&qos_vio0_iep>,
+                                        <&qos_vio1_vop>,
+                                        <&qos_vio1_isp_w0>,
+                                        <&qos_vio1_isp_w1>,
+                                        <&qos_vio0_vop>,
+                                        <&qos_vio0_vip>,
+                                        <&qos_vio2_rga_r>,
+                                        <&qos_vio2_rga_w>,
+                                        <&qos_vio1_isp_r>;
                        };
 
                        /*
                                clocks = <&cru ACLK_HEVC>,
                                         <&cru SCLK_HEVC_CABAC>,
                                         <&cru SCLK_HEVC_CORE>;
+                               pm_qos = <&qos_hevc_r>,
+                                        <&qos_hevc_w>;
                        };
 
                        /*
                                reg = <RK3288_PD_VIDEO>;
                                clocks = <&cru ACLK_VCODEC>,
                                         <&cru HCLK_VCODEC>;
+                               pm_qos = <&qos_video>;
                        };
 
                        /*
                        pd_gpu {
                                reg = <RK3288_PD_GPU>;
                                clocks = <&cru ACLK_GPU>;
+                               pm_qos = <&qos_gpu_r>,
+                                        <&qos_gpu_w>;
                        };
                };
+
+               reboot-mode {
+                       compatible = "syscon-reboot-mode";
+                       offset = <0x94>;
+                       mode-normal = <BOOT_NORMAL>;
+                       mode-recovery = <BOOT_RECOVERY>;
+                       mode-bootloader = <BOOT_FASTBOOT>;
+                       mode-loader = <BOOT_LOADER>;
+                       mode-ums = <BOOT_UMS>;
+               };
        };
 
        sgrf: syscon@ff740000 {
                rockchip,grf = <&grf>;
                #clock-cells = <1>;
                #reset-cells = <1>;
-               assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
-                                 <&cru PLL_NPLL>, <&cru ACLK_CPU>,
-                                 <&cru HCLK_CPU>, <&cru PCLK_CPU>,
-                                 <&cru ACLK_PERI>, <&cru HCLK_PERI>,
-                                 <&cru PCLK_PERI>;
-               assigned-clock-rates = <594000000>, <400000000>,
+               assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>,
+                                 <&cru PLL_GPLL>, <&cru PLL_CPLL>,
+                                  <&cru PLL_NPLL>, <&cru ACLK_CPU>,
+                                  <&cru HCLK_CPU>, <&cru PCLK_CPU>,
+                                  <&cru ACLK_PERI>, <&cru HCLK_PERI>,
+                                  <&cru PCLK_PERI>;
+               assigned-clock-rates = <0>, <0>,
+                                      <594000000>, <400000000>,
                                       <500000000>, <300000000>,
                                       <150000000>, <75000000>,
                                       <300000000>, <150000000>,
                                       <75000000>;
+               assigned-clock-parents = <&cru PLL_NPLL>, <&cru PLL_GPLL>;
        };
 
        grf: syscon@ff770000 {
                clocks = <&cru HCLK_SPDIF8CH>, <&cru SCLK_SPDIF8CH>;
                dmas = <&dmac_bus_s 3>;
                dma-names = "tx";
-               interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+               interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&spdif_tx>;
                rockchip,grf = <&grf>;
        i2s: i2s@ff890000 {
                compatible = "rockchip,rk3288-i2s", "rockchip,rk3066-i2s";
                reg = <0xff890000 0x10000>;
-               interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+               interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
                dmas = <&dmac_bus_s 0>, <&dmac_bus_s 1>;
                                reg = <0>;
                                remote-endpoint = <&hdmi_in_vopb>;
                        };
+
+                       vopb_out_edp: endpoint@1 {
+                               reg = <1>;
+                               remote-endpoint = <&edp_in_vopb>;
+                       };
+
                        vopb_out_mipi: endpoint@2 {
                                reg = <2>;
                                remote-endpoint = <&mipi_in_vopb>;
                        };
+
+                       vopb_out_lvds: endpoint@3 {
+                               reg = <3>;
+                               remote-endpoint = <&lvds_in_vopb>;
+                       };
                };
        };
 
                                reg = <0>;
                                remote-endpoint = <&hdmi_in_vopl>;
                        };
+
+                       vopl_out_edp: endpoint@1 {
+                               reg = <1>;
+                               remote-endpoint = <&edp_in_vopl>;
+                       };
+
                        vopl_out_mipi: endpoint@2 {
                                reg = <2>;
                                remote-endpoint = <&mipi_in_vopl>;
                        };
+
+                       vopl_out_lvds: endpoint@3 {
+                               reg = <3>;
+                               remote-endpoint = <&lvds_in_vopl>;
+                       };
+
                };
        };
 
                };
        };
 
+       edp: dp@ff970000 {
+               compatible = "rockchip,rk3288-dp";
+               reg = <0xff970000 0x4000>;
+               interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru SCLK_EDP>, <&cru PCLK_EDP_CTRL>;
+               clock-names = "dp", "pclk";
+               phys = <&edp_phy>;
+               phy-names = "dp";
+               resets = <&cru SRST_EDP>;
+               reset-names = "dp";
+               rockchip,grf = <&grf>;
+               status = "disabled";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       edp_in: port@0 {
+                               reg = <0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               edp_in_vopb: endpoint@0 {
+                                       reg = <0>;
+                                       remote-endpoint = <&vopb_out_edp>;
+                               };
+                               edp_in_vopl: endpoint@1 {
+                                       reg = <1>;
+                                       remote-endpoint = <&vopl_out_edp>;
+                               };
+                       };
+               };
+       };
+
+       lvds: lvds@ff96c000 {
+               compatible = "rockchip,rk3288-lvds";
+               reg = <0xff96c000 0x4000>;
+               clocks = <&cru PCLK_LVDS_PHY>;
+               clock-names = "pclk_lvds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&lcdc0_ctl>;
+               power-domains = <&power RK3288_PD_VIO>;
+               rockchip,grf = <&grf>;
+               status = "disabled";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       lvds_in: port@0 {
+                               reg = <0>;
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               lvds_in_vopb: endpoint@0 {
+                                       reg = <0>;
+                                       remote-endpoint = <&vopb_out_lvds>;
+                               };
+                               lvds_in_vopl: endpoint@1 {
+                                       reg = <1>;
+                                       remote-endpoint = <&vopl_out_lvds>;
+                               };
+                       };
+               };
+       };
+
        hdmi: hdmi@ff980000 {
                compatible = "rockchip,rk3288-dw-hdmi";
                reg = <0xff980000 0x20000>;
                };
        };
 
+       gpu: gpu@ffa30000 {
+               compatible = "arm,malit764",
+                            "arm,malit76x",
+                            "arm,malit7xx",
+                            "arm,mali-midgard";
+               reg = <0xffa30000 0x10000>;
+               interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "JOB", "MMU", "GPU";
+               clocks = <&cru ACLK_GPU>;
+               clock-names = "clk_mali";
+               operating-points = <
+                       /* KHz uV */
+                       600000 1250000
+                       /* 500000 1200000 - See crosbug.com/p/33857 */
+                       400000 1100000
+                       300000 1000000
+                       200000 950000
+                       100000 950000
+               >;
+               #cooling-cells = <2>; /* min followed by max */
+               power-domains = <&power RK3288_PD_GPU>;
+               status = "disabled";
+       };
+
+       vpu: video-codec@ff9a0000 {
+               compatible = "rockchip,rk3288-vpu";
+               reg = <0xff9a0000 0x800>;
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "vepu", "vdpu";
+               clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+               clock-names = "aclk", "hclk";
+               power-domains = <&power RK3288_PD_VIDEO>;
+               iommus = <&vpu_mmu>;
+               assigned-clocks = <&cru ACLK_VCODEC>;
+               assigned-clock-rates = <400000000>;
+               status = "disabled";
+       };
+
+       vpu_service: vpu-service@ff9a0000 {
+               compatible = "rockchip,vpu_service";
+               reg = <0xff9a0000 0x800>;
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "irq_enc", "irq_dec";
+               clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+               clock-names = "aclk_vcodec", "hclk_vcodec";
+               power-domains = <&power RK3288_PD_VIDEO>;
+               rockchip,grf = <&grf>;
+               resets = <&cru SRST_VCODEC_AXI>, <&cru SRST_VCODEC_AHB>;
+               reset-names = "video_a", "video_h";
+               iommus = <&vpu_mmu>;
+               iommu_enabled = <1>;
+               dev_mode = <0>;
+               status = "disabled";
+       };
+
+       vpu_mmu: iommu@ff9a0800 {
+               compatible = "rockchip,iommu";
+               reg = <0xff9a0800 0x100>;
+               interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "vpu_mmu";
+               power-domains = <&power RK3288_PD_VIDEO>;
+               #iommu-cells = <0>;
+       };
+
+       hevc_service: hevc-service@ff9c0000 {
+               compatible = "rockchip,hevc_service";
+               reg = <0xff9c0000 0x400>;
+               interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "irq_dec";
+               clocks = <&cru ACLK_HEVC>, <&cru HCLK_HEVC>,
+                       <&cru SCLK_HEVC_CORE>,
+                       <&cru SCLK_HEVC_CABAC>;
+               clock-names = "aclk_vcodec", "hclk_vcodec", "clk_core",
+                       "clk_cabac";
+               /*
+                * The 4K hevc would also work well with 500/125/300/300,
+                * no more err irq and reset request.
+                */
+               assigned-clocks = <&cru ACLK_HEVC>, <&cru HCLK_HEVC>,
+                                 <&cru SCLK_HEVC_CORE>,
+                                 <&cru SCLK_HEVC_CABAC>;
+               assigned-clock-rates = <400000000>, <100000000>,
+                                      <300000000>, <300000000>;
+
+               resets = <&cru SRST_HEVC>;
+               reset-names = "video";
+               power-domains = <&power RK3288_PD_HEVC>;
+               rockchip,grf = <&grf>;
+               dev_mode = <1>;
+               iommus = <&hevc_mmu>;
+               iommu_enabled = <1>;
+               status = "disabled";
+       };
+
+       hevc_mmu: iommu@ff9c0440 {
+               compatible = "rockchip,iommu";
+               reg = <0xff9c0440 0x40>, <0xff9c0480 0x40>;
+               interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "hevc_mmu";
+               power-domains = <&power RK3288_PD_HEVC>;
+               #iommu-cells = <0>;
+       };
+
        gic: interrupt-controller@ffc01000 {
                compatible = "arm,gic-400";
                interrupt-controller;
                interrupts = <GIC_PPI 9 0xf04>;
        };
 
+       efuse: efuse@ffb40000 {
+               compatible = "rockchip,rockchip-efuse";
+               reg = <0xffb40000 0x20>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               clocks = <&cru PCLK_EFUSE256>;
+               clock-names = "pclk_efuse";
+
+               cpu_leakage: cpu_leakage@17 {
+                       reg = <0x17 0x1>;
+               };
+       };
+
        usbphy: phy {
                compatible = "rockchip,rk3288-usb-phy";
                rockchip,grf = <&grf>;
                        };
                };
 
+               edp {
+                       edp_hpd: edp-hpd {
+                               rockchip,pins = <7 11 RK_FUNC_2 &pcfg_pull_down>;
+                       };
+               };
+
                i2c0 {
                        i2c0_xfer: i2c0-xfer {
                                rockchip,pins = <0 15 RK_FUNC_1 &pcfg_pull_none>,
                        };
                };
 
+               lcdc0 {
+                       lcdc0_ctl: lcdc0-ctl {
+                               rockchip,pins = <1 24 RK_FUNC_1 &pcfg_pull_none>,
+                                               <1 25 RK_FUNC_1 &pcfg_pull_none>,
+                                               <1 26 RK_FUNC_1 &pcfg_pull_none>,
+                                               <1 27 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
+
                sdmmc {
                        sdmmc_clk: sdmmc-clk {
                                rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none>;