diff options
31 files changed, 63 insertions, 1 deletions
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c index 7ad7b054800c..a4eb8b5b85ec 100644 --- a/drivers/mtd/devices/doc2000.c +++ b/drivers/mtd/devices/doc2000.c | |||
@@ -564,6 +564,7 @@ void DoC2k_init(struct mtd_info *mtd) | |||
564 | mtd->flags = MTD_CAP_NANDFLASH; | 564 | mtd->flags = MTD_CAP_NANDFLASH; |
565 | mtd->writebufsize = mtd->writesize = 512; | 565 | mtd->writebufsize = mtd->writesize = 512; |
566 | mtd->oobsize = 16; | 566 | mtd->oobsize = 16; |
567 | mtd->ecc_strength = 2; | ||
567 | mtd->owner = THIS_MODULE; | 568 | mtd->owner = THIS_MODULE; |
568 | mtd->_erase = doc_erase; | 569 | mtd->_erase = doc_erase; |
569 | mtd->_read = doc_read; | 570 | mtd->_read = doc_read; |
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c index 7bff54e62cd5..f6927955dab0 100644 --- a/drivers/mtd/devices/doc2001.c +++ b/drivers/mtd/devices/doc2001.c | |||
@@ -348,6 +348,7 @@ void DoCMil_init(struct mtd_info *mtd) | |||
348 | mtd->erasesize = 0x2000; | 348 | mtd->erasesize = 0x2000; |
349 | mtd->writebufsize = mtd->writesize = 512; | 349 | mtd->writebufsize = mtd->writesize = 512; |
350 | mtd->oobsize = 16; | 350 | mtd->oobsize = 16; |
351 | mtd->ecc_strength = 2; | ||
351 | mtd->owner = THIS_MODULE; | 352 | mtd->owner = THIS_MODULE; |
352 | mtd->_erase = doc_erase; | 353 | mtd->_erase = doc_erase; |
353 | mtd->_read = doc_read; | 354 | mtd->_read = doc_read; |
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c index 4a03d869ad03..04eb2e4aa50f 100644 --- a/drivers/mtd/devices/doc2001plus.c +++ b/drivers/mtd/devices/doc2001plus.c | |||
@@ -469,6 +469,7 @@ void DoCMilPlus_init(struct mtd_info *mtd) | |||
469 | mtd->flags = MTD_CAP_NANDFLASH; | 469 | mtd->flags = MTD_CAP_NANDFLASH; |
470 | mtd->writebufsize = mtd->writesize = 512; | 470 | mtd->writebufsize = mtd->writesize = 512; |
471 | mtd->oobsize = 16; | 471 | mtd->oobsize = 16; |
472 | mtd->ecc_strength = 2; | ||
472 | mtd->owner = THIS_MODULE; | 473 | mtd->owner = THIS_MODULE; |
473 | mtd->_erase = doc_erase; | 474 | mtd->_erase = doc_erase; |
474 | mtd->_read = doc_read; | 475 | mtd->_read = doc_read; |
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index 2c1d0fca6757..349bbfa74d0d 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c | |||
@@ -1832,6 +1832,7 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd) | |||
1832 | mtd->_write_oob = doc_write_oob; | 1832 | mtd->_write_oob = doc_write_oob; |
1833 | mtd->_block_isbad = doc_block_isbad; | 1833 | mtd->_block_isbad = doc_block_isbad; |
1834 | mtd->ecclayout = &docg3_oobinfo; | 1834 | mtd->ecclayout = &docg3_oobinfo; |
1835 | mtd->ecc_strength = DOC_ECC_BCH_T; | ||
1835 | } | 1836 | } |
1836 | 1837 | ||
1837 | /** | 1838 | /** |
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 226d28a618d8..9651c06de0a9 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -516,6 +516,7 @@ static struct mtd_part *allocate_partition(struct mtd_info *master, | |||
516 | } | 516 | } |
517 | 517 | ||
518 | slave->mtd.ecclayout = master->ecclayout; | 518 | slave->mtd.ecclayout = master->ecclayout; |
519 | slave->mtd.ecc_strength = master->ecc_strength; | ||
519 | if (master->_block_isbad) { | 520 | if (master->_block_isbad) { |
520 | uint64_t offs = 0; | 521 | uint64_t offs = 0; |
521 | 522 | ||
diff --git a/drivers/mtd/nand/alauda.c b/drivers/mtd/nand/alauda.c index ac38f73fde3b..4f20e1d8bef1 100644 --- a/drivers/mtd/nand/alauda.c +++ b/drivers/mtd/nand/alauda.c | |||
@@ -591,6 +591,7 @@ static int alauda_init_media(struct alauda *al) | |||
591 | mtd->_block_isbad = alauda_isbad; | 591 | mtd->_block_isbad = alauda_isbad; |
592 | mtd->priv = al; | 592 | mtd->priv = al; |
593 | mtd->owner = THIS_MODULE; | 593 | mtd->owner = THIS_MODULE; |
594 | mtd->ecc_strength = 1; | ||
594 | 595 | ||
595 | err = mtd_device_register(mtd, NULL, 0); | 596 | err = mtd_device_register(mtd, NULL, 0); |
596 | if (err) { | 597 | if (err) { |
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 7769519a54a7..662abf08061a 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
@@ -554,6 +554,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
554 | nand_chip->ecc.hwctl = atmel_nand_hwctl; | 554 | nand_chip->ecc.hwctl = atmel_nand_hwctl; |
555 | nand_chip->ecc.read_page = atmel_nand_read_page; | 555 | nand_chip->ecc.read_page = atmel_nand_read_page; |
556 | nand_chip->ecc.bytes = 4; | 556 | nand_chip->ecc.bytes = 4; |
557 | nand_chip->ecc.strength = 1; | ||
557 | } | 558 | } |
558 | 559 | ||
559 | nand_chip->chip_delay = 20; /* 20us command delay time */ | 560 | nand_chip->chip_delay = 20; /* 20us command delay time */ |
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c index ee81b6333f6a..fc600431f519 100644 --- a/drivers/mtd/nand/bcm_umi_nand.c +++ b/drivers/mtd/nand/bcm_umi_nand.c | |||
@@ -476,6 +476,14 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev) | |||
476 | largepage_bbt.options = NAND_BBT_SCAN2NDPAGE; | 476 | largepage_bbt.options = NAND_BBT_SCAN2NDPAGE; |
477 | this->badblock_pattern = &largepage_bbt; | 477 | this->badblock_pattern = &largepage_bbt; |
478 | } | 478 | } |
479 | |||
480 | /* | ||
481 | * FIXME: ecc strength value of 6 bits per 512 bytes of data is a | ||
482 | * conservative guess, given 13 ecc bytes and using bch alg. | ||
483 | * (Assume Galois field order m=15 to allow a margin of error.) | ||
484 | */ | ||
485 | this->ecc.strength = 6; | ||
486 | |||
479 | #endif | 487 | #endif |
480 | 488 | ||
481 | /* Now finish off the scan, now that ecc.layout has been initialized. */ | 489 | /* Now finish off the scan, now that ecc.layout has been initialized. */ |
diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index dd899cb5d366..d7b86b925de5 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c | |||
@@ -702,9 +702,11 @@ static int bf5xx_nand_scan(struct mtd_info *mtd) | |||
702 | if (likely(mtd->writesize >= 512)) { | 702 | if (likely(mtd->writesize >= 512)) { |
703 | chip->ecc.size = 512; | 703 | chip->ecc.size = 512; |
704 | chip->ecc.bytes = 6; | 704 | chip->ecc.bytes = 6; |
705 | chip->ecc.strength = 2; | ||
705 | } else { | 706 | } else { |
706 | chip->ecc.size = 256; | 707 | chip->ecc.size = 256; |
707 | chip->ecc.bytes = 3; | 708 | chip->ecc.bytes = 3; |
709 | chip->ecc.strength = 1; | ||
708 | bfin_write_NFC_CTL(bfin_read_NFC_CTL() & ~(1 << NFC_PG_SIZE_OFFSET)); | 710 | bfin_write_NFC_CTL(bfin_read_NFC_CTL() & ~(1 << NFC_PG_SIZE_OFFSET)); |
709 | SSYNC(); | 711 | SSYNC(); |
710 | } | 712 | } |
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index c23c07c5b391..2a96e1a12062 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c | |||
@@ -783,6 +783,7 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev, | |||
783 | cafe->nand.ecc.mode = NAND_ECC_HW_SYNDROME; | 783 | cafe->nand.ecc.mode = NAND_ECC_HW_SYNDROME; |
784 | cafe->nand.ecc.size = mtd->writesize; | 784 | cafe->nand.ecc.size = mtd->writesize; |
785 | cafe->nand.ecc.bytes = 14; | 785 | cafe->nand.ecc.bytes = 14; |
786 | cafe->nand.ecc.strength = 4; | ||
786 | cafe->nand.ecc.hwctl = (void *)cafe_nand_bug; | 787 | cafe->nand.ecc.hwctl = (void *)cafe_nand_bug; |
787 | cafe->nand.ecc.calculate = (void *)cafe_nand_bug; | 788 | cafe->nand.ecc.calculate = (void *)cafe_nand_bug; |
788 | cafe->nand.ecc.correct = (void *)cafe_nand_bug; | 789 | cafe->nand.ecc.correct = (void *)cafe_nand_bug; |
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c index e2b7c9e4c5c2..821c34c62500 100644 --- a/drivers/mtd/nand/cs553x_nand.c +++ b/drivers/mtd/nand/cs553x_nand.c | |||
@@ -248,6 +248,8 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) | |||
248 | goto out_ior; | 248 | goto out_ior; |
249 | } | 249 | } |
250 | 250 | ||
251 | this->ecc.strength = 1; | ||
252 | |||
251 | new_mtd->name = kasprintf(GFP_KERNEL, "cs553x_nand_cs%d", cs); | 253 | new_mtd->name = kasprintf(GFP_KERNEL, "cs553x_nand_cs%d", cs); |
252 | 254 | ||
253 | cs553x_mtd[cs] = new_mtd; | 255 | cs553x_mtd[cs] = new_mtd; |
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index b81afc748fff..d94b03c207af 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c | |||
@@ -641,6 +641,7 @@ static int __init nand_davinci_probe(struct platform_device *pdev) | |||
641 | info->chip.ecc.bytes = 3; | 641 | info->chip.ecc.bytes = 3; |
642 | } | 642 | } |
643 | info->chip.ecc.size = 512; | 643 | info->chip.ecc.size = 512; |
644 | info->chip.ecc.strength = pdata->ecc_bits; | ||
644 | break; | 645 | break; |
645 | default: | 646 | default: |
646 | ret = -EINVAL; | 647 | ret = -EINVAL; |
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 3984d488f9ab..a9e57d686297 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c | |||
@@ -1590,6 +1590,7 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1590 | ECC_15BITS * (denali->mtd.writesize / | 1590 | ECC_15BITS * (denali->mtd.writesize / |
1591 | ECC_SECTOR_SIZE)))) { | 1591 | ECC_SECTOR_SIZE)))) { |
1592 | /* if MLC OOB size is large enough, use 15bit ECC*/ | 1592 | /* if MLC OOB size is large enough, use 15bit ECC*/ |
1593 | denali->nand.ecc.strength = 15; | ||
1593 | denali->nand.ecc.layout = &nand_15bit_oob; | 1594 | denali->nand.ecc.layout = &nand_15bit_oob; |
1594 | denali->nand.ecc.bytes = ECC_15BITS; | 1595 | denali->nand.ecc.bytes = ECC_15BITS; |
1595 | iowrite32(15, denali->flash_reg + ECC_CORRECTION); | 1596 | iowrite32(15, denali->flash_reg + ECC_CORRECTION); |
@@ -1600,12 +1601,14 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1600 | " contain 8bit ECC correction codes"); | 1601 | " contain 8bit ECC correction codes"); |
1601 | goto failed_req_irq; | 1602 | goto failed_req_irq; |
1602 | } else { | 1603 | } else { |
1604 | denali->nand.ecc.strength = 8; | ||
1603 | denali->nand.ecc.layout = &nand_8bit_oob; | 1605 | denali->nand.ecc.layout = &nand_8bit_oob; |
1604 | denali->nand.ecc.bytes = ECC_8BITS; | 1606 | denali->nand.ecc.bytes = ECC_8BITS; |
1605 | iowrite32(8, denali->flash_reg + ECC_CORRECTION); | 1607 | iowrite32(8, denali->flash_reg + ECC_CORRECTION); |
1606 | } | 1608 | } |
1607 | 1609 | ||
1608 | denali->nand.ecc.bytes *= denali->devnum; | 1610 | denali->nand.ecc.bytes *= denali->devnum; |
1611 | denali->nand.ecc.strength *= denali->devnum; | ||
1609 | denali->nand.ecc.layout->eccbytes *= | 1612 | denali->nand.ecc.layout->eccbytes *= |
1610 | denali->mtd.writesize / ECC_SECTOR_SIZE; | 1613 | denali->mtd.writesize / ECC_SECTOR_SIZE; |
1611 | denali->nand.ecc.layout->oobfree[0].offset = | 1614 | denali->nand.ecc.layout->oobfree[0].offset = |
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index df921e7a496c..e2ca067631cf 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c | |||
@@ -1653,6 +1653,7 @@ static int __init doc_probe(unsigned long physadr) | |||
1653 | nand->ecc.mode = NAND_ECC_HW_SYNDROME; | 1653 | nand->ecc.mode = NAND_ECC_HW_SYNDROME; |
1654 | nand->ecc.size = 512; | 1654 | nand->ecc.size = 512; |
1655 | nand->ecc.bytes = 6; | 1655 | nand->ecc.bytes = 6; |
1656 | nand->ecc.strength = 2; | ||
1656 | nand->bbt_options = NAND_BBT_USE_FLASH; | 1657 | nand->bbt_options = NAND_BBT_USE_FLASH; |
1657 | 1658 | ||
1658 | doc->physadr = physadr; | 1659 | doc->physadr = physadr; |
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c index 9b3a64904668..b08202664543 100644 --- a/drivers/mtd/nand/docg4.c +++ b/drivers/mtd/nand/docg4.c | |||
@@ -1191,6 +1191,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd) | |||
1191 | nand->ecc.size = DOCG4_PAGE_SIZE; | 1191 | nand->ecc.size = DOCG4_PAGE_SIZE; |
1192 | nand->ecc.prepad = 8; | 1192 | nand->ecc.prepad = 8; |
1193 | nand->ecc.bytes = 8; | 1193 | nand->ecc.bytes = 8; |
1194 | nand->ecc.strength = DOCG4_T; | ||
1194 | nand->options = | 1195 | nand->options = |
1195 | NAND_BUSWIDTH_16 | NAND_NO_SUBPAGE_WRITE | NAND_NO_AUTOINCR; | 1196 | NAND_BUSWIDTH_16 | NAND_NO_SUBPAGE_WRITE | NAND_NO_AUTOINCR; |
1196 | nand->IO_ADDR_R = nand->IO_ADDR_W = doc->virtadr + DOC_IOSPACE_DATA; | 1197 | nand->IO_ADDR_R = nand->IO_ADDR_W = doc->virtadr + DOC_IOSPACE_DATA; |
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 7195ee6efe12..80b5264f0a32 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c | |||
@@ -813,6 +813,12 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) | |||
813 | &fsl_elbc_oob_sp_eccm1 : &fsl_elbc_oob_sp_eccm0; | 813 | &fsl_elbc_oob_sp_eccm1 : &fsl_elbc_oob_sp_eccm0; |
814 | chip->ecc.size = 512; | 814 | chip->ecc.size = 512; |
815 | chip->ecc.bytes = 3; | 815 | chip->ecc.bytes = 3; |
816 | chip->ecc.strength = 1; | ||
817 | /* | ||
818 | * FIXME: can hardware ecc correct 4 bitflips if page size is | ||
819 | * 2k? Then does hardware report number of corrections for this | ||
820 | * case? If so, ecc_stats reporting needs to be fixed as well. | ||
821 | */ | ||
816 | } else { | 822 | } else { |
817 | /* otherwise fall back to default software ECC */ | 823 | /* otherwise fall back to default software ECC */ |
818 | chip->ecc.mode = NAND_ECC_SOFT; | 824 | chip->ecc.mode = NAND_ECC_SOFT; |
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index 341086c22e90..588e3733c3a4 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c | |||
@@ -863,10 +863,12 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) | |||
863 | nand->ecc.calculate = fsmc_read_hwecc_ecc4; | 863 | nand->ecc.calculate = fsmc_read_hwecc_ecc4; |
864 | nand->ecc.correct = fsmc_bch8_correct_data; | 864 | nand->ecc.correct = fsmc_bch8_correct_data; |
865 | nand->ecc.bytes = 13; | 865 | nand->ecc.bytes = 13; |
866 | nand->ecc.strength = 8; | ||
866 | } else { | 867 | } else { |
867 | nand->ecc.calculate = fsmc_read_hwecc_ecc1; | 868 | nand->ecc.calculate = fsmc_read_hwecc_ecc1; |
868 | nand->ecc.correct = nand_correct_data; | 869 | nand->ecc.correct = nand_correct_data; |
869 | nand->ecc.bytes = 3; | 870 | nand->ecc.bytes = 3; |
871 | nand->ecc.strength = 1; | ||
870 | } | 872 | } |
871 | 873 | ||
872 | /* | 874 | /* |
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c index cc50e35cdc3d..e4147e8acb7c 100644 --- a/drivers/mtd/nand/jz4740_nand.c +++ b/drivers/mtd/nand/jz4740_nand.c | |||
@@ -332,6 +332,11 @@ static int __devinit jz_nand_probe(struct platform_device *pdev) | |||
332 | chip->ecc.mode = NAND_ECC_HW_OOB_FIRST; | 332 | chip->ecc.mode = NAND_ECC_HW_OOB_FIRST; |
333 | chip->ecc.size = 512; | 333 | chip->ecc.size = 512; |
334 | chip->ecc.bytes = 9; | 334 | chip->ecc.bytes = 9; |
335 | chip->ecc.strength = 2; | ||
336 | /* | ||
337 | * FIXME: ecc_strength value of 2 bits per 512 bytes of data is a | ||
338 | * conservative guess, given 9 ecc bytes and reed-solomon alg. | ||
339 | */ | ||
335 | 340 | ||
336 | if (pdata) | 341 | if (pdata) |
337 | chip->ecc.layout = pdata->ecc_layout; | 342 | chip->ecc.layout = pdata->ecc_layout; |
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 3c4c0533191d..cc0678a967c1 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -1225,6 +1225,13 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
1225 | goto escan; | 1225 | goto escan; |
1226 | } | 1226 | } |
1227 | 1227 | ||
1228 | if (this->ecc.mode == NAND_ECC_HW) { | ||
1229 | if (nfc_is_v1()) | ||
1230 | this->ecc.strength = 1; | ||
1231 | else | ||
1232 | this->ecc.strength = (host->eccsize == 4) ? 4 : 8; | ||
1233 | } | ||
1234 | |||
1228 | /* Register the partitions */ | 1235 | /* Register the partitions */ |
1229 | mtd_device_parse_register(mtd, part_probes, NULL, pdata->parts, | 1236 | mtd_device_parse_register(mtd, part_probes, NULL, pdata->parts, |
1230 | pdata->nr_parts); | 1237 | pdata->nr_parts); |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 1e907dc8638a..8008853756c9 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -3350,6 +3350,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3350 | if (!chip->ecc.size) | 3350 | if (!chip->ecc.size) |
3351 | chip->ecc.size = 256; | 3351 | chip->ecc.size = 256; |
3352 | chip->ecc.bytes = 3; | 3352 | chip->ecc.bytes = 3; |
3353 | chip->ecc.strength = 1; | ||
3353 | break; | 3354 | break; |
3354 | 3355 | ||
3355 | case NAND_ECC_SOFT_BCH: | 3356 | case NAND_ECC_SOFT_BCH: |
@@ -3384,6 +3385,8 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3384 | pr_warn("BCH ECC initialization failed!\n"); | 3385 | pr_warn("BCH ECC initialization failed!\n"); |
3385 | BUG(); | 3386 | BUG(); |
3386 | } | 3387 | } |
3388 | chip->ecc.strength = | ||
3389 | chip->ecc.bytes*8 / fls(8*chip->ecc.size); | ||
3387 | break; | 3390 | break; |
3388 | 3391 | ||
3389 | case NAND_ECC_NONE: | 3392 | case NAND_ECC_NONE: |
@@ -3397,6 +3400,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3397 | chip->ecc.write_oob = nand_write_oob_std; | 3400 | chip->ecc.write_oob = nand_write_oob_std; |
3398 | chip->ecc.size = mtd->writesize; | 3401 | chip->ecc.size = mtd->writesize; |
3399 | chip->ecc.bytes = 0; | 3402 | chip->ecc.bytes = 0; |
3403 | chip->ecc.strength = 0; | ||
3400 | break; | 3404 | break; |
3401 | 3405 | ||
3402 | default: | 3406 | default: |
@@ -3478,8 +3482,9 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3478 | mtd->_block_markbad = nand_block_markbad; | 3482 | mtd->_block_markbad = nand_block_markbad; |
3479 | mtd->writebufsize = mtd->writesize; | 3483 | mtd->writebufsize = mtd->writesize; |
3480 | 3484 | ||
3481 | /* propagate ecc.layout to mtd_info */ | 3485 | /* propagate ecc info to mtd_info */ |
3482 | mtd->ecclayout = chip->ecc.layout; | 3486 | mtd->ecclayout = chip->ecc.layout; |
3487 | mtd->ecc_strength = chip->ecc.strength * chip->ecc.steps; | ||
3483 | 3488 | ||
3484 | /* Check, if we should skip the bad block table scan */ | 3489 | /* Check, if we should skip the bad block table scan */ |
3485 | if (chip->options & NAND_SKIP_BBTSCAN) | 3490 | if (chip->options & NAND_SKIP_BBTSCAN) |
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c index ec688548c880..2b6f632cf274 100644 --- a/drivers/mtd/nand/ndfc.c +++ b/drivers/mtd/nand/ndfc.c | |||
@@ -179,6 +179,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, | |||
179 | chip->ecc.mode = NAND_ECC_HW; | 179 | chip->ecc.mode = NAND_ECC_HW; |
180 | chip->ecc.size = 256; | 180 | chip->ecc.size = 256; |
181 | chip->ecc.bytes = 3; | 181 | chip->ecc.bytes = 3; |
182 | chip->ecc.strength = 1; | ||
182 | chip->priv = ndfc; | 183 | chip->priv = ndfc; |
183 | 184 | ||
184 | ndfc->mtd.priv = chip; | 185 | ndfc->mtd.priv = chip; |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index d2e7a7da81f8..c2b0bba9d8b3 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -1058,6 +1058,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1058 | (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE)) { | 1058 | (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE)) { |
1059 | info->nand.ecc.bytes = 3; | 1059 | info->nand.ecc.bytes = 3; |
1060 | info->nand.ecc.size = 512; | 1060 | info->nand.ecc.size = 512; |
1061 | info->nand.ecc.strength = 1; | ||
1061 | info->nand.ecc.calculate = omap_calculate_ecc; | 1062 | info->nand.ecc.calculate = omap_calculate_ecc; |
1062 | info->nand.ecc.hwctl = omap_enable_hwecc; | 1063 | info->nand.ecc.hwctl = omap_enable_hwecc; |
1063 | info->nand.ecc.correct = omap_correct_data; | 1064 | info->nand.ecc.correct = omap_correct_data; |
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index d3bdc909c939..def50caa6f84 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -1002,6 +1002,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd) | |||
1002 | KEEP_CONFIG: | 1002 | KEEP_CONFIG: |
1003 | chip->ecc.mode = NAND_ECC_HW; | 1003 | chip->ecc.mode = NAND_ECC_HW; |
1004 | chip->ecc.size = host->page_size; | 1004 | chip->ecc.size = host->page_size; |
1005 | chip->ecc.strength = 1; | ||
1005 | 1006 | ||
1006 | chip->options = NAND_NO_AUTOINCR; | 1007 | chip->options = NAND_NO_AUTOINCR; |
1007 | chip->options |= NAND_NO_READRDY; | 1008 | chip->options |= NAND_NO_READRDY; |
diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c index 769a4e096b3c..c2040187c813 100644 --- a/drivers/mtd/nand/r852.c +++ b/drivers/mtd/nand/r852.c | |||
@@ -891,6 +891,7 @@ int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
891 | chip->ecc.mode = NAND_ECC_HW_SYNDROME; | 891 | chip->ecc.mode = NAND_ECC_HW_SYNDROME; |
892 | chip->ecc.size = R852_DMA_LEN; | 892 | chip->ecc.size = R852_DMA_LEN; |
893 | chip->ecc.bytes = SM_OOB_SIZE; | 893 | chip->ecc.bytes = SM_OOB_SIZE; |
894 | chip->ecc.strength = 2; | ||
894 | chip->ecc.hwctl = r852_ecc_hwctl; | 895 | chip->ecc.hwctl = r852_ecc_hwctl; |
895 | chip->ecc.calculate = r852_ecc_calculate; | 896 | chip->ecc.calculate = r852_ecc_calculate; |
896 | chip->ecc.correct = r852_ecc_correct; | 897 | chip->ecc.correct = r852_ecc_correct; |
diff --git a/drivers/mtd/nand/rtc_from4.c b/drivers/mtd/nand/rtc_from4.c index f309addc2fa0..e55b5cfbe145 100644 --- a/drivers/mtd/nand/rtc_from4.c +++ b/drivers/mtd/nand/rtc_from4.c | |||
@@ -527,6 +527,7 @@ static int __init rtc_from4_init(void) | |||
527 | this->ecc.mode = NAND_ECC_HW_SYNDROME; | 527 | this->ecc.mode = NAND_ECC_HW_SYNDROME; |
528 | this->ecc.size = 512; | 528 | this->ecc.size = 512; |
529 | this->ecc.bytes = 8; | 529 | this->ecc.bytes = 8; |
530 | this->ecc.strength = 3; | ||
530 | /* return the status of extra status and ECC checks */ | 531 | /* return the status of extra status and ECC checks */ |
531 | this->errstat = rtc_from4_errstat; | 532 | this->errstat = rtc_from4_errstat; |
532 | /* set the nand_oobinfo to support FPGA H/W error detection */ | 533 | /* set the nand_oobinfo to support FPGA H/W error detection */ |
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 97623be04e0f..91121f33f743 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -823,6 +823,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
823 | chip->ecc.calculate = s3c2410_nand_calculate_ecc; | 823 | chip->ecc.calculate = s3c2410_nand_calculate_ecc; |
824 | chip->ecc.correct = s3c2410_nand_correct_data; | 824 | chip->ecc.correct = s3c2410_nand_correct_data; |
825 | chip->ecc.mode = NAND_ECC_HW; | 825 | chip->ecc.mode = NAND_ECC_HW; |
826 | chip->ecc.strength = 1; | ||
826 | 827 | ||
827 | switch (info->cpu_type) { | 828 | switch (info->cpu_type) { |
828 | case TYPE_S3C2410: | 829 | case TYPE_S3C2410: |
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index 2ee9a1b50a22..e9b2b260de3a 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c | |||
@@ -825,6 +825,7 @@ static int flctl_chip_init_tail(struct mtd_info *mtd) | |||
825 | 825 | ||
826 | chip->ecc.size = 512; | 826 | chip->ecc.size = 512; |
827 | chip->ecc.bytes = 10; | 827 | chip->ecc.bytes = 10; |
828 | chip->ecc.strength = 4; | ||
828 | chip->ecc.read_page = flctl_read_page_hwecc; | 829 | chip->ecc.read_page = flctl_read_page_hwecc; |
829 | chip->ecc.write_page = flctl_write_page_hwecc; | 830 | chip->ecc.write_page = flctl_write_page_hwecc; |
830 | chip->ecc.mode = NAND_ECC_HW; | 831 | chip->ecc.mode = NAND_ECC_HW; |
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 2d269a53f8bb..3421e3762a5a 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -167,6 +167,7 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev) | |||
167 | this->ecc.mode = NAND_ECC_HW; | 167 | this->ecc.mode = NAND_ECC_HW; |
168 | this->ecc.size = 256; | 168 | this->ecc.size = 256; |
169 | this->ecc.bytes = 3; | 169 | this->ecc.bytes = 3; |
170 | this->ecc.strength = 1; | ||
170 | this->badblock_pattern = data->badblock_pattern; | 171 | this->badblock_pattern = data->badblock_pattern; |
171 | this->ecc.layout = data->ecc_layout; | 172 | this->ecc.layout = data->ecc_layout; |
172 | this->ecc.hwctl = sharpsl_nand_enable_hwecc; | 173 | this->ecc.hwctl = sharpsl_nand_enable_hwecc; |
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c index 060848a91db7..5aa518081c51 100644 --- a/drivers/mtd/nand/tmio_nand.c +++ b/drivers/mtd/nand/tmio_nand.c | |||
@@ -430,6 +430,7 @@ static int tmio_probe(struct platform_device *dev) | |||
430 | nand_chip->ecc.mode = NAND_ECC_HW; | 430 | nand_chip->ecc.mode = NAND_ECC_HW; |
431 | nand_chip->ecc.size = 512; | 431 | nand_chip->ecc.size = 512; |
432 | nand_chip->ecc.bytes = 6; | 432 | nand_chip->ecc.bytes = 6; |
433 | nand_chip->ecc.strength = 2; | ||
433 | nand_chip->ecc.hwctl = tmio_nand_enable_hwecc; | 434 | nand_chip->ecc.hwctl = tmio_nand_enable_hwecc; |
434 | nand_chip->ecc.calculate = tmio_nand_calculate_ecc; | 435 | nand_chip->ecc.calculate = tmio_nand_calculate_ecc; |
435 | nand_chip->ecc.correct = tmio_nand_correct_data; | 436 | nand_chip->ecc.correct = tmio_nand_correct_data; |
diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c index 8db0acbae6fa..26398dcf21cf 100644 --- a/drivers/mtd/nand/txx9ndfmc.c +++ b/drivers/mtd/nand/txx9ndfmc.c | |||
@@ -356,6 +356,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev) | |||
356 | /* txx9ndfmc_nand_scan will overwrite ecc.size and ecc.bytes */ | 356 | /* txx9ndfmc_nand_scan will overwrite ecc.size and ecc.bytes */ |
357 | chip->ecc.size = 256; | 357 | chip->ecc.size = 256; |
358 | chip->ecc.bytes = 3; | 358 | chip->ecc.bytes = 3; |
359 | chip->ecc.strength = 1; | ||
359 | chip->chip_delay = 100; | 360 | chip->chip_delay = 100; |
360 | chip->controller = &drvdata->hw_control; | 361 | chip->controller = &drvdata->hw_control; |
361 | 362 | ||
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index a1592cf755f3..3d781b87b358 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -4080,6 +4080,7 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) | |||
4080 | mtd->oobavail = this->ecclayout->oobavail; | 4080 | mtd->oobavail = this->ecclayout->oobavail; |
4081 | 4081 | ||
4082 | mtd->ecclayout = this->ecclayout; | 4082 | mtd->ecclayout = this->ecclayout; |
4083 | mtd->ecc_strength = 1; | ||
4083 | 4084 | ||
4084 | /* Fill in remaining MTD driver data */ | 4085 | /* Fill in remaining MTD driver data */ |
4085 | mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH; | 4086 | mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH; |