Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1463812pxu; Thu, 17 Dec 2020 10:30:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOD9+OpSgyhCiXKfCqnv3YBS01KgbHl5f5EOd7Ri0TaiIwPSUpNN1lfXBa2tIMdvh/xwfk X-Received: by 2002:a05:6402:229b:: with SMTP id cw27mr670727edb.23.1608229828629; Thu, 17 Dec 2020 10:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608229828; cv=none; d=google.com; s=arc-20160816; b=DJY7mNfeUE0khYzq8ScnSMLc7BNlmLlCOvRwLen40rGpi4LzUdp6s8PPEldYAzdrdr PCvF0jYfqMtUgVb7NI9SgyEaLNwKjr++4Eba/iFO1gbFZsOLnt0Nnra4ujDUFDINuTBZ Ynp5IlbLgxaUF89bQZI2uOz2w6eZMPxk5CbmDnon8R4owpJRit3AbzqKW6Zz7eEjJwP9 521D9ovvJ4rkFy7OHhgxcHDv7QWDlRUum7tq2dwefm7Co6cuA8OnlX87RDB036hPhOZA NQkhV84cVpvReZ86nu97JuVo5+v6K3q5iyyUfO0OA618AJvoXZ/yTudY9JfMf8TrxKM/ /HpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=3Eimbv4irvb06uulzwdmbgzbH0hXJUaf7zvbDZ2yAOw=; b=DOYeRVH6uu626aGRaGE9dgD7RmvZ8EsD1AxQ+xArriIsLZsKN19uD1EEMsv7U3nA9Q yw8fdubYyrOMtwSrPGM+l7+SufHHu+cDnaKrlY/IcZL31ofPPCYmDk1WV6Yk3+ENjVcs 1gqll+5Y9h0KWeh1Fk47iTzvVR9vBLvOBIdPkvMbMKSdduTDGiPpgvT8kHmD2MiEWhcB RjqQHkr1s55su7Qd6LG9/h7DPWtHVKxLO1RE+fmbjvkXmnwNMR5u73OEvZByGnGL78qv ayOrVPqVaQL2R7ZCC35CwuIs05FgEKBnq/u+5xk4vpf040upw7/aOPLKl1PYeMbQvABH CTfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MBoNO+Hz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id el22si3256635ejc.362.2020.12.17.10.30.05; Thu, 17 Dec 2020 10:30:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MBoNO+Hz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729613AbgLQS3I (ORCPT + 99 others); Thu, 17 Dec 2020 13:29:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729069AbgLQS3I (ORCPT ); Thu, 17 Dec 2020 13:29:08 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99745C0617A7 for ; Thu, 17 Dec 2020 10:28:27 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id c5so23911682wrp.6 for ; Thu, 17 Dec 2020 10:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3Eimbv4irvb06uulzwdmbgzbH0hXJUaf7zvbDZ2yAOw=; b=MBoNO+HzZQn1d2jk1/V+kBAn+RuX+Bgjf4yAuTECCPwo9pr5m6PA59e8a2suZD2rZj WQK6VoGzqsqLLXsUPVSeZCJtfpqNYYeWHwu0WtzcCHrnA0iTZqPKBNzusky0oGwcuPWI vxgZfG5PORMcS69Xl3gppSuianH953hu/LhmBsqsDfxzq0DrtWc4KMCBFbV4Zl+Tdl+j XQwoV7n4jnAiYy/9txHOHHP967uVhDMXq6PpvemH0tcgRkKhqHfeQLEuECTmp6B3Jlgd 6Fh5JlgWumnZnWlQKc+PhZd7mWDSwAf3QNa4hWd6frVbAITao8rEW0tIt4LVEW+PWtB+ D1YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3Eimbv4irvb06uulzwdmbgzbH0hXJUaf7zvbDZ2yAOw=; b=qvbV9IksPiA43xyIQMdlYhZiTu3uHNwYr1n1JBF0zHMuOpSC8H4BeY1dsjdTU1br1p BCupwJe+0JtEfWxGHfM6Dyd2ArU2xO+z0em254TvgVXbjpA7RZdBXJEvymYYTiK9zugQ aKNdyBV37piebUSIMoRE2DA+ZPXrNQugIgDm0Szl5OS7tUjbsnVTQKlGs5c4NDJAbV77 3JmBzuVAslwiLzaDmobWpdAcIsWO67nniHHN9sby+3P3d14fgzY8qsDd6fwtpbvwfSMP zkVntAAleuWfz66OqdmuYyn4fBr77JfqK5QW5kUq+BCozSYjdVGiEvzaBO2HQsHEByo9 j5Tw== X-Gm-Message-State: AOAM530PaSkyPZVnGRAYnhQOVTKCqBwZ50635XOVPjf+sGfiojR90nyg /9pOQieqZk2QOzMLPusZLUAA7Q== X-Received: by 2002:adf:ebd2:: with SMTP id v18mr115947wrn.322.1608229706152; Thu, 17 Dec 2020 10:28:26 -0800 (PST) Received: from ?IPv6:2a01:e34:ed2f:f020:ccb6:ce78:2bcd:4ead? ([2a01:e34:ed2f:f020:ccb6:ce78:2bcd:4ead]) by smtp.googlemail.com with ESMTPSA id q1sm9831416wrj.8.2020.12.17.10.28.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Dec 2020 10:28:25 -0800 (PST) Subject: Re: [PATCH v2 47/48] ARM: tegra: ventana: Support CPU voltage scaling and thermal throttling To: Dmitry Osipenko , Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-48-digetx@gmail.com> From: Daniel Lezcano Message-ID: <91139f8b-0b83-dd8a-ba53-8e7a499e6344@linaro.org> Date: Thu, 17 Dec 2020 19:28:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201217180638.22748-48-digetx@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/12/2020 19:06, Dmitry Osipenko wrote: > Enable CPU voltage scaling and thermal throttling on Tegra20 Ventana board. > > Signed-off-by: Dmitry Osipenko > --- > arch/arm/boot/dts/tegra20-ventana.dts | 40 ++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts > index 14ace2ef749c..c2d9f38960bc 100644 > --- a/arch/arm/boot/dts/tegra20-ventana.dts > +++ b/arch/arm/boot/dts/tegra20-ventana.dts > @@ -2,8 +2,10 @@ > /dts-v1/; > > #include > +#include > #include "tegra20.dtsi" > #include "tegra20-cpu-opp.dtsi" > +#include "tegra20-cpu-opp-microvolt.dtsi" > > / { > model = "NVIDIA Tegra20 Ventana evaluation board"; > @@ -527,9 +529,10 @@ ldo_rtc { > }; > }; > > - temperature-sensor@4c { > + nct1008: temperature-sensor@4c { > compatible = "onnn,nct1008"; > reg = <0x4c>; > + #thermal-sensor-cells = <1>; > }; > }; > > @@ -615,10 +618,13 @@ clk32k_in: clock@0 { > > cpus { > cpu0: cpu@0 { > + cpu-supply = <&vdd_cpu>; > operating-points-v2 = <&cpu0_opp_table>; > + #cooling-cells = <2>; > }; > > cpu@1 { > + cpu-supply = <&vdd_cpu>; > operating-points-v2 = <&cpu0_opp_table>; > }; > }; > @@ -717,4 +723,36 @@ sound { > <&tegra_car TEGRA20_CLK_CDEV1>; > clock-names = "pll_a", "pll_a_out0", "mclk"; > }; > + > + thermal-zones { > + cpu-thermal { > + polling-delay-passive = <1000>; /* milliseconds */ > + polling-delay = <5000>; /* milliseconds */ > + > + thermal-sensors = <&nct1008 1>; > + > + trips { > + trip0: cpu-alert0 { > + /* start throttling at 50C */ > + temperature = <50000>; > + hysteresis = <200>; Did you mean <2000> ? > + type = "passive"; > + }; > + > + trip1: cpu-crit { > + /* shut down at 60C */ > + temperature = <60000>; > + hysteresis = <2000>; I think you can drop the hysteresis here, when the critical temperature is reached, there is an emergency shutdown. 50°C and 60°C sound very low values, no ? > + type = "critical"; > + }; > + }; > + > + cooling-maps { > + map0 { > + trip = <&trip0>; > + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; You should add all CPUs here. > + }; > + }; > + }; > + }; > }; > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog