diff mbox

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

Message ID 1382089595-5235-2-git-send-email-josh.wu@atmel.com
State Superseded
Delegated to: Scott Wood
Headers show

Commit Message

Josh Wu Oct. 18, 2013, 9:46 a.m. UTC
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@atmel.com>
---
 include/mtd/mtd-abi.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Scott Wood Nov. 14, 2013, 12:59 a.m. UTC | #1
On Fri, Oct 18, 2013 at 05:46:30PM +0800, Wu, Josh wrote:
> 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@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];
>  };

See http://patchwork.ozlabs.org/patch/280488/

-Scott
diff mbox

Patch

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];
 };