All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Han Xu <han.xu@nxp.com>
Cc: sbabic@denx.de, sean@geanix.com, frieder.schrempf@kontron.de,
	festevam@gmail.com, ye.li@nxp.com, peng.fan@nxp.com,
	u-boot@lists.denx.de, uboot-imx@nxp.com
Subject: Re: [PATCH v4] mtd: gpmi: fix the bch setting backward compatible issue
Date: Mon, 28 Mar 2022 10:28:29 +0200	[thread overview]
Message-ID: <20220328102829.54be243f@xps13> (raw)
In-Reply-To: <20220325133638.3439-1-han.xu@nxp.com>

Hi Han,

han.xu@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@gateworks.com>
> Tested-by: Sean Nyekjaer <sean@geanix.com>
> Signed-off-by: Han Xu <han.xu@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@bootlin.com>

Thanks,
Miquèl

  reply	other threads:[~2022-03-28  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 13:36 [PATCH v4] mtd: gpmi: fix the bch setting backward compatible issue Han Xu
2022-03-28  8:28 ` Miquel Raynal [this message]
2022-03-28 14:16 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220328102829.54be243f@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=han.xu@nxp.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=sean@geanix.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.