From: Scott Wood Date: Mon, 3 Nov 2014 15:47:47 -0600 Subject: [U-Boot] [PATCH v2] mtd: nand: allow to skip BBT scanning during NAND inititialization In-Reply-To: <1415050859.23458.266.camel@snotra.buserror.net> References: <1414067128-16857-1-git-send-email-yamada.m@jp.panasonic.com> <1415050859.23458.266.camel@snotra.buserror.net> Message-ID: <1415051267.23458.270.camel@snotra.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 Mon, 2014-11-03 at 15:40 -0600, Scott Wood wrote: > On Thu, 2014-10-23 at 21:25 +0900, Masahiro Yamada wrote: > > Since commit ff94bc40af34 (mtd, ubi, ubifs: resync with Linux-3.14), > > chip->scan_bbt() is called at the end of nand_scan_tail(). > > It means the first read access happens immediately after the generic > > NAND initialization process. > > > > It causes a problem to some SoCs of UniPhier platform because some of > > their register values need to be fixed up after the general > > initialization procedure has been finished. Otherwise, read asccess > > fails. Such a fix-up is SoC-specific enough to be written in a board > > file rather than in driver code. > > > > One of possible and clean enough ways to work around this issue is > > postpone the BBT scanning until necessary fix-up is done in > > board_late_init() or somewhere else. > > > > CONFIG_MTD_NAND_SKIP_BBTSCAN, if enabled, allows to skip the BBT > > scanning at the end of nand_scan_tail(). > > > > Signed-off-by: Masahiro Yamada > > Cc: Scott Wood > > --- > > Rotislav Lisovy already posted a patch to fix the regression, but I > don't think you should be relying on this for your problem. Why don't > you want to put SoC-specific knowledge in the driver? At least make it > a callback from the driver to an SoC file, rather than hoping the NAND > won't be touched for a certain amount of time after the driver has told > the subsystem "I'm here and ready to be used". Also, if you did have a valid reason to set NAND_SKIP_BBTSCAN, why would you want to set it from nand.c rather than from your driver's init function? -Scott