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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3863BC00A89 for ; Mon, 2 Nov 2020 13:07:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2F76206F8 for ; Mon, 2 Nov 2020 13:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728547AbgKBNHb convert rfc822-to-8bit (ORCPT ); Mon, 2 Nov 2020 08:07:31 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50019 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728359AbgKBNHb (ORCPT ); Mon, 2 Nov 2020 08:07:31 -0500 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id D7E9CFF803; Mon, 2 Nov 2020 13:07:26 +0000 (UTC) Date: Mon, 2 Nov 2020 14:07:25 +0100 From: Miquel Raynal To: Johan Jonker Cc: Yifeng , richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, devicetree@vger.kernel.org, heiko@sntech.de, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others Message-ID: <20201102140725.66e7dcb1@xps13> In-Reply-To: <0b417fc2-3503-9bf6-914d-0f8b38df1914@gmail.com> References: <20201028095326.15562-1-yifeng.zhao@rock-chips.com> <20201028095326.15562-3-yifeng.zhao@rock-chips.com> <0b417fc2-3503-9bf6-914d-0f8b38df1914@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Johan, Yifeng Johan Jonker wrote on Mon, 2 Nov 2020 13:57:56 +0100: > Hi Yifeng, > > Don't poke with "ecc->bytes" ones it is set in rk_nfc_ecc_init(). It > will not be noted by the MTD frame work or userspace. I think there's > currently no way to let the user know that a different ECC must be used. > Neither can the user set ECC on the fly. > > Example R/W flow: > > nand_select_target() > chip->ecc.write_page_raw() > chip->ecc.write_page() > > [..] > > chip->ecc.read_page_raw() > chip->ecc.read_page() > nand_deselect_target() > > A write/read with: > > rk_nfc_read_page_hwecc() > rk_nfc_write_page_hwecc() > > or > > rk_nfc_read_page_raw() > rk_nfc_write_page_raw() > > must end up with the same result. If we can't archive that, then we > shouldn't offer RAW mode to the user for now. If Miquel agrees you > should just get the driver ready now without these 2 functions and round > things up. What about just not supporting the BootROM area if it was marked "reserved" by the BRom in the DT? Raw accessors is really a nice and basic feature that I would like to have in every new driver. Thanks, Miquèl