U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 12/15] clk: rockchip: rk3528: Fix trivial clock configuration errors
Date: Thu, 30 Jul 2026 14:13:01 +0000	[thread overview]
Message-ID: <20260730141308.1218014-13-jonas@kwiboo.se> (raw)
In-Reply-To: <20260730141308.1218014-1-jonas@kwiboo.se>

The RK3528 clock driver has a few trivial copy-paste mistakes in its
clock handling.

Fix the trivial clock configuration errors:
- avoid reporting incorrect PWM clock rate
- use correct mask and value for VOP clocks
- align PPLL configuration to match other PLLs

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/clk/rockchip/clk_rk3528.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/rockchip/clk_rk3528.c b/drivers/clk/rockchip/clk_rk3528.c
index cf8c3a623495..83e302dbc3c4 100644
--- a/drivers/clk/rockchip/clk_rk3528.c
+++ b/drivers/clk/rockchip/clk_rk3528.c
@@ -72,7 +72,8 @@ static struct rockchip_pll_clock rk3528_pll_clks[] = {
 		     RK3528_MODE_CON, 4, 10, 0, rk3528_pll_rates),
 
 	[PPLL] = PLL(pll_rk3328, PLL_PPLL, RK3528_PCIE_PLL_CON(32),
-		     RK3528_MODE_CON, 6, 10, ROCKCHIP_PLL_FIXED_MODE, rk3528_pll_rates),
+		     RK3528_MODE_CON, 6, 10, ROCKCHIP_PLL_FIXED_MODE,
+		     rk3528_pll_rates),
 
 	[DPLL] = PLL(pll_rk3328, PLL_DPLL, RK3528_DDRPHY_PLL_CON(16),
 		     RK3528_DDRPHY_MODE_CON, 0, 10, 0, rk3528_pll_rates),
@@ -770,7 +771,7 @@ static ulong rk3528_pwm_get_clk(struct rk3528_clk_priv *priv, ulong clk_id)
 	sel = (con & mask) >> shift;
 	if (sel == CLK_PWM0_SEL_CLK_MATRIX_100M_SRC)
 		rate = 100 * MHz;
-	if (sel == CLK_PWM0_SEL_CLK_MATRIX_50M_SRC)
+	else if (sel == CLK_PWM0_SEL_CLK_MATRIX_50M_SRC)
 		rate = 50 * MHz;
 	else
 		rate = OSC_HZ;
@@ -1097,7 +1098,7 @@ static ulong rk3528_dclk_vop_set_clk(struct rk3528_clk_priv *priv,
 	}
 
 	div = ((DIV_ROUND_UP(prate, rate) - 1) << div_shift) & div_mask;
-	rk_clrsetreg(&cru->clksel_con[id], sel, div);
+	rk_clrsetreg(&cru->clksel_con[id], sel_mask | div_mask, sel | div);
 
 	return rk3528_dclk_vop_get_clk(priv, clk_id);
 }
-- 
2.54.0


  parent reply	other threads:[~2026-07-30 14:13 UTC|newest]

Thread overview: 33+ 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 ` [PATCH 05/15] clk: rockchip: pll: Limit special rk3588_pll handling to RK3588 Jonas Karlman
2026-08-07 14:30   ` 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 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:13 ` Jonas Karlman [this message]
2026-08-07 16:07   ` [PATCH 12/15] clk: rockchip: rk3528: Fix trivial clock configuration errors 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
     [not found] ` <20260730141308.1218014-8-jonas@kwiboo.se>
2026-08-07 15:07   ` [PATCH 07/15] clk: rockchip: rk3588: Fix trivial clock configuration errors Quentin Schulz
     [not found] ` <20260730141308.1218014-11-jonas@kwiboo.se>
2026-08-07 15:46   ` [PATCH 10/15] clk: rockchip: rk3588: Use SPLL_HZ constant Quentin Schulz
     [not found] ` <20260730141308.1218014-12-jonas@kwiboo.se>
2026-08-07 16:04   ` [PATCH 11/15] clk: rockchip: rk3576: Fix trivial clock configuration errors Quentin Schulz via U-Boot
2026-08-08 13:37 ` [PATCH 00/15] rockchip: Miscellaneous RK35xx clock fixes Simon Glass
2026-09-08 11:25 ` Heiko Stübner

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-13-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox