From patchwork Mon May 6 09:36:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13655214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA32FC10F16 for ; Mon, 6 May 2024 09:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n0kp03/sbkEOIGe0BZM8itDosk4oUn8nqb5iDT6Ibn0=; b=dgyBo9cSJ+wsbJ ZryGIpwnuEQjdbksX6bfbFkCDb7m4SuCua5ONnff2xFpYsrfilLXceTvC5cEY06skFsdIFeS/VaVx VfblcBfN07DPI9w++NmKipMte3qDLe4KV+PoffOylbqbE/gAYafnYPTDPVBThd4ql7Tshi33ss87o HP+7kF0HEJAYhUg6J6KQChKCoFPz3omN0FgZu7bkX2OxFVzMivzD6KbUIePfx7ztZ975nyr4nxZpc 8FnJLRLIEQH2IyKJr7HYg2mkXWA+khC9GJ+eh6FWD9hAZw3QmSA4cAP4iRuch+TcXhGC+kYT0il5o DaDzKYOoCveEn5H3K+cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umc-00000006oXV-3Y7v; Mon, 06 May 2024 09:37:18 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umY-00000006oVF-33QV; Mon, 06 May 2024 09:37:16 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a59b81d087aso292597766b.3; Mon, 06 May 2024 02:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988232; x=1715593032; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZmGdmY8DE6zqLCMf8fCUqWkVhIJWW+2eyn2qqAadLp0=; b=MX8XwC0YZ5f6fX++wL0CS9S/vflpq98JsjDhLp/x7yRhny3E74CYHBhtg+d8YfFbI0 7cmN64aK/cGC9bVkRXsAk92XlmHZ4LRgH3nJvYSyiLOVr+IO6QPZDB8A4Sfs5y9xlM7K 6ZugEH2gmNicEGbuGVFXcp6gsYDf0gSusjoMgxyg6Sz487miC/u9WH2bw4InlkgOgi5A 8HTESf1ZYrMqKI/hhBtc3IMQkfuBA8jNlEX3RymasQar2XJEh/6K70nD0BmrXjcdh5Ep mR8eFwkH7e1LiqNILlY0/IZiKl1f7OKcO26t9L7v1WlNSkVoVATo6Qhn445gNaQBtYlf Su9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988232; x=1715593032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZmGdmY8DE6zqLCMf8fCUqWkVhIJWW+2eyn2qqAadLp0=; b=gfJQhNqh020o1QD2rfx6MGPMIHhCosBrnoU7v9k/2+k1cnSNq9ljQMJOivX/C16xJc eko8V7oG3yZGs0vww6ndJIqcYi2WFHsXqCeBoOdaggV15RYjHsp351zE9FqOkOdkXKCj 5X4HyfrMpURAHo4JlLwpT6Nt2M146RdzMLwmmWmY2Dn/NHmPn40X+XZFJ/K2oSgR7pPa L0jAJrXF5Cy5GZ7/Jwc3tsP+mdd6ZFgxf+rp6xA/EM3dOXkwu2PyJMjLVnG9UA+YuLl8 l3CN1L++cvtzEaX/hX6IODJBFfsqGftV2A3/dCHCmbbEND1GSiZedk0W6TwJGiCl+1g7 RO6w== X-Forwarded-Encrypted: i=1; AJvYcCUhIB+SKMKeCvyS6vleSLMd4X6afaMR63sPhF/jDP8L2duA86483vmKU6sJlD4KQI+mM3qfcfpP0o0GkIiyvpqKLRkxwVH89ZMHhkodwpNa59o6vULDn3EPYU2DvlBbIR6gjf94STqYrCjfX6sgY5J/IKSLANlLAQw= X-Gm-Message-State: AOJu0Yz/HdfJtrj0ihtdyQOLlNJ9kWBQA8yAgnFZhZSHOfVRPh8wz3Pj 2TduhoI8wf9TQyPNPCNvW97qGkMxAQlYAQ0DzCdhsS/KNZtALZQO X-Google-Smtp-Source: AGHT+IFTy2eBX+SCcZX80gxFh0M8yziHMdYiwC7RP5+Th3wIlkpQvWMdH63lC5HB6XaT4i46Tq/YEA== X-Received: by 2002:a50:c319:0:b0:56f:e7b9:e67d with SMTP id a25-20020a50c319000000b0056fe7b9e67dmr9422796edb.12.1714988232147; Mon, 06 May 2024 02:37:12 -0700 (PDT) Received: from [172.30.32.119] ([2001:8f8:183b:f2c::d35]) by smtp.gmail.com with ESMTPSA id f6-20020a056402160600b005722ce89ae2sm4983647edv.38.2024.05.06.02.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:11 -0700 (PDT) From: Alexey Charkov Date: Mon, 06 May 2024 13:36:32 +0400 Subject: [PATCH v4 1/6] arm64: dts: rockchip: add thermal zones information on RK3588 MIME-Version: 1.0 Message-Id: <20240506-rk-dts-additions-v4-1-271023ddfd40@gmail.com> References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> In-Reply-To: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988224; l=4796; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=+CRjCu5/qMbviqrE7tKv0CDQlxSHs+JH5lEn/bmXM3Y=; b=EzL8gJdaHg+A1S3Q8nrUlNLWmEKSCa0G7Sxga0J9K3BPOvz6Ld9L11TR3dmiltGPq92SM/bLY N9PjqYnNTheAGDY2BCBsg8YbcF95OobZ1LadcHzT2Pj+MPWM0QHIerj X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_023714_817807_15968295 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This includes the necessary device tree data to allow thermal monitoring on RK3588(s) using the on-chip TSADC device, along with trip points for automatic thermal management. Each of the CPU clusters (one for the little cores and two for the big cores) get a passive cooling trip point at 85C, which will trigger DVFS throttling of the respective cluster upon reaching a high temperature condition. All zones also have a critical trip point at 115C, which will trigger a reset. Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 147 ++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 6ac5ac8b48ab..ef06c1f742e8 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"; @@ -2368,6 +2369,152 @@ pwm15: pwm@febf0030 { status = "disabled"; }; + thermal_zones: thermal-zones { + /* sensor near the center of the SoC */ + package_thermal: package-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsadc 0>; + + trips { + package_crit: package-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + /* sensor between A76 cores 0 and 1 */ + bigcore0_thermal: bigcore0-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-sensors = <&tsadc 1>; + + trips { + bigcore0_alert: bigcore0-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + bigcore0_crit: bigcore0-crit { + temperature = <115000>; + hysteresis = <0>; + 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>; + }; + }; + }; + + /* sensor between A76 cores 2 and 3 */ + bigcore2_thermal: bigcore2-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-sensors = <&tsadc 2>; + + trips { + bigcore2_alert: bigcore2-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + bigcore2_crit: bigcore2-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + trip = <&bigcore2_alert>; + cooling-device = + <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + /* sensor between the four A55 cores */ + little_core_thermal: littlecore-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-sensors = <&tsadc 3>; + + trips { + littlecore_alert: littlecore-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + littlecore_crit: littlecore-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + cooling-maps { + map0 { + 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>; + }; + }; + }; + + /* sensor near the PD_CENTER power domain */ + center_thermal: center-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsadc 4>; + + trips { + center_crit: center-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsadc 5>; + + trips { + gpu_crit: gpu-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + npu_thermal: npu-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsadc 6>; + + trips { + npu_crit: npu-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + }; + tsadc: tsadc@fec00000 { compatible = "rockchip,rk3588-tsadc"; reg = <0x0 0xfec00000 0x0 0x400>; From patchwork Mon May 6 09:36:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13655215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9CB5EC25B5C for ; Mon, 6 May 2024 09:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tSi84IeKld98L+wGB6ZCw5KLxbasbnTOYKCsw23N7cc=; b=V/eaBeTW8M8yaY 6lhDm6f28j9pyBalbN6W1M4LIJAzVQNOSttfoHG7ZlUhwAMvIyXZgJGGvoLxctbhZxzgUYAH9wZnB 71+mpE0sbQ7j1rIX0q2E8zzUdIvn3W9YwuuvgzEPGA2xD+h9PKOWoUHaEz3i+7mQV7sFPj25gjdYE emp2x+KQ9wbWULv3Ql04ox4BWpRSZxL0LWukGQ2TT4lMiG9pR5Zu/Yu46jUCxv2vJ/9EhhSTGpqRh zwlKDxiC3G654nxI8AbO3AQpDHDOL/ylG56GZvM9YDCRFvcM4HJiqlCoaGPSiwYgAyjBZYKs6hUsK YQy391E5ehFZAG5DwYPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umg-00000006oZH-1oje; Mon, 06 May 2024 09:37:22 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umd-00000006oWT-1HUF; Mon, 06 May 2024 09:37:20 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a599af16934so384509066b.1; Mon, 06 May 2024 02:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988236; x=1715593036; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6QUAJdxvdjJF0g4Iedvv3W5jbeIoEk4V3HwGZq9hD1M=; b=lTsZHdihvP2Rh1tef6xJcs5RGLn4ZjucTYAvZsa19BtaE4GGmFUuERgA1lchBXcF+E FLKlf6jhNOYPL+agPYfGLQaEXKV2odxJIo2w6xOKADqSyfxMe4xPpn80EJaOSd3BoxSz +5j3FRUTfAxOJDM079ci6ZNCOIyVGY1jfAq9Eb6/Md8pOkAKMVG92q8VC9rg5DgV/QNY Nuq7vUNn3+fUxnS2ejueWkOs6LzsVA2YYb0YZFyCpHg0P0PZy8bBf37YOKyQJIu+Rvf2 S6agO17DZG9kTR/WlZZwthET9y4lxRVJIm8dlyTlu6wof9RcPL7KvMy3nO70XEIP5HLq DZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988236; x=1715593036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6QUAJdxvdjJF0g4Iedvv3W5jbeIoEk4V3HwGZq9hD1M=; b=IZHtLlzXcTS+0ufdIqFWdflyIkGRX8rLG6VA6UqBpImeBT79I9E2OTtUGnLJjzCGwI hIx9D3hEslUVGsJnwWDEHSZd3U6lHVzifpVYzXGowYHZyAtYHPV0AZUP2PUYqLZNrra/ tGIFSnIj4xc1EoCowjH2qGOmNnAvxTlR1bzM8CxtBvShSyoIRHNcAM4gV2xsfAa2DlLD F/O7whoXFkPrEWK3wvtSWUdpwcDPJIZIGIJkjB+NMJVVnXLw3qYsq8oBbKB74+1hqccj f8EUH9TwIKxO6HnAsDS+eoTiqk4XDuuHua5QyyQkzTx6h7TwdKiNG0PwV71cUAQ17N3a WU1A== X-Forwarded-Encrypted: i=1; AJvYcCXZ+bfo5eG0MN1NhyiB2t735852pWNJDbE1hPrpl8i7pD1vQFvDNOCLaNN7+8Mfp2ssk8B8i53TQcO36/u4Eke93ehLmUd0wRlcURp4Qqr7z3HDRls5N14F7hCFAR8xoGn4rg0RxzR9N5Ncsfq9vlvLfE83ABvMasE= X-Gm-Message-State: AOJu0YzNtxKYjc/c2P0jYgauUOlXSLPSZEscJ/gBiOa39YpDY2Z84gwb NI3pOn7nLvhwUH9U+Cj/eq3+XcpyMVHScwvZ2Hhin3k+I8slIYzLeD96glHToQA= X-Google-Smtp-Source: AGHT+IEpoDThqBrXD8AVnT5RjXcFvvech0tAE2sx6cAOPOuHnZuctTfwzvyaGhf+wUdbkeccEPLO0w== X-Received: by 2002:a50:a699:0:b0:572:42ac:9b19 with SMTP id e25-20020a50a699000000b0057242ac9b19mr6652365edc.0.1714988236054; Mon, 06 May 2024 02:37:16 -0700 (PDT) Received: from [172.30.32.119] ([2001:8f8:183b:f2c::d35]) by smtp.gmail.com with ESMTPSA id f6-20020a056402160600b005722ce89ae2sm4983647edv.38.2024.05.06.02.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:15 -0700 (PDT) From: Alexey Charkov Date: Mon, 06 May 2024 13:36:33 +0400 Subject: [PATCH v4 2/6] arm64: dts: rockchip: enable thermal management on all RK3588 boards MIME-Version: 1.0 Message-Id: <20240506-rk-dts-additions-v4-2-271023ddfd40@gmail.com> References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> In-Reply-To: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988224; l=4390; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=lraF8Hbej6o/vzD2ibMl+sD1o6QIvu8qx6CUPylhTS0=; b=L+SmgqiZUWX1QlD1lAl8Fvx6rg3te0i8Dfivs/4C85qKwq5x8IqH2l/yBUMfv+hG0SscnqBb5 /rqtiXXtC+xCIsVzjy5l4iHbWTkC4rlKbTBgxQjs9K1pcoxUz13N3BS X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_023719_533568_B109B545 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This enables the on-chip thermal monitoring sensor (TSADC) on all RK3588(s) boards that don't have it enabled yet. It provides temperature monitoring for the SoC and emergency thermal shutdowns, and is thus important to have in place before CPU DVFS is enabled, as high CPU operating performance points can overheat the chip quickly in the absence of thermal management. Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-common.dtsi | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588-ok3588-c.dts | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588-toybrick-x0.dts | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi | 4 ++++ arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts | 4 ++++ 8 files changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts b/arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts index 98c622b27647..c667704ba985 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-armsom-sige7.dts @@ -673,6 +673,10 @@ regulator-state-mem { }; }; +&tsadc { + status = "okay"; +}; + &u2phy0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-common.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-common.dtsi index 709d348cf06b..03fd193be253 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-common.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-common.dtsi @@ -466,3 +466,7 @@ regulator-state-mem { }; }; }; + +&tsadc { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts index 7be2190244ba..7c3696a3ad3a 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts @@ -1131,6 +1131,10 @@ &sata0 { status = "okay"; }; +&tsadc { + status = "okay"; +}; + &u2phy0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-ok3588-c.dts b/arch/arm64/boot/dts/rockchip/rk3588-ok3588-c.dts index 009566d881f3..230e630820b4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-ok3588-c.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-ok3588-c.dts @@ -376,6 +376,10 @@ &sdmmc { status = "okay"; }; +&tsadc { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index b8e15b76a8a6..21e96c212dd8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -742,6 +742,10 @@ regulator-state-mem { }; }; +&tsadc { + status = "okay"; +}; + &uart2 { pinctrl-0 = <&uart2m0_xfer>; status = "okay"; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-toybrick-x0.dts b/arch/arm64/boot/dts/rockchip/rk3588-toybrick-x0.dts index 9090c5c99f2a..d0021524e7f9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-toybrick-x0.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-toybrick-x0.dts @@ -648,6 +648,10 @@ regulator-state-mem { }; }; +&tsadc { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi index 6b9206ce4a03..77bcf0f6b028 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi @@ -601,6 +601,10 @@ regulator-state-mem { }; }; +&tsadc { + status = "okay"; +}; + &uart2 { pinctrl-0 = <&uart2m0_xfer>; status = "okay"; diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts index 8e2a07612d17..c671a61d3aef 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts @@ -697,6 +697,10 @@ regulator-state-mem { }; }; +&tsadc { + status = "okay"; +}; + &u2phy0 { status = "okay"; }; From patchwork Mon May 6 09:36:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13655216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D27FC10F16 for ; Mon, 6 May 2024 09:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WKHNSTYS87WpCMpsAVe2KyxVVMebg9Cqn/Bf8q8RctA=; b=N5tacUA3aZPeAG MfaHlvcZLvwhF3QI73uWvS0EuHn7xyyrlioHBuIAxk4XePiaClDlyK/7UBLWEJ2EEgf6mUuEgVo/E 47EeLLCRbcCcxdVB8imZrBTl0dC1CsyFnSlb6x9BB87J8andceGm/+6/n5PcHwdrmsdPqu4QbnxZu avuCSUaB+VrefI+NMkwzrHsy5kuQMgu7Emvzor3Xtd7WUmuiRfzHqMqXPtS8HEX+5Dcy/pFT2MDyq zhc4nbwidfBrki8aGvwNfi3DkVePMUBF9sxW7atTb9ngUX/CD8qiWYICbavcMt9dMx2RvWNNDus+q 2hvEOx7rKHEiYG3FpgWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umk-00000006ocj-3rtC; Mon, 06 May 2024 09:37:27 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umh-00000006oYh-0AIh; Mon, 06 May 2024 09:37:24 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a59b49162aeso308797266b.3; Mon, 06 May 2024 02:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988240; x=1715593040; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DPJZwHx34N3Ow7z49nFpdVnJJVNFy+nT0MarnQ8cM+A=; b=krP1dJGYU37wjpaaoUV4uawIaL3nlX6sVa5G3vOmq1kuHoZ1sO8PERFmUyIwrloVUq npf8QA7NYZbGCzsrXZe4UbIZbvqOQ4vF0EL9B9OVbyxYQxpRNrv8AAO4aGHWAVRcpukG xEDGlqxDyGthl1ZqnB3plw0CAhKmpYkbrVJpLhcJbLSl/VOHi12YNUDoirOK0GqczoNi 7FULFJQdhMfnxIz/58Y+sE9xNy3eiLi1O0qI9khwIe9Z7BfkhZUIVJK1nK4VNh0uKOFn k1eMSBZZi1DCfwg/3/aV2LzFzBSLhrJlVWsAKjFXmVlzsA4aqinsttjCjYHnvDy8xuCp WGqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988240; x=1715593040; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DPJZwHx34N3Ow7z49nFpdVnJJVNFy+nT0MarnQ8cM+A=; b=w/hOoK5frwP73POnpS/RCW3gPc3JK8pwMehs9wid09e0PuZCImP0gpO4EzgITNCcnZ GVuLai53OE67c9vOsZjm7OKimqL39Ap3Dts+dNMSRwd6F+6pknoh4y0DlEuHV3zLbQOe b10y1c0L/XJm0L0OUITXirbj1wyRjGHEki4VEyQo/+MtjyuX65wf7jBvXCsOzaO07bfp oZfid5RXjnZNjtcES0FPHWlPpsGQIYslzrAoj8fOYH1DQgLdg2vuXNgo8n6KVSYOFCDO yXfXsWbAF3Mdc78BijqvYC6g8uQ9H2lIDBPZYUYLjHzXvqRfEQbPcbkcYqA6JvOgSyOA /ftA== X-Forwarded-Encrypted: i=1; AJvYcCURle+/BFAjyfnTKg5eE9Af3lbAEWqHpN4N1VQKSfXEylD+vZmKBtXkL1RW0o8GDlPkypaHka/tRux6AThoOPJYk/OKUzcstYEdGDLJtdTrgVQ1kMLPWmAYZnPXRkm3Jcg++e/ZNShY7IB1vqR5yyAGVYmUPLZXM+Y= X-Gm-Message-State: AOJu0YyTjeXpdkg3lVxKsFAejlvP8aLIyDq2g/18cgYAng4CH15AzdAB 3jnznma44EFmH8QksiiHk/BEO/97IStEbgLqWH+yFpoKTFJ2xQkC X-Google-Smtp-Source: AGHT+IFaEDRcX/eXmw7esyfzzdC59VSTAyURsII4QqC2jC9dS3tj96yWHX5rUfe+NF44OcXPw3e8+w== X-Received: by 2002:a50:bb42:0:b0:570:3b4:53ff with SMTP id y60-20020a50bb42000000b0057003b453ffmr6300213ede.6.1714988239866; Mon, 06 May 2024 02:37:19 -0700 (PDT) Received: from [172.30.32.119] ([2001:8f8:183b:f2c::d35]) by smtp.gmail.com with ESMTPSA id f6-20020a056402160600b005722ce89ae2sm4983647edv.38.2024.05.06.02.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:19 -0700 (PDT) From: Alexey Charkov Date: Mon, 06 May 2024 13:36:34 +0400 Subject: [PATCH v4 3/6] arm64: dts: rockchip: add passive GPU cooling on RK3588 MIME-Version: 1.0 Message-Id: <20240506-rk-dts-additions-v4-3-271023ddfd40@gmail.com> References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> In-Reply-To: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988224; l=1255; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=QMB2BQUFw504Si0nPhgwd4U1cGB1jsKPa2V0a7oyVXA=; b=kOJ0Ccq6KM+zlPF5AmBsuM09NjiaXHs7BkcQ43+BtvNRKJFT8LEz+ydboCdWRkGjp1pcFJNgq YfaX5AKGTxsAeKGf08Q0SYC6Lt+B7TVrNrDrlkoUuC7CKxfBqCVafZX X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_023723_229844_8D57E804 X-CRM114-Status: GOOD ( 11.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As the GPU support on RK3588 has been merged upstream, along with OPP values, add a corresponding cooling map for passive cooling using the GPU. Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index ef06c1f742e8..57c2d998ae75 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -2487,17 +2487,29 @@ center_crit: center-crit { }; gpu_thermal: gpu-thermal { - polling-delay-passive = <0>; + polling-delay-passive = <100>; polling-delay = <0>; thermal-sensors = <&tsadc 5>; trips { + gpu_alert: gpu-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; gpu_crit: gpu-crit { temperature = <115000>; hysteresis = <0>; type = "critical"; }; }; + cooling-maps { + map0 { + trip = <&gpu_alert>; + cooling-device = + <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; }; npu_thermal: npu-thermal { From patchwork Mon May 6 09:36:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13655218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEA8FC10F16 for ; Mon, 6 May 2024 09:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fUG5vQtr3Icfw4KuQ1dB0ojsEdwEv70beG7laDsq5NY=; b=KPuyEDQ0ZwVkLR iMgzdM+sFVN/Zl9+lE/UYFheiE5PF3BKvrRGHeE/QVJgYCIxzo5AvHITyq7FbiwbBCV+p3Np+nb3O EPrwRCWe8G+eGOtDN5BRIrSqPN2nmMbh+B0jG1qxiHawH5MQySdCCYIPDqNJNtY/izxb+IZHgIfsF Q4yIA7swGBFXcSDT9Idr4oGHokdhqncTPO9uaY+SFMv6GF5jFpilBm9TgxdN98OTLdXQ+dmXpnchS aF9utS8klHI5X+FGras4Q6dTn7D6qY60X4+b6NgEgJvG6SvviDGlzzdpIFoTe0QMlMg9gv8UW//u+ w/AJ+cenSHZho7NNzA0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3ump-00000006ogm-2Sua; Mon, 06 May 2024 09:37:32 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umj-00000006oak-46hy; Mon, 06 May 2024 09:37:27 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a51f9ad7684so165782866b.2; Mon, 06 May 2024 02:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988243; x=1715593043; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IN8AzJhjBwWtAAosg/wWfPeK9DB1fotvNa0tcVkBcLc=; b=Xo/gnW6RIlu7AFU5ui1QgrdkA28K9c8GBdJ9vCo3qBXEP7Io4k4/LWm0yKQNcm4Qf4 W+s2DH2NkvvUvU63ehuYw5KItAZScdGqCUOdW2qQjVm0ON07QwlSOuNecvVgZjQRVytA gRrk1hZIAREyjbCL0Cpkf9U7UwgZRmAEa7r2omhQ7xwJTriT4ZLpBY/fKX+bzkoNn+yo cGzoNUkD+1Yigpsiw9yCLqVr5AOoUF0FeV3QHsM8iTh7Z7/fRK8fZ2n+Uf3JMdoaAfs9 RN14K8QmpmcCujE9EqamBzqJusbJgKQ75UWn2x+3RiA1g36lNWaVsOwHSUTiWOctLJ73 lSNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988243; x=1715593043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IN8AzJhjBwWtAAosg/wWfPeK9DB1fotvNa0tcVkBcLc=; b=IdLhtvBvHtNULsjvWrQEL79GqAImP+3t0fdp8KVKr2kDkJdp2uirSmcO6yC3o5FrCa SzLvZ0pHq0STOMer6AJ4skvcVmYDvhZwahQ8JDWvKpzZQLdcYWkxE3GUeDIcaF8YFvMB nxE7MMO6KsjaO4KDBEAGj0Y+MjrOqm0mJZ+27Mfcpridj4/Jxo+nHC/gTAlRpSQ2g7iu CZH0MzEW0QJ7pTNYASS4qQyzAP0euChG7uTJX72i67JUQUUg/RNeJrFeHd6uidILO622 2N0QSJQ8hSXkISdBlW+ustyW6THQZiLKMKQe9z4DnM46Cvkzk1wdghFsfbqDiNkblfMo lx7w== X-Forwarded-Encrypted: i=1; AJvYcCVoK2+C0nrd1/EgzxAdr/YseK0sWikzuDyjEboQcqvk+W0zYJssv8/k4fzdA+kj0JRT4P++SQ/YERRIdI64mxYTyWerKY2rGxwT1omvI0RHQaX8h5KWXJKfZVBaqDcDvNmvCh2hdqUOhS8zIt7pdITB/bHd92b90Cw= X-Gm-Message-State: AOJu0YwSFiGlt1Y1maSqqn4vjLJSExI+R335zUvSu2pfHvn+870U8s9Z rpSqRuUlwrBoZMnZWbJzBtRk3VfnPC6YsJJWRiyizUosAC60zVTc X-Google-Smtp-Source: AGHT+IGcY5JPNQmvChpfcdsIQTFh32yMe02GUq9RVZ7zy32Rbqb4gkVD+R9OuRJFJ0k/WupnQcSi9g== X-Received: by 2002:a05:6402:7cb:b0:572:d4fc:cc7 with SMTP id u11-20020a05640207cb00b00572d4fc0cc7mr6753577edy.12.1714988243075; Mon, 06 May 2024 02:37:23 -0700 (PDT) Received: from [172.30.32.119] ([2001:8f8:183b:f2c::d35]) by smtp.gmail.com with ESMTPSA id f6-20020a056402160600b005722ce89ae2sm4983647edv.38.2024.05.06.02.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:22 -0700 (PDT) From: Alexey Charkov Date: Mon, 06 May 2024 13:36:35 +0400 Subject: [PATCH v4 4/6] arm64: dts: rockchip: enable automatic fan control on Rock 5B MIME-Version: 1.0 Message-Id: <20240506-rk-dts-additions-v4-4-271023ddfd40@gmail.com> References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> In-Reply-To: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988224; l=1732; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=M2euxf6Q8SBg4Hukc8wh3jha9LlUxWfNoH85/fD9b74=; b=MahjJ0I2pQJ4AW3JzNQC9fccwUyhos/l9FLjyPDexr0mdVocKlMIJIoQ564q3b6hHPkFvMV06 d43aMKeL9/xCskjRFLK+lSYGdbjw526FpglZ7y4rHmfArWI/C/9Otwf X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_023726_093305_97D4AC05 X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This links the PWM fan on Radxa Rock 5B as an active cooling device managed automatically by the thermal subsystem, with a target SoC temperature of 65C and a minimum-spin interval from 55C to 65C to ensure airflow when the system gets warm Helped-by: Dragan Simic Reviewed-by: Dragan Simic Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts | 30 ++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index 21e96c212dd8..b70313643af8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -52,7 +52,7 @@ led_rgb_b { fan: pwm-fan { compatible = "pwm-fan"; - cooling-levels = <0 95 145 195 255>; + cooling-levels = <0 120 150 180 210 240 255>; fan-supply = <&vcc5v0_sys>; pwms = <&pwm1 0 50000 0>; #cooling-cells = <2>; @@ -279,6 +279,34 @@ i2s0_8ch_p0_0: endpoint { }; }; +&package_thermal { + polling-delay = <1000>; + + trips { + package_fan0: package-fan0 { + temperature = <55000>; + hysteresis = <2000>; + type = "active"; + }; + package_fan1: package-fan1 { + temperature = <65000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&package_fan0>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + map2 { + trip = <&package_fan1>; + cooling-device = <&fan 2 THERMAL_NO_LIMIT>; + }; + }; +}; + &pcie2x1l0 { pinctrl-names = "default"; pinctrl-0 = <&pcie2_0_rst>; From patchwork Mon May 6 09:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13655219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19E71C25B5C for ; Mon, 6 May 2024 09:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TOqhYlbbxADxGaKlrMEyi67NyETrLYKnssa0uKeigjM=; b=EtA61HerO9Nuig uZC8M0XVfCNLmE6iAWCljCwD4v6yP/CaEowiDj9WLzUSR4Y1s6M6o+y7nQ7L0eE9ceuLOVC2jMy6b 4YjWlhzxkazlWnBEuWirq6U6h0l+O4EkBGMGixxiccxKeKCXpBDSXmQYYyAPz56wzdZSvtBI/5qbE VgzkhTmcjWBX+4PijgIZjdUWyUN3X9DsG85iwe96rBqCnIxGs9ntDFAl2SUmwkAUmrtlknYnyedJP mLZH+Bsg7w8BhGcAJcGXrL8/keujFobzG09bsjTi5Jzt/nUOnqOUftPZoQmJ65/KSTgIhiPjya6rM dM34tHANhdxEYkVuehbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umv-00000006olI-1AUN; Mon, 06 May 2024 09:37:37 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umm-00000006ocw-0sT3; Mon, 06 May 2024 09:37:31 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a59cc765c29so181656766b.3; Mon, 06 May 2024 02:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988247; x=1715593047; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YwJQ8VUdBqnfny8gTVz/c10Fv5YxuURKySJ0zdXA/+A=; b=SMCwx6Xh72PrPCCmh7Rhar9xIY5v9K9y2r00JWtgfPPbOLsXYNMCG3rHTNKW9+0i7U 1U9Nq1aipuiGqtwy1UbgemkLlm1exbESOrCppDlqExWO7GK2HRNZcP+5ZpHcBxuX0cyS g15zFHtbyBO/Ua06NmDkp65XLQjH4Fdg1Uo3kcq1v4tQ+ucE66EjNjFTv5PW2ktQCwgC ea/nOCqrzC7zov6xunnNcteA1hoThhspNJokHJD5jLl+xdPY8uPhi50oI2PVSX1qtLdw rbnWljEtfbtoKa4Qz1tyvS8db2sgsrHXBqSvh+VSQIZxdZ+gYvHOPio/JGh3a6At1jcR Mg7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988247; x=1715593047; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YwJQ8VUdBqnfny8gTVz/c10Fv5YxuURKySJ0zdXA/+A=; b=cHW/WGTLMvIQXTP0kVOjskRZ/3DS1itfaAV6TuiGx9c9zBVufV3iWc4ILUpXXia0s6 6KUIswYcTPzwgoj0kGc6BaMQl12UbjbINEHqt+jaejpod+fxrK6lViNWbq5ife+w53sq 8bzWuaUKi+Hn0zForLzgZEjOr0E4D3O1CmyGNvCw/9SY1vgxVcNCh//mwJelARhsb2y1 +sk62OBNXOZP/fnMeX2K50ikd8o/G4/ew1f6QUfikMNhmhlalTwBdyZO7bOitxfBBNzJ h0vFWAbtJluQ9bV3+7RlU46YqfK3MrUn9ojAcREIrQX6JghurF1JbG6RYLoHNLzSP4KP zeWQ== X-Forwarded-Encrypted: i=1; AJvYcCUyQOJel2XsJ7Bon/idgStM5Tmu6VqFyUfnf5BrCR4JN4kLk+xVEeOETrWT+EFy58dAmtgOtxuMKn5yATO7mSbb/WeKpBK6iP1TtBLEx6z70bORx152ArMgzMvMJ/gCLsokqaX9IFbsROubNXgxHwB1e6M6bz/siGM= X-Gm-Message-State: AOJu0YwbP5lgPehG1maq3T5zNVgwtQyETay5Y+tXqJN9GffhqAEONAOG XqxNmFrccclVnwRH9+fJrn27vnvM+KGLN+2A+03fq70m5y7nvp8c X-Google-Smtp-Source: AGHT+IGl5bNbGtIncVQHCuVr3453VDHFLfzpkdJaqPBXiJN/wYUafW4SauUKLhdoaGhtK9C1HFhj4w== X-Received: by 2002:a50:ab1a:0:b0:572:a16f:29b with SMTP id s26-20020a50ab1a000000b00572a16f029bmr5508587edc.16.1714988246738; Mon, 06 May 2024 02:37:26 -0700 (PDT) Received: from [172.30.32.119] ([2001:8f8:183b:f2c::d35]) by smtp.gmail.com with ESMTPSA id f6-20020a056402160600b005722ce89ae2sm4983647edv.38.2024.05.06.02.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:26 -0700 (PDT) From: Alexey Charkov Date: Mon, 06 May 2024 13:36:36 +0400 Subject: [PATCH v4 5/6] arm64: dts: rockchip: Add CPU/memory regulator coupling for RK3588 MIME-Version: 1.0 Message-Id: <20240506-rk-dts-additions-v4-5-271023ddfd40@gmail.com> References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> In-Reply-To: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988224; l=5927; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=hRIkjs6ilNO5CkTYJyMd31t+JYZiL+ZsbuuDrU+GbqI=; b=XVssbaVtYFgNJD/XqYSrTYailN5Ixj2qPGOg//g6Locd7JznRCRUL/ireurFFFp18tnJlooDf tXw2RHepzHuAmunHqLkS8cBfLNJvwfiLch3E3gsH6QRKwVokgZS+b30 X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_023728_558276_BCBB276D X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org RK3588 chips allow for their CPU cores to be powered by a different supply vs. their corresponding memory interfaces, and two of the boards currently upstream do that (EVB1 and QuartzPro64). The voltage of the memory interface though has to match that of the CPU cores that use it, which downstream kernels achieve by the means of a custom cpufreq driver which adjusts both at the same time. It seems that regulator coupling is a more appropriate generic interface for it, so this patch introduces coupling to affected device trees to ensure that memory interface voltage is also updated whenever cpufreq switches between CPU OPPs. Note that other boards, such as Radxa Rock 5B, define both the CPU and memory interface regulators as aliases to the same DT node, so this doesn't apply there. Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts | 12 ++++++++++++ arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts index 7c3696a3ad3a..00f660d50127 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts @@ -878,6 +878,8 @@ regulators { vdd_cpu_big1_s0: dcdc-reg1 { regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big1_mem_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <550000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -890,6 +892,8 @@ regulator-state-mem { vdd_cpu_big0_s0: dcdc-reg2 { regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big0_mem_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <550000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -902,6 +906,8 @@ regulator-state-mem { vdd_cpu_lit_s0: dcdc-reg3 { regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_lit_mem_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <550000>; regulator-max-microvolt = <950000>; regulator-ramp-delay = <12500>; @@ -926,6 +932,8 @@ regulator-state-mem { vdd_cpu_big1_mem_s0: dcdc-reg5 { regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big1_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <675000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -939,6 +947,8 @@ regulator-state-mem { vdd_cpu_big0_mem_s0: dcdc-reg6 { regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big0_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <675000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -963,6 +973,8 @@ regulator-state-mem { vdd_cpu_lit_mem_s0: dcdc-reg8 { regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_lit_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <675000>; regulator-max-microvolt = <950000>; regulator-ramp-delay = <12500>; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts b/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts index b4f22d95ac0e..baeb08d665c7 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts @@ -832,6 +832,8 @@ vdd_cpu_big1_s0: dcdc-reg1 { regulator-name = "vdd_cpu_big1_s0"; regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big1_mem_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <550000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -845,6 +847,8 @@ vdd_cpu_big0_s0: dcdc-reg2 { regulator-name = "vdd_cpu_big0_s0"; regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big0_mem_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <550000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -858,6 +862,8 @@ vdd_cpu_lit_s0: dcdc-reg3 { regulator-name = "vdd_cpu_lit_s0"; regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_lit_mem_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <550000>; regulator-max-microvolt = <950000>; regulator-ramp-delay = <12500>; @@ -884,6 +890,8 @@ vdd_cpu_big1_mem_s0: dcdc-reg5 { regulator-name = "vdd_cpu_big1_mem_s0"; regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big1_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <675000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -898,6 +906,8 @@ vdd_cpu_big0_mem_s0: dcdc-reg6 { regulator-name = "vdd_cpu_big0_mem_s0"; regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_big0_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <675000>; regulator-max-microvolt = <1050000>; regulator-ramp-delay = <12500>; @@ -924,6 +934,8 @@ vdd_cpu_lit_mem_s0: dcdc-reg8 { regulator-name = "vdd_cpu_lit_mem_s0"; regulator-always-on; regulator-boot-on; + regulator-coupled-with = <&vdd_cpu_lit_s0>; + regulator-coupled-max-spread = <10000>; regulator-min-microvolt = <675000>; regulator-max-microvolt = <950000>; regulator-ramp-delay = <12500>; From patchwork Mon May 6 09:36:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13655220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D110CC10F16 for ; Mon, 6 May 2024 09:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=48gprz1v2aGh4kVd4qfNW4r5FhUaaUJbAD6X858yldw=; b=DDTYm2F0uIjK92 lqu7v3YTOHQPO7Z5VUQyUR202tKRWA4kfFVPy+Qt7WvyuQ/JYEKKoEYb2Ati9KtNC+nCxnEmR9uQl 6K0V5MyKHL8OEx7erLIdoQdNBfB0K/q9Ja1vydqr/2/Jl4COmNfhdEA0un4w8N+ccuc+ab0LcrqoA Ea/8yC+MsWoZalFGZKwtlho2iXPxzMRKSfn8YXk8z9ZYnEqR1gXBTQ45a3fnrY5CR9bjYnZ76lvqz lI3lRyRbDL0B39PVELzFYo6XRUnK4RXEHn6gfJj8KlVKyREMw+0mdfbYMoV0H+wvaABImEyshqG22 fsM3t99vVqfebWYARlAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3un5-00000006oub-1nKq; Mon, 06 May 2024 09:37:47 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3umr-00000006ogl-3qtO; Mon, 06 May 2024 09:37:40 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2dd7e56009cso22355621fa.3; Mon, 06 May 2024 02:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988250; x=1715593050; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YJ/i9aSextJBDewJyOG1hC8/ORRuaV5BU0FGPlg+ibI=; b=cnEOOCimDOK2PL5Zvyqrcc44/RQ6eedMFx3XEspxQ2XrUFMATKVkj6t/8aPmYalugV xfZSDuYXUDziPKlwoFe5p9LddnsVi4jTCwdM8v3KKY099dA0LQNIahP/lOFZdZoYjgKe nnaEYArE1ErFDa5ConcVTE/KQsFk6v/G5ii2z3m0wS3XMPDPeCTuHj8fzfe+zT23M5nl nx4/GAMzz7cZuXXlBNhQa1nVTIP735a8s/Rx6HgwGMT5lggw7GR9JTDJbuqAwrjhceTd pDqluwkMmwfDI06FG70oWWC517W4UguScFZID0MtppYZIjDmbhNrQLYpOii8JsIsy/W1 9P7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988250; x=1715593050; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YJ/i9aSextJBDewJyOG1hC8/ORRuaV5BU0FGPlg+ibI=; b=eLsOmmCtrlHI4lrl05C0umeNoYHOVrEBY1KXDErqx5wZlA2nodO6vH+WRYHgU01omE UzNXfNBv40UI9rD198pzT0tb2YJMaRTDet8M9zhCoNUH3kPNW35xil5Qz3vhldE+/pWY vcFacmRCPtK400Qzyr0fASf30/JxayWFU4u3lW5SY0IUe1O8JYthDfGsRgOUdX8xnlB6 X9RQWt//nE81+Em9tNWjGU55RBmDSMI9CAMUq210wbsGxopKcNm5XLbLtDRUfbXeQJQt aN+ntb23n/5LK4XAL4IrdBxh7bCwXB4faWN4P1zE5YPn3rifsRk2CU5mWh3cnjjIFRlz dCgw== X-Forwarded-Encrypted: i=1; AJvYcCWgWNaIhGz4T/RXP1nJhFvQu9j+5222usF+UUBULJ9+cgWB4bDgaWIHXi8wGtQjwxSIDmXWQ05LTbmZ2/qNtQVFHsVoBuouJ7+be3MJczHRydYNoGWXG11x+pKmbMhZcE6LRV8wacXrnIhrWowDh4AbJ2d2X/jk+Vo= X-Gm-Message-State: AOJu0YwRuLxQGBgT1wGcpYXyjki46hOFOqhavORhyYUxEFkyWAINaG3+ gynFB0aAIDIaus/nmc8sWaFP+8PIUcZH+0Zf+XO7GKwE6kqtHvL7 X-Google-Smtp-Source: AGHT+IGmDp3zClvpYcSZX9BMZ5alfu+DnAeI8C/Ka2kdqS+p80hCz9EVcR9O2B0IHmViYyKyuGF0Gg== X-Received: by 2002:a19:381a:0:b0:51d:3b87:70a6 with SMTP id f26-20020a19381a000000b0051d3b8770a6mr7073690lfa.13.1714988250256; Mon, 06 May 2024 02:37:30 -0700 (PDT) Received: from [172.30.32.119] ([2001:8f8:183b:f2c::d35]) by smtp.gmail.com with ESMTPSA id f6-20020a056402160600b005722ce89ae2sm4983647edv.38.2024.05.06.02.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:29 -0700 (PDT) From: Alexey Charkov Date: Mon, 06 May 2024 13:36:37 +0400 Subject: [PATCH v4 6/6] arm64: dts: rockchip: Add OPP data for CPU cores on RK3588 MIME-Version: 1.0 Message-Id: <20240506-rk-dts-additions-v4-6-271023ddfd40@gmail.com> References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> In-Reply-To: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714988225; l=7420; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=u0gM6tgf6YzJQvPrv4bbdJjzpHgMPBoZnVPNA5o69i0=; b=NfzFHVbPxKtMkrjMx7ITPK0l9dIz6TK3LMlotIOo6u548b6Xuf0R6hhxasx1fOlIhVYKEcYv/ J0vR7Nvg0SADzl2KsFF5wijg/ZINprMkziy6RTlh00QO7fHZLtRxYeE X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_023734_160009_B238B1E8 X-CRM114-Status: GOOD ( 15.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org By default the CPUs on RK3588 start up in a conservative performance mode. Add frequency and voltage mappings to the device tree to enable dynamic scaling via cpufreq. OPP values are adapted from Radxa's downstream kernel for Rock 5B [1], stripping them down to the minimum frequency and voltage combinations as expected by the generic upstream cpufreq-dt driver, and also dropping those OPPs that don't differ in voltage but only in frequency (keeping the top frequency OPP in each case). Note that this patch ignores voltage scaling for the CPU memory interface which the downstream kernel does through a custom cpufreq driver, and which is why the downstream version has two sets of voltage values for each OPP (the second one being meant for the memory interface supply regulator). This is done instead via regulator coupling between CPU and memory interface supplies on affected boards. This has been tested on Rock 5B with u-boot 2023.11 compiled from Collabora's integration tree [2] with binary bl31 and appears to be stable both under active cooling and passive cooling (with throttling) [1] https://github.com/radxa/kernel/blob/stable-5.10-rock5/arch/arm64/boot/dts/rockchip/rk3588s.dtsi [2] https://gitlab.collabora.com/hardware-enablement/rockchip-3588/u-boot Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 122 ++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 57c2d998ae75..85c25d5efdad 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -97,6 +97,7 @@ cpu_l0: cpu@0 { clocks = <&scmi_clk SCMI_CLK_CPUL>; assigned-clocks = <&scmi_clk SCMI_CLK_CPUL>; assigned-clock-rates = <816000000>; + operating-points-v2 = <&cluster0_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <32768>; i-cache-line-size = <64>; @@ -116,6 +117,7 @@ cpu_l1: cpu@100 { enable-method = "psci"; capacity-dmips-mhz = <530>; clocks = <&scmi_clk SCMI_CLK_CPUL>; + operating-points-v2 = <&cluster0_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <32768>; i-cache-line-size = <64>; @@ -135,6 +137,7 @@ cpu_l2: cpu@200 { enable-method = "psci"; capacity-dmips-mhz = <530>; clocks = <&scmi_clk SCMI_CLK_CPUL>; + operating-points-v2 = <&cluster0_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <32768>; i-cache-line-size = <64>; @@ -154,6 +157,7 @@ cpu_l3: cpu@300 { enable-method = "psci"; capacity-dmips-mhz = <530>; clocks = <&scmi_clk SCMI_CLK_CPUL>; + operating-points-v2 = <&cluster0_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <32768>; i-cache-line-size = <64>; @@ -175,6 +179,7 @@ cpu_b0: cpu@400 { clocks = <&scmi_clk SCMI_CLK_CPUB01>; assigned-clocks = <&scmi_clk SCMI_CLK_CPUB01>; assigned-clock-rates = <816000000>; + operating-points-v2 = <&cluster1_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <65536>; i-cache-line-size = <64>; @@ -194,6 +199,7 @@ cpu_b1: cpu@500 { enable-method = "psci"; capacity-dmips-mhz = <1024>; clocks = <&scmi_clk SCMI_CLK_CPUB01>; + operating-points-v2 = <&cluster1_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <65536>; i-cache-line-size = <64>; @@ -215,6 +221,7 @@ cpu_b2: cpu@600 { clocks = <&scmi_clk SCMI_CLK_CPUB23>; assigned-clocks = <&scmi_clk SCMI_CLK_CPUB23>; assigned-clock-rates = <816000000>; + operating-points-v2 = <&cluster2_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <65536>; i-cache-line-size = <64>; @@ -234,6 +241,7 @@ cpu_b3: cpu@700 { enable-method = "psci"; capacity-dmips-mhz = <1024>; clocks = <&scmi_clk SCMI_CLK_CPUB23>; + operating-points-v2 = <&cluster2_opp_table>; cpu-idle-states = <&CPU_SLEEP>; i-cache-size = <65536>; i-cache-line-size = <64>; @@ -348,6 +356,120 @@ l3_cache: l3-cache { }; }; + cluster0_opp_table: opp-table-cluster0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <675000 675000 950000>; + clock-latency-ns = <40000>; + }; + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <712500 712500 950000>; + clock-latency-ns = <40000>; + }; + opp-1416000000 { + opp-hz = /bits/ 64 <1416000000>; + opp-microvolt = <762500 762500 950000>; + clock-latency-ns = <40000>; + opp-suspend; + }; + opp-1608000000 { + opp-hz = /bits/ 64 <1608000000>; + opp-microvolt = <850000 850000 950000>; + clock-latency-ns = <40000>; + }; + opp-1800000000 { + opp-hz = /bits/ 64 <1800000000>; + opp-microvolt = <950000 950000 950000>; + clock-latency-ns = <40000>; + }; + }; + + cluster1_opp_table: opp-table-cluster1 { + compatible = "operating-points-v2"; + opp-shared; + + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <675000 675000 1000000>; + clock-latency-ns = <40000>; + }; + opp-1416000000 { + opp-hz = /bits/ 64 <1416000000>; + opp-microvolt = <725000 725000 1000000>; + clock-latency-ns = <40000>; + }; + opp-1608000000 { + opp-hz = /bits/ 64 <1608000000>; + opp-microvolt = <762500 762500 1000000>; + clock-latency-ns = <40000>; + }; + opp-1800000000 { + opp-hz = /bits/ 64 <1800000000>; + opp-microvolt = <850000 850000 1000000>; + clock-latency-ns = <40000>; + }; + opp-2016000000 { + opp-hz = /bits/ 64 <2016000000>; + opp-microvolt = <925000 925000 1000000>; + clock-latency-ns = <40000>; + }; + opp-2208000000 { + opp-hz = /bits/ 64 <2208000000>; + opp-microvolt = <987500 987500 1000000>; + clock-latency-ns = <40000>; + }; + opp-2400000000 { + opp-hz = /bits/ 64 <2400000000>; + opp-microvolt = <1000000 1000000 1000000>; + clock-latency-ns = <40000>; + }; + }; + + cluster2_opp_table: opp-table-cluster2 { + compatible = "operating-points-v2"; + opp-shared; + + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <675000 675000 1000000>; + clock-latency-ns = <40000>; + }; + opp-1416000000 { + opp-hz = /bits/ 64 <1416000000>; + opp-microvolt = <725000 725000 1000000>; + clock-latency-ns = <40000>; + }; + opp-1608000000 { + opp-hz = /bits/ 64 <1608000000>; + opp-microvolt = <762500 762500 1000000>; + clock-latency-ns = <40000>; + }; + opp-1800000000 { + opp-hz = /bits/ 64 <1800000000>; + opp-microvolt = <850000 850000 1000000>; + clock-latency-ns = <40000>; + }; + opp-2016000000 { + opp-hz = /bits/ 64 <2016000000>; + opp-microvolt = <925000 925000 1000000>; + clock-latency-ns = <40000>; + }; + opp-2208000000 { + opp-hz = /bits/ 64 <2208000000>; + opp-microvolt = <987500 987500 1000000>; + clock-latency-ns = <40000>; + }; + opp-2400000000 { + opp-hz = /bits/ 64 <2400000000>; + opp-microvolt = <1000000 1000000 1000000>; + clock-latency-ns = <40000>; + }; + }; + display_subsystem: display-subsystem { compatible = "rockchip,display-subsystem"; ports = <&vop_out>;