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 75CBBC433EF for ; Mon, 20 Jun 2022 11:02:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 45B4D80584; Mon, 20 Jun 2022 13:02:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="cYx8gw1u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A98D5802F3; Mon, 20 Jun 2022 13:02:27 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 B3B6F80584 for ; Mon, 20 Jun 2022 13:02:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D217B8108F; Mon, 20 Jun 2022 11:02:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD0BCC3411B; Mon, 20 Jun 2022 11:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655722943; bh=c07DKqizq5EguRB6zee504Yj2JOtVdiVeEUAc2Pq7Rc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cYx8gw1uAR6kew/bZ9Cu9v//XSZJdv//delHe6w/vrrIpNEHEAcFrndGU2WSRgL3H aFRkv3qy0SzWNGlbcLxsb2i7KKCz7OB4pISIf0NJWAAvUO5xZa4DmJEKlHeGYk15L0 mFWCnAHyw1Pkusa30z4ohclU/OHNg8z7/skUrxpwO4wVrwWX9ihG9bNLOTPD5IWuXz 0YEvf4F/1cDtno9VjmQGPVeTwDnFzhyc86T6ggJzzCFkwBFyKEOVQMRalAddgI2qU3 LgG6wYh8dNSqf7VvMHCxPWM3jUIAV3npOiagQ4Krzfd+qCbmiOZ6Chk5LiOAuOf0Sp okoeW0iFO3v+w== Received: by pali.im (Postfix) id EC4DBF8F; Mon, 20 Jun 2022 13:02:18 +0200 (CEST) Date: Mon, 20 Jun 2022 13:02:18 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: "Peng Fan (OSS)" Cc: Priyanka Jain , Wolfgang Denk , Sinan Akman , u-boot@lists.denx.de Subject: Re: [PATCH] mtd: rawnand: fsl_elbc: Fix detection when nand_scan_ident() has not selected ecc.mode Message-ID: <20220620110218.dtzplvmtv4elhfos@pali> References: <20220511182450.26658-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 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.6 at phobos.denx.de X-Virus-Status: Clean On Monday 20 June 2022 15:08:43 Peng Fan (OSS) wrote: > 在 2022/5/12 2:24, Pali Rohár 写道: > > ecc.mode is set to 0 (aliased to NAND_ECC_NONE) either when function > > nand_scan_ident() has not selected ecc.mode or when it selected it to none > > ecc mode. > > > > Distinguish between these two states by checking of node property > > "nand-ecc-mode" which function nand_scan_ident() uses for filling ecc.mode. > > > > This change fixes usage of none ecc mode if it is specified in DTS file. > > > > Fixes: c9ea9019c5aa ("mtd: rawnand: fsl_elbc: Use ECC configuration from device tree") > > Signed-off-by: Pali Rohár > >    powerpc:  +   ids8313 > +===================== WARNING ====================== > +This board does not use CONFIG_WDT (Driver Model > +for DM watchdog). Please update the board to use > +CONFIG_WDT before the v2019.10 release. Failure to > +update by the deadline may result in board removal. > +See doc/develop/driver-model/migration.rst for more info. > +==================================================== > +This board does not use CONFIG_DM_ETH (Driver Model > +for Ethernet drivers). Please update the board to use > +CONFIG_DM_ETH before the v2020.07 release. Failure to > +This board does not use CONFIG_DM_I2C (Driver Model > +for I2C drivers). Please update the board to use > +CONFIG_DM_I2C before the v2022.04 release. Failure to > +This board does not use CONFIG_DM_SERIAL (Driver Model > +for Serial drivers). Please update the board to use > +CONFIG_DM_SERIAL before the v2023.04 release. Failure to > +powerpc-linux-ld.bfd: drivers/mtd/nand/raw/fsl_elbc_nand.o: in function > `fsl_elbc_chip_init': > +drivers/mtd/nand/raw/fsl_elbc_nand.c:749: undefined reference to > `ofnode_read_string' Uff... I see that other nand code guards ofnode_read_string() calls via #if CONFIG_IS_ENABLED(OF_CONTROL). And seems that same preprocessor guard is needed also here in fsl driver. I will send v2 patch with this guard. > +make[1]: *** [Makefile:1813: u-boot] Error 1 > +make: *** [Makefile:177: sub-make] Error 2 > > Build fail. > > Regards, > Peng. > > > --- > > drivers/mtd/nand/raw/fsl_elbc_nand.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c > > index b0e3eb607ed4..8e14739b3ee9 100644 > > --- a/drivers/mtd/nand/raw/fsl_elbc_nand.c > > +++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c > > @@ -745,7 +745,8 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr, struct udevice *dev) > > return ret; > > /* If nand_scan_ident() has not selected ecc.mode, do it now */ > > - if (nand->ecc.mode == NAND_ECC_NONE) { > > + if (nand->ecc.mode == 0 && > > + !ofnode_read_string(nand->flash_node, "nand-ecc-mode")) { > > /* If CS Base Register selects full hardware ECC then use it */ > > if ((br & BR_DECC) == BR_DECC_CHK_GEN) { > > nand->ecc.mode = NAND_ECC_HW; >