Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2643625ybv; Mon, 24 Feb 2020 08:55:15 -0800 (PST) X-Google-Smtp-Source: APXvYqx+cmJqLBCQiN0FWr9b8J+4sllfRKTIP8Gwzabw9+BBYkwbD11jKYEXZjw2LYQAY3CT61Zg X-Received: by 2002:aca:3d7:: with SMTP id 206mr5157oid.98.1582563315153; Mon, 24 Feb 2020 08:55:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582563315; cv=none; d=google.com; s=arc-20160816; b=qlMLRUExTayZIeGO03giDzJ7t48A422glTZ6PkYFAGT4NK7ThxM91JtkWXLaezcpiX USU+0AeenSaKjdgB7eQVv/to9zFKyYfuzu1HGM4enGKwPMlRlLTduTNGb6yW9Ap1Bawf GQIHZntrhCFoCU++wN65oXDtTQqMhz2GlnRazcYD6aPDgc0KayzQSfQju/Yke1LHsbqU 3mpfbysq9kuJQCV59i6GcQig3pp2dW58mDF2xYFfzd6yfqbKV8K1a3TH0VJGwk08rZIu 1RNkZlh77rrzAv4Rx7UkotVzNoLK+mz77FMlkYcNFegsvc1/YZd16uRW7E7PmyzYE8ls 8kYA== 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=xlmOFMCkBm6hnjom5LHLb3ZK7r3nj38Gt8+zNNd3BwM=; b=BhBBzLjtCMbAKy7PquXMN/a/MwS1T93DmfYLgpkUjqjrVVeO+wLJgy/NdWV3YBK1m7 pDektTnlDPM+YemWXelBCQHUjx+DnIMUGzJRUdkRNCo7M/MIe16EKaipYRZ3KAZWJdp6 iOKcx7kH6t2MlaJf6nhGkeqOJOOAnwrswRIEjNecdZ3OgGWXFUH8Ws9xZylPZlKhdk5A v4XqHkdzJlTbTOiSCgPec2feJfDvQIKocwK4bWo38R8A/SychjiGs0Tmf9a2fJx1pdHR Fh90Mpys2iGk5lyoIb6PxK96QCDyipEPMi3HSuDZ4zJM/H+KVGk21w+C/hTvu/FVDG92 Z2Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=dLIt+PT2; 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 a22si6278254otp.84.2020.02.24.08.55.02; Mon, 24 Feb 2020 08:55:15 -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=dLIt+PT2; 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 S1727979AbgBXQyu (ORCPT + 99 others); Mon, 24 Feb 2020 11:54:50 -0500 Received: from vps.xff.cz ([195.181.215.36]:59702 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbgBXQyu (ORCPT ); Mon, 24 Feb 2020 11:54:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1582563288; bh=FwaS6CxBkt9Bed13hZj3FhQm0Xpmwou2Qyewryzy0rk=; h=From:To:Cc:Subject:Date:From; b=dLIt+PT21mzhB7bkMaBmqfbreoWoLbajY+BfxLlK58bhKOKcNJBo66sTIKJmHNXA5 v2kxp/PZ7fJ59SGkrQqc7pUq8+Xa+MXH0zWFAX+3baHL9aNAHL4D9EisHbeqzkZPjc o3s4M5YcZ68sh5SAahz0MC19nZhe/ByRrpJD8Cmc= 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-h3: Add thermal trip points/cooling maps Date: Mon, 24 Feb 2020 17:54:46 +0100 Message-Id: <20200224165446.334712-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 trip points, I used a slightly lowered values from the BSP code. The critical temperature of 110°C from BSP code seemed like a lot, so I rounded it off to 100°C. 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-h3.dtsi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) v2: - added more detail to the commit description diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 20217e2ca4d3a..e83aa6866e7ea 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -41,6 +41,7 @@ */ #include "sunxi-h3-h5.dtsi" +#include / { cpu0_opp_table: opp_table0 { @@ -227,6 +228,30 @@ cpu_thermal: cpu-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 0>; + + trips { + cpu_hot_trip: cpu-hot { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_very_hot_trip: cpu-very-hot { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + cpu-hot-limit { + trip = <&cpu_hot_trip>; + 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>; + }; + }; }; }; }; -- 2.25.1