From: Jonas Karlman <jonas@kwiboo.se>
To: Quentin Schulz <u-boot@0leil.net>,
Kever Yang <kever.yang@rock-chips.com>,
Tom Rini <trini@konsulko.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Lukasz Majewski <lukma@denx.de>, Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.u-boot-project.org, Jonas Karlman <jonas@kwiboo.se>
Subject: [PATCH 05/15] clk: rockchip: pll: Limit special rk3588_pll handling to RK3588
Date: Thu, 30 Jul 2026 14:12:54 +0000 [thread overview]
Message-ID: <20260730141308.1218014-6-jonas@kwiboo.se> (raw)
In-Reply-To: <20260730141308.1218014-1-jonas@kwiboo.se>
The rk3588_pll_set_rate() function contains special handling intended
only for PLLs on RK3588 that are also applied to PLLs on RK3576.
This special handling should ideally be moved from the common pll funcs
into the clk_rk3588 driver. Add IS_ENABLED() guards as an initial step
to limit this special handling to PLLs on RK3588 targets.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
drivers/clk/rockchip/clk_pll.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/rockchip/clk_pll.c b/drivers/clk/rockchip/clk_pll.c
index 5f035eb98adc..76276e1ac1f2 100644
--- a/drivers/clk/rockchip/clk_pll.c
+++ b/drivers/clk/rockchip/clk_pll.c
@@ -453,7 +453,7 @@ static int rk3588_pll_set_rate(struct rockchip_pll_clock *pll,
* When power on or changing PLL setting,
* we must force PLL into slow mode to ensure output stable clock.
*/
- if (pll_id == 3)
+ if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 3)
rk_clrsetreg(base + 0x84c, 0x1 << 1, 0x1 << 1);
if (!(pll->pll_flags & ROCKCHIP_PLL_FIXED_MODE)) {
@@ -461,15 +461,15 @@ static int rk3588_pll_set_rate(struct rockchip_pll_clock *pll,
pll->mode_mask << pll->mode_shift,
RKCLK_PLL_MODE_SLOW << pll->mode_shift);
}
- if (pll_id == 0)
+ if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 0)
rk_clrsetreg(base + RK3588_B0PLL_CLKSEL_CON(0),
pll->mode_mask << 6,
RKCLK_PLL_MODE_SLOW << 6);
- else if (pll_id == 1)
+ else if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 1)
rk_clrsetreg(base + RK3588_B1PLL_CLKSEL_CON(0),
pll->mode_mask << 6,
RKCLK_PLL_MODE_SLOW << 6);
- else if (pll_id == 2)
+ else if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 2)
rk_clrsetreg(base + RK3588_LPLL_CLKSEL_CON(5),
pll->mode_mask << 14,
RKCLK_PLL_MODE_SLOW << 14);
@@ -505,7 +505,7 @@ static int rk3588_pll_set_rate(struct rockchip_pll_clock *pll,
pll->mode_mask << pll->mode_shift,
RKCLK_PLL_MODE_NORMAL << pll->mode_shift);
}
- if (pll_id == 0) {
+ if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 0) {
rk_clrsetreg(base + RK3588_B0PLL_CLKSEL_CON(0),
pll->mode_mask << 6,
2 << 6);
@@ -515,7 +515,7 @@ static int rk3588_pll_set_rate(struct rockchip_pll_clock *pll,
rk_clrsetreg(base + RK3588_B0PLL_CLKSEL_CON(1),
RK3588_CORE_DIV_MASK << RK3588_CORE_B13_DIV_SHIFT,
0 << RK3588_CORE_B13_DIV_SHIFT);
- } else if (pll_id == 1) {
+ } else if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 1) {
rk_clrsetreg(base + RK3588_B1PLL_CLKSEL_CON(0),
pll->mode_mask << 6,
2 << 6);
@@ -525,7 +525,7 @@ static int rk3588_pll_set_rate(struct rockchip_pll_clock *pll,
rk_clrsetreg(base + RK3588_B1PLL_CLKSEL_CON(1),
RK3588_CORE_DIV_MASK << RK3588_CORE_B13_DIV_SHIFT,
0 << RK3588_CORE_B13_DIV_SHIFT);
- } else if (pll_id == 2) {
+ } else if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 2) {
rk_clrsetreg(base + RK3588_LPLL_CLKSEL_CON(5),
pll->mode_mask << 14,
2 << 14);
@@ -543,7 +543,7 @@ static int rk3588_pll_set_rate(struct rockchip_pll_clock *pll,
0 << RK3588_CORE_L02_DIV_SHIFT);
}
- if (pll_id == 3)
+ if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588) && pll_id == 3)
rk_clrsetreg(base + 0x84c, 0x1 << 1, 0);
debug("PLL at %p: con0=%x con1= %x con2= %x mode= %x\n",
--
2.54.0
next prev parent reply other threads:[~2026-07-30 14:13 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 14:12 [PATCH 00/15] rockchip: Miscellaneous RK35xx clock fixes Jonas Karlman
2026-07-30 14:12 ` [PATCH 01/15] clk: rockchip: pll: Fix double use of postdiv1 Jonas Karlman
2026-08-07 9:36 ` Quentin Schulz via U-Boot
2026-08-07 10:38 ` Jonas Karlman
2026-08-07 16:38 ` Quentin Schulz via U-Boot
2026-08-07 13:19 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 02/15] clk: rockchip: pll: Always write the dsmpd flag Jonas Karlman
2026-08-07 13:24 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 03/15] clk: rockchip: pll: Always write the k param Jonas Karlman
2026-08-07 13:29 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 04/15] clk: rockchip: pll: Use PLL_FIXED_MODE flag on rk3588/rk3576 plls Jonas Karlman
2026-08-07 14:09 ` Quentin Schulz
2026-07-30 14:12 ` Jonas Karlman [this message]
2026-08-07 14:30 ` [PATCH 05/15] clk: rockchip: pll: Limit special rk3588_pll handling to RK3588 Quentin Schulz
2026-07-30 14:12 ` [PATCH 06/15] clk: rockchip: rk3568: Fix trivial clock configuration errors Jonas Karlman
2026-08-07 14:46 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 07/15] clk: rockchip: rk3588: " Jonas Karlman
2026-08-07 15:07 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 08/15] clk: rockchip: rk3588: Fix possible divide by zero Jonas Karlman
2026-08-07 15:20 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 09/15] clk: rockchip: rk3588: Fix ACLK_BUS_ROOT rate set during probe Jonas Karlman
2026-08-07 15:44 ` Quentin Schulz
2026-07-30 14:12 ` [PATCH 10/15] clk: rockchip: rk3588: Use SPLL_HZ constant Jonas Karlman
2026-08-07 15:46 ` Quentin Schulz
2026-07-30 14:13 ` [PATCH 11/15] clk: rockchip: rk3576: Fix trivial clock configuration errors Jonas Karlman
2026-08-07 16:04 ` Quentin Schulz via U-Boot
2026-07-30 14:13 ` [PATCH 12/15] clk: rockchip: rk3528: " Jonas Karlman
2026-08-07 16:07 ` Quentin Schulz
2026-07-30 14:13 ` [PATCH 13/15] clk: rockchip: rk3506: " Jonas Karlman
2026-08-07 16:08 ` Quentin Schulz
2026-07-30 14:13 ` [PATCH 14/15] clk: rockchip: rk3568: Drop unused GRF syscon lookup Jonas Karlman
2026-08-07 16:16 ` Quentin Schulz
2026-07-30 14:13 ` [PATCH 15/15] clk: rockchip: rk3588: " Jonas Karlman
2026-08-07 16:19 ` Quentin Schulz
2026-08-08 13:37 ` [PATCH 00/15] rockchip: Miscellaneous RK35xx clock fixes Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260730141308.1218014-6-jonas@kwiboo.se \
--to=jonas@kwiboo.se \
--cc=ilias.apalodimas@linaro.org \
--cc=kever.yang@rock-chips.com \
--cc=lukma@denx.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@0leil.net \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.