From f5ed5cc0682ef8806279fc461b8a19946d133252 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Mon, 18 Oct 2010 09:23:25 +0200 Subject: nanddump: warn when the start address is not page aligned nanddump should be consistent with nandwrite, which does not accept non page aligned start addresses. Thus, non page aligned dumps are useless. To ease migration only warn for now. Add the plan of making this an error to feature-removal-schedule.txt. Tweaked by Artem. Signed-off-by: Baruch Siach Signed-off-by: Artem Bityutskiy --- nanddump.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nanddump.c') diff --git a/nanddump.c b/nanddump.c index 15bf9c4..bb649da 100644 --- a/nanddump.c +++ b/nanddump.c @@ -360,6 +360,13 @@ int main(int argc, char * const argv[]) } /* Initialize start/end addresses and block size */ + if (start_addr & (meminfo.writesize - 1)) { + fprintf(stderr, "WARNING: The start address is not page-aligned !\n" + "The pagesize of this NAND Flash is 0x%x.\n" + "nandwrite doesn't allow writes starting at this location.\n" + "Future versions of nanddump will fail here.\n", + meminfo.writesize); + } if (length) end_addr = start_addr + length; if (!length || end_addr > meminfo.size) -- cgit v1.2.3