From patchwork Mon Dec 21 18:13:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11985109 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 D0EF6C433DB for ; Mon, 21 Dec 2020 18:15:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 93E1D22D08 for ; Mon, 21 Dec 2020 18:15:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93E1D22D08 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=utueZWbI6+3B/90T+Ar5t2eZTpPajMnn1C28iZ8vAUI=; b=02EMQ3Y3VjGpJgq+zxqSN4X0C 7zhhtWdFYAx3K8G3InbFTrEauFlVVUZvI/S7KJ82pR1juTHT3F5cc0SuYx9Gltg2z+TRAkFPLrK4O xKknX0h1gnalu73BiwricbxnywXmPpRtnRm38PYaP5kY0v9CGKj+nua510eMIEdPBBRiSt0pw+4OP mhYfnKose8tCAWXepmJk/4usVfnyq0JHt7kc1DO25KE+QXrLdVlS+5cDBA7a8+0pByNAjUXbSpuba E5b1t//9JyJhEcUdwDOTbHfXHBLi9MYGgCfVHBqCBgFImg7o3KyKjI6vQ+SyJf1/vWKOqKO2gAhf7 +0Fy33SGQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krPhJ-00022U-4j; Mon, 21 Dec 2020 18:14:17 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krPgl-0001sE-4h; Mon, 21 Dec 2020 18:13:44 +0000 Received: by mail-wm1-x336.google.com with SMTP id 3so11822894wmg.4; Mon, 21 Dec 2020 10:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=htWpp3iKagAp/qem+WLHc63LEn5Nif+eGu8hyXoZAoY=; b=MOnQAKHEImD9X64/gcEyDfGlMI84eE0HnR8ZqMOb8Zp39e38nDGCaaj32uQumTrqjX iuMJSVwSHRPDweKbfjcmnwAcVdYxY9q4seeWG5F/91coHSMpXGN7c/CTNAoLe2ZYjR03 Pi8BPVqqqtHRsI2p2KeEjyFoY7SXOWMrINXyoZq/djUxtjBalzh8lMVhs/5V4zf7FPxB jsZbUtG3WVrAPGJ828je10I4L74XOuvB64tmffslqgNxiF2SR+jKXr/p9RsuMwbefB9q i1LuX3/49qv0M5SPNItpIVnOoAjhH+93RpUklJggFhCIep0BuHJYsitFUSldmkgOgl4H 6pCg== 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=htWpp3iKagAp/qem+WLHc63LEn5Nif+eGu8hyXoZAoY=; b=GbtnHQpub/tinssGDCMruVJDtBonvk5VjJu3YVll6NB+eJ8BUMIZwERMgIXOhwjS3Q tGvtJDvfa92Htu2biSs450tC564AcQD7yKWzf8i22BZDkYOF+CrdBbtbqAOxN8/AxnED Vra7GmRzqDWp2F9G0XvP0oCAoa8fKM8Eqp+oi/YkuSk3sBfyarworPa5eno82pquexy4 oHYbdAku3xZuwnQCsREVeRTRVJwQw/6Mdw3sZJDRphZ/v81YeposI9TbqZMyEMWKYEXW SSBouQJFtYrvDZJX/TQZg2Vdzom6hExrTJ09TKZ0lAwxCNn/auuGzzrVD3UnXlR/qddb CHxw== X-Gm-Message-State: AOAM532sKCKioTF5sHTKVl5Sme52flKiijxvEweuNfdO4HBUH+OPxB+t 3EnNW8cZSf5rKTYxpv7STGRQo22fFi4= X-Google-Smtp-Source: ABdhPJwPVeC/S2fOq4AHcgYMmdO6siU97r4ZLGePCER4Vy3o/0t1Sshm+A23OGyh+e1krTVohsuGLA== X-Received: by 2002:a1c:8085:: with SMTP id b127mr17547256wmd.16.1608574421478; Mon, 21 Dec 2020 10:13:41 -0800 (PST) Received: from localhost.localdomain (p200300f137019000428d5cfffeb99db8.dip0.t-ipconnect.de. [2003:f1:3701:9000:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id m11sm23434936wmi.16.2020.12.21.10.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 10:13:40 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com Subject: [PATCH 4/5] ARM: dts: meson8b: add the thermal-zones with cooling configuration Date: Mon, 21 Dec 2020 19:13:05 +0100 Message-Id: <20201221181306.904272-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201221181306.904272-1-martin.blumenstingl@googlemail.com> References: <20201221181306.904272-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_131343_268515_CF1B4F37 X-CRM114-Status: GOOD ( 16.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, narmstrong@baylibre.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The vendor kernel uses the following thermal-zone settings: <= 70°C: - CPU frequency limited to 1.488GHz - GPU limited to 511MHz and 2 cores (pixel processors) <= 80°C: - CPU frequency limited to 1.2GHz - GPU limited to 435MHz and 2 cores (pixel processors) <= 90°C: - CPU frequency limited to 0.804GHz - GPU limited to 328MHz and 1 core (pixel processor) Add simplified thermal configuration which is taken from the GXBB/GXL/GXM SoC family (which uses the same manufacturing process and has the same maximum junction temperature of 125°C). With this the thermal framework will try to keep the SoC temperature at or below 80°C which is identical to the vendor kernel (with the exception of one CPU frequency step from 1.488GHz to 1.536GHz). The number of GPU cores are not taken into account as this is not supported. Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong --- arch/arm/boot/dts/meson8b.dtsi | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi index 2401cdf5f751..dbf7963b6c87 100644 --- a/arch/arm/boot/dts/meson8b.dtsi +++ b/arch/arm/boot/dts/meson8b.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include #include "meson.dtsi" / { @@ -26,6 +27,7 @@ cpu0: cpu@200 { resets = <&clkc CLKC_RESET_CPU0_SOFT_RESET>; operating-points-v2 = <&cpu_opp_table>; clocks = <&clkc CLKID_CPUCLK>; + #cooling-cells = <2>; /* min followed by max */ }; cpu1: cpu@201 { @@ -37,6 +39,7 @@ cpu1: cpu@201 { resets = <&clkc CLKC_RESET_CPU1_SOFT_RESET>; operating-points-v2 = <&cpu_opp_table>; clocks = <&clkc CLKID_CPUCLK>; + #cooling-cells = <2>; /* min followed by max */ }; cpu2: cpu@202 { @@ -48,6 +51,7 @@ cpu2: cpu@202 { resets = <&clkc CLKC_RESET_CPU2_SOFT_RESET>; operating-points-v2 = <&cpu_opp_table>; clocks = <&clkc CLKID_CPUCLK>; + #cooling-cells = <2>; /* min followed by max */ }; cpu3: cpu@203 { @@ -59,6 +63,7 @@ cpu3: cpu@203 { resets = <&clkc CLKC_RESET_CPU3_SOFT_RESET>; operating-points-v2 = <&cpu_opp_table>; clocks = <&clkc CLKID_CPUCLK>; + #cooling-cells = <2>; /* min followed by max */ }; }; @@ -167,6 +172,54 @@ hwrom@0 { }; }; + thermal-zones { + soc { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&thermal_sensor>; + + cooling-maps { + map0 { + trip = <&soc_passive>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map1 { + trip = <&soc_hot>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + + trips { + soc_passive: soc-passive { + temperature = <80000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + + soc_hot: soc-hot { + temperature = <90000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "hot"; + }; + + soc_critical: soc-critical { + temperature = <110000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "critical"; + }; + }; + }; + }; + mmcbus: bus@c8000000 { compatible = "simple-bus"; reg = <0xc8000000 0x8000>; @@ -221,6 +274,7 @@ mali: gpu@c0000 { clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_MALI>; clock-names = "bus", "core"; operating-points-v2 = <&gpu_opp_table>; + #cooling-cells = <2>; /* min followed by max */ }; }; }; /* end of / */