Skip to contentSkip to conversation

NAND: davinci_nand, 4-bit ECC for smallpage

patch/rft 2.6.30-rc1 David Brownell 1 participant 1 message Apr 8, 2009

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

Minimal support for the 4-bit ECC engine found on DM355 and OMAP-L137 chips. This is limited to small-page flash for now; there are special layout issues for large page chips (which, nowadays, are prevalent).

Note that the DM355 EVM uses a large-page chip -- unless you swap socketed chips -- so this version will be a bit awkward to test. The core ECC logic is unchanged from the version which was previously happy with most of the newish MTD tests.

CHANGES since my last version: says byebye to ECC_HW_SYNDROME; select this using an explicit count of how many ECC bits to use. Add brief comment about the anticipated fix for the large page issue.

# NYET Signed-off-...

---
 arch/arm/mach-davinci/include/mach/nand.h |    8 
 drivers/mtd/nand/davinci_nand.c           |  302 ++++++++++++++++++++++++++--
 2 files changed, 295 insertions(+), 15 deletions(-)
arch/arm/mach-davinci/include/mach/nand.h +6 -2
@@ -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 support 4 bits 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 +289 -13

373 lines not on this page · raw message