Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Brian Norris <computersforpeace@gmail.com>
Cc: "Hauke Mehrtens" <hauke@hauke-m.de>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	linux-spi@vger.kernel.org, "Huang Shijie" <b32955@freescale.com>,
	"Andre Renaud" <andre@bluewatersys.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: Writing SPI flash driver for Broadcom BCM53xx ARM SoC
Date: Sat, 16 Aug 2014 17:33:15 +0100	[thread overview]
Message-ID: <20140816163315.GX28623@sirena.org.uk> (raw)
In-Reply-To: <20140802020036.GR3711@ld-irv-0074>

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

On Fri, Aug 01, 2014 at 07:00:36PM -0700, Brian Norris wrote:

> You can probably write a pure SPI driver (drivers/spi/) that uses only
> the MSPI hardware to do (slow, single-I/O) true SPI, and hooks into
> m25p80.c.

This seems like a good first pass at any rate, it's uncontroversial and
at least functional even if slow.

> But if you want to integrate the accelerated BSPI for reads, it gets
> harder. You might be able to export a kind of 'lock' API from the MSPI
> driver, so that a BSPI driver can utilize the MSPI for most
> transactions, but then lock it down when doing BSPI/read operations. I
> think with a little bit of work, spi-nor.c can accomodate the right kind
> of callbacks to allow you to do this. But the coordination between
> drivers/spi/<MSPI> and drivers/mtd/spi-nor/<BSPI> would be the hardest
> to architect, I think.

Right, I think we'd need something that allowed the MTD controller to
take ownership of the device, lock out other users and then do what it
wants with the controller.  If we provide a way for the SPI and MTD
drivers to get hold of each other and pass around the underlying device
we probably don't even need to architect the interface too much, we can
just say it's a private arrangement between the two drivers, given that
I don't think we have a good picture of what a standard interface would
look like and the hardware seems to have a reasonable amount of
variation in how things are split this may actually be the most tasteful
thin we can do for the time being.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2014-08-16 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  9:27 Writing SPI flash driver for Broadcom BCM53xx ARM SoC Rafał Miłecki
2014-08-02  2:00 ` Brian Norris
2014-08-16 16:33   ` Mark Brown [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=20140816163315.GX28623@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andre@bluewatersys.com \
    --cc=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=hauke@hauke-m.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.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