From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 14 Nov 2016 23:30:49 -0600 Subject: [U-Boot] [PATCH] nand: force BBT scan for controllers which need it In-Reply-To: <20161027001844.11710-1-stefan@agner.ch> References: <20161027001844.11710-1-stefan@agner.ch> Message-ID: <1479187849.21746.25.camel@buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2016-10-26 at 17:18 -0700, Stefan Agner wrote: > From: Stefan Agner > > Commit 35c204d8a9d0 ("nand: reinstate lazy bad block scanning") > introduced lazy BBT scanning. However, some controller do parts > of the initialization (mxs_nand.c) during scan_bbt, hence for > those controllers the BBT must be scanned at initialization time. > > In most situation the U-Boot environment gets read first, and > the U-Boot environment code checks for bad blocks first. Checking > for bad blocks will ask for scan_bbt before reading the first page, > hence in most situation the issue does not appear in practice. > However, when there is no environment configured, other code might > access NAND first which does not explicitly checks for bad blocks, > in those cases ECC reads will fail always. > > Cc: Rostislav Lisovy > Signed-off-by: Stefan Agner > --- > Not sure if this solution is a nice solution as we diverge more > and more from the kernel... Why does this init code need to run at the end of nand_scan_tail()? ?If it can run in between nand_scan_ident() and nand_scan_tail(), then use CONFIG_SYS_NAND_SELF_INIT to allow the driver to run its init at that time. -Scott