From patchwork Thu May 28 19:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Miller X-Patchwork-Id: 246783 List-Id: U-Boot discussion From: kurt at intricatesoftware.com (Kurt Miller) Date: Thu, 28 May 2020 15:32:02 -0400 Subject: [PATCH] rockchip: rockpro64: Set cooling levels for pwm-fan Message-ID: <20200528193202.41505-1-kurt@intricatesoftware.com> The cooling levels are tuned to the fan that comes with the rockpro64 NAS case. A gpu_thermal zone was not added because having two active cooling maps control one physical fan causes them to compete for the fan speed which results in erratic fan behavior. Signed-off-by: Kurt Miller --- arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi index deaa3efd39..c0e0396758 100644 --- a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi +++ b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi @@ -13,6 +13,49 @@ chosen { u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci; }; + + fan: pwm-fan { + cooling-levels = <0 40 80 255>; + }; +}; + +&cpu_thermal { + trips { + cpu_warm: cpu_warm { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_med: cpu_med { + temperature = <60000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_hot: cpu_hot { + temperature = <65000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map2 { + trip = <&cpu_warm>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + map3 { + trip = <&cpu_med>; + cooling-device = <&fan THERMAL_NO_LIMIT 2>; + }; + + map4 { + trip = <&cpu_hot>; + cooling-device = <&fan 2 THERMAL_NO_LIMIT>; + }; + }; }; &vdd_center {