aboutsummaryrefslogtreecommitdiff
path: root/common/cmd_nand.c
diff options
context:
space:
mode:
authorAllen Martin <amartin@nvidia.com>2012-12-19 13:02:36 -0800
committerAllen Martin <amartin@nvidia.com>2012-12-19 13:02:36 -0800
commita098cf41fdb2a6607c675f7fe4f3164617c9367e (patch)
treeb37acb36f65909e6f74cc537d73efd883a1485a6 /common/cmd_nand.c
parentb8a7c467960ffb4d5a5e1eef5f7783fb6f594542 (diff)
parent095728803eedfce850a2f85828f79500cb09979e (diff)
Merge remote-tracking branch 'u-boot/master' into u-boot-arm-merged
Conflicts: README arch/arm/cpu/armv7/exynos/clock.c board/samsung/universal_c210/universal.c drivers/misc/Makefile drivers/power/power_fsl.c include/configs/mx35pdk.h include/configs/mx53loco.h include/configs/seaboard.h
Diffstat (limited to 'common/cmd_nand.c')
-rw-r--r--common/cmd_nand.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 4b1606972b..1568594ca4 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -700,6 +700,25 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return ret == 0 ? 0 : 1;
}
+#ifdef CONFIG_CMD_NAND_TORTURE
+ if (strcmp(cmd, "torture") == 0) {
+ if (argc < 3)
+ goto usage;
+
+ if (!str2off(argv[2], &off)) {
+ puts("Offset is not a valid number\n");
+ return 1;
+ }
+
+ printf("\nNAND torture: device %d offset 0x%llx size 0x%x\n",
+ dev, off, nand->erasesize);
+ ret = nand_torture(nand, off);
+ printf(" %s\n", ret ? "Failed" : "Passed");
+
+ return ret == 0 ? 0 : 1;
+ }
+#endif
+
if (strcmp(cmd, "markbad") == 0) {
argc -= 2;
argv += 2;
@@ -810,6 +829,9 @@ static char nand_help_text[] =
"nand erase.chip [clean] - erase entire chip'\n"
"nand bad - show bad blocks\n"
"nand dump[.oob] off - dump page\n"
+#ifdef CONFIG_CMD_NAND_TORTURE
+ "nand torture off - torture block at offset\n"
+#endif
"nand scrub [-y] off size | scrub.part partition | scrub.chip\n"
" really clean NAND erasing bad blocks (UNSAFE)\n"
"nand markbad off [...] - mark bad block(s) at offset (UNSAFE)\n"