[PATCH RFC 02/18] clk: rockchip: rk3568: Fix probe with OF_PLATDATA enabled
Jonas Karlman
jonas at kwiboo.se
Sun May 24 20:42:33 CEST 2026
Hi Pavel,
On 5/17/2026 9:24 PM, Pavel Golikov wrote:
> Properly initialize cru address space reference when CONFIG_OF_PLATDATA
> is enabled.
Do we have to use OF_PLATDATA for TPL to fit into SRAM?
Also, why do we need CLK driver in TPL? Based on small glance at the
code it looks like the DPLL was handled by the RAM driver itself.
I will also shortly send out a series that cleanup a few of these
syscon_get_first_range(ROCKCHIP_SYSCON_x), rockchip_get_cru() or
rockchip_get_clk() usage.
Hopefully that can give you a cleaner baseline, with the direction most
recently added RK SoCs have been following.
Regards,
Jonas
>
> Signed-off-by: Pavel Golikov <paullo612 at ya.ru>
> ---
> drivers/clk/rockchip/clk_rk3568.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/rockchip/clk_rk3568.c b/drivers/clk/rockchip/clk_rk3568.c
> index 67bc04b81c0..199bb51fa6f 100644
> --- a/drivers/clk/rockchip/clk_rk3568.c
> +++ b/drivers/clk/rockchip/clk_rk3568.c
> @@ -9,6 +9,7 @@
> #include <dm.h>
> #include <dt-structs.h>
> #include <errno.h>
> +#include <mapmem.h>
> #include <syscon.h>
> #include <asm/arch-rockchip/cru_rk3568.h>
> #include <asm/arch-rockchip/clock.h>
> @@ -2906,8 +2907,14 @@ static void rk3568_clk_init(struct rk3568_clk_priv *priv)
> static int rk3568_clk_probe(struct udevice *dev)
> {
> struct rk3568_clk_priv *priv = dev_get_priv(dev);
> +#if CONFIG_IS_ENABLED(OF_PLATDATA)
> + struct rk3568_clk_plat *plat = dev_get_plat(dev);
> +#endif
> int ret;
>
> +#if CONFIG_IS_ENABLED(OF_PLATDATA)
> + priv->cru = map_sysmem(plat->dtd.reg[0], plat->dtd.reg[1]);
> +#endif
> priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
> if (IS_ERR(priv->grf))
> return PTR_ERR(priv->grf);
> @@ -2926,9 +2933,11 @@ static int rk3568_clk_probe(struct udevice *dev)
>
> static int rk3568_clk_ofdata_to_platdata(struct udevice *dev)
> {
> - struct rk3568_clk_priv *priv = dev_get_priv(dev);
> + if (CONFIG_IS_ENABLED(OF_REAL)) {
> + struct rk3568_clk_priv *priv = dev_get_priv(dev);
>
> - priv->cru = dev_read_addr_ptr(dev);
> + priv->cru = dev_read_addr_ptr(dev);
> + }
>
> return 0;
> }
>
More information about the U-Boot
mailing list