[PATCH v4] mtd: gpmi: fix the bch setting backward compatible issue
Miquel Raynal
miquel.raynal at bootlin.com
Mon Mar 28 10:28:29 CEST 2022
Hi Han,
han.xu at nxp.com wrote on Fri, 25 Mar 2022 08:36:38 -0500:
> Previous u-boot code changed the default bch setting behavior and caused
> backward compatible issue. This fix choose the legacy bch geometry back
> again as the default option. If the minimum ecc strength that NAND chips
> required need to be chosen, it can be enabled by either adding DT flag
> "fsl,use-minimum-ecc" or CONFIG_NAND_MXS_USE_MINIMUM_ECC in configs. The
> unused flag "fsl,legacy-bch-geometry" get removed.
>
> Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geometry)
> Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob NAND)
> Tested-by: Tim Harvey <tharvey at gateworks.com>
> Tested-by: Sean Nyekjaer <sean at geanix.com>
> Signed-off-by: Han Xu <han.xu at nxp.com>
>
One nit below.
> +void mxs_nand_dump_geo(struct mtd_info *mtd)
> +{
> + struct nand_chip *nand = mtd_to_nand(mtd);
> + struct mxs_nand_info *nand_info = nand_get_controller_data(nand);
> + struct bch_geometry *geo = &nand_info->bch_geometry;
> +
> + dev_dbg(mtd->dev, "BCH Geometry :\n"
> + "GF Length\t\t: %u\n"
> + "ECC Strength\t\t: %u\n"
> + "ECC for Meta\t\t: %u\n"
> + "ECC Chunk0 Size\t\t: %u\n"
> + "ECC Chunkn Size\t\t: %u\n"
> + "ECC Chunk Count\t\t: %u\n"
> + "Block Mark Byte Offset\t: %u\n"
> + "Block Mark Bit Offset\t: %u\n",
> + geo->gf_len,
> + geo->ecc_strength,
> + geo->ecc_for_meta,
> + geo->ecc_chunk0_size,
> + geo->ecc_chunkn_size,
> + geo->ecc_chunk_count,
> + geo->block_mark_byte_offset,
> + geo->block_mark_bit_offset);
> }
>
> /*
> @@ -1159,6 +1210,8 @@ int mxs_nand_setup_ecc(struct mtd_info *mtd)
> if (ret)
> return ret;
>
> + mxs_nand_dump_geo(mtd);
> +
> /* Configure BCH and set NFC geometry */
> mxs_reset_block(&bch_regs->hw_bch_ctrl_reg);
>
The above addition should not be part of the commit fixing the
situation, they should be in a separate patch.
With this fixed,
Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
Thanks,
Miquèl
More information about the U-Boot
mailing list