Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2644251ybv; Mon, 24 Feb 2020 08:56:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzhBjcIZVikFaHTRt0xsvq79pfTn+j9/V3ME0G09D08eqryswFxpfJFkfLrKPqGjNZBh47o X-Received: by 2002:aca:330b:: with SMTP id z11mr7675oiz.96.1582563361877; Mon, 24 Feb 2020 08:56:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582563361; cv=none; d=google.com; s=arc-20160816; b=s6ILp0GPP60mC7g7/5Q1eUXUvvgh8mWeIbig+HzeO/2akuojgSHYdQY1NY8KKm+MuC 1xVVctH5xi/yeoD3Qgsnp4J19Jjs/h9y9ogaevACsnLgIcfpKHF9d2Fwz0N2gtdq8v18 QPMK2PS8JIHqwwoxv1iQJtwCWeOsu2gPI/JjLQFxmYMyKwKMPI/dQ4HKioGJ47Dwm0cz 0+PDnC6SldjFdOEgU3wJaBuz/atDSQj2JPYEje7Sa/yKiBDAbexmoLCfTMJnOjhCpxpH ZAak/v+1NuAXuFG52G3LX/Vtchui0Nu/b44ehmscA3oPnDPmiF3/Q94KJaPEo4dNCiV4 6/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GmWPA/Gdcoz1i5PlbjdCUwmnrsBjWyPJ6MiuzOjITik=; b=vD0+sOira5xo9Cx9xGvjisBYTB1JyP1ur5c7JvGMyRFFA2rQuMNH5Vk5Tpwss6XO9X jE+vxUDYvj69/6rfF5O+aGjbNDctFMVwBupAtXNsAFQAV9UfKg0wbCvxBeqtHsbQsM8c IzcnfwYkpcnksZp5bU2PcCEqIoIj1VWx+ETaK+RyM7BvY2dqbP4YL++MVP3inhTyeq4j Oq0R+1lZaOdS0Cwry/xT4Rka0fz2zRTLGNcwpJPUYFXnWVVblnwVvZa3Grn6bsnAhJ6O NVt1cLE1y2pyBeBdQXX+p6ymSsBzOLauFQfFKn0RuHQ3QyDzUsmticKfQCAsKMkN0vaw 0npQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=NLuyiR9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si6524646ota.299.2020.02.24.08.55.49; Mon, 24 Feb 2020 08:56:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=NLuyiR9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727950AbgBXQyb (ORCPT + 99 others); Mon, 24 Feb 2020 11:54:31 -0500 Received: from vps.xff.cz ([195.181.215.36]:59666 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbgBXQya (ORCPT ); Mon, 24 Feb 2020 11:54:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1582563269; bh=bXleBqxpwvxMLnOw4FuIKeZikmPAgqyT4C7j2/p3/WA=; h=From:To:Cc:Subject:Date:From; b=NLuyiR9Q7d/imiTXP42D1TVu/I0SKzHae44k3Y8poVJnmljL5ZdzUVKleIRauIGnB Zl43UHhSc0bLaurhrdnLUFF7hRx3fVUGq4GpjblSQVPEqvvF7LZgaNAwmox58VdQPH Gwsp8ypgtPo9bZGbEcrRLELhN0XcH1HD2vQUDJd4= From: Ondrej Jirman To: linux-sunxi@googlegroups.com Cc: Ondrej Jirman , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] ARM: dts: sun8i-a83t: Add thermal trip points/cooling maps Date: Mon, 24 Feb 2020 17:54:17 +0100 Message-Id: <20200224165417.334617-1-megous@megous.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This enables passive cooling by down-regulating CPU voltage and frequency. For the trip points, I used values from the BSP code directly. The critical trip point value is 30°C above the maximum recommended ambient temperature (70°C) for the SoC from the datasheet, so there's some headroom even at such a high ambient temperature. Signed-off-by: Ondrej Jirman --- arch/arm/boot/dts/sun8i-a83t.dtsi | 60 +++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 6 deletions(-) v2: - added more detail to the commit description diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index 74ac7ee9383cf..53c2b6a836f27 100644 --- a/arch/arm/boot/dts/sun8i-a83t.dtsi +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi @@ -72,7 +72,7 @@ cpu0: cpu@0 { #cooling-cells = <2>; }; - cpu@1 { + cpu1: cpu@1 { compatible = "arm,cortex-a7"; device_type = "cpu"; clocks = <&ccu CLK_C0CPUX>; @@ -83,7 +83,7 @@ cpu@1 { #cooling-cells = <2>; }; - cpu@2 { + cpu2: cpu@2 { compatible = "arm,cortex-a7"; device_type = "cpu"; clocks = <&ccu CLK_C0CPUX>; @@ -94,7 +94,7 @@ cpu@2 { #cooling-cells = <2>; }; - cpu@3 { + cpu3: cpu@3 { compatible = "arm,cortex-a7"; device_type = "cpu"; clocks = <&ccu CLK_C0CPUX>; @@ -116,7 +116,7 @@ cpu100: cpu@100 { #cooling-cells = <2>; }; - cpu@101 { + cpu101: cpu@101 { compatible = "arm,cortex-a7"; device_type = "cpu"; clocks = <&ccu CLK_C1CPUX>; @@ -127,7 +127,7 @@ cpu@101 { #cooling-cells = <2>; }; - cpu@102 { + cpu102: cpu@102 { compatible = "arm,cortex-a7"; device_type = "cpu"; clocks = <&ccu CLK_C1CPUX>; @@ -138,7 +138,7 @@ cpu@102 { #cooling-cells = <2>; }; - cpu@103 { + cpu103: cpu@103 { compatible = "arm,cortex-a7"; device_type = "cpu"; clocks = <&ccu CLK_C1CPUX>; @@ -1188,12 +1188,60 @@ cpu0_thermal: cpu0-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 0>; + + trips { + cpu0_hot: cpu-hot { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu0_very_hot: cpu-very-hot { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + cpu-hot-limit { + trip = <&cpu0_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>; + }; + }; }; cpu1_thermal: cpu1-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 1>; + + trips { + cpu1_hot: cpu-hot { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu1_very_hot: cpu-very-hot { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + cpu-hot-limit { + trip = <&cpu1_hot>; + cooling-device = <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; }; gpu_thermal: gpu-thermal { -- 2.25.1