Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 drivers/mtd/nand/mxs_nand.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index 912fed8..76e47ab 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -148,6 +148,13 @@ static inline uint32_t mxs_nand_get_ecc_strength(uint32_t 
page_data_size,
 {
        int ecc_strength;
 
+       /* Determine the ECC layout with the formula:
+        *      ECC bits per chunk = (total page spare data bits) /
+        *              (bits per ECC level) / (chunks per page)
+        * where:
+        *      total page spare data bits =
+        *              (page oob size - meta data size) * (bits per byte)
+        */
        ecc_strength = ((page_oob_size - MXS_NAND_METADATA_SIZE) * 8)
                        / (MXS_NAND_BITS_PER_ECC_LEVEL *
                                mxs_nand_ecc_chunk_cnt(page_data_size));
-- 
2.3.5

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to