mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 05:22:19 -04:00
mtd: nand: davinci: add support for on-die ECC engine type
Some chips, e.g. Micron MT29F1G08ABBFAH4, has a mandatory on-die ECC. Add "on-die" as ECC engine type in order to be compatible with those. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
committed by
Miquel Raynal
parent
e0a4f50fce
commit
ef73c7dad4
@@ -66,6 +66,7 @@ struct davinci_nand_pdata {
|
||||
|
||||
/* none == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!)
|
||||
* soft == NAND_ECC_ENGINE_TYPE_SOFT
|
||||
* on-die == NAND_ECC_ENGINE_TYPE_ON_DIE
|
||||
* else == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits
|
||||
*
|
||||
* All DaVinci-family chips support 1-bit hardware ECC.
|
||||
@@ -525,6 +526,8 @@ nand_davinci_get_pdata(struct platform_device *pdev)
|
||||
pdata->engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
|
||||
if (!strncmp("hw", mode, 2))
|
||||
pdata->engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
|
||||
if (!strncmp("on-die", mode, 6))
|
||||
pdata->engine_type = NAND_ECC_ENGINE_TYPE_ON_DIE;
|
||||
}
|
||||
if (!device_property_read_u32(&pdev->dev,
|
||||
"ti,davinci-ecc-bits", &prop))
|
||||
@@ -580,6 +583,7 @@ static int davinci_nand_attach_chip(struct nand_chip *chip)
|
||||
|
||||
switch (chip->ecc.engine_type) {
|
||||
case NAND_ECC_ENGINE_TYPE_NONE:
|
||||
case NAND_ECC_ENGINE_TYPE_ON_DIE:
|
||||
pdata->ecc_bits = 0;
|
||||
break;
|
||||
case NAND_ECC_ENGINE_TYPE_SOFT:
|
||||
|
||||
Reference in New Issue
Block a user