From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2504BC2BB48 for ; Thu, 17 Dec 2020 18:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6034238E8 for ; Thu, 17 Dec 2020 18:29:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730323AbgLQS3I (ORCPT ); Thu, 17 Dec 2020 13:29:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729613AbgLQS3I (ORCPT ); Thu, 17 Dec 2020 13:29:08 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B35BCC0617B0 for ; Thu, 17 Dec 2020 10:28:27 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id r7so27582255wrc.5 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=Ss8pd10RT3EM7UzYe4aoA8m7qu5/v73RzLsY+Eq8qAHX5GGMOKfW5V+tlczYlnwznk /8X3z8PREM6RFZ6qcWwRuvescC+KJi4dzcKRpxDjjeLH81vcSv0GVlfZ9co8eqUiupDd 1Q2dIYje+hjyXyN6P9Wh5CelJ7nqtUaFl9UAMDXOl9QDQU4zHtybnnPLuho6h9GkNt1W Qx8y+vVQxm/GkdxxxIP9OVTeHAIzIBgtL6DNcpMgFwVTgLy95xZE2tg0qG3e0j0IoYYs h/Is/kd9cgTfzdPljm7Bf/PuXsvDomyqfvVlVbnI7eYNtfylWkyGuGz1yQWAjpXmIsrG zYww== X-Gm-Message-State: AOAM5330mJ58eesioEi0Ow111q6ceoD2Lj8S+RDhR50XiHcrWL5IlKE3 lr8BnfamvGXbuwizLy07gdTLSw== X-Google-Smtp-Source: ABdhPJzKbCCGpt8ELmmFbxdiuj0VOZ+HkKMKFTm6vWFFlnL6Ebt+3D8mHpr+ALmo4+wr+vg26zHlzQ== 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: devicetree@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