From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Norris Subject: Re: [PATCH 0/4] mtd: spi-nor: add a new framework for SPI NOR Date: Tue, 10 Dec 2013 01:08:54 -0800 Message-ID: <20131210090854.GD11489@norris.computersforpeace.net> References: <1385447575-23773-1-git-send-email-b32955@freescale.com> <20131127043253.GA9468@ld-irv-0074.broadcom.com> <5298AA23.7080404@st.com> <1386082273.18201.61.camel@shinybook.infradead.org> <20131204184405.GE9468@ld-irv-0074.broadcom.com> <52A08F43.6060307@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Woodhouse , Huang Shijie , marex-ynQEQJNshbs@public.gmane.org, broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Lee Jones , Linus Walleij , 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 To: Angus Clark Return-path: Content-Disposition: inline In-Reply-To: <52A08F43.6060307-qxv4g6HH51o@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: On Thu, Dec 05, 2013 at 02:35:47PM +0000, Angus Clark wrote: > On 12/04/2013 06:44 PM, Brian Norris wrote: > > On this topic, I have one more stick to throw on this fire; I have some > > Broadcom hardware that consists of two pieces: > > > > (1) a true SPI controller, with single-line-I/O and > > (2) a Serial Flash controller that can accelerate flash read, using > > dual/quad I/O. > > We support one platform with properties similar to the hardware you describe, > and such a hybrid configuration was in mind when I was thinking about the > spi-nor framework. I am not sure how well this will come across over email, but > I envisage something like this: > > spi-nor > | > v > [spi-nor-xfer] > | > ------------------------------------------------ > | | | > v v v > spi-wrapper (<------) hybrid-driver serial-flash-driver > | | | > [SPI] | | > | | | > v | | > generic-spi-driver | | > | | | > v v v > [generic-SPI-Cntrl] [SPI-Flash-Read Cntrl] [SPI-Flash-Controller] > > The 'spi-nor' layer is responsible for Serial Flash domain knowledge, and how to > generate 'spi-nor-xfer' messages. The 'spi-wrapper' would provide an interface > to the generic SPI framework, flattening the 'spi-nor-xfer' message to standard > SPI calls. The combination of 'spi-nor' and 'spi-wrapper' should achieve what > we have today for the m25p80 driver. The 'serial-flash-driver' in the example > provides an implementation for a dedicated Serial Flash Controller, making use > of the spi-nor-xfer semantics where required. The 'hybrid-driver' could use the > 'spi-wrapper' implementation for write and erase hooks, and optimised > implementations for read hooks. OK, that sounds reasonable. But how do I bind my "generic SPI driver" with my "SPI NOR accelerated read driver" to represent this? Does the hybrid driver (my accelerated-read driver) have to register itself as a SPI protocol driver (struct spi_driver)? The "controller" boundaries seem to get a little fuzzy under this design. 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