summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHan Xu <b45815@freescale.com>2015-04-30 14:41:28 -0500
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:33 +0100
commitc522e3d8c371a1163e417dfd658fcc6516c6abb9 (patch)
tree29cb3c30538096c701424b524644d4b7852abedf /drivers
parent34ece78a0655bba0300cfbb22711ae0a53eb0db3 (diff)
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)
Diffstat (limited to 'drivers')
-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 3f8d2235ae..f17a691ab4 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,