From fe16f4b53f5a0ce564299f402079ab73c9cb8697 Mon Sep 17 00:00:00 2001 From: Rocky Hao Date: Thu, 10 Mar 2016 18:51:27 +0800 Subject: [PATCH] arm64: dts: rockchip: add tsadc node and the IPA parameters for rk3366 thermal 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 --- arch/arm64/boot/dts/rockchip/rk3366.dtsi | 89 ++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3366.dtsi b/arch/arm64/boot/dts/rockchip/rk3366.dtsi index 75784150d756..8b54201b52a0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3366.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3366.dtsi @@ -49,6 +49,7 @@ #include #include #include +#include / { 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 { @@ -261,6 +264,69 @@ 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 = ; + 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>; @@ -1544,6 +1610,18 @@ <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 { @@ -1561,8 +1639,19 @@ 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 { -- 2.34.1