summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-rockchip/rk3288
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-06-07 18:46:03 +0200
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-07-11 12:13:44 +0200
commit8f1034e627f1af3940d92cab3bc9cacc81df4779 (patch)
treeb56ff07f6dcaa1f651a022f175fb3d58dc4752c1 /arch/arm/mach-rockchip/rk3288
parent3d40479f00c9406463b716d1874de0d2f4a31a02 (diff)
downloadu-boot-8f1034e627f1af3940d92cab3bc9cacc81df4779.tar.gz
u-boot-8f1034e627f1af3940d92cab3bc9cacc81df4779.tar.xz
u-boot-8f1034e627f1af3940d92cab3bc9cacc81df4779.zip
rockchip: dm: convert fdt_get to dev_read
With the new dev_read functions available, we can convert the rockchip architecture-specific drivers and common drivers used by these devices over to the dev_read family of calls. This covers the DRAM controller initialisation for the RK3188, RK3288 and RK3399... all of these read some of the tuning/setup/timing parameters from the device-tree. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/mach-rockchip/rk3288')
-rw-r--r--arch/arm/mach-rockchip/rk3288/sdram_rk3288.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
index 2feda61205..b3ed3f25d9 100644
--- a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
@@ -1018,29 +1018,27 @@ static int rk3288_dmc_ofdata_to_platdata(struct udevice *dev)
{
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3288_sdram_params *params = dev_get_platdata(dev);
- const void *blob = gd->fdt_blob;
- int node = dev_of_offset(dev);
int ret;
/* Rk3288 supports dual-channel, set default channel num to 2 */
params->num_channels = 2;
- ret = fdtdec_get_int_array(blob, node, "rockchip,pctl-timing",
- (u32 *)&params->pctl_timing,
- sizeof(params->pctl_timing) / sizeof(u32));
+ ret = dev_read_u32_array(dev, "rockchip,pctl-timing",
+ (u32 *)&params->pctl_timing,
+ sizeof(params->pctl_timing) / sizeof(u32));
if (ret) {
debug("%s: Cannot read rockchip,pctl-timing\n", __func__);
return -EINVAL;
}
- ret = fdtdec_get_int_array(blob, node, "rockchip,phy-timing",
- (u32 *)&params->phy_timing,
- sizeof(params->phy_timing) / sizeof(u32));
+ ret = dev_read_u32_array(dev, "rockchip,phy-timing",
+ (u32 *)&params->phy_timing,
+ sizeof(params->phy_timing) / sizeof(u32));
if (ret) {
debug("%s: Cannot read rockchip,phy-timing\n", __func__);
return -EINVAL;
}
- ret = fdtdec_get_int_array(blob, node, "rockchip,sdram-params",
- (u32 *)&params->base,
- sizeof(params->base) / sizeof(u32));
+ ret = dev_read_u32_array(dev, "rockchip,sdram-params",
+ (u32 *)&params->base,
+ sizeof(params->base) / sizeof(u32));
if (ret) {
debug("%s: Cannot read rockchip,sdram-params\n", __func__);
return -EINVAL;