summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan Xu <b45815@freescale.com>2015-04-30 14:41:28 -0500
committerHan Xu <b45815@freescale.com>2015-04-30 14:49:20 -0500
commit053dda1f184cf31472444fcdcf6b0543a40aa193 (patch)
tree820b2e95164687836d02d46dec5e627a24d923bb
parent9b97b690c68b59c99458360d907ea0970577e36a (diff)
downloadu-boot-imx-053dda1f184cf31472444fcdcf6b0543a40aa193.zip
u-boot-imx-053dda1f184cf31472444fcdcf6b0543a40aa193.tar.gz
u-boot-imx-053dda1f184cf31472444fcdcf6b0543a40aa193.tar.bz2
MLK-10740: add maximum ecc platfrom can support
Add maximum ecc strength for each platfrom to avoid the calculated ecc exceed the limitation. Signed-off-by: Han Xu <b45815@freescale.com> (cherry picked from commit fdc5bac6ae8b699924c4e84b86e38aa73f694827)
-rw-r--r--drivers/mtd/nand/mxs_nand.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index e76d9e1..0dcdbcf 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -41,6 +41,12 @@
#define MXS_NAND_BCH_TIMEOUT 10000
+#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX7))
+#define MXS_NAND_MAX_ECC_STRENGTH 62
+#else
+#define MXS_NAND_MAX_ECC_STRENGTH 40
+#endif
+
int chunk_data_chunk_size = MXS_NAND_CHUNK_DATA_CHUNK_SIZE;
int galois_field = 13;
@@ -156,7 +162,7 @@ static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size,
/* We need the minor even number. */
ecc_strength -= ecc_strength & 1;
- return ecc_strength;
+ return min(ecc_strength, MXS_NAND_MAX_ECC_STRENGTH);
}
static inline uint32_t mxs_nand_get_mark_offset(uint32_t page_data_size,