[U-Boot] [PATCH 1/5] MTD: nand: increase the max eccpos size to 448 to support 8k page nand

Josh Wu josh.wu at atmel.com
Fri Oct 18 11:46:30 CEST 2013


For example, Micron MT29F64G08CBAAAWP has 8192 bytes page with 448 byte
oob. It needs 24bit ecc per page.
If 24bit error correction per 1024 bytes need extra 42 bytes in oob.
That means we need eccpos array size is 336 byte.

Signed-off-by: Josh Wu <josh.wu at atmel.com>
---
 include/mtd/mtd-abi.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index d51c1ab..f6f7370 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -156,13 +156,14 @@ struct nand_oobfree {
 };
 
 #define MTD_MAX_OOBFREE_ENTRIES	8
+#define MTD_MAX_ECCPOS_ENTRIES_LARGE    448
 /*
  * ECC layout control structure. Exported to userspace for
  * diagnosis and to allow creation of raw images
  */
 struct nand_ecclayout {
 	uint32_t eccbytes;
-	uint32_t eccpos[128];
+	uint32_t eccpos[MTD_MAX_ECCPOS_ENTRIES_LARGE];
 	uint32_t oobavail;
 	struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
 };
-- 
1.7.9.5



More information about the U-Boot mailing list