[U-Boot] [PATCH v2] mtd: nand: allow to skip BBT scanning during NAND inititialization

Masahiro Yamada yamada.m at jp.panasonic.com
Tue Nov 11 14:10:37 CET 2014


Hi Scott,

On Tue, 4 Nov 2014 23:45:44 -0600
Scott Wood <scottwood at freescale.com> 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



More information about the U-Boot mailing list