public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	David Woodhouse <David.Woodhouse@intel.com>,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH] mtd: spi-nor: allow NULL as chip name and try to auto detect it
Date: Tue, 16 Dec 2014 22:50:01 -0800	[thread overview]
Message-ID: <20141217065001.GE7112@brian-ubuntu> (raw)
In-Reply-To: <CACna6rxmagC5wyGR=pL9=G3Yrihk7tvOkBXcR2wXCSuhEeOA5Q@mail.gmail.com>

On Wed, Dec 17, 2014 at 07:19:58AM +0100, Rafał Miłecki wrote:
> On 17 December 2014 at 02:15, Brian Norris <computersforpeace@gmail.com> wrote:
> > On Mon, Dec 01, 2014 at 10:49:28AM +0100, Rafał Miłecki wrote:
> >> The case with non-DT platforms is simple. There is
> >> struct flash_platform_data
> >> which contains "type". I was thinking about Introducing new type like
> >> "m25p80-rdid". What do you think about this?
> >
> > It should reflect "JEDEC RDID" in the name; it means the flash supports
> > the JEDEC opcode (0x9F), unlike some of the SST flash you've looked at.
> > I'm also not sure why it should still be tied to the m25p80 name. How
> > about "spi-nor,jedec-id" or "spi-flash,jedec-id"?
> 
> OK on "jedec-id".
> 
> However I'm not sure about this "spi-nor," because spi-not is a
> framework and it doesn't support all needed ops by itself.

No, SPI NOR is a (moderately) specific type of SPI device. It also
happens to be the name of the framework / library in
drivers/mtd/spi-nor/spi-nor.c and include/linux/mtd/spi-nor.h.

The point is that the name is descriptive of exactly what we expect of
it; it operates on the SPI bus, it's a NOR flash, and it supports the
JEDEC read ID command.

> And it
> wouldn't be clear if "spi-nor,jedec-id" should be handled by m25p80,
> fsl-quadspi, or even some different spi-nor driver.

fsl-quadspi (and other non-SPI flash drivers that may plug into
spi-nor.c) is not probed on a per flash device basis; it's probed based
on the controller compatibility (i.e., the "fsl,vf610-qspi" DT binding).
The driver then happens to use flash names when it calls into the SPI
NOR library.

As I see it, we only need to worry about true SPI devices when
considering this name. We'd need to be able to differentiate the kinds
of SPI devices which cannot be handled by m25p80.c + spi-nor.c. And as
far as I can see, that will only happen for devices which don't support
the JEDEC RDID opcode.

Brian

  reply	other threads:[~2014-12-17  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 16:05 [PATCH] mtd: spi-nor: allow NULL as chip name and try to auto detect it Rafał Miłecki
2014-11-28  8:24 ` Rafał Miłecki
2014-12-01  8:40 ` Brian Norris
2014-12-01  9:49   ` Rafał Miłecki
2014-12-17  1:15     ` Brian Norris
2014-12-17  6:19       ` Rafał Miłecki
2014-12-17  6:50         ` Brian Norris [this message]
2014-12-01  8:42 ` [PATCH V2] " Rafał Miłecki
2014-12-01  8:53   ` Brian Norris

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=20141217065001.GE7112@brian-ubuntu \
    --to=computersforpeace@gmail.com \
    --cc=David.Woodhouse@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=zajec5@gmail.com \
    /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