[U-Boot] [PATCH 1/1] nand: adjust erase/read/write partition/chip size for bad blocks

Scott Wood scottwood at freescale.com
Wed Feb 27 22:48:58 CET 2013


On 02/26/2013 09:57:14 PM, Harvey Chapman wrote:
> Adjust the sizes calculated for whole partition/chip operations by
> removing the size of bad blocks so we don't try to erase/read/write
> past a partition/chip boundary.
> 
> Signed-off-by: Harvey Chapman <hchapman at 3gfp.com>
> ---
>  common/cmd_nand.c |   35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)

I don't think we want to do this adjustment for erase -- the value you  
pass in there is already defined as being the range of blocks on the  
flash, rather than the amount of data you want to be able to store in  
the range (except for the ".spread" variant, but that can't be used  
with .part or .chip).

This makes me wonder if a better approach would be a flag that tells  
the nand_read|write_skip_bad() function whether "size" is meant as  
"good data size" or "actual size"?  Then we could just set that flag  
for whole-chip/whole-partition accesses, and let the existing bad block  
skipping code handle it with some minor tweaks.  This would be similar  
to opts->spread for erase.

-Scott


More information about the U-Boot mailing list