linux/drivers/mtd/nand/raw
Herve Codina 9472335eaa mtd: rawnand: fsmc: Fix timing computation
Under certain circumstances, the timing settings calculated by
the FSMC NAND controller driver were inaccurate.
These settings led to incorrect data reads or fallback to
timing mode 0 depending on the NAND chip used.

The timing computation did not take into account the following
constraint given in SPEAr3xx reference manual:
  twait >= tCEA - (tset * TCLK) + TOUTDEL + TINDEL

Enhance the timings calculation by taking into account this
additional constraint.

This change has no impact on slow timing modes such as mode 0.
Indeed, on mode 0, computed values are the same with and
without the patch.

NANDs which previously stayed in mode 0 because of fallback to
mode 0 can now work at higher speeds and NANDs which were not
working at all because of the corrupted data work at high
speeds without troubles.

Overall improvement on a Micron/MT29F1G08 (flash_speed tool):
                        mode0       mode3
eraseblock write speed  3220 KiB/s  4511 KiB/s
eraseblock read speed   4491 KiB/s  7529 KiB/s

Fixes: d9fb079571 ("mtd: nand: fsmc: add support for SDR timings")
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211119150316.43080-5-herve.codina@bootlin.com
2021-12-03 14:33:45 +01: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: Prevent an unsupported configuration 2021-10-15 12:24:54 +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 mtd: rawnand: Replace zero-length array with flexible-array member 2020-03-11 16:17:54 +01:00
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 timing computation 2021-12-03 14:33:45 +01: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: denali: Add the dependency on HAS_IOMEM 2021-12-03 14:33:43 +01: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: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:20 +02: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 mtd: rawnand: mtk: Re-license MTK NAND driver as Dual MIT/GPL 2019-06-27 20:07:46 +02:00
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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
nand_base.c mtd: rawnand: Fix nand_choose_best_timings() on unsupported interface 2021-12-03 14:33:44 +01: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: hynix: Add support for H27UCG8T2ETR-BC MLC NAND 2021-10-15 12:24:50 +02:00
nand_ids.c mtd: rawnand: hynix: Add support for H27UCG8T2ETR-BC MLC NAND 2021-10-15 12:24:50 +02:00
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 mtd: rawnand: Create a nand_chip operations structure 2020-06-26 08:35:04 +02:00
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: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:22 +02: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: rawnand: pasemi: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:24 +02: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: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:26 +02:00
qcom_nandc.c mtd: rawnand: qcom: Update code word value for raw read 2021-09-14 19:36:00 +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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sm_common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
socrates_nand.c mtd: rawnand: socrates: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:29 +02: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: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:31 +02:00