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

Commit 6a918bad authored by Mike Dunn's avatar Mike Dunn Committed by David Woodhouse
Browse files

mtd: flash drivers set ecc strength



Flash device drivers initialize 'ecc_strength' in struct mtd_info, which is the
maximum number of bit errors that can be corrected in one writesize region.

Drivers using the nand interface intitialize 'strength' in struct nand_ecc_ctrl,
which is the maximum number of bit errors that can be corrected in one ecc step.
Nand infrastructure code translates this to 'ecc_strength'.

Also for nand drivers, the nand infrastructure code sets ecc.strength for ecc
modes NAND_ECC_SOFT, NAND_ECC_SOFT_BCH, and NAND_ECC_NONE.  It is set in the
driver for all other modes.

Signed-off-by: default avatarMike Dunn <mikedunn@newsguy.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 1d0b95b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -564,6 +564,7 @@ void DoC2k_init(struct mtd_info *mtd)
	mtd->flags = MTD_CAP_NANDFLASH;
	mtd->writebufsize = mtd->writesize = 512;
	mtd->oobsize = 16;
	mtd->ecc_strength = 2;
	mtd->owner = THIS_MODULE;
	mtd->_erase = doc_erase;
	mtd->_read = doc_read;
+1 −0
Original line number Diff line number Diff line
@@ -348,6 +348,7 @@ void DoCMil_init(struct mtd_info *mtd)
	mtd->erasesize = 0x2000;
	mtd->writebufsize = mtd->writesize = 512;
	mtd->oobsize = 16;
	mtd->ecc_strength = 2;
	mtd->owner = THIS_MODULE;
	mtd->_erase = doc_erase;
	mtd->_read = doc_read;
+1 −0
Original line number Diff line number Diff line
@@ -469,6 +469,7 @@ void DoCMilPlus_init(struct mtd_info *mtd)
	mtd->flags = MTD_CAP_NANDFLASH;
	mtd->writebufsize = mtd->writesize = 512;
	mtd->oobsize = 16;
	mtd->ecc_strength = 2;
	mtd->owner = THIS_MODULE;
	mtd->_erase = doc_erase;
	mtd->_read = doc_read;
+1 −0
Original line number Diff line number Diff line
@@ -1832,6 +1832,7 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
	mtd->_write_oob = doc_write_oob;
	mtd->_block_isbad = doc_block_isbad;
	mtd->ecclayout = &docg3_oobinfo;
	mtd->ecc_strength = DOC_ECC_BCH_T;
}

/**
+1 −0
Original line number Diff line number Diff line
@@ -516,6 +516,7 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
	}

	slave->mtd.ecclayout = master->ecclayout;
	slave->mtd.ecc_strength = master->ecc_strength;
	if (master->_block_isbad) {
		uint64_t offs = 0;

Loading