]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: fsl_elbc: Fix none ECC mode
authorPali Rohár <pali@kernel.org>
Thu, 7 Jul 2022 18:43:28 +0000 (20:43 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 20 Sep 2022 08:06:59 +0000 (10:06 +0200)
commit93bdc6d82f902eefc58ae0a62d01509cd35e8b90
tree22b085fa5029dd6e16720235b76e194db4421eff
parent15e262499677c62c2b1c3f1615a270aeb8aa08eb
mtd: rawnand: fsl_elbc: Fix none ECC mode

Commit 1f7d5e089928 ("mtd: rawnand: fsl_elbc: Make SW ECC work") added
support for specifying ECC mode via DTS and skipping autodetection.

But it broke explicit specification of HW ECC mode in DTS as correct
settings for HW ECC mode are applied only when NONE mode or nothing was
specified in DTS file.

Also it started aliasing NONE mode to be same as when ECC mode was not
specified and disallowed usage of ON_DIE mode.

Fix all these issues. Use autodetection of ECC mode only in case when mode
was really not specified in DTS file by checking that ecc value is invalid.
Set HW ECC settings either when HW ECC was specified in DTS or it was
autodetected. And do not fail when ON_DIE mode is set.

Fixes: 1f7d5e089928 ("mtd: rawnand: fsl_elbc: Make SW ECC work")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220707184328.3845-1-pali@kernel.org
drivers/mtd/nand/raw/fsl_elbc_nand.c