Commit c8efe010 authored by Miquel Raynal's avatar Miquel Raynal

mtd: spinand: Fill a default ECC provider/algorithm

The SPI-NAND layer default is on-die ECC because until now it was the
only one supported. New SPI-NAND chip flavors might use something else
as ECC engine provider but this will always be the default if the user
does not choose explicitly something else.
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200930154109.3922-6-miquel.raynal@bootlin.com
parent da429b96
...@@ -309,7 +309,7 @@ static struct nand_ecc_engine_ops spinand_ondie_ecc_engine_ops = { ...@@ -309,7 +309,7 @@ static struct nand_ecc_engine_ops spinand_ondie_ecc_engine_ops = {
.finish_io_req = spinand_ondie_ecc_finish_io_req, .finish_io_req = spinand_ondie_ecc_finish_io_req,
}; };
static __maybe_unused struct nand_ecc_engine spinand_ondie_ecc_engine = { static struct nand_ecc_engine spinand_ondie_ecc_engine = {
.ops = &spinand_ondie_ecc_engine_ops, .ops = &spinand_ondie_ecc_engine_ops,
}; };
...@@ -1133,6 +1133,10 @@ static int spinand_init(struct spinand_device *spinand) ...@@ -1133,6 +1133,10 @@ static int spinand_init(struct spinand_device *spinand)
if (ret) if (ret)
goto err_manuf_cleanup; goto err_manuf_cleanup;
/* SPI-NAND default ECC engine is on-die */
nand->ecc.defaults.engine_type = NAND_ECC_ENGINE_TYPE_ON_DIE;
nand->ecc.ondie_engine = &spinand_ondie_ecc_engine;
/* /*
* Right now, we don't support ECC, so let the whole oob * Right now, we don't support ECC, so let the whole oob
* area available for the user. * area available for the user.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment