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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF74BD1CDB8 for ; Tue, 22 Oct 2024 08:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TQcS/K1EL6TJRmWoBCyGMGQnz1Ou/w2iE3xeVuMMr/M=; b=BdLY+VHxfhivo3R4v9TfMT4XkZ h2oq/1x0sLlnmZ0kjtp3doXUCMyY6vibngW6wGAuFRTdPOw4YOx9Mp0XHRt6A6kXXk26eF+qlTHKX of5O+RvvHF02OV3qTFUM8bwUOWcqufyFj5GYvCFVSEqBO1b1u9TEsTVo3aYrl6XHSVhsKNYKTeKFL SaLQlivNXOKZWFgfWNFjOqfJFjTnMUl8Lwa17AKvrNV5pUuHpI+F//vtSqDZhEk57Eohao6cHz4v+ 18sTY3tj4pJitr8KPgwwKNC4z1uNIEP5/vUN9NSltZp9FLnHkHkf5UhfLxXTEArMW1vBn+fyKH853 j4/tXdKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3AiZ-0000000AFyQ-0quc; Tue, 22 Oct 2024 08:58:19 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3Abh-0000000AEYs-0ZOb; Tue, 22 Oct 2024 08:51:14 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id EF223E0002; Tue, 22 Oct 2024 08:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1729587070; 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=TQcS/K1EL6TJRmWoBCyGMGQnz1Ou/w2iE3xeVuMMr/M=; b=QQhlXlUfBbPRw4FrGNQz71LqTH9JBAfQIy+uGcFziA3YMgqQDrl+m8asJT6kfpW73K/W0O fanUjjjlf9L2zbV0OuuOej0RC5NHuUBS2qKzo59xmg7Fyg0ZP7ofg7PjgWe/Czep9io91f mzAJuRw8WVOVI+TRtNhRq3/0ucLb5d5p8oDAjoys8pUO+/XkHCZld1osg1mNNGhYn9MC41 MJbjldOkZC1dOz+HIg+XmtIAEOILhhRkqz9Szqi/rf7pkHTWntnKxXtDYhXt53REg51NAc RVo+RiFKLRO5WBw1FX8jmusCCnFWEPo/xZzkT9gQx09x8dzXF5a/8/X95SUvSA== Date: Tue, 22 Oct 2024 10:51:09 +0200 From: Miquel Raynal To: Hui-Ping Chen Cc: richard@nod.at, vigneshr@ti.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, nikita.shubin@maquefel.me, arnd@arndb.de, vkoul@kernel.org, esben@geanix.com, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 2/2] mtd: rawnand: nuvoton: add new driver for the Nuvoton MA35 SoC Message-ID: <20241022105109.1906f524@xps-13> In-Reply-To: <9cfd923a-4bc8-4a6c-986d-8d0c6fd6d9bb@gmail.com> References: <20241018022519.721914-1-hpchen0nvt@gmail.com> <20241018022519.721914-3-hpchen0nvt@gmail.com> <20241021103254.1f31205b@xps-13> <9cfd923a-4bc8-4a6c-986d-8d0c6fd6d9bb@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_015113_331371_D27E85CB X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Hui-Ping, > >> + > >> +static int ma35_nand_write_page_hwecc(struct nand_chip *chip, const u= 8 *buf, > >> + int oob_required, int page) > >> +{ =20 > > The hardware ECC engine should always be disabled by default. > > > > Then, in these helpers you should: > > * enable the ECC engine > > * do your things > > * disable the ECC engine =20 >=20 > The ECC engine of the MA35 NAND controller cannot be turned on or off sep= arately. >=20 > The ECC engine is activated with the DMA, >=20 > and it calculates and writes to the OOB during the transfer. What about: ECC Algorithm Enable Bit [23] ECCEN This field is used to select the ECC algorithm for data protecting. The BCH algorithm can correct 8 or 12 or 24 bits. 0 =3D BCH code encode/decode Disabled. 1 =3D BCH code encode/decode Enabled. ? Thanks, Miqu=C3=A8l