From patchwork Wed Nov 30 14:16:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13059961 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 0918FC4332F for ; Wed, 30 Nov 2022 14:18:03 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1gm5bGREpN06SwvNsJvErkVp43bF6ZK/wl8n1DTPjmc=; b=4zQEqX1jwxvo8Q H//r0oYooyU0m9DmszMZRXi0C7Ky2G2MV4XAdYcpFak1FaLjUL7hv/a+GzIwWXXUsCsR3beFNtYfC GY3cknExEbFGj2UEZ4FXVrDxhy1CMYrLb4TrJylCyMnEVgdwktrNRUtbK9eihQjImz8Xxw39a4BES car1hTCdp0sgOnrXMRATnJQUGTsz2pHj1gBhQHEJQPDAZ7wBpfdwojGqj2n1jrpcabEWJ9OGhnBfS nlIfwKRtoBTGtHNg2b5WgbMqszazV7apK/vqZLw5MuzjWkaPKN9S3P9/H/W4oX3eu3PbgOD+mwStl 0c+nHf2o+9goSHO7iVcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0NtD-00Gnlr-Du; Wed, 30 Nov 2022 14:16:44 +0000 Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0Nt4-00Gnb6-Nl for linux-arm-kernel@lists.infradead.org; Wed, 30 Nov 2022 14:16:37 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:3c4f:c29d:dee7:957c]) by michel.telenet-ops.be with bizsmtp id qeGG2800H1wQlgf06eGG1T; Wed, 30 Nov 2022 15:16:18 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1p0Nsm-0028RH-5F; Wed, 30 Nov 2022 15:16:16 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1p0Nsl-003ruc-OB; Wed, 30 Nov 2022 15:16:15 +0100 From: Geert Uytterhoeven To: Magnus Damm Cc: Tho Vu , Viresh Kumar , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH] arm64: dts: renesas: r8a779f0: Add CA55 operating points Date: Wed, 30 Nov 2022 15:16:13 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221130_061634_989967_AE8DBF64 X-CRM114-Status: GOOD ( 14.02 ) 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 Add operating points for running the Cortex-A55 CPU cores on R-Car S4-8 at various speeds, up to the maximum supported frequency (1200 MHz). R-Car S4-8 has 8 Cortex-A55 cores, grouped in 4 clusters. CA55 Sub-System 0 (first 2 clusters / CPU cores 0-3) is clocked by Z0φ. CA55 Sub-System 1 (last 2 clusters / CPU cores 4-7) is clocked by Z1φ. As the two sets of clusters are driven by separate clocks, this requires specifying two separate tables (using the same operating performance point values), with "opp-shared" to indicate that the CPU cores in each set share state. Based on a patch in the BSP by Tho Vu. Signed-off-by: Geert Uytterhoeven Acked-by: Viresh Kumar --- To be queued in renesas-devel for v6.3. Changes compared to the BSP: - Use two tables. Tested on the Renesas Spider development board by using the CPUfreq userspace governor, writing the desired CPU clock rate to the CPUfreq policy's "scaling_setspeed" file in sysfs, verifying the clock rate of the Z0φ and Z1φ clocks in debugfs, and running the dhrystones benchmark on the various CPU cores. The Linux cpufreq driver creates two policies under /sys/devices/system/cpu/cpufreq/: "policy0" and "policy4". With a single table and "opp-shared", only "policy0" would be created, and clock Z1φ would never be changed. With a single table and without "opp-shared", 8 policies would be created, and the rate of clocks Z0φ and Z1φ would reflect the value for the last touched CPU core from the corresponding set. --- arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 62 +++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi index 67a4f2d4480d8450..ac294168c86785db 100644 --- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi @@ -14,6 +14,60 @@ / { #address-cells = <2>; #size-cells = <2>; + cluster01_opp: opp-table-0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + }; + opp-800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + }; + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + }; + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + opp-suspend; + }; + }; + + cluster23_opp: opp-table-1 { + compatible = "operating-points-v2"; + opp-shared; + + opp-500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + }; + opp-800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + }; + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + }; + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <880000>; + clock-latency-ns = <500000>; + opp-suspend; + }; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -65,6 +119,7 @@ a55_0: cpu@0 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>; + operating-points-v2 = <&cluster01_opp>; }; a55_1: cpu@100 { @@ -76,6 +131,7 @@ a55_1: cpu@100 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>; + operating-points-v2 = <&cluster01_opp>; }; a55_2: cpu@10000 { @@ -87,6 +143,7 @@ a55_2: cpu@10000 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>; + operating-points-v2 = <&cluster01_opp>; }; a55_3: cpu@10100 { @@ -98,6 +155,7 @@ a55_3: cpu@10100 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>; + operating-points-v2 = <&cluster01_opp>; }; a55_4: cpu@20000 { @@ -109,6 +167,7 @@ a55_4: cpu@20000 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>; + operating-points-v2 = <&cluster23_opp>; }; a55_5: cpu@20100 { @@ -120,6 +179,7 @@ a55_5: cpu@20100 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>; + operating-points-v2 = <&cluster23_opp>; }; a55_6: cpu@30000 { @@ -131,6 +191,7 @@ a55_6: cpu@30000 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>; + operating-points-v2 = <&cluster23_opp>; }; a55_7: cpu@30100 { @@ -142,6 +203,7 @@ a55_7: cpu@30100 { enable-method = "psci"; cpu-idle-states = <&CPU_SLEEP_0>; clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>; + operating-points-v2 = <&cluster23_opp>; }; L3_CA55_0: cache-controller-0 {