Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1451230pxu; Thu, 17 Dec 2020 10:12:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJznbmQDJlPUSk1t4Ez9myUBi0TKSkhB4pc6Cm5rzjJOn8Qafch5b3/HG7jQznzfVAtbm7tz X-Received: by 2002:a17:906:fb0e:: with SMTP id lz14mr260964ejb.232.1608228745590; Thu, 17 Dec 2020 10:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608228745; cv=none; d=google.com; s=arc-20160816; b=Vrs5sdTEae4lFOfQW7+NldN2t2d22oXS5CH3HCchTQXHT18xx3PKQxGKOJQm7etnDW g9jMH973SnfA19ColUwtFhzXnr4577ylB2D4xnZg8v4oA06c7P5xAZVLBAgBb9/7IaAD oF0Taa4Vymeon95QCTSGcXUTq/sJbu2jNL/Y2LFbkMrPtZjsLxPb62Unrrpa7YadvtKv bph8LNLpBoAnxgT4a6SItKWjawdDfIV3RP0TXwpwVFVU5vWHqh9smzfDPI/yYR1CWAPG sLcHTnJpPmyl3riXTIiJvsbFkmQX1SskmSynyGmXkT5uoGER0QR7ldpcTa09hd6SOvyf c+2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4BCi2FA9cuc84aB3j2Dtgj2hYIKTYzldBGMNPDQ+ziE=; b=WDSm1W69eA+iAezCFO26r0o70AdORIZD/cDPDbqtItd1QS0jUagPcQxqdBQJcL5EGN XY5NDOLrnePAxhFfsLTCUhfLY1d0U2V+2ZipmkLdXG1/H3cdMs7axZSGxfPkGJvbebzQ lyR0JIlvssKOD+ta0Tbfm2f3Vo6nydnzV5fhqxRhofstjHQn50ykrMu+7UrWcW1DTx0v baIctr1Mnj5Es5Nfc56MqAQEouaSuQEJFd0PRZAhM0mCBNt8iIF+QWlTKMFruuY0+8fc cZhypqWvz2afy2IOTXWdCdjeMgjOizUrHQOSyEwG3vEHMucwNS7T00P8ik62silNp1+8 1dUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r2zTV0Lh; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si3006537ejc.540.2020.12.17.10.12.02; Thu, 17 Dec 2020 10:12:25 -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=@gmail.com header.s=20161025 header.b=r2zTV0Lh; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731429AbgLQSJ5 (ORCPT + 99 others); Thu, 17 Dec 2020 13:09:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731143AbgLQSJ0 (ORCPT ); Thu, 17 Dec 2020 13:09:26 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A791C061A4C; Thu, 17 Dec 2020 10:08:16 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id a12so59841861lfl.6; Thu, 17 Dec 2020 10:08:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4BCi2FA9cuc84aB3j2Dtgj2hYIKTYzldBGMNPDQ+ziE=; b=r2zTV0LhxvbLLcRE/Q6upA3jHFFoIHhmeTHZH8k7Nfo6TEPtghv24CkOqquv0+y9xP 6+FZ+MXgdTx2ytHtR7Sk7W1UA2CPz43wyzcL6eN3hopQk/E3YteFKOLhzUro4h8CbQNU +fgzGRIhTqgs+WbaL3TqMhWkuNzse6BJ4C/8X7Ixe3FMp1bc0jGwx6igCKOSE5vPOnJl gKxDySx0IGEHosYP6Q0PXPEXhoddkGXNRY8r2Ow5AL11IX4RdEBmmxMv3sTV6ncFWhYG PEoo8YrrVqcuWZEFkH1nd5jPACS2AUeM4P0FHx1ROikt0gKyKm/OLrSZrtjiGzDY2xKO o/CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4BCi2FA9cuc84aB3j2Dtgj2hYIKTYzldBGMNPDQ+ziE=; b=Q0L24Z/kgQyW0HIBSOJ3RS4hnctEy1pP8flBXnbUxbQ9PpymV6os6iIcyHCW6JSrv2 T7K6QfmAZywPmu+siJ/GzZYXn0I2jgFRs8SaQ2p5j1MktqmfaPn3fSsYVTWjblNd/HaB CS9woxMK71Ehnha/Um1q4osa51tLjNwC5WAL71MiKr+yWga3j6eznrXa0JEyS+VUgXfT Aoarp3oE2uQn/TUbQRRC6rECWvlj0HW6NB9bQ1bxTURCLnZboq+0978SAnNB8Y0g5pkG 1y8Ag4v62dgvB6Kf2qQdIPJ52kDMvgTxNEd8RIytL+hOyD3bQ58QXbmud/MncuFgtYmp asIQ== X-Gm-Message-State: AOAM532hHzUozQ+LpY3gmMhfYvWbVVHmd4ricAGSvKhQ35Vg41D6jXCo jK0Rs2Wjgx8suyUK5dEaum4= X-Received: by 2002:a05:651c:2dc:: with SMTP id f28mr208929ljo.13.1608228494555; Thu, 17 Dec 2020 10:08:14 -0800 (PST) Received: from localhost.localdomain (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.gmail.com with ESMTPSA id u5sm655596lff.78.2020.12.17.10.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 10:08:14 -0800 (PST) From: Dmitry Osipenko To: 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 Subject: [PATCH v2 47/48] ARM: tegra: ventana: Support CPU voltage scaling and thermal throttling Date: Thu, 17 Dec 2020 21:06:37 +0300 Message-Id: <20201217180638.22748-48-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217180638.22748-1-digetx@gmail.com> References: <20201217180638.22748-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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>; + type = "passive"; + }; + + trip1: cpu-crit { + /* shut down at 60C */ + temperature = <60000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&trip0>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; }; -- 2.29.2