Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp891484rdb; Sat, 6 Jan 2024 14:24:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IENQae3UirQ55HQT71AoSNvQ7HUBJeuHv2dvFfPg2HRrl7MgdSGi+IwZ9E0pjYK4UL9xSZa X-Received: by 2002:a05:6214:5087:b0:67f:f92:2a05 with SMTP id kk7-20020a056214508700b0067f0f922a05mr2054784qvb.25.1704579865177; Sat, 06 Jan 2024 14:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704579865; cv=none; d=google.com; s=arc-20160816; b=x2FXq4gLx2NczQpavRyhC0841ykhbVW7vYijIj6Ti/MH6ew0oqmZCbuF4o48GxLBoi EELlQnHmAAzZGBmiPFS7B3N0i19t48C0J4yHWCIbjiYAZxXP6/oKFyf6bpG2zP06zjHE 27Nqmp18JL+3oJPoMY5wPXycyIg6wel+TphZtX1q4BiAYsIHYZeSRqtOHBU1ZQP21HIy 1rSveOg6Uplo0rkodZRLjMCnF91ZhjKQZ8ozCGiNMRxX5kgB9SN+4Qf2GrbQzM51LpbR XPqOFETtpnXzCyM+FpziMo1kPv1+flyBOmkrh/gC3wJ0LCFzI73Kvyb4X+P+u+spiOb/ qR1w== ARC-Message-Signature: i=1; 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:message-id:date:subject:to:from :dkim-signature; bh=IZIA5zf/VHPtEHf5BZda2vmVXuJ+Vs5INvQNZOIe84E=; fh=c30vSLxUoiTZMpwQgyTz/D5WjuHw+K/owoU+JFI5Msw=; b=kubkleGxvmzWHHsPJ7MK4MGHmR5UupX4/eRCOaV/vd3yGHSeCVxMm1a7t030dKzeFd oQsw5OqpkS7JCwxMg6xs/MwSBcvLNzJgYRilaWH7tf47Cd4bF7ZVSji7asZGlItX8X1s 5ZROMGsV4fFuyf6z/BIqpxuZXrjCIAUsb70rYEz3884Rk8lqVrPdAmzBvkV3am/GIlhN I5t7jM2swcpno3HCDclLyW+db4XEP4lBqKFGmkeVbkGEiZvWHJh1h6U41AqWdN3CJOxw 7rKr8evxpNrIVzq9SBVMwFvrTn45iJOwAMKTj0tgsyHyxj7KrOB8+n8Fn3xBQ4MSePpx n0OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V6OBQTpB; spf=pass (google.com: domain of linux-kernel+bounces-18730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u11-20020a0cb40b000000b0067f94768e83si4698314qve.119.2024.01.06.14.24.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 14:24:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V6OBQTpB; spf=pass (google.com: domain of linux-kernel+bounces-18730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C8CFB1C20894 for ; Sat, 6 Jan 2024 22:24:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF8CC101E9; Sat, 6 Jan 2024 22:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V6OBQTpB" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 4707B101D3; Sat, 6 Jan 2024 22:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40d8902da73so6368495e9.2; Sat, 06 Jan 2024 14:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704579853; x=1705184653; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=IZIA5zf/VHPtEHf5BZda2vmVXuJ+Vs5INvQNZOIe84E=; b=V6OBQTpB5sZBkqHa6eGS4C9ZS7yI4rLqHlZFdgmdySdVuQVPKiFR1jCdwXWlevASDH lG2XL8fNSn0P+VUFYDh3iF4koUooY5FxCIXtDKx0F+40kaD2MdJT3lVuoJ9Z2xPZW5bH pP9xfmLLd6gFrUrqlnc4xcN66zcnWXdjXuhS6Rk6w8+sJ8VrE34DK1mHkOwafLPSqL7v mbI7IiN6f4jBzSEaHYIN/0NTKl82iVN+Y2gbfLGMbVEIzV7fns3xAEeLoj62c3pTYErj lmN1Q3l4vCWVsZaEtgveMdotzzoPTo9fZTP1E2kgiKQoygksAW02iw/HPHCerAmgE/vn zHuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704579853; x=1705184653; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IZIA5zf/VHPtEHf5BZda2vmVXuJ+Vs5INvQNZOIe84E=; b=imSwucjlfo6w9jw9BDwTrWw8nfkmhvUYw5JLR3o6f5Y8qw8uqdptAMkxG+WrHF+osL vBxA/0h9adQ2IoNy4v71VWw+euenYzrLsudnM2cQ30RPl6VqRzey1cDFbBORbw8gwcSn 014m8T3kYKnfUpyLwnOwAFyoRhgZc4flVrXpypDCYrOrrEnXNp+I8NjTYUjhu+zJ8Xc3 O2JWtn6uNFdPgTZGPv2SeJA5m0PV0LpUrU4u4x300KH9sx6VHlPqlYzKsokH0V0hF7Cq XER0POvtFhqxOmqAZFoA1RSUi9oJOeDQfRAH9yh31QFPkhdsjL1o341X35v5kyNQ+xmG Sr8A== X-Gm-Message-State: AOJu0Yw9vCDtzp6WD17rqFxeXyXeZ2fy+I5NxyxZK546Eofd/FWFDDf9 nE1gt37oAkPoEPeOeiKzPPc= X-Received: by 2002:a05:600c:5027:b0:40e:43e5:f33f with SMTP id n39-20020a05600c502700b0040e43e5f33fmr39936wmr.65.1704579853213; Sat, 06 Jan 2024 14:24:13 -0800 (PST) Received: from latitude-fedora.lan ([2001:8f8:183b:50fb::d35]) by smtp.gmail.com with ESMTPSA id w15-20020adfe04f000000b00336471bc7ffsm4078128wrh.109.2024.01.06.14.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 14:24:12 -0800 (PST) From: Alexey Charkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Sebastian Reichel , Cristian Ciocaltea , Christopher Obbard , =?UTF-8?q?Tam=C3=A1s=20Sz=C5=B1cs?= , Shreeya Patel , Kever Yang , Chris Morgan , Alexey Charkov , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: rockchip: enable built-in thermal monitoring on rk3588 Date: Sun, 7 Jan 2024 02:23:42 +0400 Message-ID: <20240106222357.23835-1-alchark@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- .../boot/dts/rockchip/rk3588-rock-5b.dts | 4 + arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 143 ++++++++++++++++++ 2 files changed, 147 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..8235991e3112 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,148 @@ tsadc: tsadc@fec00000 { status = "disabled"; }; + thermal_zones: thermal-zones { + soc_thermal: soc-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + sustainable-power = <2100>; /* milliwatts */ + + thermal-sensors = <&tsadc 0>; + trips { + threshold: trip-point-0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + target: trip-point-1 { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + soc_crit: soc-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&target>; + cooling-device = <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + map1 { + trip = <&target>; + cooling-device = <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + map2 { + trip = <&target>; + cooling-device = <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + }; + }; + + bigcore0_thermal: bigcore0-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 1>; + + trips { + big0_crit: big0-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + bigcore1_thermal: bigcore1-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 2>; + + trips { + big1_crit: big1-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + little_core_thermal: littlecore-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 3>; + + trips { + little_crit: little-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + center_thermal: center-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 4>; + + trips { + center_crit: center-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 5>; + + trips { + gpu_crit: gpu-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + npu_thermal: npu-thermal { + polling-delay-passive = <20>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + thermal-sensors = <&tsadc 6>; + + trips { + npu_crit: npu-crit { + /* millicelsius */ + temperature = <115000>; + /* millicelsius */ + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; + saradc: adc@fec10000 { compatible = "rockchip,rk3588-saradc"; reg = <0x0 0xfec10000 0x0 0x10000>; -- 2.43.0