summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2010-10-18 09:23:25 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-18 13:33:43 +0300
commitf5ed5cc0682ef8806279fc461b8a19946d133252 (patch)
tree99fc7bbaa9fe41c0342c8aeecbc6feed7c8db9d8
parent4fdd0fe036c9122edb708221b66e168a7f6aa77b (diff)
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 <baruch@tkos.co.il> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--feature-removal-schedule.txt12
-rw-r--r--nanddump.c7
2 files changed, 18 insertions, 1 deletions
diff --git a/feature-removal-schedule.txt b/feature-removal-schedule.txt
index 21bc8d4..4e9824a 100644
--- a/feature-removal-schedule.txt
+++ b/feature-removal-schedule.txt
@@ -27,5 +27,15 @@ So the plan is (to be done by Artem Bityutskiy):
3.1 adding a warning to make users stop using them
3.2 removing both options.
---------------------------
-2.
+2. nanddump: fail when the -s parameter is not page aligned
+
+nanddump should be consistent with nandwrite, and refuse accepting non page
+aligned start addresses. These dumps are most likely useless, since nandwrite
+won't write then at this location. Currently only a warning is issued to keep
+backward compatibility during a transition period. This should become an error
+one release after the next release (current is mtd-utils-1.4.0, 18 Sep 2010).
+
+To be done by Artem Bityutskiy.
+---------------------------
+3.
---------------------------
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)