From: Allen Martin <amartin@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 05/14] spi: add common fdt SPI driver interface
Date: Thu, 14 Feb 2013 13:42:42 -0800 [thread overview]
Message-ID: <20130214214241.GE32695@badger> (raw)
In-Reply-To: <511D474E.7020003@wwwdotorg.org>
On Thu, Feb 14, 2013 at 12:21:34PM -0800, Stephen Warren wrote:
> On 02/14/2013 01:07 PM, Allen Martin wrote:
> > On Wed, Feb 13, 2013 at 02:40:29PM -0800, Stephen Warren wrote:
> >> On 02/12/2013 08:23 PM, Allen Martin wrote:
> >>> Add a common interface to fdt based SPI drivers. Each driver is
> >>> represented by a table entry in fdt_spi_drivers[]. If there are
> >>> multiple SPI drivers in the table, the first driver to return success
> >>> from spi_init() will be registered as the SPI driver.
> >>
> >> I don't think there should be a global concept of "the" SPI driver;
> >> instances of both SPI blocks exist on Tegra20, so they should be able to
> >> co-exist, using the SFLASH driver for 1 SPI port, and the SLINK driver
> >> for the other 4 ports.
> >
> > I agree, but that's probably beyond the scope of this series, as
> > that's a more global problem. Other drivers call directly into the
> > SPI driver by use of well known function names, so that would need to
> > be abstracted to fix.
>
> It should be simple to fix; you already have a table of all known
> (DT-based) SPI drivers; simply iterate over all entries in the table
> always, rather than stopping when you hit the first one. Also, don't
> store /a/ pointer to the driver, but store a pointer per instance. I
> think the modifications to your patch series to solve this shouldn't be
> large at all.
>
I don't think it will be that easy. The different drivers would have
to coordinate on bus numbering, or there would have to be a new
"adapter number" addressing to differentiate the drivers, which would
be hard to do without impacting all the other non-fdt drivers as well.
> >> How does this patch interact with any SPI-related device manager work?
> >
> > I'm not sure what device manager is in the context of u-boot. Is that
> > the same as the unified driver model that's being documented in
> > doc/driver-model?
>
> Yes.
>
> > If so I think this fits in really well with that.
> > The "struct ops" described there is almost identical to the callbacks
> > I added in "struct fdt_spi_driver"
>
> The code certainly looks like a move in the right direction. I was
> thinking more along the lines of: Is anyone actively working on this
> right now, so your patches will conflict.
I haven't seen any, but I haven't been looking out for those patches
either, I'll look through the list archives and see if anyting turns
up.
-Allen
--
nvpublic
next prev parent reply other threads:[~2013-02-14 21:42 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 3:23 [U-Boot] [PATCH 00/14] tegra114 SPI driver Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers Allen Martin
2013-02-13 22:30 ` Stephen Warren
2013-02-14 19:58 ` Allen Martin
2013-02-14 20:18 ` Stephen Warren
2013-02-13 22:36 ` Stephen Warren
2013-02-14 20:01 ` Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 02/14] tegra: spi: remove non fdt support Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 03/14] tegra: spi: pull register structs out of headers Allen Martin
2013-02-13 22:32 ` Stephen Warren
2013-02-14 19:20 ` Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 04/14] tegra20: spi: move fdt probe to spi_init Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 05/14] spi: add common fdt SPI driver interface Allen Martin
2013-02-13 22:40 ` Stephen Warren
2013-02-14 20:07 ` Allen Martin
2013-02-14 20:21 ` Stephen Warren
2013-02-14 21:42 ` Allen Martin [this message]
2013-02-13 3:23 ` [U-Boot] [PATCH 06/14] sf: winbond: add W25Q32DW Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 07/14] tegra114: dalmore: add SPI pinmux config Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 08/14] tegra114: fdt: add compatible string for tegra114 SPI ctrl Allen Martin
2013-02-13 22:51 ` Stephen Warren
2013-02-13 3:23 ` [U-Boot] [PATCH 09/14] tegra114: fdt: add CAR block Allen Martin
2013-02-13 22:46 ` Stephen Warren
2013-02-13 3:23 ` [U-Boot] [PATCH 10/14] tegra114: fdt: add apbdma block Allen Martin
2013-02-13 22:48 ` Stephen Warren
2013-02-13 3:23 ` [U-Boot] [PATCH 11/14] tegra114: fdt: add SPI blocks Allen Martin
2013-02-13 22:52 ` Stephen Warren
2013-02-13 3:23 ` [U-Boot] [PATCH 12/14] tegra114: dalmore: fdt: enable dalmore SPI controller Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 13/14] tegra114: add SPI driver Allen Martin
2013-02-13 22:59 ` Stephen Warren
2013-02-14 14:32 ` Simon Glass
2013-02-14 21:49 ` Allen Martin
2013-02-13 3:23 ` [U-Boot] [PATCH 14/14] tegra114: dalmore: config: enable SPI Allen Martin
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=20130214214241.GE32695@badger \
--to=amartin@nvidia.com \
--cc=u-boot@lists.denx.de \
/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