Skip to contentSkip to conversation

mtd: nand: davinci_nand: 4-bit ECC for smallpage

PATCH In review [email protected] 1 participant 1 message May 12, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 12/14 mtd: nand: davinci_nand: 4-bit ECC for smallpage

From: David Brownell <[email protected]>

Minimal support for the 4-bit ECC engine found on DM355, DM365, DA830/OMAP-L137, and similar recent DaVinci-family chips.

This is limited to small-page flash for now; there are some page layout issues for large page chips. Note that most boards using this engine (like the DM355 EVM) include 2GByte large page chips.

Sanity tested on DM355 EVM after swapping the socketed NAND for a small-page one.

---

 arch/arm/mach-davinci/include/mach/nand.h |    8 
 drivers/mtd/nand/davinci_nand.c           |  304 +++++++++++++++++++-
 2 files changed, 297 insertions(+), 15 deletions(-)
arch/arm/mach-davinci/include/mach/nand.h renamed from arch/arm/mach-davinci/include/mach/nand.h~mtd-nand-davinci_nand-4-bit-ecc-for-smallpage +6 -2
diff -puN arch/arm/mach-davinci/include/mach/nand.h~mtd-nand-davinci_nand-4-bit-ecc-for-smallpage arch/arm/mach-davinci/include/mach/nand.h
@@ -68,10 +68,14 @@ struct davinci_nand_pdata {		/* platform
 
 	/* none  == NAND_ECC_NONE (strongly *not* advised!!)
 	 * soft  == NAND_ECC_SOFT
-	 * 1-bit == NAND_ECC_HW
-	 * 4-bit == NAND_ECC_HW_SYNDROME (not on all chips)
+	 * else  == NAND_ECC_HW, according to ecc_bits
+	 *
+	 * All DaVinci-family chips support 1-bit hardware ECC.
+	 * Newer ones also support 4-bit ECC, but are awkward
+	 * using it with large page chips.
 	 */
 	nand_ecc_modes_t	ecc_mode;
+	u8			ecc_bits;
 
 	/* e.g. NAND_BUSWIDTH_16 or NAND_USE_FLASH_BBT */
 	unsigned		options;
drivers/mtd/nand/davinci_nand.c renamed from drivers/mtd/nand/davinci_nand.c~mtd-nand-davinci_nand-4-bit-ecc-for-smallpage +291 -13

375 lines not on this page · raw message

_