Message ID | 1524540428-6650-1-git-send-email-kever.yang@rock-chips.com |
---|---|
State | Accepted |
Delegated to: | Philipp Tomsich |
Headers | show |
Series | [U-Boot,v2,1/3] rockchip: rk3036: add ofdata_to_platdata() method for driver | expand |
> Parse of data in dedicated api instead of in probe(). > > The clk_set_rate() may be called before the clk driver is probed, > after core support set default clock. > This patch fix system abort issue since: > f4fcba5 clk: implement clk_set_defaults() > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > Changes in v2: > - address commentS from Simon > > drivers/clk/rockchip/clk_rk3036.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Parse of data in dedicated api instead of in probe(). > > The clk_set_rate() may be called before the clk driver is probed, > after core support set default clock. > This patch fix system abort issue since: > f4fcba5 clk: implement clk_set_defaults() > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > Changes in v2: > - address commentS from Simon > > drivers/clk/rockchip/clk_rk3036.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Parse of data in dedicated api instead of in probe(). > > The clk_set_rate() may be called before the clk driver is probed, > after core support set default clock. > This patch fix system abort issue since: > f4fcba5 clk: implement clk_set_defaults() > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> > Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> > --- > > Changes in v2: > - address commentS from Simon > > drivers/clk/rockchip/clk_rk3036.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > Applied to u-boot-rockchip, thanks!
diff --git a/drivers/clk/rockchip/clk_rk3036.c b/drivers/clk/rockchip/clk_rk3036.c index 560222b..5e11318 100644 --- a/drivers/clk/rockchip/clk_rk3036.c +++ b/drivers/clk/rockchip/clk_rk3036.c @@ -317,11 +317,19 @@ static struct clk_ops rk3036_clk_ops = { .set_rate = rk3036_clk_set_rate, }; -static int rk3036_clk_probe(struct udevice *dev) +static int rk3036_clk_ofdata_to_platdata(struct udevice *dev) { struct rk3036_clk_priv *priv = dev_get_priv(dev); priv->cru = dev_read_addr_ptr(dev); + + return 0; +} + +static int rk3036_clk_probe(struct udevice *dev) +{ + struct rk3036_clk_priv *priv = dev_get_priv(dev); + rkclk_init(priv->cru); return 0; @@ -367,6 +375,7 @@ U_BOOT_DRIVER(rockchip_rk3036_cru) = { .id = UCLASS_CLK, .of_match = rk3036_clk_ids, .priv_auto_alloc_size = sizeof(struct rk3036_clk_priv), + .ofdata_to_platdata = rk3036_clk_ofdata_to_platdata, .ops = &rk3036_clk_ops, .bind = rk3036_clk_bind, .probe = rk3036_clk_probe,
Parse of data in dedicated api instead of in probe(). The clk_set_rate() may be called before the clk driver is probed, after core support set default clock. This patch fix system abort issue since: f4fcba5 clk: implement clk_set_defaults() Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- Changes in v2: - address commentS from Simon drivers/clk/rockchip/clk_rk3036.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)