arm64: dts: rockchip: add tsadc node and the IPA parameters for rk3366 thermal
authorRocky Hao <rocky.hao@rock-chips.com>
Thu, 10 Mar 2016 10:51:27 +0000 (18:51 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Mon, 30 May 2016 03:01:10 +0000 (11:01 +0800)
according to our testing results, added the ipa parameters for both cpu
and gpu.

for now,the gpu thermal zone is used only to get the gpu's temperature.

Change-Id: I14274c0b2d7645d08f37d918ddb415ac49ed0d9e
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
arch/arm64/boot/dts/rockchip/rk3366.dtsi

index 75784150d756140cf5d005cca90460fa61395019..8b54201b52a022d21ae7f3cb4df080d4ad422482 100644 (file)
@@ -49,6 +49,7 @@
 #include <dt-bindings/display/mipi_dsi.h>
 #include <dt-bindings/power/rk3366-power.h>
 #include <dt-bindings/soc/rockchip_boot-mode.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        compatible = "rockchip,rk3366";
@@ -82,6 +83,8 @@
                        clocks = <&cru ARMCLK>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        cpu-idle-states = <&cpu_sleep>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <166>;
                };
 
                cpu1: cpu@1 {
                status = "disabled";
        };
 
+       thermal-zones {
+               soc_thermal: soc-thermal {
+                       polling-delay-passive = <100>; /* milliseconds */
+                       polling-delay = <1000>; /* milliseconds */
+                       sustainable-power = <1600>; /* milliwatts */
+
+                       thermal-sensors = <&tsadc 0>;
+
+                       trips {
+                               threshold: trip-point@0 {
+                                       temperature = <70000>; /* millicelsius */
+                                       hysteresis = <2000>; /* millicelsius */
+                                       type = "passive";
+                               };
+                               target: trip-point@1 {
+                                       temperature = <85000>; /* millicelsius */
+                                       hysteresis = <2000>; /* millicelsius */
+                                       type = "passive";
+                               };
+                               soc_crit: soc-crit {
+                                       temperature = <95000>; /* millicelsius */
+                                       hysteresis = <2000>; /* millicelsius */
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&target>;
+                                       cooling-device =
+                                               <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                               map1 {
+                                       trip = <&target>;
+                                       cooling-device =
+                                               <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+
+               gpu_thermal: gpu-thermal {
+                       polling-delay-passive = <100>; /* milliseconds */
+                       polling-delay = <1000>; /* milliseconds */
+
+                       thermal-sensors = <&tsadc 1>;
+               };
+       };
+
+       tsadc: tsadc@ff260000 {
+               compatible = "rockchip,rk3366-tsadc";
+               reg = <0x0 0xff260000 0x0 0x100>;
+               interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+               clock-names = "tsadc", "apb_pclk";
+               resets = <&cru SRST_TSADC>;
+               reset-names = "tsadc-apb";
+               pinctrl-names = "default";
+               pinctrl-0 = <&tsadc_gpio>;
+               #thermal-sensor-cells = <1>;
+               rockchip,hw-tshut-temp = <95000>;
+               status = "disabled";
+       };
+
        sdmmc: rksdmmc@ff400000 {
                compatible = "rockchip,rk3366-dw-mshc","rockchip,rk3288-dw-mshc";
                clock-freq-min-max = <400000 150000000>;
                                        <0 25 RK_FUNC_GPIO &pcfg_pull_none>;
                        };
                };
+
+               tsadc_pin {
+                       tsadc_gpio: tsadc-gpio {
+                               rockchip,pins =
+                                       <0 22 RK_FUNC_GPIO &pcfg_pull_none>;
+                       };
+
+                       tsadc_int: tsadc-int {
+                               rockchip,pins =
+                                       <0 22 RK_FUNC_2 &pcfg_pull_none>;
+                       };
+               };
        };
 
        gpu: gpu@ffa30000 {
 
                clocks = <&cru ACLK_GPU>;
                clock-names = "clk_mali";
+               #cooling-cells = <2>; /* min followed by max */
                operating-points-v2 = <&gpu_opp_table>;
                status = "disabled";
+
+               power_model {
+                       compatible = "arm,mali-simple-power-model";
+                       voltage = <900>;
+                       frequency = <500>;
+                       static-power = <300>;
+                       dynamic-power = <1780>;
+                       ts = <32000 4700 (-80) 2>;
+                       thermal-zone = "gpu-thermal";
+               };
        };
 
        gpu_opp_table: gpu_opp_table {