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>,
	Lukasz Majewski <lukma@denx.de>, Simon Glass <sjg@chromium.org>,
	Tom Rini <trini@konsulko.com>
Cc: Alexey Charkov <alchark@flipper.net>,
	u-boot@lists.u-boot-project.org, Jonas Karlman <jonas@kwiboo.se>
Subject: [PATCH 2/4] clk: rockchip: rk3588: Always init clocks in SPL build
Date: Tue,  4 Aug 2026 00:26:40 +0000	[thread overview]
Message-ID: <20260804002643.2308515-3-jonas@kwiboo.se> (raw)
In-Reply-To: <20260804002643.2308515-1-jonas@kwiboo.se>

The CPU PLLs and SPLL are only initialized in SPL on RK3588.

Ensure clock driver is always probed after bind for SPL builds to
initialize core PLLs and clocks in SPL phase on RK3588.

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

diff --git a/drivers/clk/rockchip/clk_rk3588.c b/drivers/clk/rockchip/clk_rk3588.c
index 5236c3fa985e..5313457aec92 100644
--- a/drivers/clk/rockchip/clk_rk3588.c
+++ b/drivers/clk/rockchip/clk_rk3588.c
@@ -2004,6 +2004,10 @@ static int rk3588_clk_bind(struct udevice *dev)
 	struct udevice *sys_child;
 	struct sysreset_reg *priv;
 
+	/* Ensure clocks are initialized after bind in SPL build */
+	if (IS_ENABLED(CONFIG_SPL_BUILD))
+		dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
+
 	/* The reset driver does not have a device node, so bind it here */
 	ret = device_bind_driver(dev, "rockchip_sysreset", "sysreset",
 				 &sys_child);
@@ -2133,6 +2137,15 @@ static int rk3588_scru_clk_probe(struct udevice *dev)
 	return 0;
 }
 
+static int rk3588_scru_clk_bind(struct udevice *dev)
+{
+	/* Ensure clocks are initialized after bind in SPL build */
+	if (IS_ENABLED(CONFIG_SPL_BUILD))
+		dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
+
+	return 0;
+}
+
 static const struct clk_ops rk3588_scru_clk_ops = {
 	.get_rate = rk3588_scru_clk_get_rate,
 	.set_rate = rk3588_scru_clk_set_rate,
@@ -2142,6 +2155,7 @@ U_BOOT_DRIVER(rockchip_rk3588_scru) = {
 	.name	= "rockchip_rk3588_scru",
 	.id	= UCLASS_CLK,
 	.ops	= &rk3588_scru_clk_ops,
+	.bind	= rk3588_scru_clk_bind,
 	.probe	= rk3588_scru_clk_probe,
 };
 
-- 
2.54.0


  parent reply	other threads:[~2026-08-04  0:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  0:26 [PATCH 0/4] rockchip: Always init clocks in SPL build for RK35xx Jonas Karlman
2026-08-04  0:26 ` [PATCH 1/4] clk: rockchip: rk3568: Always init clocks in SPL build Jonas Karlman
2026-08-08 17:30   ` Simon Glass
2026-08-08 19:33     ` Jonas Karlman
2026-08-09  0:33       ` Simon Glass
2026-08-04  0:26 ` Jonas Karlman [this message]
2026-08-08 17:32   ` [PATCH 2/4] clk: rockchip: rk3588: " Simon Glass
2026-08-08 19:46     ` Jonas Karlman
2026-08-04  0:26 ` [PATCH 3/4] clk: rockchip: rk3576: " Jonas Karlman
2026-08-05  7:21   ` Alexey Charkov
2026-08-05  7:52     ` Jonas Karlman
2026-08-09  0:34   ` Simon Glass
2026-08-04  0:26 ` [PATCH 4/4] clk: rockchip: rk3528: " Jonas Karlman
2026-09-08 11:26 ` [PATCH 0/4] rockchip: Always init clocks in SPL build for RK35xx 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=20260804002643.2308515-3-jonas@kwiboo.se \
    --to=jonas@kwiboo.se \
    --cc=alchark@flipper.net \
    --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