Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp479822pxb; Mon, 16 Aug 2021 09:43:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRxP60QYGkIE0S/6nvHVeE4eI0LBJVp4LCfpaZt1XOyb7YIYJlhQT+fKLio3SMOH4KzkAI X-Received: by 2002:a92:c212:: with SMTP id j18mr11960274ilo.77.1629132197106; Mon, 16 Aug 2021 09:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629132197; cv=none; d=google.com; s=arc-20160816; b=c1zYeXBcJDiNfJGF6Rv0qosDIfyeiZwh5IF4JCq6dEHidoBWsmmIayF1SLxy37hFTS rZ7hzvR6PDv73cVhWSC/gtdKNGhrkWX9ahuMgAUQSX7EW4RaafG/+TmmxCctPEc+i58B EvXkQE3qF/EdfXCIAjQWb1ST11Ag9PZe1TfSFzDz5x2C0vDehh9aj6MSRNdIzQ2k7I7t M1z9GdVL8RATfDeripg29CEErdKGAF/v3qH48fxIzZ9reMqxlVQbj6X18UO3KayYVhAo SaM8v5yxK0ievLT91ZslxATTtb4Oj/nYH/JAc+1DJwlbcECts61hAteYOelX9Wr0K91b tAkg== 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=ri5K1Xpjc4a4zjNHt8k/tccc7l+lexuuCDCYomtiW64=; b=0VQUThU+RZGsPtq7kE0dghQzgAZJj48hOaObjuRdiWINJDsf74Zm4QDm4LWZK3lksm 6uTi8Oj/EZ/hy5F2GtzY0O6tT2BPgiU4ODIFqW25Bx42ExjIFpupOSrQRYlfAdonLGpm 3qMep3vhLDtSt3xQ7rBRj/dScD3zBYGRWt59UMGoyB3PlprrZNyl12/CoIfcfxWKc3OP d9WT8bwFlxbZdb/SSAY9newOW/PMXz01EwFaHuB/BJjwxo7vkf8HXRf8V/lQrNjVcu1N xISt1oijz8J4Tdav3R5eC0pGwCh4rKrL0lnlH/lNsdwP9BRcaVBzGUeN3J7AFU6OJnfm 4eMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fsWJKH+0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si7098625ioz.23.2021.08.16.09.43.05; Mon, 16 Aug 2021 09:43:17 -0700 (PDT) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fsWJKH+0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbhHPQm2 (ORCPT + 99 others); Mon, 16 Aug 2021 12:42:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbhHPQmY (ORCPT ); Mon, 16 Aug 2021 12:42:24 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10545C0617AE for ; Mon, 16 Aug 2021 09:41:52 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id k8so5576229wrn.3 for ; Mon, 16 Aug 2021 09:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ri5K1Xpjc4a4zjNHt8k/tccc7l+lexuuCDCYomtiW64=; b=fsWJKH+0VfSp4+mk99VbiWU+aOxWRQF1uKnQBKOdUacrT9mpUf8NrFQ0ZSeFt0hb0M SEp6y8StXl7ZDdCbR75BdMp2ImU551lmP/MO6LTRG2YMHS0M4DeyzRZOGUUnWR4fVBlR urHnvSMVl5eDS8YiEEEkmRjO7mqbBQ+nd5/RAvsA44nMq2Qv54BjmIO3Z+nhk4T3Zehv N6umhJlCVWeZY/qeXAhrhBLeoub3qUYFVkK9uVtIOawpC0MglXH0XASyiBs+l8NLlD59 me6UqnfXCliq/Y1U4jXpoV/+PxYDk0jx2le0q9h9XREHdPFf3bKI4iYoZV3+BHYkRuyb 6mlg== 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=ri5K1Xpjc4a4zjNHt8k/tccc7l+lexuuCDCYomtiW64=; b=G9HSa8PyJvt8W2LL9lG5N6tMvVmzItj6HrruTDd+OkEIeW2sFEdsU0VlACWuQqpMP3 FHPO2JcDIBFJwd7K+u/VFJmsyIhqLjGKuGfgsTO/VV5bDv35qvXZWlfBu68wqxCPuYvp 2lhhsmun2QAd/DeLHk7nnH2oMOX+oidQ4CzqolcbBWhE58F+Uuk6D1zSob7iDTuDEGAX w4VlB+Io5XNzdWTl1dDf043EMuvzFhYiP6kF6OwaeX60GOI7WRmjEe2kXgy+YX58StpN TmLhrlvaW/odoGqjlFauQ8E3diTjZeHkX6z9ADto4k9J1iWZScqnq9ruk87ETxXQglP8 cLLw== X-Gm-Message-State: AOAM531tx6g+dL9yIuQTp4TkoiHSMaJ5/60Mq/L6OmVYiHKY/vbozzI5 NE9ei1ysKR8jnCGxaYpiTtGGbA== X-Received: by 2002:adf:c044:: with SMTP id c4mr4686867wrf.275.1629132110579; Mon, 16 Aug 2021 09:41:50 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3a81:3690:b885:8dcf:f8c6:7841]) by smtp.gmail.com with ESMTPSA id m10sm15211730wro.63.2021.08.16.09.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 09:41:49 -0700 (PDT) From: Alexandre Bailon To: rui.zhang@intel.com, daniel.lezcano@linaro.org, robh+dt@kernel.org, matthias.bgg@gmail.com Cc: ben.tseng@mediatek.com, michael.kao@mediatek.com, ethan.chang@mediatek.com, fparent@baylibre.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Tinghan Shen , Alexandre Bailon Subject: [PATCH 3/3] arm64: dts: mt8195: Add thermal zone and thermal policy Date: Mon, 16 Aug 2021 18:43:07 +0200 Message-Id: <20210816164307.557315-4-abailon@baylibre.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210816164307.557315-1-abailon@baylibre.com> References: <20210816164307.557315-1-abailon@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tinghan Shen 1. Add SoC and board thermal zones. 2. Add thermal throttle policy Signed-off-by: Tinghan Shen Signed-off-by: Ben Tseng Signed-off-by: Alexandre Bailon --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 164 +++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index d05492ff8f190..62d0944dea4db 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -11,6 +11,7 @@ #include #include #include +#include / { compatible = "mediatek,mt8195"; @@ -475,6 +476,21 @@ spi0: spi@1100a000 { status = "disabled"; }; + lvts: lvts@1100b000 { + compatible = "mediatek,mt8195-lvts"; + #thermal-sensor-cells = <1>; + reg = <0 0x1100b000 0 0x1000>, + <0 0x11278000 0 0x1000>; + interrupts = , + ; + clocks = <&infracfg_ao CLK_INFRA_AO_THERM>; + clock-names = "lvts_clk"; + resets = <&infracfg_rst 1>, + <&infracfg_rst 2>; + nvmem-cells = <&lvts_e_data1 &lvts_e_data2>; + nvmem-cell-names = "e_data1","e_data2"; + }; + spi1: spi@11010000 { compatible = "mediatek,mt8195-spi", "mediatek,mt6765-spi"; reg = <0 0x11010000 0 0x100>; @@ -830,4 +846,152 @@ vdosys1: syscon@1c100000 { #clock-cells = <1>; }; }; + + thermal_zones: thermal-zones { + soc_max { + polling-delay = <1000>; /* milliseconds */ + polling-delay-passive = <1000>; /* milliseconds */ + thermal-sensors = <&lvts 0>; + sustainable-power = <1500>; + + trips { + threshold: trip-point@0 { + temperature = <68000>; + hysteresis = <2000>; + type = "passive"; + }; + + target: target@1 { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + soc_max_crit: soc_max_crit@0 { + temperature = <115000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&target>; + 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>; + contribution = <3072>; + }; + map1 { + trip = <&target>; + cooling-device = <&cpu4 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu5 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu6 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu7 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + }; + }; + cpu_big1 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 1>; + }; + cpu_big2 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 2>; + }; + cpu_big3 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 3>; + }; + cpu_big4 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 4>; + }; + cpu_little1{ + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 5>; + }; + cpu_little2 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 6>; + }; + cpu_little3 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 7>; + }; + cpu_little4 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 8>; + }; + vpu1 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 9>; + }; + vpu2 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 10>; + }; + gpu1 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 11>; + }; + gpu2 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 12>; + }; + vdec { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 13>; + }; + img { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 14>; + }; + infra { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 15>; + }; + cam1 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 16>; + }; + cam2 { + polling-delay = <0>; /* milliseconds */ + polling-delay-passive = <0>; /* milliseconds */ + thermal-sensors = <&lvts 17>; + }; + }; }; -- 2.31.1