From: Masahiro Yamada Date: Tue, 11 Nov 2014 22:10:37 +0900 Subject: [U-Boot] [PATCH v2] mtd: nand: allow to skip BBT scanning during NAND inititialization In-Reply-To: <1415166344.23458.354.camel@snotra.buserror.net> References: <20141105123945.CB20.AA925319@jp.panasonic.com> <1415166344.23458.354.camel@snotra.buserror.net> Message-ID: <20141111221037.3A4C.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Scott, On Tue, 4 Nov 2014 23:45:44 -0600 Scott Wood wrote: > 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. > Thanks for your advice! I have posted patches: http://patchwork.ozlabs.org/patch/409429/ http://patchwork.ozlabs.org/patch/409428/ Best Regards Masahiro Yamada