From patchwork Mon Jun 17 18:28:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13701240 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 CF469C2BA1A for ; Mon, 17 Jun 2024 18:30:22 +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=TkxUy/5lC8B4EHt3jUU6t2bACBlLZbsq1+k9d7XvKAE=; b=oAgRQehFMJLnMD +O+WhQcrML/VHYqn1y1HlpTdChylThomMEY7l54U6Drz+j4SIvL5GCBVeeaoobi5dIXeI9RylqOE3 XMPj8qjqmZfu1k3YN+TVTjotfg4VPKcKQsYOQexaN8tK13eBOQQ0DkShmYvqUY6EOqlVCwZG8vqqp BgYkmkcGgWIZEq4H6ddY3MBJr9hDfw3dmlvHg6Y1pzCqfvPa3ibB4p5cqN5kwOy2XscEx/gXymi+e 2S/lUWf6ZT3nGpJu7GKX/3tNwbE5Xjq35B9Llj+9hac1+i227EW1BKBQr462Vs8GUXVQRMspMHXIz d45OTW6O3gml/JYVRiDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJH7U-0000000CBNQ-00K9; Mon, 17 Jun 2024 18:30:20 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJH6v-0000000CAyO-0i1r; Mon, 17 Jun 2024 18:29:51 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ec002caf3eso77783061fa.1; Mon, 17 Jun 2024 11:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718648983; x=1719253783; 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=bdw9hr2E9oUOwrjNMHx+TgoMIxb4y1m0pUnscfpkFu0=; b=YIXR+XvKpqW5gDumR632gvt261PCgME0n9uUqp0wy0NNl+M6R5BsQpERu8Dul85fNk 5t8p9QAS0zbQ1VVzEdOgaMhVuh+WMHK5wAL9QKGSrR6niaSh5Jup9oeoJz3uVG2+9JWX X2PR+RlDxK6a+/4v2dq54ukFJ+pIG8P0GvJKr/v4En+UGEApZkjYbjrpPKB80bp1XEu+ uMLCEsxIX5nsZAFpiNZD5QgyM0a30JpHtZprYXFEH6CQ9Enl/lf67neorYj78MPlCcFQ +AQtuFobK/vjmqCpInQLdl5uBGh4CivS5Td2JkiMxDsUPUiRwvHeLJr02MgBLF+0+hFM YbvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718648983; x=1719253783; 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=bdw9hr2E9oUOwrjNMHx+TgoMIxb4y1m0pUnscfpkFu0=; b=QSmh8heTG9R1pALh63mw8hVKx+WrYCQnTmQA/HGumY9WK81GyRrBeg9UqGkAVQX0Bn vg0CgQIrhBo2Xnr5YnOZFQbjLlqM3oBeJDe9juR7Aez6mEX6UAm9HuvLkIL36D2e3Ymj tb0Oe6aI0S2PXzeF56k2rQVOAqv8/B4Ux3puJqGCxlhkdvjRToP1MPRO3OPJb7RVY2Ae VuBLzCQV+co780y6DbCq5m8GnLiuxheL68WUn2GsT37uBO02hBQNRXlzRcw5LNLU49S3 mZQGQVSJBAM8yuQ9TuL892SJM9b67SPzchU1QLEHb1OgoIRd3SS6nbMS0ReFOTB3z0bU ICNQ== X-Forwarded-Encrypted: i=1; AJvYcCW8IbRaRcl8x8L+ObYd2EXa+wkDAS8k7RNrkemRRPPfUkx2/Wb+elOyRlPJmhkmRY3tggk9SH9XgJxBV1w9SJHV8oZj1TEPMPBSsctQ8tvdllaU4BFu/m2NP4A5iC0yWaa1QS7pZqzQmD6SK93ZODNaPDxRlfFsvB8= X-Gm-Message-State: AOJu0YxYh1tfAUHM8xPgbGNMY0Xizx3EyhmKTvuopFdptETGezHMWlKm U2cBlfBRN1Bgx5xAll+V6AxlIfOZXHnCVeDse7fGkQz86wea4RKd X-Google-Smtp-Source: AGHT+IFmxp/6V4QXIWhNMCK24m/K84kyHPGSSNIJ/eXuISr4o3JyAQAFAvwChhtA+6vFzZy1ZH4S/A== X-Received: by 2002:a19:690b:0:b0:52c:8304:db31 with SMTP id 2adb3069b0e04-52ca6e67c17mr7849875e87.27.1718648983021; Mon, 17 Jun 2024 11:29:43 -0700 (PDT) Received: from latitude-fedora.lan ([2001:8f8:183b:6864::d35]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f8a6e58bdsm115397666b.187.2024.06.17.11.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 11:29:42 -0700 (PDT) From: Alexey Charkov Date: Mon, 17 Jun 2024 22:28:55 +0400 Subject: [PATCH v5 5/8] arm64: dts: rockchip: Add CPU/memory regulator coupling for RK3588 MIME-Version: 1.0 Message-Id: <20240617-rk-dts-additions-v5-5-c1f5f3267f1e@gmail.com> References: <20240617-rk-dts-additions-v5-0-c1f5f3267f1e@gmail.com> In-Reply-To: <20240617-rk-dts-additions-v5-0-c1f5f3267f1e@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=1718648960; l=5927; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=Lw6cvt6e5TFSBzp/kko3I8KOLayecFMagWIlbMmvaMY=; b=QfA4GQWUTiwN1V7Ur5GD7HfKSzVBRXt2ENXTozT4AWKRGyFMO65b44VPlh7M5224KRGomKrcV mNfqhWvuQV0A8KZRhS8g0xLKAmrJjAr0Sin1g6LNQ3ywZ88nhRUBecG 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-20240617_112945_370439_C553489C X-CRM114-Status: GOOD ( 12.62 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=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>;