[U-Boot] [U-boot] question about nand_scan_bbt()

Scott Wood scottwood at freescale.com
Fri Jul 18 21:08:20 CEST 2014


On Wed, 2014-07-09 at 18:27 +0800, TigerLiu at via-alliance.com wrote:
> Hi, Scott:
> 
> I have a question about nand_scan_bbt() function in
> drivers/mtd/nand/nand_bbt.c .
> 
>          ……
> 
>          len = (1 << this->bbt_erase_shift); // bbt_erase_shift = 18
> (256KB)
> 
>          len += (len >> this->page_shift) * mtd->oobsize;
> 
>          buf = vmalloc(len);
> 
>          ……
> 
>  
> 
> Why does it need to allocate “1 block size + all pages’ oob size in
> this block” .
> 
> It seems other functions called in nand_scan_bbt() only needs a small
> buf (“one page size + its oob size”).

read_bbt() appears to operate one block at a time.

This code comes from Linux, so linux-mtd may be a better place to ask
questions about it.

-Scott





More information about the U-Boot mailing list