From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1374C433EF for ; Mon, 28 Mar 2022 08:28:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA9D983B07; Mon, 28 Mar 2022 10:28:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="KLRRH8SC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 91CC883AF9; Mon, 28 Mar 2022 10:28:39 +0200 (CEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ECA9483B07 for ; Mon, 28 Mar 2022 10:28:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=miquel.raynal@bootlin.com Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 44652FF808; Mon, 28 Mar 2022 08:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1648456111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6VtD6l+rdr/k8kP5Eo9HCdKaJAhE2TShGIo5kiWAa1c=; b=KLRRH8SCeVFUpSU/N+3APBF6ji5R5RypTcjvvY6JZlgfgvTlIbqU0mJMde800/w6dErVH2 FWGYOsC1j0Zuv0zuQN7AIGzpk3/gTNzTvT1lDoDzsYs3k1TluiTr/eosJGbq3ZHGK512S+ fT1BRS3A2yhJ16YiUgPDDXc3t8RTxoQBERnPWEQO60sLnIKtESjNYQqC4H/8o0V8De3Ekm Z5mGVotgbiwM52aPfCTdDlV+mI9HZG2hLst4A+pQ5geD1tVQQov+Qv6/9JsTNB4S4jPxxq Dw52oi5gCt72d2+fVzdq6rtW4nkS0BSO3NHIDdPECCYU23gCYEvMRBnvo6kzWA== Date: Mon, 28 Mar 2022 10:28:29 +0200 From: Miquel Raynal To: Han Xu 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 Message-ID: <20220328102829.54be243f@xps13> In-Reply-To: <20220325133638.3439-1-han.xu@nxp.com> References: <20220325133638.3439-1-han.xu@nxp.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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. >=20 > Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geomet= ry) > Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob= NAND) > Tested-by: Tim Harvey > Tested-by: Sean Nyekjaer > Signed-off-by: Han Xu >=20 One nit below. > +void mxs_nand_dump_geo(struct mtd_info *mtd) > +{ > + struct nand_chip *nand =3D mtd_to_nand(mtd); > + struct mxs_nand_info *nand_info =3D nand_get_controller_data(nand); > + struct bch_geometry *geo =3D &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); > } > =20 > /* > @@ -1159,6 +1210,8 @@ int mxs_nand_setup_ecc(struct mtd_info *mtd) > if (ret) > return ret; > =20 > + mxs_nand_dump_geo(mtd); > + > /* Configure BCH and set NFC geometry */ > mxs_reset_block(&bch_regs->hw_bch_ctrl_reg); > =20 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 Thanks, Miqu=C3=A8l