mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-05 02:51:00 +00:00
616f03daba
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> |
||
---|---|---|
.. | ||
brcmnand | ||
am335x_spl_bch.c | ||
arasan_nfc.c | ||
atmel_nand.c | ||
atmel_nand_ecc.h | ||
davinci_nand.c | ||
denali.c | ||
denali.h | ||
denali_dt.c | ||
denali_spl.c | ||
fsl_elbc_nand.c | ||
fsl_elbc_spl.c | ||
fsl_ifc_nand.c | ||
fsl_ifc_spl.c | ||
fsl_upm.c | ||
fsmc_nand.c | ||
kb9202_nand.c | ||
Kconfig | ||
kirkwood_nand.c | ||
kmeter1_nand.c | ||
lpc32xx_nand_mlc.c | ||
lpc32xx_nand_slc.c | ||
Makefile | ||
mxc_nand.c | ||
mxc_nand.h | ||
mxc_nand_spl.c | ||
mxs_nand.c | ||
mxs_nand_dt.c | ||
mxs_nand_spl.c | ||
nand.c | ||
nand_base.c | ||
nand_bbt.c | ||
nand_bch.c | ||
nand_ecc.c | ||
nand_ids.c | ||
nand_plat.c | ||
nand_spl_load.c | ||
nand_spl_loaders.c | ||
nand_spl_simple.c | ||
nand_timings.c | ||
nand_util.c | ||
omap_elm.c | ||
omap_gpmc.c | ||
pxa3xx_nand.c | ||
pxa3xx_nand.h | ||
stm32_fmc2_nand.c | ||
sunxi_nand.c | ||
sunxi_nand_spl.c | ||
tegra_nand.c | ||
tegra_nand.h | ||
vf610_nfc.c | ||
zynq_nand.c |