9
0
Fork 0

nand: Make different ecc modes optional

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2011-04-04 12:26:25 +02:00
parent eb133335e6
commit 8f5b0e497a
3 changed files with 32 additions and 5 deletions

View File

@ -13,6 +13,26 @@ config NAND_WRITE
default y
prompt "Support writing to Nand"
config NAND_ECC_SOFT
bool
default y
prompt "Support software ecc"
config NAND_ECC_HW
bool
default y
prompt "Support hardware ecc"
config NAND_ECC_HW_SYNDROME
bool
default y
prompt "Support syndrome hardware ecc controllers"
config NAND_ECC_HW_NONE
bool
default y
prompt "Support skipping ecc support"
config NAND_IMX
bool
prompt "i.MX NAND driver"

View File

@ -1,7 +1,10 @@
# Generic NAND options
obj-$(CONFIG_NAND) += nand.o nand_ecc.o nand_hwecc.o nand_swecc.o nand_hwecc_syndrome.o
obj-$(CONFIG_NAND) += nand.o nand_ecc.o
obj-$(CONFIG_NAND_WRITE) += nand_write.o
obj-$(CONFIG_NAND_ECC_SOFT) += nand_ecc.o nand_swecc.o
obj-$(CONFIG_NAND_ECC_HW) += nand_hwecc.o
obj-$(CONFIG_NAND_ECC_HW_SYNDROME) += nand_hwecc_syndrome.o
obj-$(CONFIG_MTD_NAND_IDS) += nand_ids.o
obj-$(CONFIG_NAND) += nand_base.o nand_bbt.o

View File

@ -1322,20 +1322,24 @@ int nand_scan_tail(struct mtd_info *mtd)
chip->ecc.write_page_raw = nand_write_page_raw;
#endif
switch (chip->ecc.mode) {
#ifdef CONFIG_NAND_ECC_HW
case NAND_ECC_HW:
nand_check_hwecc(mtd, chip);
nand_init_ecc_hw(chip);
break;
#endif
#ifdef CONFIG_NAND_ECC_HW_SYNDROME
case NAND_ECC_HW_SYNDROME:
nand_check_hwecc(mtd, chip);
nand_init_ecc_hw_syndrome(chip);
break;
#endif
#ifdef CONFIG_NAND_ECC_SOFT
case NAND_ECC_SOFT:
nand_init_ecc_soft(chip);
break;
#endif
#ifdef CONFIG_NAND_ECC_NONE
case NAND_ECC_NONE:
printk(KERN_WARNING "NAND_ECC_NONE selected by board driver. "
"This is not recommended !!\n");
@ -1348,7 +1352,7 @@ int nand_scan_tail(struct mtd_info *mtd)
chip->ecc.size = mtd->writesize;
chip->ecc.bytes = 0;
break;
#endif
default:
printk(KERN_WARNING "Invalid NAND_ECC_MODE %d\n",
chip->ecc.mode);