Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp83887rdb; Mon, 22 Jan 2024 12:42:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IF04MYReGme2JmaOyuovPZpBr/sjSu2EjewFmCLFd4s03HnEAqvgNWIVgNlZuI+JRJKd5Kn X-Received: by 2002:a05:600c:6003:b0:40e:b1d9:6883 with SMTP id az3-20020a05600c600300b0040eb1d96883mr442011wmb.164.1705956144828; Mon, 22 Jan 2024 12:42:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705956144; cv=pass; d=google.com; s=arc-20160816; b=uBEHGS5bVuTCLCXc8tfaSQGwO0NrOMq91eGL2XrgTnLyhPvLyyy2Io41HOAjgltjNP wWVMbPb2NVqmSZZWQlPspvDUGdeYeNM1OtK5g5ejHRh70iiyXJXJMNsafKrJzS+G4EgU hHuvLX3IQ/e2iKKFKH42ObkkH4hb6YIlq41oEmNBACc9/i48it5MJQ35A8aEuJ8cUacI bXlPi73oxUATrITD4YafH3cqPDPU0NWww2m3kwIrnrezesZ8YkZnnCw03w48mMD35sO3 /uh3LlAuOc1GFG1bbOr3iuu1PwTiEtaZMAf6e19sVQazw3r9+bWe35bzL9RO2bf7gUk9 QuiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from; bh=tLpd/AUGj/L9YTxmUKkdcnUdTadZmY1s4dcZ/g7Fhtc=; fh=d8hvjnIA2Pl0hjDO21DPTab/Gwi6WRXVJFcQWr+WbVw=; b=MZbnKKBo7U3YtDTToPamnWXFIjMLqxe/CcLR7XQMTgjjntdyYNQu3PliBLzjDQG1Ho eFNXdV/9ZrmvmFG7RMlMlhqZiyXPm1JPq3TScb0/REPfZsYdIls+SaVOO3tq5LAEIqV1 hscmB11HqtEu+U0A/Y+YqjJRTSoDE8HnGR4hyqDC36Z/FY72lkdRHo0/3xcbbpV9KC2X 3NeLNuowaQXBar8gNw4iSqAOP3n+rc5/GvAoltYKn7BnmQbfG/LhmlGrqnHAmq392kbV GxeECBwy4L8k9aTbLeae//TUtuedMc/FQjF+q9h6DZnEW82vTQE2OZbmxpR+IlYmVBar uVCQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=linkmauve.fr); spf=pass (google.com: domain of linux-kernel+bounces-34130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34130-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id em2-20020a056402364200b0055c5ee666a6si709826edb.234.2024.01.22.12.42.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 12:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=linkmauve.fr); spf=pass (google.com: domain of linux-kernel+bounces-34130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34130-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B581B1F22235 for ; Mon, 22 Jan 2024 20:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A53DB47F73; Mon, 22 Jan 2024 20:40:46 +0000 (UTC) Received: from luna.linkmauve.fr (luna.linkmauve.fr [82.65.109.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0DD147A40; Mon, 22 Jan 2024 20:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.65.109.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705956046; cv=none; b=Kn9sSa0m/V2qG6xZCh32hzV7agcovPr9x8i+49tP1b/A57Qp397e/b0O9SjA5kvCqjj0Mwz9/UXYMcIluhEzPGc1gKvWTOn4QF95hKd20ug8XJxe+J+ap91xZLUdVT28ad9Ks233YOZBHcCKY9yZUS54Q0irUv3siAjy7/ICZ/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705956046; c=relaxed/simple; bh=95e9LKMr1i7TcQv/j6xkAELrGzQGpKGG89U02mGQQO4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nT+3KMD75mP6+bjidCA3lsYvr5eQ4BQR1erCG+JNJPx6ALu2q+Bb4oSMAdbkAOhoLJkuA8kNBp0F7GXddSasndH2DhTQrUaEJcWiynYPRgYZVet1hkIKBB11hHgPyLx2Xxh0oXMrVuzCNHaod4TpLsP1ODwUwn+w9SssSecx76c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linkmauve.fr; spf=pass smtp.mailfrom=linkmauve.fr; arc=none smtp.client-ip=82.65.109.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linkmauve.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linkmauve.fr Received: by luna.linkmauve.fr (Postfix, from userid 1000) id 371E5DDADC3; Mon, 22 Jan 2024 21:35:15 +0100 (CET) From: Emmanuel Gil Peyrot To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Sebastian Reichel , Cristian Ciocaltea , =?UTF-8?q?Tam=C3=A1s=20Sz=C5=B1cs?= , Christopher Obbard , Shreeya Patel , John Clark , Dragan Simic , Chris Morgan , Emmanuel Gil Peyrot , Andy Yan , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Nicolas Frattaroli Subject: [PATCH 1/2] arm64: dts: rockchip: Add the rk3588 thermal zones Date: Mon, 22 Jan 2024 21:34:57 +0100 Message-ID: <20240122203502.3311520-2-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122203502.3311520-1-linkmauve@linkmauve.fr> References: <20240122203502.3311520-1-linkmauve@linkmauve.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver got added back in 45d7b3867a5cabb97fc31f16122cda8540c3a30c, but the dts never got updated, so here it is! I’ve added it to the rk3588s because that’s where most of the definitions are, but I’ve only tested on a rk3588 so maybe there are subtle changes. The rk3588 TRM also documents slightly different values (in part 1 section 14.5.3) than the driver, but I’ve left the values alone since I have no way to determine which one is (more) correct. Only the CPU is properly mapped, as neither the GPU nor the NPU have been added to the dts for now, I’ve left some TODOs there. All of the thermal zones report almost the same value on my rock-5b board, I’m not sure if this is due to a programming error or if this is to be expected. For instance, after running for a while, all of the zones report 44384 m℃, despite having used neither the GPU nor the NPU. Additionally, the alert and crit temperatures have been arbitrarily chosen based on other dts files, not based on any knowledge of the thermal behaviours of this specific SoC. Signed-off-by: Emmanuel Gil Peyrot --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 181 ++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 36b1b7acfe6a..c7a2078960b7 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include / { compatible = "rockchip,rk3588"; @@ -436,6 +437,186 @@ scmi_shmem: sram@0 { }; }; + thermal_zones: thermal-zones { + soc-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 0>; + + trips { + soc_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + soc_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&soc_alert>; + cooling-device = <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + cluster1-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 1>; + + trips { + cluster1_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster1_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&cluster1_alert>; + cooling-device = <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + cluster2-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 2>; + + trips { + cluster2_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster2_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&cluster2_alert>; + cooling-device = <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + cluster0-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 3>; + + trips { + cluster0_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster0_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&cluster0_alert>; + cooling-device = <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + center-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 4>; + + trips { + center_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + center_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + /* TODO: what exactly is "center"? */ + }; + }; + + gpu-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 5>; + + trips { + gpu_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + gpu_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + /* TODO: Add the GPU here once it is supported. */ + }; + }; + + npu-thermal { + polling-delay-passive = <250>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 6>; + + trips { + npu_alert: trip-alert { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + npu_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + /* TODO: Add the NPU here once it is supported. */ + }; + }; + }; + usb_host0_ehci: usb@fc800000 { compatible = "rockchip,rk3588-ehci", "generic-ehci"; reg = <0x0 0xfc800000 0x0 0x40000>; -- 2.43.0