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

Scott Wood scottwood at freescale.com
Wed Nov 5 06:45:44 CET 2014


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




More information about the U-Boot mailing list