diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2018-04-24 11:27:08 +0800 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2018-04-25 22:20:07 +0200 |
commit | c877ef3ac163259b0098acaac15f878aca0c9673 (patch) | |
tree | 4f5a417ebc4c5862272678300208d008a23e46c3 /drivers | |
parent | d2e938d993074ebd989b20901590be7d4f79bf85 (diff) | |
download | u-boot-c877ef3ac163259b0098acaac15f878aca0c9673.tar.gz |
rockchip: rv1108: add ofdata_to_platdata() method for driver
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-sytems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-sytems.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/rockchip/clk_rv1108.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/clk/rockchip/clk_rv1108.c b/drivers/clk/rockchip/clk_rv1108.c index 958fc78592..42341a8566 100644 --- a/drivers/clk/rockchip/clk_rv1108.c +++ b/drivers/clk/rockchip/clk_rv1108.c @@ -209,12 +209,19 @@ static void rkclk_init(struct rv1108_cru *cru) printf("APLL: %d DPLL:%d GPLL:%d\n", apll, dpll, gpll); } -static int rv1108_clk_probe(struct udevice *dev) +static int rv1108_clk_ofdata_to_platdata(struct udevice *dev) { struct rv1108_clk_priv *priv = dev_get_priv(dev); priv->cru = dev_read_addr_ptr(dev); + return 0; +} + +static int rv1108_clk_probe(struct udevice *dev) +{ + struct rv1108_clk_priv *priv = dev_get_priv(dev); + rkclk_init(priv->cru); return 0; @@ -260,6 +267,7 @@ U_BOOT_DRIVER(clk_rv1108) = { .id = UCLASS_CLK, .of_match = rv1108_clk_ids, .priv_auto_alloc_size = sizeof(struct rv1108_clk_priv), + .ofdata_to_platdata = rv1108_clk_ofdata_to_platdata, .ops = &rv1108_clk_ops, .bind = rv1108_clk_bind, .probe = rv1108_clk_probe, |