On Mon, Jun 13, 2016 at 10:15:48AM +0200, Max Krummenacher wrote: > nand torture currently works on exactly one nand block which is specified > by giving the byteoffset to the beginning of the block. > > Extend this by allowing for a second parameter specifying the byte size > to be tested. > > e.g. > ==> nand torture 1000000 > > NAND torture: device 0 offset 0x1000000 size 0x20000 (block size 0x20000) > Passed: 1, failed: 0 > > ==> nand torture 1000000 40000 > > NAND torture: device 0 offset 0x1000000 size 0x40000 (block size 0x20000) > Passed: 2, failed: 0 > > Signed-off-by: Max Krummenacher <max.krummenac...@toradex.com> > Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau....@gmail.com> > ---
Applying with these changes: diff --git a/cmd/nand.c b/cmd/nand.c index 6d239a3..ffdeea4 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -659,11 +659,12 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } size = mtd->erasesize; - if (argc > 3) + if (argc > 3) { if (!str2off(argv[3], &size)) { puts("Size is not a valid number\n"); return 1; } + } endoff = off + size; if (endoff > mtd->size) { @@ -803,7 +804,7 @@ static char nand_help_text[] = "nand dump[.oob] off - dump page\n" #ifdef CONFIG_CMD_NAND_TORTURE "nand torture off - torture one block at offset\n" - "nand torture off size - torture blocks from off to off+size\n" + "nand torture off [size] - torture blocks from off to off+size\n" #endif "nand scrub [-y] off size | scrub.part partition | scrub.chip\n" " really clean NAND erasing bad blocks (UNSAFE)\n" -Scott _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot