[U-Boot] nand sector size is zero in jffs2 cmds

Derek Ou derek at siconix.com
Tue Dec 23 02:02:28 CET 2008


Hi, all,

When I tested jffs2 command for NAND, I found that jffs2_1pass.c:: 
jffs2_1pass_build_lists() fails at
    u32 nr_sectors = part->size/part->sector_size;
because part->sector_size is zero.  And cause the "### ERROR ### Please 
RESET the board ###" error when entering the for loop (i < nr_sectors), 
I think.

It looks like the sector_size was not updated in mtdparts_init().  
According to cmd_jffs2.c, the mtdparts_init in the #ifdef 
CONFIG_JFFS2_CMDLINE section calls the parse_mtdparts() and eventually 
reach the following lines in part_validate_nand():
    nand = &nand_info[id->num];
    part->sector_size = nand->erasesize;
However, the other mtdparts_init(), which is not in the #ifdef 
CONFIG_JFFS2_CMDLINE section, does not call parse_mtdparts() and it may 
lead to the part->sector_size not initialized.

I am not totally familiar with this jffs2 and nand code.  Can someone 
review this?  Thanks.
Derek


More information about the U-Boot mailing list