linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Angus Clark <angus.clark-qxv4g6HH51o@public.gmane.org>,
	marex-ynQEQJNshbs@public.gmane.org,
	broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	pekon-l0cyMroinI0@public.gmane.org,
	sourav.poddar-l0cyMroinI0@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 0/4] mtd: spi-nor: add a new framework for SPI NOR
Date: Thu, 5 Dec 2013 01:20:48 -0800	[thread overview]
Message-ID: <20131205092048.GE4636@norris.computersforpeace.net> (raw)
In-Reply-To: <20131205075901.GA20407-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>

On Thu, Dec 05, 2013 at 03:59:02PM +0800, Huang Shijie wrote:
> On Thu, Dec 05, 2013 at 12:11:01AM -0800, Brian Norris wrote:
> > On Thu, Dec 05, 2013 at 03:12:25PM +0800, Huang Shijie wrote:
> > > On Wed, Dec 04, 2013 at 10:44:05AM -0800, Brian Norris wrote:
> > > > 
> > > > I mostly bring this up, though, because it is an example of hardware
> > > > that
> > > > 
> > > >    (a) can operate as a true SPI device (hardware (1) can handle generic
> > > >        SPI transfers), but
> > > >    (b) requires knowledge of the details of SPI flash in order to get
> > > >        optimal usage out of the acceleration from (2).
> > > > 
> > > > In my book, point (a) and (b) hold some bearing over the question of
> > > > "where should this SPI NOR framework live", because it is reasonable
> > > > that a single driver for this hardware should be able to handle either
> > > > true SPI devices or accelerated SPI-NOR flash.
> > > 
> > > We have add a @read_id hook for the spi-nor layer, you can use it to read out
> > > more info (such as the Device Geometry Definition) for your spi-nor controller driver.
> > > 
> > > Is it okay?
> > 
> > I'm not sure which @read_id hook you're talking about, as I've only
> > skimmed the most recent thread, and it's not in the last patch series I
> > have from you, I don't think. But that is not a response at all to the
> > points I brought up. My statements have nothing to do with device
> > geometry detection.
> 
> My meaning is You can write a new driver for the (b) with the new spi-nor layer,

Yes, I can do that.

> In the new driver you can implement the @read_id yourself, and read out the
> the necessary info, and implement other hooks for the so-called peculiarities.

Without giving a full judgment on the framework yet (I haven't followed
as closely as I'd like), I expect that the SPI NOR API will cover the
needs of my SPI NOR hardware.

> > 
> > What I was actually addressing:
> > 
> > Your framework aligns with Mark's original suggestion: that the "SPI
> > NOR" framework should be a separate layer held entirely within the MTD
> > subsystem, and that any given driver is *either* a "SPI NOR" driver *or*
> > a "true SPI" driver, not both.
> You can only use a SPI-NOR driver, and you can abandon the "true SPI" driver.
> 
> Is there some limits that prevent we just code a SPI-NOR driver for your hardware?

SPI is not used only for SPI NOR; it is useful for other things, like
communicating with off-chip peripherals or microcontrollers, supporting
touchscreens, LEDs, media controllers, etc. So with a SPI NOR framework
living only in the MTD subsystem, I have to write two drivers: one
(under drivers/spi/) to use only-(a) for controlling non-flash SPI
devices, and one (under drivers/mtd/) to manage (a)+(b) on SPI NOR
flash.

If, however, we can define a spi_nor_transfer like Angus suggested, and
if we take that a step further and make it a first-class (but optional)
citizen of the SPI framework, then we could have drivers that support
SPI-only, SPI-NOR-only, or both.

Now, I'm not sure how exactly that sort of proposal would work yet, but
I wanted to test the waters to see
  - if this is a complete distortion of what Angus or David may have
    suggested;
  - if Mark thinks this is reasonable, or if he thinks I'm spouting
    nonsense; and
  - if there is some obvious alternate way to support what I describe
    without moving the SPI-NOR layer into the SPI subsystem.

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-12-05  9:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1385447575-23773-1-git-send-email-b32955@freescale.com>
     [not found] ` <1385447575-23773-1-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-11-27  4:32   ` [PATCH 0/4] mtd: spi-nor: add a new framework for SPI NOR Brian Norris
     [not found]     ` <20131127043253.GA9468-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org>
2013-11-27  4:39       ` Huang Shijie
2013-11-29 14:52       ` Angus Clark
2013-12-03 14:51         ` David Woodhouse
     [not found]           ` <1386082273.18201.61.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2013-12-04 18:44             ` Brian Norris
     [not found]               ` <20131204184405.GE9468-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org>
2013-12-05  7:12                 ` Huang Shijie
     [not found]                   ` <20131205071224.GA8936-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-12-05  8:11                     ` Brian Norris
     [not found]                       ` <20131205081101.GA4636-7ciq9WCbhwJWVhifINYOO1poFGfAdsVx5NbjCUgZEJk@public.gmane.org>
2013-12-05  7:59                         ` Huang Shijie
     [not found]                           ` <20131205075901.GA20407-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-12-05  9:20                             ` Brian Norris [this message]
     [not found]                               ` <20131205092048.GE4636-7ciq9WCbhwJWVhifINYOO1poFGfAdsVx5NbjCUgZEJk@public.gmane.org>
2013-12-06  3:07                                 ` Huang Shijie
2013-12-05 14:35                 ` Angus Clark
     [not found]                   ` <52A08F43.6060307-qxv4g6HH51o@public.gmane.org>
2013-12-06  8:18                     ` Huang Shijie
2013-12-10  9:08                     ` Brian Norris
     [not found]         ` <5298AA23.7080404-qxv4g6HH51o@public.gmane.org>
2013-12-02 10:06           ` Huang Shijie
     [not found]             ` <529C5BBF.6000604-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-12-02 11:01               ` Gupta, Pekon
2013-12-02 11:19             ` Angus Clark
     [not found]               ` <529C6CBB.4000008-qxv4g6HH51o@public.gmane.org>
2013-12-03  6:20                 ` Huang Shijie
     [not found]                   ` <529D7838.6030606-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-12-03  8:23                     ` Lee Jones
2013-12-10  8:25                       ` Brian Norris
     [not found]                         ` <20131210082547.GC11489-7ciq9WCbhwJWVhifINYOO1poFGfAdsVx5NbjCUgZEJk@public.gmane.org>
2013-12-10 10:00                           ` Lee Jones
2013-12-03  0:32           ` Marek Vasut
     [not found]             ` <201312030132.10410.marex-ynQEQJNshbs@public.gmane.org>
2013-12-03 10:36               ` Huang Shijie
2013-12-04  2:46           ` Huang Shijie
     [not found]             ` <529E976E.4050104-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-12-04  6:58               ` Angus Clark
     [not found]                 ` <529ED29C.1030208-qxv4g6HH51o@public.gmane.org>
2013-12-04  7:19                   ` Gupta, Pekon
     [not found]                     ` <20980858CB6D3A4BAE95CA194937D5E73EA51905-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-12-04  8:21                       ` Angus Clark
     [not found]                         ` <529EE5F1.9080806-qxv4g6HH51o@public.gmane.org>
2013-12-04 15:36                           ` Marek Vasut
     [not found]                             ` <201312041636.20875.marex-ynQEQJNshbs@public.gmane.org>
2013-12-05  2:42                               ` Huang Shijie
     [not found]                                 ` <529FE81C.4000608-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-12-05  5:43                                   ` Gupta, Pekon
     [not found]                                     ` <20980858CB6D3A4BAE95CA194937D5E73EA51E1A-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-12-05  7:33                                       ` Huang Shijie

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=20131205092048.GE4636@norris.computersforpeace.net \
    --to=computersforpeace-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=angus.clark-qxv4g6HH51o@public.gmane.org \
    --cc=b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marex-ynQEQJNshbs@public.gmane.org \
    --cc=pekon-l0cyMroinI0@public.gmane.org \
    --cc=sourav.poddar-l0cyMroinI0@public.gmane.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;
as well as URLs for NNTP newsgroup(s).