u-boot/drivers/mtd/nand/raw
Ye Li 616f03daba mtd: gpmi: change the BCH layout setting for large oob NAND
The code change updated the NAND driver BCH ECC layout algorithm to
support large oob size NAND chips(oob > 1024 bytes) and proposed a new
way to set ECC layout.

Current implementation requires each chunk size larger than oob size so
the bad block marker (BBM) can be guaranteed located in data chunk. The
ECC layout always using the unbalanced layout(Ecc for both meta and
Data0 chunk), but for the NAND chips with oob larger than 1k, the driver
cannot support because BCH doesn’t support GF 15 for 2K chunk.

The change keeps the data chunk no larger than 1k and adjust the ECC
strength or ECC layout to locate the BBM in data chunk. General idea for
large oob NAND chips is

1.Try all ECC strength from the minimum value required by NAND spec to
the maximum one that works, any ECC makes the BBM locate in data chunk
can be chosen.

2.If none of them works, using separate ECC for meta, which will add one
extra ecc with the same ECC strength as other data chunks. This extra
ECC can guarantee BBM located in data chunk, of course, we need to check
if oob can afford it.

Previous code has two methods for ECC layout setting, the
legacy_calc_ecc_layout and calc_ecc_layout_by_info, the difference
between these two methods is, legacy_calc_ecc_layout set the chunk size
larger chan oob size and then set the maximum ECC strength that oob can
afford. While the calc_ecc_layout_by_info set chunk size and ECC
strength according to NAND spec. It has been proved that the first
method cannot provide safe ECC strength for some modern NAND chips, so
in current code,

1. Driver read NAND parameters first and then chose the proper ECC
layout setting method.

2. If the oob is large or NAND required data chunk larger than oob size,
chose calc_ecc_for_large_oob, otherwise use calc_ecc_layout_by_info

3. legacy_calc_ecc_layout only used for some NAND chips does not contains
necessary information. So this is only a backup plan, it is NOT
recommended to use these NAND chips.

Signed-off-by: Han Xu <b45815@freescale.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-10 20:55:20 +02:00
..
brcmnand nand: brcmnand: return without disabling clock 2020-04-27 20:29:33 +02:00
am335x_spl_bch.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
arasan_nfc.c mtd: nand: Fix on-die ecc issues in arasan_nfc driver 2020-02-28 12:04:10 +01:00
atmel_nand.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
atmel_nand_ecc.h mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
davinci_nand.c nand: davinci: avoid out of bounds array access 2019-07-31 13:08:07 -04:00
denali.c dma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h> 2020-02-19 21:27:30 +08:00
denali.h mtd: rawnand: denali: Do not reset the block before booting the kernel 2020-02-01 01:14:32 +09:00
denali_dt.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
denali_spl.c mtd: rawnand: denali-spl: Add missing hardware init on SoCFPGA 2020-02-01 01:14:32 +09:00
fsl_elbc_nand.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
fsl_elbc_spl.c common: Move ARM cache operations out of common.h 2019-12-02 18:24:58 -05:00
fsl_ifc_nand.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
fsl_ifc_spl.c common: Move ARM cache operations out of common.h 2019-12-02 18:24:58 -05:00
fsl_upm.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
fsmc_nand.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
kb9202_nand.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
Kconfig mtd: rawnand: denali_dt: use UCLASS_MTD instead of UCLASS_MISC 2020-02-01 01:14:32 +09:00
kirkwood_nand.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
kmeter1_nand.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
lpc32xx_nand_mlc.c mtd: nand: lpc32xx mlc: predefine number of NAND chips to support 2018-11-16 13:34:36 -05:00
lpc32xx_nand_slc.c mtd: nand: lpc32xx slc: disable DMA support in SPL builds 2018-11-16 13:34:37 -05:00
Makefile drivers: nand: brcmnand: add initial support 2019-04-22 11:55:58 -04:00
mxc_nand.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
mxc_nand.h mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
mxc_nand_spl.c common: Move hang() to the same header as panic() 2020-01-17 17:53:40 -05:00
mxs_nand.c mtd: gpmi: change the BCH layout setting for large oob NAND 2020-05-10 20:55:20 +02:00
mxs_nand_dt.c i.MX6: nand: add nandbcb command for imx 2019-07-19 14:51:25 +02:00
mxs_nand_spl.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
nand.c mtd: rename CONFIG_MTD_DEVICE -> CONFIG_MTD 2019-12-03 23:04:10 -05:00
nand_base.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
nand_bbt.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
nand_bch.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
nand_ecc.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
nand_ids.c mtd: nand: raw: Add Hynix H27UBG8T2BTR id table 2019-01-02 00:58:16 +05:30
nand_plat.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
nand_spl_load.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
nand_spl_loaders.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
nand_spl_simple.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
nand_timings.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
nand_util.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
omap_elm.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
omap_gpmc.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
pxa3xx_nand.c mtd: nand: pxa3xx: fix raw read when last_chunk_size == 0 2020-04-24 15:17:14 -04:00
pxa3xx_nand.h mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
stm32_fmc2_nand.c dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
sunxi_nand.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
sunxi_nand_spl.c mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
tegra_nand.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
tegra_nand.h mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
vf610_nfc.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
zynq_nand.c ARM: zynq: Fix invalid check on NAND_CMD_NONE. 2020-04-27 14:21:18 +02:00