summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/nandtest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/commands/nandtest.c b/commands/nandtest.c
index f9c9318e13..f08f8eb886 100644
--- a/commands/nandtest.c
+++ b/commands/nandtest.c
@@ -282,6 +282,13 @@ static int do_nandtest(int argc, char *argv[])
printf("Erasesize: 0x%08x\n", meminfo.erasesize);
printf("Starting nandtest...\n");
+ if (!IS_ALIGNED(meminfo.erasesize, meminfo.writesize)) {
+ printf("Erasesize 0x%08x is not a multiple "
+ "of writesize 0x%08x.\n"
+ "Please check driver implementation\n",
+ meminfo.erasesize, meminfo.writesize);
+ goto err;
+ }
if (!IS_ALIGNED(flash_offset, meminfo.erasesize)) {
printf("Offset 0x%08llx not multiple of erase size 0x%08x\n",
flash_offset, meminfo.erasesize);