Skip to content

Commit ef73c7d

Browse files
marcusfolkessonmiquelraynal
authored andcommitted
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 <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent e0a4f50 commit ef73c7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/mtd/nand/raw/davinci_nand.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ struct davinci_nand_pdata {
6666

6767
/* none == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!)
6868
* soft == NAND_ECC_ENGINE_TYPE_SOFT
69+
* on-die == NAND_ECC_ENGINE_TYPE_ON_DIE
6970
* else == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits
7071
*
7172
* All DaVinci-family chips support 1-bit hardware ECC.
@@ -525,6 +526,8 @@ nand_davinci_get_pdata(struct platform_device *pdev)
525526
pdata->engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
526527
if (!strncmp("hw", mode, 2))
527528
pdata->engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
529+
if (!strncmp("on-die", mode, 6))
530+
pdata->engine_type = NAND_ECC_ENGINE_TYPE_ON_DIE;
528531
}
529532
if (!device_property_read_u32(&pdev->dev,
530533
"ti,davinci-ecc-bits", &prop))
@@ -580,6 +583,7 @@ static int davinci_nand_attach_chip(struct nand_chip *chip)
580583

581584
switch (chip->ecc.engine_type) {
582585
case NAND_ECC_ENGINE_TYPE_NONE:
586+
case NAND_ECC_ENGINE_TYPE_ON_DIE:
583587
pdata->ecc_bits = 0;
584588
break;
585589
case NAND_ECC_ENGINE_TYPE_SOFT:

0 commit comments

Comments
 (0)