public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 1/4] mtd: rawnand: denali_dt: insert udelay() after reset deassert
@ 2020-01-29 15:55 Masahiro Yamada
  2020-01-29 15:55 ` [PATCH v2 2/4] mtd: rawnand: denali: set SPARE_AREA_SKIP_BYTES based on DT compatible Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-29 15:55 UTC (permalink / raw)
  To: u-boot

When the reset signal is de-asserted, the HW-controlled bootstrap
starts running unless it is disabled in the SoC integration.
It issues some commands to detect a NAND chip, and sets up registers
automatically. Until this process finishes, software should avoid
any register access.

Without this delay function, some of UniPhier boards hangs up while
executing nand_scan_ident(). (denali_read_byte() is blocked)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v2: None

 drivers/mtd/nand/raw/denali_dt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c
index 91d0f20aae..1afc61f876 100644
--- a/drivers/mtd/nand/raw/denali_dt.c
+++ b/drivers/mtd/nand/raw/denali_dt.c
@@ -136,11 +136,19 @@ static int denali_dt_probe(struct udevice *dev)
 	}
 
 	ret = reset_get_bulk(dev, &resets);
-	if (ret)
+	if (ret) {
 		dev_warn(dev, "Can't get reset: %d\n", ret);
-	else
+	} else {
 		reset_deassert_bulk(&resets);
 
+		/*
+		 * When the reset is deasserted, the initialization sequence is
+		 * kicked (bootstrap process). The driver must wait until it is
+		 * finished. Otherwise, it will result in unpredictable behavior.
+		 */
+		udelay(200);
+	}
+
 	return denali_init(denali);
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-01-31 16:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-29 15:55 [PATCH v2 1/4] mtd: rawnand: denali_dt: insert udelay() after reset deassert Masahiro Yamada
2020-01-29 15:55 ` [PATCH v2 2/4] mtd: rawnand: denali: set SPARE_AREA_SKIP_BYTES based on DT compatible Masahiro Yamada
2020-01-31 16:55   ` Masahiro Yamada
2020-01-29 15:55 ` [PATCH v2 3/4] mtd: rawnand: denali_dt: use UCLASS_MTD instead of UCLASS_MISC Masahiro Yamada
2020-01-29 16:34   ` Miquel Raynal
2020-01-29 17:08   ` Simon Goldschmidt
2020-01-29 22:01     ` Marek Vasut
2020-01-30  5:34       ` Masahiro Yamada
2020-01-30 13:06         ` Marek Vasut
2020-01-29 15:55 ` [PATCH v2 4/4] ARM: uniphier: remove adhoc reset deassertion for the NAND controller Masahiro Yamada
2020-01-31 16:56   ` Masahiro Yamada
2020-01-31 16:54 ` [PATCH v2 1/4] mtd: rawnand: denali_dt: insert udelay() after reset deassert Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox