[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3acc6cd6-abdb-434e-a4da-c371e7f49a70@kontron.de>
Date: Tue, 22 Aug 2023 14:32:51 +0200
From: Frieder Schrempf <frieder.schrempf@...tron.de>
To: Martin Kurbanov <mmkurbanov@...rdevices.ru>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>
Cc: linux-kernel@...r.kernel.org, linux-mtd@...ts.infradead.org,
kernel@...rdevices.ru
Subject: Re: [PATCH v2 2/2] mtd: spinand: micron: fixing the offset for OOB
On 22.08.23 14:25, Martin Kurbanov wrote:
> The first 4 bytes are reserved for bad block data.
>
> Signed-off-by: Martin Kurbanov <mmkurbanov@...rdevices.ru>
This should probably also have a Fixes tag like:
Fixes: a508e8875e13 ("mtd: spinand: Add initial support for Micron
MT29F2G01ABAGD")
Reviewed-by: Frieder Schrempf <frieder.schrempf@...tron.de>
> ---
> drivers/mtd/nand/spi/micron.c | 20 +++++++++++++++++---
> 1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
> index 12601bc4227a..64b41c7c9cce 100644
> --- a/drivers/mtd/nand/spi/micron.c
> +++ b/drivers/mtd/nand/spi/micron.c
> @@ -57,6 +57,20 @@ static SPINAND_OP_VARIANTS(x1_write_cache_variants,
> static SPINAND_OP_VARIANTS(x1_update_cache_variants,
> SPINAND_PROG_LOAD(false, 0, NULL, 0));
>
> +/*
> + * OOB spare area map (128 and 256 bytes)
> + *
> + * +-----+-----------------+-------------------+---------------------+
> + * | BBM | Non ECC | ECC protected | ECC Area |
> + * | | protected Area | Area | |
> + * ----------+-----+-----------------+-------------------+---------------------+
> + * oobsize | 0:3 | 4:31 (28 bytes) | 32:63 (32 bytes) | 64:127 (64 bytes) |
> + * 128 bytes | | | | |
> + * ----------+-----+-----------------+-------------------+---------------------+
> + * oobsize | 0:3 | 4:63 (60 bytes) | 64:127 (64 bytes) | 127:255 (128 bytes) |
> + * 256 bytes | | | | |
> + * ----------+-----+-----------------+-------------------+---------------------+
> + */
> static int micron_8_ooblayout_ecc(struct mtd_info *mtd, int section,
> struct mtd_oob_region *region)
> {
> @@ -75,9 +89,9 @@ static int micron_8_ooblayout_free(struct mtd_info *mtd, int section,
> if (section)
> return -ERANGE;
>
> - /* Reserve 2 bytes for the BBM. */
> - region->offset = 2;
> - region->length = (mtd->oobsize / 2) - 2;
> + /* Reserve 4 bytes for the BBM. */
> + region->offset = 4;
> + region->length = (mtd->oobsize / 2) - 4;
>
> return 0;
> }
Powered by blists - more mailing lists