[PATCH 6/9] s3c2410: Add NAND force software ECC

Nelson Castillo arhuaco at freaks-unidos.net
Tue Mar 31 20:07:20 CEST 2009


Allow software ECC forcing.

Signed-off-by: Andy Green <andy at openmoko.com>
---

 arch/arm/plat-s3c/include/plat/nand.h |    1 +
 drivers/mtd/nand/s3c2410.c            |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-s3c/include/plat/nand.h b/arch/arm/plat-s3c/include/plat/nand.h
index 70e1a72..b37ded0 100644
--- a/arch/arm/plat-s3c/include/plat/nand.h
+++ b/arch/arm/plat-s3c/include/plat/nand.h
@@ -24,6 +24,7 @@
 struct s3c2410_nand_set {
 	unsigned int		disable_ecc:1;
 	unsigned int		use_bbt:1;
+	unsigned int		force_soft_ecc:1;
 
 	int			nr_chips;
 	int			nr_partitions;
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 3c733b9..65ccf17 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -743,7 +743,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
 	nmtd->mtd.owner    = THIS_MODULE;
 	nmtd->set	   = set;
 
-	if (hardware_ecc) {
+	if (!set->force_soft_ecc && hardware_ecc) {
 		chip->ecc.calculate = s3c2410_nand_calculate_ecc;
 		chip->ecc.correct   = s3c2410_nand_correct_data;
 		chip->ecc.mode	    = NAND_ECC_HW;




More information about the openmoko-kernel mailing list