]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi: tests: Support up to 65k NAND page size
authorRichard Weinberger <richard@nod.at>
Mon, 22 Feb 2016 13:52:04 +0000 (14:52 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Tue, 21 Feb 2017 09:13:24 +0000 (10:13 +0100)
io_read and io_update of mtd-utils support NAND with 4k page size only.
Increase that to support up to 65k page size.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
tests/ubi-tests/helpers.h
tests/ubi-tests/io_read.c
tests/ubi-tests/io_update.c

index d7d6d9c217bbf60677b14b2a23949123a8f65e39..4533f4b773e12e231058de6865d1462f2867afc7 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 
 #define UBI_VOLUME_PATTERN "/dev/ubi%d_%d"
 #define MIN_AVAIL_EBS 5
-#define PAGE_SIZE 4096
+#define MAX_NAND_PAGE_SIZE 65536
 
 #define errorm(fmt, ...) ({                                                    \
        __errorm(PROGRAM_NAME, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__);    \
index 386291edb454b9b87b2a8508d2c2b24b930f8481..f48db677f655cacfedc34fa443d1297a45260dde 100644 (file)
@@ -41,7 +41,7 @@ static int fd;
 /* Data lengthes to test, @io - minimal I/O unit size, @s - eraseblock size */
 #define LENGTHES(io, s)                                                        \
        {1, (io), (io)+1, 2*(io), 3*(io)-1, 3*(io),                            \
-        PAGE_SIZE-1, PAGE_SIZE-(io), 2*PAGE_SIZE, 2*PAGE_SIZE-(io),           \
+        MAX_NAND_PAGE_SIZE-1, MAX_NAND_PAGE_SIZE-(io), 2*MAX_NAND_PAGE_SIZE, 2*MAX_NAND_PAGE_SIZE-(io),           \
         (s)/2-1, (s)/2, (s)/2+1, (s)-1, (s), (s)+1, 2*(s)-(io), 2*(s),        \
         2*(s)+(io), 3*(s), 3*(s)+(io)};
 
@@ -51,9 +51,9 @@ static int fd;
  */
 #define OFFSETS(io, s, sz)                                                     \
        {0, (io)-1, (io), (io)+1, 2*(io)-1, 2*(io), 3*(io)-1, 3*(io),          \
-        PAGE_SIZE-1, PAGE_SIZE-(io), 2*PAGE_SIZE, 2*PAGE_SIZE-(io),           \
+        MAX_NAND_PAGE_SIZE-1, MAX_NAND_PAGE_SIZE-(io), 2*MAX_NAND_PAGE_SIZE, 2*MAX_NAND_PAGE_SIZE-(io),           \
         (s)/2-1, (s)/2, (s)/2+1, (s)-1, (s), (s)+1, 2*(s)-(io), 2*(s),        \
-        2*(s)+(io), 3*(s), (sz)-(s)-1, (sz)-(io)-1, (sz)-PAGE_SIZE-1};
+        2*(s)+(io), 3*(s), (sz)-(s)-1, (sz)-(io)-1, (sz)-MAX_NAND_PAGE_SIZE-1};
 
 /**
  * test_static - test static volume-specific features.
index 2e9969e246593c515ae14c5dd84dd92d625b3ce9..7040e6aaf682761b01814a593504c8ad9f5686f3 100644 (file)
@@ -44,22 +44,22 @@ const char *node;
        {512},                       \
        {666},                       \
        {2048},                      \
-       {(io), (io), PAGE_SIZE},     \
-       {(io)+1, (io)+1, PAGE_SIZE}, \
-       {PAGE_SIZE},                 \
-       {PAGE_SIZE-1},               \
-       {PAGE_SIZE+(io)},            \
+       {(io), (io), MAX_NAND_PAGE_SIZE},     \
+       {(io)+1, (io)+1, MAX_NAND_PAGE_SIZE}, \
+       {MAX_NAND_PAGE_SIZE},                 \
+       {MAX_NAND_PAGE_SIZE-1},               \
+       {MAX_NAND_PAGE_SIZE+(io)},            \
        {(s)},                       \
        {(s)-1},                     \
        {(s)+1},                     \
        {(io), (s)+1},               \
-       {(s)+(io), PAGE_SIZE},       \
-       {2*(s), PAGE_SIZE},          \
-       {PAGE_SIZE, 2*(s), 1},       \
-       {PAGE_SIZE, 2*(s)},          \
+       {(s)+(io), MAX_NAND_PAGE_SIZE},       \
+       {2*(s), MAX_NAND_PAGE_SIZE},          \
+       {MAX_NAND_PAGE_SIZE, 2*(s), 1},       \
+       {MAX_NAND_PAGE_SIZE, 2*(s)},          \
        {2*(s)-1, 2*(s)-1},          \
-       {3*(s), PAGE_SIZE + 1},      \
-       {1, PAGE_SIZE},              \
+       {3*(s), MAX_NAND_PAGE_SIZE + 1},      \
+       {1, MAX_NAND_PAGE_SIZE},              \
        {(io), (s)}                  \
 }