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 30DD0C61DA4 for ; Wed, 22 Feb 2023 08:01:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 958C085A7B; Wed, 22 Feb 2023 09:01:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2994085A6E; Wed, 22 Feb 2023 09:01:35 +0100 (CET) Received: from mail-m11874.qiye.163.com (mail-m11874.qiye.163.com [115.236.118.74]) (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 A7C25859B9 for ; Wed, 22 Feb 2023 09:01:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [172.16.12.93] (unknown [58.22.7.114]) by mail-m11874.qiye.163.com (Hmail) with ESMTPA id 77B733C016E; Wed, 22 Feb 2023 16:01:19 +0800 (CST) Message-ID: <425440e8-8e72-7b24-1c53-290dc653dcc3@rock-chips.com> Date: Wed, 22 Feb 2023 16:01:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v4 11/11] mtd: nand: raw: rockchip_nfc: fix oobfree offset and description Content-Language: en-US To: Johan Jonker , dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, sjg@chromium.org Cc: philipp.tomsich@vrull.eu, u-boot@lists.denx.de, yifeng.zhao@rock-chips.com References: <4412f90b-08d6-2640-3c1f-fbe6aaae008d@gmail.com> From: Kever Yang In-Reply-To: <4412f90b-08d6-2640-3c1f-fbe6aaae008d@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZGRkZH1YYSkNDHk9PHU5OSkhVEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSkpLSEpMVUpLS1VLWQ Y+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PRg6Oio*HT0ODA4SIyEaLy8v LiwKCRRVSlVKTUxMS05JQ0NLSEtMVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFISENNNwY+ X-HM-Tid: 0a86782423392eb0kusn77b733c016e X-HM-MType: 1 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 2023/2/18 23:29, Johan Jonker wrote: > The MTD framework reserves 1 or 2 bytes for the bad block marker > depending on the bus size. The rockchip_nfc driver currently only > supports a 8 bit bus, but reserves standard 2 bytes for the BBM. > The first free OOB byte is therefore OOB2 at offset 2. > Page address(PA) bytes are moved to the last 4 positions before > ECC. Update the description for U-boot. > > Signed-off-by: Johan Jonker Reviewed-by: Kever Yang Thanks, - Kever > --- > drivers/mtd/nand/raw/rockchip_nfc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/raw/rockchip_nfc.c b/drivers/mtd/nand/raw/rockchip_nfc.c > index ca5e7313..5ca7eeb8 100644 > --- a/drivers/mtd/nand/raw/rockchip_nfc.c > +++ b/drivers/mtd/nand/raw/rockchip_nfc.c > @@ -487,10 +487,10 @@ static int rk_nfc_write_page_raw(struct mtd_info *mtd, > * > * BBM OOB1 OOB2 OOB3 |......| PA0 PA1 PA2 PA3 > * > - * The rk_nfc_ooblayout_free() function already has reserved > - * these 4 bytes with: > + * The oobfree structure already has reserved these 4 bytes > + * together with 2 bytes for BBM by reducing it's length: > * > - * oob_region->offset = NFC_SYS_DATA_SIZE + 2; > + * oobfree[0].length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2; > */ > if (!i) > memcpy(rk_nfc_oob_ptr(chip, i), > @@ -867,7 +867,7 @@ static int rk_nfc_ecc_init(struct rk_nfc *nfc, struct nand_chip *chip) > ecc->layout->eccpos[i] = rknand->metadata_size + i; > > ecc->layout->oobfree[0].length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2; > - ecc->layout->oobfree[0].offset = NFC_SYS_DATA_SIZE + 2; > + ecc->layout->oobfree[0].offset = 2; > > return 0; > } > -- > 2.20.1 >