diff options
author | Tom Rini <trini@konsulko.com> | 2018-04-26 07:21:41 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-04-26 07:21:41 -0400 |
commit | d2a1f120cf638fd8a149bc8a46aec961c2fb9406 (patch) | |
tree | dfc98f40a7dc8738197303fa02f86e156cebc179 /drivers | |
parent | a61f9d1fbbca3c5e59b907ad3071db70ef174872 (diff) | |
parent | eb3d707e99fcd2213d5f8f0fe4ae53ad416b377e (diff) | |
download | u-boot-d2a1f120cf638fd8a149bc8a46aec961c2fb9406.tar.gz |
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/rockchip/clk_rk3036.c | 11 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk_rk3128.c | 11 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk_rk3288.c | 13 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk_rv1108.c | 10 | ||||
-rw-r--r-- | drivers/timer/rockchip_timer.c | 2 |
5 files changed, 44 insertions, 3 deletions
diff --git a/drivers/clk/rockchip/clk_rk3036.c b/drivers/clk/rockchip/clk_rk3036.c index 560222b96c..5e11318042 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, diff --git a/drivers/clk/rockchip/clk_rk3128.c b/drivers/clk/rockchip/clk_rk3128.c index 132d50dda3..7b479e79bb 100644 --- a/drivers/clk/rockchip/clk_rk3128.c +++ b/drivers/clk/rockchip/clk_rk3128.c @@ -546,11 +546,19 @@ static struct clk_ops rk3128_clk_ops = { .set_rate = rk3128_clk_set_rate, }; +static int rk3128_clk_ofdata_to_platdata(struct udevice *dev) +{ + struct rk3128_clk_priv *priv = dev_get_priv(dev); + + priv->cru = dev_read_addr_ptr(dev); + + return 0; +} + static int rk3128_clk_probe(struct udevice *dev) { struct rk3128_clk_priv *priv = dev_get_priv(dev); - priv->cru = (struct rk3128_cru *)dev_read_addr(dev); rkclk_init(priv->cru); return 0; @@ -590,6 +598,7 @@ U_BOOT_DRIVER(rockchip_rk3128_cru) = { .id = UCLASS_CLK, .of_match = rk3128_clk_ids, .priv_auto_alloc_size = sizeof(struct rk3128_clk_priv), + .ofdata_to_platdata = rk3128_clk_ofdata_to_platdata, .ops = &rk3128_clk_ops, .bind = rk3128_clk_bind, .probe = rk3128_clk_probe, diff --git a/drivers/clk/rockchip/clk_rk3288.c b/drivers/clk/rockchip/clk_rk3288.c index 3a36d04096..78ada2d2db 100644 --- a/drivers/clk/rockchip/clk_rk3288.c +++ b/drivers/clk/rockchip/clk_rk3288.c @@ -893,12 +893,25 @@ static int __maybe_unused rk3288_clk_set_parent(struct clk *clk, struct clk *par return -ENOENT; } +static int rk3288_clk_enable(struct clk *clk) +{ + switch (clk->id) { + case HCLK_USBHOST0: + case HCLK_HSIC: + return 0; + } + + debug("%s: unsupported clk %ld\n", __func__, clk->id); + return -ENOENT; +} + static struct clk_ops rk3288_clk_ops = { .get_rate = rk3288_clk_get_rate, .set_rate = rk3288_clk_set_rate, #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .set_parent = rk3288_clk_set_parent, #endif + .enable = rk3288_clk_enable, }; static int rk3288_clk_ofdata_to_platdata(struct udevice *dev) 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, diff --git a/drivers/timer/rockchip_timer.c b/drivers/timer/rockchip_timer.c index 07d14482d6..b847bc40c4 100644 --- a/drivers/timer/rockchip_timer.c +++ b/drivers/timer/rockchip_timer.c @@ -152,6 +152,8 @@ static const struct timer_ops rockchip_timer_ops = { }; static const struct udevice_id rockchip_timer_ids[] = { + { .compatible = "rockchip,rk3188-timer" }, + { .compatible = "rockchip,rk3288-timer" }, { .compatible = "rockchip,rk3368-timer" }, {} }; |