diff options
author | Jagan Teki <jagan@amarulasolutions.com> | 2019-09-17 11:40:38 +0530 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2019-09-19 09:35:31 +0800 |
commit | 4f24163efad8a886800a02da0dd787996d7adfa7 (patch) | |
tree | d760a65180c7dcd93e64ef6e11b2875a1e834cc4 /drivers/ram | |
parent | 78efae613bbade1d366e920ba93a44cdeb06c5f6 (diff) | |
download | u-boot-4f24163efad8a886800a02da0dd787996d7adfa7.zip u-boot-4f24163efad8a886800a02da0dd787996d7adfa7.tar.gz u-boot-4f24163efad8a886800a02da0dd787996d7adfa7.tar.bz2 |
ram: rk3288: Initialize dram for TPL builds
Few of the rk3288 boards like tinker, vyasa are using
TPL, SPL bootchain so the dram initialization must needed
during TPL stage. So add proper ifconstruct to satisfy
both TPL, SPL and SPL-only bootchain boards.
This eventually fixing TPL to SPL handoff, otherwise missing
dram initilaztion at TPL stage would leads to SPL hang.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
Diffstat (limited to 'drivers/ram')
-rw-r--r-- | drivers/ram/rockchip/sdram_rk3288.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/ram/rockchip/sdram_rk3288.c b/drivers/ram/rockchip/sdram_rk3288.c index 6bb025a..5775254 100644 --- a/drivers/ram/rockchip/sdram_rk3288.c +++ b/drivers/ram/rockchip/sdram_rk3288.c @@ -79,7 +79,8 @@ const int ddrconf_table[] = { #define DQS_GATE_TRAINING_ERROR_RANK0 (1 << 4) #define DQS_GATE_TRAINING_ERROR_RANK1 (2 << 4) -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) static void copy_to_reg(u32 *dest, const u32 *src, u32 n) { int i; @@ -1035,7 +1036,8 @@ static int conv_of_platdata(struct udevice *dev) static int rk3288_dmc_probe(struct udevice *dev) { -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) struct rk3288_sdram_params *plat = dev_get_platdata(dev); struct udevice *dev_clk; struct regmap *map; @@ -1044,7 +1046,8 @@ static int rk3288_dmc_probe(struct udevice *dev) struct dram_info *priv = dev_get_priv(dev); priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU); -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) #if CONFIG_IS_ENABLED(OF_PLATDATA) ret = conv_of_platdata(dev); if (ret) @@ -1111,12 +1114,14 @@ U_BOOT_DRIVER(dmc_rk3288) = { .id = UCLASS_RAM, .of_match = rk3288_dmc_ids, .ops = &rk3288_dmc_ops, -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .ofdata_to_platdata = rk3288_dmc_ofdata_to_platdata, #endif .probe = rk3288_dmc_probe, .priv_auto_alloc_size = sizeof(struct dram_info), -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .platdata_auto_alloc_size = sizeof(struct rk3288_sdram_params), #endif }; |