From: Brian Norris <computersforpeace@gmail.com>
To: Cyril Bur <cyrilbur@gmail.com>
Cc: Joel Stanley <joel@jms.id.au>,
linuxppc-dev@lists.ozlabs.org, linux-mtd@lists.infradead.org,
dwmw2@infradead.org, jk@ozlabs.org
Subject: Re: [PATCH] drivers/mtd: add powernv flash MTD abstraction driver
Date: Wed, 27 May 2015 13:56:57 -0700 [thread overview]
Message-ID: <20150527205559.GK27753@ld-irv-0074> (raw)
In-Reply-To: <1432188772.2911.15.camel@cyril>
Hi Cyril,
On Thu, May 21, 2015 at 04:12:52PM +1000, Cyril Bur wrote:
> One question though,
>
> On Wed, 2015-05-20 at 14:17 -0700, Brian Norris wrote:
> > On Mon, May 04, 2015 at 04:42:19PM +1000, Cyril Bur wrote:
> > > Powerpc powernv platforms allow access to certain system flash devices
> > > through a firmwarwe interface. This change adds an mtd driver for these
> > > flash devices.
> > >
> > > Minor updates from Jeremy Kerr and Joel Stanley.
> > >
> > > Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> > > Signed-off-by: Joel Stanley <joel@jms.id.au>
> > > Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> > > ---
> > > drivers/mtd/devices/Kconfig | 6 +
> > > drivers/mtd/devices/Makefile | 1 +
> > > drivers/mtd/devices/powernv_flash.c | 288 ++++++++++++++++++++++++++++++++++++
> > > 3 files changed, 295 insertions(+)
> > > create mode 100644 drivers/mtd/devices/powernv_flash.c
> > >
>
> [snip]
>
> > > +
> > > +/**
> > > + * powernv_flash_set_driver_info - Fill the mtd_info structure and docg3
> > > + * structure @pdev: The platform device
> > > + * @mtd: The structure to fill
> > > + */
> > > +static int __init powernv_flash_set_driver_info(struct device *dev,
> > > + struct mtd_info *mtd)
> > > +{
...
> > > + /* Going to have to check what details I need to set and how to
> > > + * get them */
> > > + mtd->name = of_get_property(dev->of_node, "name", NULL);
> > > + mtd->type = MTD_NANDFLASH;
> > > + mtd->flags = MTD_CAP_NANDFLASH;
> >
> > Is this really NAND flash? It doesn't look like it; I see no bad block
> > implementation, and writesize==1.
>
> Correct, but the type here is a bit misleading, we have a firmware
> interface for the low level read/write/erase functions, all this driver
> does is pass the calls through to firmware, there isn't much that linux
> or userspace can do since it doesn't actually do the hardware accesses.
>
> I've checked with Jeremy, turns out the hardware is actually NOR, no
> idea how I ever thought it was NAND.
>
> Perhaps just:
> mtd->type = MTD_RAM;
> mtd->flags = MTD_WRITEABLE;
>
> I would have used MTD_NOR but Jeremy confirms that the backing flash may
> not always be NOR on other platforms.
Well, it definitely shouldn't have a type of MTD_NANDFLASH if it's
actually NOR. MTD users may very well treat NAND differently than
anything else. And MTD_RAM is also pretty misleading.
Also, the comments throughout the driver about PNOR will be misleading
if it's not always PNOR.
What other type of memory might be used? Would it act any differently
than PNOR? If so, then I'd expect the driver would need to account for
this anyway (at a minimum, just by exposing that information through an
MTD API, so users can treat it differently) so we'd have a chance to
change the mtd->type.
Brian
prev parent reply other threads:[~2015-05-27 20:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 6:42 [PATCH] Add a MTD driver for OpenPower PNOR flash Cyril Bur
2015-05-04 6:42 ` [PATCH] drivers/mtd: add powernv flash MTD abstraction driver Cyril Bur
2015-05-20 21:17 ` Brian Norris
2015-05-21 5:09 ` Jeremy Kerr
2015-05-21 6:12 ` Cyril Bur
2015-05-27 20:56 ` Brian Norris [this message]
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=20150527205559.GK27753@ld-irv-0074 \
--to=computersforpeace@gmail.com \
--cc=cyrilbur@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jk@ozlabs.org \
--cc=joel@jms.id.au \
--cc=linux-mtd@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/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