From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Sun, 19 Jun 2016 19:25:00 -0500 Subject: [U-Boot] [U-Boot,v3,2/2] nand: extend nand torture In-Reply-To: <1465805748-30110-2-git-send-email-max.krummenacher@toradex.com> References: <1465805748-30110-2-git-send-email-max.krummenacher@toradex.com> Message-ID: <20160620002500.GA1982@home.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Reviewed-by: Beno?t Th?baudeau > --- 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