Skip to contentSkip to conversation

NDFC: add support for alternate ECC format for ndfc

PATCH New Feng Kan 1 participant 1 message Feb 18, 2010

Subsystems (2)
lore
Share & tools
lore

Feng Kan

author
#0 lore raw

PATCH 1/1 NDFC: add support for alternate ECC format for ndfc

This is to lock down the ordering in the correction routine against the calculate routine. Otherwise, incorrect define would cause ECC errors.

---
 drivers/mtd/nand/ndfc.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/mtd/nand/ndfc.c +6 -0
index 40b5658..fc1f0ff 100644
@@ -102,10 +102,15 @@ static int ndfc_calculate_ecc(struct mtd_info *mtd,
 	wmb();
 	ecc = in_be32(ndfc->ndfcbase + NDFC_ECC);
 	/* The NDFC uses Smart Media (SMC) bytes order */
+#ifdef CONFIG_MTD_NAND_ECC_SMC
 	ecc_code[0] = p[1];
 	ecc_code[1] = p[2];
 	ecc_code[2] = p[3];
+#else
+	ecc_code[0] = p[2];
+	ecc_code[1] = p[1];
+	ecc_code[2] = p[3];
+#endif
 
 	return 0;
 }
Signature · 1 line
1.5.5