From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: bbrezillon@kernel.org, richard@nod.at,
frieder.schrempf@kontron.de, marek.vasut@gmail.com,
linux-mtd@lists.infradead.org, kernel@pengutronix.de,
Peter Pan <peterpandong@micron.com>
Subject: Re: [PATCH] mtd: spinand: micron: add support for MT29F1G01AAADD
Date: Mon, 19 Aug 2019 16:34:49 +0200 [thread overview]
Message-ID: <20190819163449.6e62e6a5@xps13> (raw)
In-Reply-To: <20190819133042.23jpf3eap2u5teuo@pengutronix.de>
Hi Marco,
Marco Felsch <m.felsch@pengutronix.de> wrote on Mon, 19 Aug 2019
15:30:42 +0200:
> Hi Miquel,
>
> On 19-08-19 10:17, Miquel Raynal wrote:
> > Hi Marco,
> >
> > Marco Felsch <m.felsch@pengutronix.de> wrote on Wed, 14 Aug 2019
> > 10:22:32 +0200:
> >
> > > The MT29F1G01AAADD is a single die, SLC based SPI NAND. It has a
> > > capacity of 1Gb and supports 4-bit ECC. The datasheet can be found [1].
> > >
> > > Unfortunatly the linked device is marked as EoL, but I will expect that
> > > the MT29F1G01AAADDH4-ITX behaves the same way.
> > >
> > > [1] https://datasheet.octopart.com/ \
> > > MT29F1G01AAADDH4-IT:D-Micron-datasheet-11572380.pdf
> > >
> > > Cc: Peter Pan <peterpandong@micron.com>
> > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > > ---
> > > drivers/mtd/nand/spi/micron.c | 68 +++++++++++++++++++++++++++++++++++
> > > 1 file changed, 68 insertions(+)
> > >
> > > diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
> > > index 7d7b1f7fcf71..9d63450afc69 100644
> > > --- a/drivers/mtd/nand/spi/micron.c
> > > +++ b/drivers/mtd/nand/spi/micron.c
> > > @@ -34,6 +34,18 @@ static SPINAND_OP_VARIANTS(update_cache_variants,
> > > SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
> > > SPINAND_PROG_LOAD(false, 0, NULL, 0));
> > >
> > > +static SPINAND_OP_VARIANTS(read_cache_variants_mt29f1g01aaadd,
> > > + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
> > > + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
> > > + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
> > > + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
> > > +
> > > +static SPINAND_OP_VARIANTS(write_cache_variants_mt29f1g01aaadd,
> > > + SPINAND_PROG_LOAD(true, 0, NULL, 0));
> > > +
> > > +static SPINAND_OP_VARIANTS(update_cache_variants_mt29f1g01aaadd,
> > > + SPINAND_PROG_LOAD(false, 0, NULL, 0));
> > > +
> > > static int mt29f2g01abagd_ooblayout_ecc(struct mtd_info *mtd, int section,
> > > struct mtd_oob_region *region)
> > > {
> > > @@ -90,6 +102,52 @@ static int mt29f2g01abagd_ecc_get_status(struct spinand_device *spinand,
> > > return -EINVAL;
> > > }
> > >
> > > +static int mt29f1g01aaadd_ooblayout_ecc(struct mtd_info *mtd, int section,
> > > + struct mtd_oob_region *region)
> > > +{
> > > + if (section > 3)
> > > + return -ERANGE;
> > > +
> > > + region->offset = (section * 0x10) + 8;
> >
> > Any reason to use hex here? ^
> >
> > If not I would prefer decimal numbers.
>
> Since the datasheet describe it in hex to.
>
> Can you have a look on [1] table 11? May we do something like:
>
> region->offset = (section * 0x10) + 0x8;
>
> [1] https://datasheet.octopart.com/MT29F1G01AAADDH4-IT:D-Micron-datasheet-11572380.pdf
>
> >
> > Otherwise looks fine.
>
> Anyway I can change the above code to use only decimal values if you
> like it more.
I think it is better to reserve hexadecimal values to register
operations. Please translate into decimal.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-08-19 14:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 8:22 [PATCH] mtd: spinand: micron: add support for MT29F1G01AAADD Marco Felsch
2019-08-19 8:17 ` Miquel Raynal
2019-08-19 13:30 ` Marco Felsch
2019-08-19 14:34 ` Miquel Raynal [this message]
2019-08-20 6:39 ` Marco Felsch
2019-08-20 11:31 ` [EXT] " Shivamurthy Shastri (sshivamurthy)
2019-08-20 11:33 ` Shivamurthy Shastri (sshivamurthy)
2019-08-21 7:19 ` Marco Felsch
2019-08-24 10:40 ` Miquel Raynal
2019-08-20 11:35 ` Marco Felsch
2019-08-20 8:28 ` Uwe Kleine-König
2019-08-20 8:32 ` Miquel Raynal
2019-11-08 7:48 Marco Felsch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190819163449.6e62e6a5@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=bbrezillon@kernel.org \
--cc=frieder.schrempf@kontron.de \
--cc=kernel@pengutronix.de \
--cc=linux-mtd@lists.infradead.org \
--cc=m.felsch@pengutronix.de \
--cc=marek.vasut@gmail.com \
--cc=peterpandong@micron.com \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).