在373行,红色字体为添加部分
if (!s || !strcmp(s, ".jffs2") ||
!strcmp(s, ".e") || !strcmp(s, ".i")) {
if (read)
ret = nand_read_skip_bad(nand, off, &size,
(u_char *)addr);
else
ret = nand_write_skip_bad(nand, off, &size,
(u_char *)addr);
}
#if defined(ENABLE_CMD_NAND_YAFFS)
}else if ( s != NULL &&
(!strcmp(s, ".yaffs") || !strcmp(s, ".yaffs1"))){
if(read) {
printf("nand read.yaffs[1] is not provide temporarily!");
} else {
nand->rw_oob = 1;
#if defined(ENABLE_CMD_NAND_YAFFS_SKIPFB)
nand->skipfirstblk = 1;
#else
nand->skipfirstblk = 0;
#endif
ret = nand_write_skip_bad(nand,off,&size,(u_char *)addr);
#if defined(ENABLE_CMD_NAND_YAFFS_SKIPFB)
nand->skipfirstblk = 0;
#endif
nand->rw_oob = 0;
}
#endif
}
else if (!strcmp(s, ".oob")) {
/* out-of-band data */
mtd_oob_ops_t ops = {
.oobbuf = (u8 *)addr,
.ooblen = size,
.mode = MTD_OOB_RAW
};
在505行添加,红色字体为添加部分
"nand erase [clean] [off size] - erase 'size' bytes from\n"
" offset 'off' (entire device if not specified)\n"
#if defined(CONFIG_SYS_NAND_YAFFS_WRITE)
"nand read[.yaffs[1]] is not provide temporarily\n"
"nand write[.yaffs[1]] addr off size -write the 'size' byte yaffs image starting\n"
"at offset 'off' from memory address 'addr' (.yaffs for 512+16 Nand)"
#endif
"nand bad - show bad blocks\n"
|