Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp101791lqc; Thu, 29 Feb 2024 11:28:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUBv0ox89UDtTSoEnVXC16HTGMCMUKCOzMD5lurWdKT3LVpvafEaWA4bbC1tu/qxaSDBf+yyGLKBTreOJO/a6ejDHcY3FsUz4tVOfWk0g== X-Google-Smtp-Source: AGHT+IGVtKS+azqJuTZ9eD8mdaCYXplJ+7QBSsUf4qX/OHZM/x1+KJEfpefwLck88zZDFOx8ZdZy X-Received: by 2002:a05:6402:2156:b0:566:93d9:a184 with SMTP id bq22-20020a056402215600b0056693d9a184mr2220291edb.7.1709234913881; Thu, 29 Feb 2024 11:28:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709234913; cv=pass; d=google.com; s=arc-20160816; b=pYVydSxBSFqbKxFBVnK7a9f5E8JTBZsNglD6WBRYsrCzdAWTJXwDH8NqtPelPPRmsT gQoAz6ALBCPfYkD1PvXP9iOH7CZ9fc0MXcWrIPICyxpPaGvYtY9ocMu7al1g6+ZBC+yD AaPdqMUXdpm+gH3esA4oYiPDJFrcHWjcul+/bouxZ8xARcRAuHo0KNd8/9mU0TTKs1Op SlhI6VkwsetZGXSQlQXqFgNuNak32l/k+CKvx9OJE8dJyPu3xvjnIv8WU3wiFe/S0Kas kSHrdPC04YeK/H6/U8Pq/D2//b+pTlGRsCDBfu2rVARhg+aC3mFy+C7Vm6R1Ci0q2OJ9 vn0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ZwVUPftNegb6HH4bYsAEUZGVb0uMfPEnr6vp5tlxDKo=; fh=PfhwbW3m7DVr4ekwXdlI92rEBnj4elBStcIPT7fJxIw=; b=ztdio9gOczqP1sXPae7/ABme+ica7F71IgdzuvJEefmj2WIzZn1/XptAifyFLovgcA ce23EaPpm8Z5maOhVd/NaZZj5rAyhjv6/wJww/vuWmJIT5Rwdq8Y5mL0vUmCJUkLS4Qz 5dqurZBO+f36fR2XjHMs92P1lqHNyh+VLn1AFPEAqggV5vT2bCut2kQcdcD1Z6f/Ow4w VoZwADoI4fWV3e4ZDUVVjbW4fEuoiQM47ZOykxBKtu7qSRNpAT4DBXWA/jHfGHjm3W6e ewNB2L3945T9RcTTLZhx4+rtfCdd3VvZ7eRBMsDjWuhkjtrHK1ZId0qpI1oaI61XJO1e JzOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LucdOhfy; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c8-20020aa7d608000000b00566bf12cf1bsi213254edr.270.2024.02.29.11.28.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:28:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87350-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LucdOhfy; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87350-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 71BD61F24645 for ; Thu, 29 Feb 2024 19:28:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A428D14291D; Thu, 29 Feb 2024 19:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LucdOhfy" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 98B621428FE; Thu, 29 Feb 2024 19:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709234836; cv=none; b=oqBZgdyc0Met/FEY7bpg4TR2rK7WtrEOwH66wFP9tpqrj2VDz/uoiczuWCtiy4IldiZ4WvDS+eT9fjPPVuLSiFbkN806VwFbRUQsuG3ZI9EhxLKmgiGebSaZesLgyEj+X9ttknRnSdEUawGsDPdLJgoXkNek7HICFCtwbmmgHVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709234836; c=relaxed/simple; bh=HqctyYsaxYWsfVb7+E0CHFs01nBeI4mecklDekwBdvM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LGN2JAGv6lAVb+KXZ/LUNotLOWJSj/xxfuxlJ3dD0tl/LqwAYNYm4jZicnMSTwZyI/8fMyYVQCL47aTW+8GiddHCg7aCKJVtlD3GVUmjAFa8DkOWgh2em7dZYebeMuOdBTLgykzwpLNFB7/+P0jXhGlADtenYt9xeFKOeW4na3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LucdOhfy; arc=none smtp.client-ip=209.85.128.52 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-f52.google.com with SMTP id 5b1f17b1804b1-412bb23e5c5so7332355e9.1; Thu, 29 Feb 2024 11:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709234832; x=1709839632; darn=vger.kernel.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=ZwVUPftNegb6HH4bYsAEUZGVb0uMfPEnr6vp5tlxDKo=; b=LucdOhfyXKHucI/KoayXmt5RXO9XEM6hcNXW1b/dQ97n1//VlCWUml3Y1G+phruBhJ VJAqlh12Z345rk/vJboR4xnTQRayUdka973rRhh56Kn+Ds11cpoBdS+L7sXHqveZNae+ L7lX+0vP2HaYd1xKj/3dfommgvm9mBkcq4iCkTM8BNwryy5IWbZWW4DT7uXsvf837fiC ISxSkymgzdO2xtsRRhhtl2S+XqqegsAJOpMdrfDbiLh0zdDoWIni9vKAzmFWTbLbrSac xpo66+s8MlG5PwraaNhmQSmjWra7KGniByEUTWkoVHiHfoPvvO/7ZF+IJDvgaQ9F5fh0 Hv9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709234832; x=1709839632; 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=ZwVUPftNegb6HH4bYsAEUZGVb0uMfPEnr6vp5tlxDKo=; b=MEflfdnIbnunFbaXXJMVeDNF7WEwK8g9Yti4qIThQNrffi8kUMZ0u0SRtki+ZrvzFg a+B8UR4eqJPR6BROt/pzjhay5a/q9DFyt07BeCg9vODCbWLf7Jozx8Zfgw50L/IiZv+C SfQVUYZS5OQoLyRo67EAjY7a1Gos+xDf0xbCnJ8RfWSGN6T/kM3VKphz4buOwynmcV/c phAfbqfNDA5E7gAkFcF3MVJ8gHssn8bL1PeiBOGwYwNrteZYKRMpPFyjRT3Y5iLbqPib FjHGuQz/sIbuVfrEaNSspThKlkMHsGNEzq0A/5XehQHm4ouTlFhKNQlb/Vfw2OwiiqRC PV6A== X-Forwarded-Encrypted: i=1; AJvYcCUDz0Do0jApvw/bT1kj9MbEHcD6+PX3N49eXsDKaDTN4eAYxBsjw/lHDI+4fQ5GeM9xJgPvj7tNmd+AUdr5mlAZsZi5ReyiHBzYj6y7oUR9bvlybG/RpS74AljKHxdLCo5QGgYdUGb4kg== X-Gm-Message-State: AOJu0Yzmwk8VP4uQC15WlDmU3aEzmhV6MVv/n5Rq/PPoiJmoGw+XWIYJ DZEmwj5L2Vh16TGvBFYceEhZMX8lV4W2zGC2l5Bxee0n6JZsXNcWnycaV13xVbmfyA== X-Received: by 2002:a05:600c:4749:b0:412:c379:606 with SMTP id w9-20020a05600c474900b00412c3790606mr831572wmo.2.1709234832258; Thu, 29 Feb 2024 11:27:12 -0800 (PST) Received: from [172.30.32.188] ([2001:8f8:183b:6ebc::d35]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c1c1400b00412bca49a5bsm2853944wms.42.2024.02.29.11.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:27:12 -0800 (PST) From: Alexey Charkov Date: Thu, 29 Feb 2024 23:26:35 +0400 Subject: [PATCH v3 4/5] arm64: dts: rockchip: Add OPP data for CPU cores on RK3588 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: 7bit Message-Id: <20240229-rk-dts-additions-v3-4-6afe8473a631@gmail.com> References: <20240229-rk-dts-additions-v3-0-6afe8473a631@gmail.com> In-Reply-To: <20240229-rk-dts-additions-v3-0-6afe8473a631@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , 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.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709234816; l=7377; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=HqctyYsaxYWsfVb7+E0CHFs01nBeI4mecklDekwBdvM=; b=IYPGKtGqei9coIZquJt1iE33PtngNeOPlB/ef9HB4xIjCSziIGRB8ptL33UMkddciAK3l4pds VG9L7idHWQAAxjgIXiVfMwhIq6g+NNrafoCbW8NrtVp4uhzEa4VB9M3 X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= 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 9bf197358642..bd39c5c47bfb 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>; + }; + }; + firmware { optee: optee { compatible = "linaro,optee-tz"; -- 2.44.0