diff options
Diffstat (limited to 'drivers/ram/rockchip/sdram_rk3399.c')
-rw-r--r-- | drivers/ram/rockchip/sdram_rk3399.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index a83a670..c0a06dc 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -3013,10 +3013,12 @@ static int sdram_init(struct dram_info *dram, static int rk3399_dmc_of_to_plat(struct udevice *dev) { -#if !CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_dmc_plat *plat = dev_get_plat(dev); int ret; + if (!CONFIG_IS_ENABLED(OF_REAL)) + return 0; + ret = dev_read_u32_array(dev, "rockchip,sdram-params", (u32 *)&plat->sdram_params, sizeof(plat->sdram_params) / sizeof(u32)); @@ -3029,7 +3031,6 @@ static int rk3399_dmc_of_to_plat(struct udevice *dev) if (ret) printf("%s: regmap failed %d\n", __func__, ret); -#endif return 0; } @@ -3068,7 +3069,7 @@ static int rk3399_dmc_init(struct udevice *dev) struct dram_info *priv = dev_get_priv(dev); struct rockchip_dmc_plat *plat = dev_get_plat(dev); int ret; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) struct rk3399_sdram_params *params = &plat->sdram_params; #else struct dtd_rockchip_rk3399_dmc *dtplat = &plat->dtplat; @@ -3106,7 +3107,7 @@ static int rk3399_dmc_init(struct udevice *dev) priv->cic, priv->pmugrf, priv->pmusgrf, priv->pmucru, priv->pmu); #if CONFIG_IS_ENABLED(OF_PLATDATA) - ret = clk_get_by_driver_info(dev, dtplat->clocks, &priv->ddr_clk); + ret = clk_get_by_phandle(dev, dtplat->clocks, &priv->ddr_clk); #else ret = clk_get_by_index(dev, 0, &priv->ddr_clk); #endif |