linux/drivers/mtd/nand/raw
Miquel Raynal b5b5b4dc6f mtd: rawnand: gpio: Keep the driver compatible with on-die ECC engines
Following the introduction of the generic ECC engine infrastructure, it
was necessary to reorganize the code and move the ECC configuration in
the ->attach_chip() hook. Failing to do that properly lead to a first
series of fixes supposed to stabilize the situation. Unfortunately, this
only fixed the use of software ECC engines, preventing any other kind of
engine to be used, including on-die ones.

It is now time to (finally) fix the situation by ensuring that we still
provide a default (eg. software ECC) but will still support different
ECC engines such as on-die ECC engines if properly described in the
device tree.

There are no changes needed on the core side in order to do this, but we
just need to leverage the logic there which allows:
1- a subsystem default (set to Host engines in the raw NAND world)
2- a driver specific default (here set to software ECC engines)
3- any type of engine requested by the user (ie. described in the DT)

As the raw NAND subsystem has not yet been fully converted to the ECC
engine infrastructure, in order to provide a default ECC engine for this
driver we need to set chip->ecc.engine_type *before* calling
nand_scan(). During the initialization step, the core will consider this
entry as the default engine for this driver. This value may of course
be overloaded by the user if the usual DT properties are provided.

Fixes: f6341f6448 ("mtd: rawnand: gpio: Move the ECC initialization to ->attach_chip()")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210928222258.199726-4-miquel.raynal@bootlin.com
2021-10-15 12:21:18 +02:00
..
atmel mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:30 +02:00
bcm47xxnflash mtd: rawnand: Use the new ECC engine type enumeration 2020-09-28 15:59:42 +02:00
brcmnand mtd: rawnand: bcm6368: Make use of the helper function devm_platform_ioremap_resource_byname() 2021-09-14 19:34:32 +02:00
gpmi-nand mtd: rawnand: gpmi: Make use of the helper function devm_platform_ioremap_resource_byname() 2021-09-14 19:34:39 +02:00
ingenic mtd: rawnand: ingenic: remove redundant get_device() in ingenic_ecc_get() 2020-12-10 22:37:31 +01:00
ams-delta.c mtd: rawnand: ams-delta: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:14 +02:00
arasan-nand-controller.c mtd: rawnand: arasan: Finer grain NV-DDR configuration 2021-06-18 09:45:20 +02:00
au1550nd.c mtd: rawnand: au1550nd: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:16 +02:00
cadence-nand-controller.c mtd: rawnand: Use more recent ONFI specification wording 2021-05-26 10:43:40 +02:00
cafe_nand.c mtd: rawnand: cafe: Fix a resource leak in the error handling path of 'cafe_nand_probe()' 2021-08-23 10:58:14 +02:00
cs553x_nand.c Revert "mtd: rawnand: cs553x: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:11 +02:00
davinci_nand.c mtd: rawnand: davinci: Do not use extra dereferencing 2020-12-10 22:37:32 +01:00
denali_dt.c mtd: rawnand: denali: Make use of the helper function devm_platform_ioremap_resource_byname() 2021-09-14 19:34:34 +02:00
denali_pci.c mtd: rawnand: Use the NAND framework user_conf object for ECC flags 2020-09-30 16:44:15 +02:00
denali.c mtd: rawnand: Use the new ECC engine type enumeration 2020-09-28 15:59:42 +02:00
denali.h
diskonchip.c SPI NOR core changes: 2020-12-16 18:48:16 +01:00
fsl_elbc_nand.c mtd: nand: ecc-hamming: Remove useless includes 2020-12-10 22:37:30 +01:00
fsl_ifc_nand.c mtd: nand: ecc-hamming: Remove useless includes 2020-12-10 22:37:30 +01:00
fsl_upm.c mtd: nand: ecc-hamming: Remove useless includes 2020-12-10 22:37:30 +01:00
fsmc_nand.c mtd: rawnand: fsmc: Fix use of SM ORDER 2021-10-15 12:20:57 +02:00
gpio.c mtd: rawnand: gpio: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:18 +02:00
hisi504_nand.c mtd: rawnand: hisi504: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:41 +02:00
intel-nand-controller.c mtd: rawnand: intel: Fix potential buffer overflow in probe 2021-09-14 19:35:08 +02:00
internals.h mtd: rawnand: Choose the best timings, NV-DDR included 2021-05-26 10:52:43 +02:00
Kconfig mtd: rawnand: Fix a couple of spelling mistakes in Kconfig 2021-07-16 01:07:05 +02:00
lpc32xx_mlc.c mtd: nand: ecc-hamming: Remove useless includes 2020-12-10 22:37:30 +01:00
lpc32xx_slc.c Revert "mtd: rawnand: lpc32xx_slc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:09 +02:00
Makefile mtd: rawnand: pl353: Add support for the ARM PL353 SMC NAND controller 2021-06-18 09:45:21 +02:00
marvell_nand.c mtd: rawnand: marvell: Minor documentation correction 2021-06-18 09:45:21 +02:00
meson_nand.c mtd: rawnand: remove never changed ret variable 2021-08-06 22:01:56 +02:00
mpc5121_nfc.c mtd: rawnand: mpc5121: Do not force a particular software ECC engine 2020-12-11 20:09:58 +01:00
mtk_ecc.c mtd: rawnand: mtk_ecc: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:46 +02:00
mtk_ecc.h
mtk_nand.c mtd: rawnand: mtk: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:44 +02:00
mxc_nand.c mtd: rawnand: mxc: Remove unneeded of_match_ptr() 2021-03-28 19:13:39 +02:00
mxic_nand.c mtd: nand: ecc-hamming: Move Hamming code to the generic NAND layer 2020-12-10 22:37:29 +01:00
nand_amd.c
nand_base.c mtd: rawnand: Fix probe failure due to of_get_nand_secure_regions() 2021-08-06 21:44:16 +02:00
nand_bbt.c mtd: rawnand: nand_bbt: Skip bad blocks when searching for the BBT in NAND 2021-07-16 01:06:22 +02:00
nand_esmt.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_hynix.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_ids.c
nand_jedec.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_legacy.c mtd: rawnand: Avoid accessing NV-DDR timings from legacy code 2021-05-26 10:43:52 +02:00
nand_macronix.c
nand_micron.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_onfi.c mtd: rawnand: onfi: Fix endianness when reading NV-DDR values 2021-06-18 09:45:20 +02:00
nand_samsung.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_timings.c mtd: rawnand: Add a helper to find the closest ONFI NV-DDR mode 2021-05-26 10:43:59 +02:00
nand_toshiba.c mtd: rawnand: Use the ECC framework OOB layouts 2020-09-30 16:43:52 +02:00
nandsim.c mtd: rawnand: nandsim: Fix the logic when selecting Hamming soft ECC engine 2021-01-14 16:44:37 +01:00
ndfc.c Revert "mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:07 +02:00
omap2.c mtd: rawnand: omap: Fix kernel doc warning on 'calcuate' typo 2021-08-06 22:01:56 +02:00
omap_elm.c mtd: rawnand: omap_elm: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:49 +02:00
orion_nand.c mtd: rawnand: orion: Do not force a particular software ECC engine 2020-12-11 20:09:58 +01:00
oxnas_nand.c mtd: rawnand: oxnas: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:51 +02:00
pasemi_nand.c MTD core: 2020-12-16 14:58:35 -08:00
pl35x-nand-controller.c mtd: rawnand: pl353: Add support for the ARM PL353 SMC NAND controller 2021-06-18 09:45:21 +02:00
plat_nand.c mtd: rawnand: plat_nand: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:54 +02:00
qcom_nandc.c mtd: rawnand: qcom: avoid writing to obsolete register 2021-06-18 09:45:21 +02:00
r852.c mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro 2021-06-18 09:45:21 +02:00
r852.h mtd: rawnand: r852: Move the ECC initialization to ->attach_chip() 2020-11-20 12:30:53 +01:00
rockchip-nand-controller.c mtd: rawnand: rockchip: Use flexible-array member instead of zero-length array 2021-03-28 19:13:39 +02:00
s3c2410.c SPI NOR core changes: 2020-12-16 18:48:16 +01:00
sh_flctl.c mtd: rawnand: Use the new ECC engine type enumeration 2020-09-28 15:59:42 +02:00
sharpsl.c Revert "mtd: rawnand: sharpsl: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:05 +02:00
sm_common.c
sm_common.h
socrates_nand.c mtd: rawnand: socrates: Do not force a particular software ECC engine 2020-12-11 20:10:02 +01:00
stm32_fmc2_nand.c mtd: rawnand: stm32_fmc2: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:56 +02:00
sunxi_nand.c mtd: rawnand: sunxi: remove unnecessary oom message 2021-06-11 20:43:33 +02:00
tegra_nand.c mtd: rawnand: tegra: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:59 +02:00
tmio_nand.c Revert "mtd: rawnand: tmio: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:03 +02:00
txx9ndfmc.c Revert "mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:01 +02:00
vf610_nfc.c mtd: rawnand: vf610: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:35:03 +02:00
xway_nand.c mtd: rawnand: xway: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:35:06 +02:00