Skip to contentSkip to conversation

mtd: nand: Base BCH ECC bytes on required strength

PATCH Applied Aaron Sierra 2 participants 2 messages Aug 27, 2014 – Nov 5, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 mtd: nand: Base BCH ECC bytes on required strength

In reply to a message not in the archive

From: Jordan Friendshuh <[email protected]>

NAND devices with page sizes over 4 KiB require more than 4-bits of ECC coverage. This patch calculates the value of ecc_bytes based on a still assumed 512-byte step size (13-bits) and the ecc_strength.

Example:
Micron M73A devices (8 KiB page) require 8-bit ECC per 512-byte

---
 drivers/mtd/nand/nand_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_base.c +1 -1
index 4f3e80c..9fdfed4 100644
@@ -4001,7 +4001,7 @@ int nand_scan_tail(struct mtd_info *mtd)
 		 */
 		if (!ecc->size && (mtd->oobsize >= 64)) {
 			ecc->size = 512;
-			ecc->bytes = 7;
+			ecc->bytes = DIV_ROUND_UP(13 * ecc->strength, 8);
 		}
 		ecc->priv = nand_bch_init(mtd, ecc->size, ecc->bytes,
 					       &ecc->layout);
Signature · 1 line
1.9.1
Applied
#2 lore raw
Quoted 11 lines · Aaron Sierra

From: Jordan Friendshuh <[email protected]>

NAND devices with page sizes over 4 KiB require more than 4-bits of ECC coverage. This patch calculates the value of ecc_bytes based on a still assumed 512-byte step size (13-bits) and the ecc_strength.

Example:
Micron M73A devices (8 KiB page) require 8-bit ECC per 512-byte

Applied to l2-mtd.git.

Brian