Discussion:
[U-Boot] [PATCH] rockchip: rk322x: ram: enable DRAM init in SPL instead of TPL
Kever Yang
2018-12-04 09:49:58 UTC
Permalink
Patch for rk322x TPL is not merged, and only SPL is available now,
enable the sdram driver in SPL first. We should update back to TPL
after TPL is enabled for rk322x.

Signed-off-by: Kever Yang <***@rock-chips.com>
---

drivers/ram/rockchip/sdram_rk322x.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/ram/rockchip/sdram_rk322x.c b/drivers/ram/rockchip/sdram_rk322x.c
index 8bafd17f8f..e079ef7a70 100644
--- a/drivers/ram/rockchip/sdram_rk322x.c
+++ b/drivers/ram/rockchip/sdram_rk322x.c
@@ -49,7 +49,7 @@ struct rk322x_sdram_params {
struct regmap *map;
};

-#ifdef CONFIG_TPL_BUILD
+#ifdef CONFIG_SPL_BUILD
/*
* [7:6] bank(n:n bit bank)
* [5:4] row(13+n)
@@ -750,7 +750,7 @@ static int rk322x_dmc_ofdata_to_platdata(struct udevice *dev)

return 0;
}
-#endif /* CONFIG_TPL_BUILD */
+#endif /* CONFIG_SPL_BUILD */

#if CONFIG_IS_ENABLED(OF_PLATDATA)
static int conv_of_platdata(struct udevice *dev)
@@ -778,7 +778,7 @@ static int conv_of_platdata(struct udevice *dev)

static int rk322x_dmc_probe(struct udevice *dev)
{
-#ifdef CONFIG_TPL_BUILD
+#ifdef CONFIG_SPL_BUILD
struct rk322x_sdram_params *plat = dev_get_platdata(dev);
int ret;
struct udevice *dev_clk;
@@ -786,7 +786,7 @@ static int rk322x_dmc_probe(struct udevice *dev)
struct dram_info *priv = dev_get_priv(dev);

priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
-#ifdef CONFIG_TPL_BUILD
+#ifdef CONFIG_SPL_BUILD
#if CONFIG_IS_ENABLED(OF_PLATDATA)
ret = conv_of_platdata(dev);
if (ret)
@@ -842,12 +842,12 @@ U_BOOT_DRIVER(dmc_rk322x) = {
.id = UCLASS_RAM,
.of_match = rk322x_dmc_ids,
.ops = &rk322x_dmc_ops,
-#ifdef CONFIG_TPL_BUILD
+#ifdef CONFIG_SPL_BUILD
.ofdata_to_platdata = rk322x_dmc_ofdata_to_platdata,
#endif
.probe = rk322x_dmc_probe,
.priv_auto_alloc_size = sizeof(struct dram_info),
-#ifdef CONFIG_TPL_BUILD
+#ifdef CONFIG_SPL_BUILD
.platdata_auto_alloc_size = sizeof(struct rk322x_sdram_params),
#endif
};
--
2.18.0
Philipp Tomsich
2018-12-04 11:03:57 UTC
Permalink
Post by Kever Yang
Patch for rk322x TPL is not merged, and only SPL is available now,
enable the sdram driver in SPL first. We should update back to TPL
after TPL is enabled for rk322x.
Reviewed-by: Philipp Tomsich <***@theobroma-systems.com>
Philipp Tomsich
2018-12-10 00:01:53 UTC
Permalink
Post by Kever Yang
Patch for rk322x TPL is not merged, and only SPL is available now,
enable the sdram driver in SPL first. We should update back to TPL
after TPL is enabled for rk322x.
---
drivers/ram/rockchip/sdram_rk322x.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Applied to u-boot-rockchip, thanks!
Philipp Tomsich
2018-12-09 18:51:49 UTC
Permalink
Post by Kever Yang
Patch for rk322x TPL is not merged, and only SPL is available now,
enable the sdram driver in SPL first. We should update back to TPL
after TPL is enabled for rk322x.
---
drivers/ram/rockchip/sdram_rk322x.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Philipp Tomsich <***@theobroma-systems.com>
Loading...