From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 4 Nov 2014 23:45:44 -0600 Subject: [U-Boot] [PATCH v2] mtd: nand: allow to skip BBT scanning during NAND inititialization In-Reply-To: <20141105123945.CB20.AA925319@jp.panasonic.com> References: <1414067128-16857-1-git-send-email-yamada.m@jp.panasonic.com> <1415050859.23458.266.camel@snotra.buserror.net> <20141105123945.CB20.AA925319@jp.panasonic.com> Message-ID: <1415166344.23458.354.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 Wed, 2014-11-05 at 12:39 +0900, Masahiro Yamada wrote: > [2] There is no good place to insert a callback to an SoC file. > I need to write parameters such as page_size to hardware registers. > (You can see my code, nand_denali_fixup() in arch/arm/cpu/armv7/uniphier/board_late_init.c) > > The NAND init procedure of U-Boot is like this: > > (1) board_nand_init() (drivers/mtd/nand/denali.c) > (2) nand_scan_ident() (drivers/mtd/nand/nand_base.c) > (3) nand_scan_tail() (drivers/mtd/nand/nand_base.c) > > > > (2) detects the device size and set mtd->write_size, > mtd->erase_size, mtd->oob_size. > I need to set these values to the Denali hardware, but > the Denali driver code is called at (1) which is called > before the detection of the device size. > > In Linux, nand_scan_ident() and nand_scan_tail() are called > from each of NAND drivers, so we can use the values which > have been set during nand_scan_ident(). > > In U-Boot, I think it is impossible. If you use CONFIG_SYS_NAND_SELF_INIT you can insert code between nand_scan_ident() and nand_scan_tail(), just like in Linux. -Scott