[EXT] [PATCH] mtd: mxs_nand: default to legacy bch and rename to modern bch option
han.xu
han.xu at nxp.com
Tue May 11 04:49:26 CEST 2021
On 21/05/10 12:00PM, Sean Nyekjaer wrote:
> Caution: EXT Email
>
> Linux kernel defaults to use legacy bch setting, this was creating a
> mismatch between U-boot and Linux default settings.
Kernel uses the NAND chip specified minimum ecc strength and steps by default
not the legacy bch setting, unless users enable it in DT file.
>
> Fixes: 51cdf83eea ("mtd: gpmi: provide the option to use legacy bch geometry")
> Signed-off-by: Sean Nyekjaer <sean at geanix.com>
> ---
> drivers/mtd/nand/raw/mxs_nand.c | 2 +-
> drivers/mtd/nand/raw/mxs_nand_dt.c | 2 +-
> include/mxs_nand.h | 4 ++--
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c
> index e6bbfac4d6..49795e20d2 100644
> --- a/drivers/mtd/nand/raw/mxs_nand.c
> +++ b/drivers/mtd/nand/raw/mxs_nand.c
> @@ -1119,7 +1119,7 @@ static int mxs_nand_set_geometry(struct mtd_info *mtd, struct bch_geometry *geo)
> }
>
> if ((!(chip->ecc_strength_ds > 0 && chip->ecc_step_ds > 0) &&
> - mtd->oobsize < 1024) || nand_info->legacy_bch_geometry) {
> + mtd->oobsize < 1024) || !nand_info->modern_bch_geometry) {
> dev_warn(mtd->dev, "use legacy bch geometry\n");
> return mxs_nand_legacy_calc_ecc_layout(geo, mtd);
> }
> diff --git a/drivers/mtd/nand/raw/mxs_nand_dt.c b/drivers/mtd/nand/raw/mxs_nand_dt.c
> index 878796d555..bbb7396324 100644
> --- a/drivers/mtd/nand/raw/mxs_nand_dt.c
> +++ b/drivers/mtd/nand/raw/mxs_nand_dt.c
> @@ -92,7 +92,7 @@ static int mxs_nand_dt_probe(struct udevice *dev)
>
> info->use_minimum_ecc = dev_read_bool(dev, "fsl,use-minimum-ecc");
>
> - info->legacy_bch_geometry = dev_read_bool(dev, "fsl,legacy-bch-geometry");
> + info->modern_bch_geometry = dev_read_bool(dev, "fsl,modern-bch-geometry");
>
> if (IS_ENABLED(CONFIG_CLK) && IS_ENABLED(CONFIG_IMX8)) {
> /* Assigned clock already set clock */
> diff --git a/include/mxs_nand.h b/include/mxs_nand.h
> index c0cefaca90..7e254d6b31 100644
> --- a/include/mxs_nand.h
> +++ b/include/mxs_nand.h
> @@ -43,8 +43,8 @@ struct mxs_nand_info {
> struct udevice *dev;
> unsigned int max_ecc_strength_supported;
> bool use_minimum_ecc;
> - /* legacy bch geometry flag */
> - bool legacy_bch_geometry;
> + /* modern bch geometry flag */
> + bool modern_bch_geometry;
> int cur_chip;
>
> uint32_t cmd_queue_len;
> --
> 2.31.0
>
More information about the U-Boot
mailing list