Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp994225rdb; Fri, 19 Jan 2024 05:16:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+QydnHZfa11POqEf1lSdIak3J9uMlyCEM+PyfLT7vhmtpEX8CpyUnUak2GLL1IHRexlPH X-Received: by 2002:a17:902:e852:b0:1d6:fe15:b579 with SMTP id t18-20020a170902e85200b001d6fe15b579mr2357741plg.111.1705670188636; Fri, 19 Jan 2024 05:16:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705670188; cv=pass; d=google.com; s=arc-20160816; b=Wu3TAUHgtE+JqbZg6J1xrpaqrOChxa8QQwiZ29QAQVPoGj2rth7VCjeEgOrbeHZzfv 9kLlCmS3G2MoDIcPZuuLcDSUYyEtF2xj+LGNZRdztlctbkFi5gfrTNeFde3+LKy9u1GV KXIPW7uwj5EdZ4ausn6tr0UvCIS97NGh/LpdvOaXUSoRfPz1GV76745cW4HuYMAX8NEH 8N7e4mbDtonNwgR7YyfEAiXG1FO9iUz3FyB5nZ2YP61H934sboPwgBS/wwjLaLQMOwvE elI0vS3MxBU19PYp5fDlNwL4iGhXONoZKrRiKo11meKfmnCtXtccwlSkdN2bNdBL/7PW JcJg== 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=/bA7VG7Ok9gAryNB2deafmxmHLvh5dpkDDDcbmDWHoI=; fh=DAhKdWd2tmJfB2Wb2kUd9Ih5Vi9iJ6bHRzOPPsfxOzg=; b=r0rdBN4v1lXwmzZKhAjRxuFXRpKERoWnD2t0WgmpNQyNF3uSno/Z2EACb+R3O7ffpC XdXc+wJh3qh4wME6txMBWI3c8jix/Dzg+t9MN/M5RREps/EWUF8523mSUIVUaUr85Ubm Tnyp37NBSJW3B2YS+n9giSF95gAh3LxXMoXbNXvZJnsIDgIqiTb33kqS45ZRL+b5ZK9r w8loGg2TN4eYLiyOUiuYrU2Q82wjy13Zhfy1WHxkwrNoElcl9efc0NLrMlGgytU8O1hd Yn50wjwBh5+0ZP/f9m8j+uvW8SdUaa5hElmj02usbrJfEzDa3SBNvQSFBf4K0X6i0lAz h7rw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-31181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h10-20020a170902f54a00b001d50ecf8686si3429426plf.520.2024.01.19.05.16.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:16:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-31181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B3C54284AFD for ; Fri, 19 Jan 2024 13:16:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7987524CD; Fri, 19 Jan 2024 13:16:18 +0000 (UTC) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77C9852F7D; Fri, 19 Jan 2024 13:16:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670178; cv=none; b=lgEChTswFiVa/Nz9qPL3OL5lpZVXM5wrRP30Nlph1BkymontV4cMSc4CoV/GpzLP8/dJa/R9pwhQTjXvV7xdjmJJJa9uYWbnvleSH+k1fiKdW5hh9Jj2QVoRiqUw/CzwEPHzxLObQoDl7aqBvaQ2Ax1v+6ZjvSmkltmgwuOMQos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670178; c=relaxed/simple; bh=kcLkyySanaripxr4heKCeCGgPE5w7W+62Vy2xj7e8DM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c9e4NBmgfSU1EkOqijazaoLJd3EZYkSnJY+kq0pJQXJE/gtJsm7E7eXXqpUEDR0dXQHonuniSszFpcOnGXifj+rGZsmdQFmybHzbfeCO095RdxSPN50LCcvmFlnPxV5nDIl3GXTY3T49rqDS7BtO/rtaQXoXUayWfRgBI4u2IFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Received: from i53875a8b.versanet.de ([83.135.90.139] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQoiZ-0006YU-Ke; Fri, 19 Jan 2024 14:15:31 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sebastian Reichel , Cristian Ciocaltea , Christopher Obbard , =?utf-8?B?VGFtw6FzIFN6xbFjcw==?= , Shreeya Patel , Alexey Charkov , Kever Yang , Jagan Teki , Chris Morgan , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov Subject: Re: [PATCH v2] arm64: dts: rockchip: enable built-in thermal monitoring on rk3588 Date: Fri, 19 Jan 2024 14:15:30 +0100 Message-ID: <6579508.YiXZdWvhHV@diego> In-Reply-To: <20240109192608.5981-1-alchark@gmail.com> References: <20240106222357.23835-1-alchark@gmail.com> <20240109192608.5981-1-alchark@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Am Dienstag, 9. Januar 2024, 20:19:47 CET schrieb Alexey Charkov: > Include thermal zones information in device tree for rk3588 variants > and enable the built-in thermal sensing ADC on RADXA Rock 5B > > Signed-off-by: Alexey Charkov > --- > Changes in v2: > - Dropped redundant comments > - Included all CPU cores in cooling maps > - Split cooling maps into more granular ones utilizing TSADC > channels 1-3 which measure temperature by separate CPU clusters > instead of channel 0 which measures the center of the SoC die all of what Dragan wrote and additionally, please don't post v2 patches as reply to earlier versions. It confuses tooling like "b4" when trying to retrieve patches. Thanks Heiko > --- > .../boot/dts/rockchip/rk3588-rock-5b.dts | 4 + > arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 151 ++++++++++++++++++ > 2 files changed, 155 insertions(+) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts > index a5a104131403..f9d540000de3 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts > +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts > @@ -772,3 +772,7 @@ &usb_host1_ehci { > &usb_host1_ohci { > status = "okay"; > }; > + > +&tsadc { > + status = "okay"; > +}; > diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi > index 8aa0499f9b03..8d54998d0ecc 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"; > @@ -2112,6 +2113,156 @@ tsadc: tsadc@fec00000 { > status = "disabled"; > }; > > + thermal_zones: thermal-zones { > + /* sensor near the center of the whole chip */ > + soc_thermal: soc-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + sustainable-power = <2100>; > + thermal-sensors = <&tsadc 0>; > + > + trips { > + soc_crit: soc-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + }; > + > + /* sensor between A76 cores 0 and 1 */ > + bigcore0_thermal: bigcore0-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + thermal-sensors = <&tsadc 1>; > + > + trips { > + bigcore0_alert: bigcore0-alert { > + temperature = <85000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + bigcore0_crit: bigcore0-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + cooling-maps { > + map0 { > + trip = <&bigcore0_alert>; > + cooling-device = > + <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > + <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > + contribution = <1024>; > + }; > + }; > + }; > + > + /* sensor between A76 cores 2 and 3 */ > + bigcore2_thermal: bigcore2-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + thermal-sensors = <&tsadc 2>; > + > + trips { > + bigcore2_alert: bigcore2-alert { > + temperature = <85000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + bigcore2_crit: bigcore2-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + cooling-maps { > + map1 { > + trip = <&bigcore2_alert>; > + cooling-device = > + <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > + <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > + contribution = <1024>; > + }; > + }; > + }; > + > + /* sensor between the four A55 cores */ > + little_core_thermal: littlecore-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + thermal-sensors = <&tsadc 3>; > + > + trips { > + littlecore_alert: littlecore-alert { > + temperature = <85000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + littlecore_crit: littlecore-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + cooling-maps { > + map2 { > + trip = <&littlecore_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>; > + contribution = <1024>; > + }; > + }; > + }; > + > + /* sensor near the PD_CENTER power domain */ > + center_thermal: center-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + thermal-sensors = <&tsadc 4>; > + > + trips { > + center_crit: center-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + }; > + > + gpu_thermal: gpu-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + thermal-sensors = <&tsadc 5>; > + > + trips { > + gpu_crit: gpu-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + }; > + > + npu_thermal: npu-thermal { > + polling-delay-passive = <20>; > + polling-delay = <1000>; > + thermal-sensors = <&tsadc 6>; > + > + trips { > + npu_crit: npu-crit { > + temperature = <115000>; > + hysteresis = <2000>; > + type = "critical"; > + }; > + }; > + }; > + }; > + > saradc: adc@fec10000 { > compatible = "rockchip,rk3588-saradc"; > reg = <0x0 0xfec10000 0x0 0x10000>; >