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

Commit 8c3e843d authored by Andy Green's avatar Andy Green Committed by Ben Dooks
Browse files

[MTD] [NAND] S3C2410: NAND ECC by chip rather than global



This makes us take note about the chosen ECC mode per-chip and
not the one set globally.

Signed-off-by: default avatarAndy Green <andy@warmcat.com>
Signed-off-by: default avatarNelson Castillo <arhuaco@freaks-unidos.net>
[ben-linux@fluff.org: andy@openmoko.com => andy@warmcat.com, rewrite subject]
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 3db72151
Loading
Loading
Loading
Loading
+25 −9
Original line number Diff line number Diff line
@@ -819,6 +819,21 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,

	if (set->disable_ecc)
		chip->ecc.mode	= NAND_ECC_NONE;

	switch (chip->ecc.mode) {
	case NAND_ECC_NONE:
		dev_info(info->device, "NAND ECC disabled\n");
		break;
	case NAND_ECC_SOFT:
		dev_info(info->device, "NAND soft ECC\n");
		break;
	case NAND_ECC_HW:
		dev_info(info->device, "NAND hardware ECC\n");
		break;
	default:
		dev_info(info->device, "NAND ECC UNKNOWN\n");
		break;
	}
}

/**
@@ -840,7 +855,9 @@ static void s3c2410_nand_update_chip(struct s3c2410_nand_info *info,
	dev_dbg(info->device, "chip %p => page shift %d\n",
		chip, chip->page_shift);

	if (hardware_ecc) {
	if (chip->ecc.mode != NAND_ECC_HW)
		return;

		/* change the behaviour depending on wether we are using
		 * the large or small page nand device */

@@ -853,7 +870,6 @@ static void s3c2410_nand_update_chip(struct s3c2410_nand_info *info,
		chip->ecc.layout    = &nand_hw_eccoob;
	}
}
}

/* s3c24xx_nand_probe
 *