u-boot-brain/drivers/mtd/nand
Boris Brezillon f3d235702d mtd: nand: pxa3xx: Fix READOOB implementation
In the current driver, OOB bytes are accessed in raw mode, and when a
page access is done with NDCR_SPARE_EN set and NDCR_ECC_EN cleared, the
driver must read the whole spare area (64 bytes in case of a 2k page,
16 bytes for a 512 page). The driver was only reading the free OOB
bytes, which was leaving some unread data in the FIFO and was somehow
leading to a timeout.

We could patch the driver to read ->spare_size + ->ecc_size instead of
just ->spare_size when READOOB is requested, but we'd better make
in-band and OOB accesses consistent.
Since the driver is always accessing in-band data in non-raw mode (with
the ECC engine enabled), we should also access OOB data in this mode.
That's particularly useful when using the BCH engine because in this
mode the free OOB bytes are also ECC protected.

Fixes: 43bcfd2bb24a ("mtd: nand: pxa3xx: Add driver-specific ECC BCH support")
Cc: stable@vger.kernel.org
Reported-by: Sean Nyekjær <sean.nyekjaer@prevas.dk>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Ofer Heifetz <oferh@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2018-09-19 09:02:34 +02:00
..
am335x_spl_bch.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arasan_nfc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
atmel_nand_ecc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
atmel_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
davinci_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
denali_dt.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
denali_spl.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
denali.c mtd: nand: denali: fix unaligned cache operations on ARMv7 SoCs 2018-09-10 14:08:22 -04:00
denali.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsl_elbc_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsl_elbc_spl.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsl_ifc_nand.c mtd: nand: fsl_ifc: Fix handling of bitflips in erased pages 2018-08-10 10:35:51 -07:00
fsl_ifc_spl.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsl_upm.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsmc_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
kb9202_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Kconfig Convert CONFIG_NAND_DAVINCI to Kconfig 2018-07-21 22:26:56 -04:00
kirkwood_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
kmeter1_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lpc32xx_nand_mlc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lpc32xx_nand_slc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile spl, nand: add option CONFIG_SPL_NAND_IDENT to lookup for supported NAND chips 2018-06-27 12:20:55 +02:00
mxc_nand_spl.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxc_nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxc_nand.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxs_nand_dt.c mtd: nand: mxs_nand: add device tree support for i.MX 6 2018-07-23 10:12:00 +02:00
mxs_nand_spl.c mtd: nand: mxs_nand_spl: add mxs_flash_full_ident 2018-06-27 12:20:55 +02:00
mxs_nand.c mtd: nand: mxs_nand: add support for specific ECC strength 2018-06-27 09:07:55 +02:00
mxs_nand.h mtd: nand: mxs_nand: move structs into header file 2018-06-27 09:07:55 +02:00
nand_base.c mtd: nand: nand_base: Convert EINVAL into ENOTSUPP 2018-07-31 20:45:42 +05:30
nand_bbt.c mtd: nand: Rename nand.h into rawnand.h 2017-12-04 22:00:00 +09:00
nand_bch.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nand_ecc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nand_ids.c mtd: nand: Rename nand.h into rawnand.h 2017-12-04 22:00:00 +09:00
nand_plat.c mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data 2016-06-03 20:27:48 -05:00
nand_spl_load.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nand_spl_loaders.c mtd: nand: Consolidate nand spl loaders implementation 2017-05-08 11:57:26 -04:00
nand_spl_simple.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nand_timings.c mtd: nand: Rename nand.h into rawnand.h 2017-12-04 22:00:00 +09:00
nand_util.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
omap_elm.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
omap_gpmc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pxa3xx_nand.c mtd: nand: pxa3xx: Fix READOOB implementation 2018-09-19 09:02:34 +02:00
pxa3xx_nand.h mtd: nand: Add mvebu (PXA / AXP / A38x) NAND device driver 2015-08-25 22:53:58 -05:00
sunxi_nand_spl.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sunxi_nand.c mtd: nand: sunxi: Return on set_feature only when not ENOTSUPP 2018-07-31 20:45:50 +05:30
tegra_nand.c mtd: nand: tegra: convert to driver model and live tree 2018-05-10 16:34:10 -07:00
tegra_nand.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
vf610_nfc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
zynq_nand.c nand: zynq: Send address cycles as per onfi parameter page 2018-05-11 09:23:43 +02:00