[U-Boot] Tinker-rk3288 SPL broken with MMC timeout

Michael Trimarchi michael at amarulasolutions.com
Sat Sep 14 12:17:09 UTC 2019


On Fri, Sep 13, 2019 at 08:11:17AM +0530, Jagan Teki wrote:
> On Thu, Sep 12, 2019 at 8:25 PM Tom Rini <trini at konsulko.com> wrote:
> >
> > On Thu, Sep 12, 2019 at 08:55:24AM +0530, Jagan Teki wrote:
> >
> > > I have seen this even on v2019.07 release, and the only release that
> > > it got working with on v2019.01 (SPL, BROM_RETURN)
> > >
> > > Any idea? here is the log dump.
> > >
> > > U-Boot TPL 2019.10-rc3-00297-g5ba8b12543 (Sep 12 2019 - 08:50:36)
> > > Trying to boot from BOOTROM
> > > Returning to boot ROM...
> > >
> > > U-Boot SPL 2019.10-rc3-00297-g5ba8b12543 (Sep 12 2019 - 08:50:36 +0530)
> > > Trying to boot from MMC1
> > > spl: mmc init failed with error: -110
> > > SPL: failed to boot from all boot devices
> > > ### ERROR ### Please RESET the board ###
> >
> > Time to run 'git bisect' since you know when it worked last at least?
> 
> Look hard to bisect, few of commits in between seems SPL size
> blow-out, doesn't boot etc. May be verify with respect boards might
> help.

Well I think that ddr should follow the same rule of rk3399, but still
the mmc is not working

>From c457eb849ce31a75db50a9b99e09d2453ee40580 Mon Sep 17 00:00:00 2001
From: Michael Trimarchi <michael at amarulasolutions.com>
Date: Sat, 14 Sep 2019 13:34:08 +0200
Subject: [PATCH 1/2] rockchip: ram: rk3288: Init ram in TPL when is configured

Init the ddr sdram in TPL instead of SPL, update the code.

Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
---
 drivers/ram/rockchip/sdram_rk3288.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/ram/rockchip/sdram_rk3288.c b/drivers/ram/rockchip/sdram_rk3288.c
index 6bb025a851..5775254007 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
 };
-- 
2.17.1

> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |


More information about the U-Boot mailing list