Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 438320dd authored by Jordan Friendshuh's avatar Jordan Friendshuh Committed by Brian Norris
Browse files

mtd: nand: Base BCH ECC bytes on required strength



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

Signed-off-by: default avatarJordan Friendshuh <jfriendshuh@xes-inc.com>
Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent c9d79c4b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4035,7 +4035,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);