From c581befe925c2370c3acacbdb43f94e0dcd17d54 Mon Sep 17 00:00:00 2001 From: Rocky Hao Date: Wed, 6 Dec 2017 14:50:34 +0800 Subject: [PATCH] ARM: dts: rockchip: add tsadc node and thermal config for rk312x Change-Id: I5d3c5c77ec8e14b26ee7ef02cf4aec4729558d02 Signed-off-by: Rocky Hao --- arch/arm/boot/dts/rk312x.dtsi | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/arch/arm/boot/dts/rk312x.dtsi b/arch/arm/boot/dts/rk312x.dtsi index 2e927d66f91b..6d73ca6a4f80 100644 --- a/arch/arm/boot/dts/rk312x.dtsi +++ b/arch/arm/boot/dts/rk312x.dtsi @@ -46,6 +46,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; @@ -72,6 +73,8 @@ reg = <0xf00>; operating-points-v2 = <&cpu0_opp_table>; clocks = <&cru ARMCLK>; + #cooling-cells = <2>; /* min followed by max */ + dynamic-power-coefficient = <120>; }; cpu1: cpu@f01 { device_type = "cpu"; @@ -215,6 +218,56 @@ clock-frequency = <24000000>; }; + thermal-zones { + soc_thermal: soc-thermal { + polling-delay-passive = <1000>; + polling-delay = <2000>; + sustainable-power = <200>; + + thermal-sensors = <&tsadc 0>; + + trips { + threshold: trip-point0 { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + target: trip-point1 { + temperature = <90000>; + hysteresis = <2000>; + type = "passive"; + }; + soc_crit: soc-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&target>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + map1 { + trip = <&target>; + cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + }; + }; + + }; + + tsadc: tsadc { + compatible = "rockchip,rk3126-tsadc-virtual"; + nvmem-cells = <&cpu_leakage>; + nvmem-cell-names = "cpu_leakage"; + #thermal-sensor-cells = <1>; + status = "disabled"; + }; + xin24m: oscillator { compatible = "fixed-clock"; clock-frequency = <24000000>;