summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElie De Brauwer <eliedebrauwer@gmail.com>2013-08-24 16:51:24 +0200
committerStefano Babic <sbabic@denx.de>2013-09-11 09:33:36 +0200
commita8f2d0e6757c8f5391113582d8fecad29dc8cedc (patch)
treeca5e4c8972038a1da9b94b096621644fe8e43cd8
parent47ac53d7aee90ec46f7a5b4e10e62114e60b1976 (diff)
downloadtalos-obmc-uboot-a8f2d0e6757c8f5391113582d8fecad29dc8cedc.tar.gz
talos-obmc-uboot-a8f2d0e6757c8f5391113582d8fecad29dc8cedc.zip
mxs_nand: Fix ECC strength for NAND flash with OOB size of 224
On a board with an i.mx28 and a Micron MT29F4G08ABAEAH4, Linux says: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron MT29F4G08ABAEAH4), 512MiB, page size: 4096, OOB size: 224) the ECC strength is 16. root@(none):/sys/devices/virtual/mtd/mtd0# for i in ecc_strength oobsize subpagesize; do echo $i = `cat $i`; done ecc_strength = 16 oobsize = 224 subpagesize = 4096 The ECC strength was not properly discovered by U-Boot causing the data written by Linux to return an -74 (EBADMSG) when read from U-Boot. This patch fixes mxs_nand_get_ecc_strength() to function in case of a NAND flash with page_data_size = 4096 and page_oob_size= 224. Signed-off-by: Elie De Brauwer <eliedebrauwer@gmail.com> Acked-by: Scott Wood <scottwood@freescale.com>
-rw-r--r--drivers/mtd/nand/mxs_nand.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index 378f8c513a..036c113ad3 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -155,6 +155,9 @@ static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size,
if (page_oob_size == 218)
return 16;
+
+ if (page_oob_size == 224)
+ return 16;
}
return 0;
OpenPOWER on IntegriCloud