2011-03-10 10:56:17     NAND, bad-block-table and u-boot "nand markbad" (multiple u-boot questions)

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-03-10 10:56:17     NAND, bad-block-table and u-boot "nand markbad" (multiple u-boot questions)

Reggy Perrin (UNITED STATES)

Message: 98850   

 

Hi folks,

 

Here's our environment:

 

    BF524

    128MB NAND flash (SLC)

    Config file based on include/configs/bf526-ezbrd.h

 

This started because I was trying to test a development unit for bad-block handling, and I noticed that the nand markbad command wasn't working:

 

bfin> nand device

 

Device 0: NAND 128MiB 3,3V 8-bit, sector size 128 KiB

bfin> nand bad

 

Device 0 bad blocks:

bfin> nand markbad 0x40000

block 0x00040000 successfully marked as bad

bfin> nand bad

 

Device 0 bad blocks:

  00040000

bfin> reset

 

U-Boot 2010.09-svn2728 (ADI-2011R1-pre) (Mar 09 2011 - 09:49:43)

 

(snip)

 

bfin> nand bad

 

Device 0 bad blocks:

bfin>

 

 

This is a dev unit I've beat on significantly, so I'm not surprised that something isn't right.  However, in reading up on this (and with my other post about bad blocks), I need to work through the following:

 

1)  How do you define the bad block table for the NAND?  We aren't setting anything, that I can see.  Is it using the table in the flash chip?  Can I reset that somehow?

 

2)  The NAND supplier recommends the following the first time you access the flash: 

 

    Read each block

    If data found, mark block as bad.

 

I've been searching to see if this is a feature that somebody has done for u-boot, but don't see it.  Is this something that needs to be implemented, or is it handled already?

 

Thanks!

QuoteReplyEditDelete

 

 

2011-03-10 16:37:34     Re: NAND, bad-block-table and u-boot "nand markbad" (multiple u-boot questions)

Mike Frysinger (UNITED STATES)

Message: 98857   

 

when you do 'nand markbad', it should update the OOB page for that block.  you should be able to check this by using 'nand dump.oob' and seeing if the bad block marker is actually set in flash.

 

then when you reboot and run 'nand bad', it should call scan_bbt/nand_default_bbt which should skip the in-flash bbt handling and do a full scan via nand_scan_bbt/nand_memory_bbt to build up a bbt in ram.

 

i dont what svn version that is but it isnt the latest svn trunk that's for sure.  i cant tell if it is the version using CONFIG_NAND_EARLY_INIT.

 

there is no support in u-boot for an automated bad block marking based on the algorithm proposed to you.  you'd have to a simple command to do that for you.

Attachments

    Outcomes