[U-Boot] [PATCH] [NAND] Add board_nand_init_tail to give board module a chance to init after NAND chip is scaned.

Scott Wood scottwood at freescale.com
Fri Aug 8 16:49:33 CEST 2008


On Fri, Aug 08, 2008 at 10:06:03AM +0800, Hong Xu wrote:
> Sometimes, board module needs to know some information about the NAND
> chip e.g. page size to continue it's initialization. This short patch
> give board module a chance to continue its initialization after the
> NAND chip is scaned.
[snip]
>  	nand->IO_ADDR_R = nand->IO_ADDR_W = (void  __iomem *)base_addr;
>  	if (board_nand_init(nand) == 0) {
> -		if (nand_scan(mtd, 1) == 0) {
> +		if ((nand_scan(mtd, 1) == 0) && (board_nand_init_tail(nand) == 0)) {
>  			if (!mtd->name)
>  				mtd->name = (char *)default_nand_name;
>  		} else

This doesn't give the board driver a chance to run before the bad block
scan, though.  The MTD code itself does (nand_scan_ident and nand_scan_tail,
around which nand_scan is a wrapper), but the u-boot glue code doesn't
currently let board drivers take advantage of that.

I'd like to transition away from having a centralized nand_init(), and
instead have the board drivers call nand_scan*() themselves.

-Scott



More information about the U-Boot mailing list