From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] spi: orion.c: Add direct access mode
Date: Thu, 24 Mar 2016 21:07:32 +0100 [thread overview]
Message-ID: <12540712.SXPhdxqg9f@wuerfel> (raw)
In-Reply-To: <56F42939.4020803@denx.de>
On Thursday 24 March 2016 18:51:53 Stefan Roese wrote:
> On 24.03.2016 17:48, Arnd Bergmann wrote:
> > On Thursday 24 March 2016 17:15:49 Stefan Roese wrote:
> >>>
> >>> soc@ {
> >>> spi0 {
> >>> compatible = "marvell,armada-370-spi",
> >>> "marvell,orion-spi";
> >>> reg = <MBUS_ID(0xf0, 0x01) 0x10600 0x28>,
> >>> <MBUS_ID(0x01, 0x5e) 0 0x100000>;
> >>> #address-cells = <1>;
> >>> #size-cells = <0>;
> >>> pinctrl-0 = <&spi0_pins1>;
> >>> pinctrl-names = "default";
> >>> cell-index = <0>;
> >>> interrupts = <30>;
> >>> clocks = <&coreclk 0>;
> >>> status = "disabled";
> >>> };
> >>> };
> >>
> >> Do I understand this correctly, that you suggest to list all MBus
> >> windows here, that the SoC supports (e.g. 8 for the Armada XP).
> >> And let the SPI driver then extract and dynamically enable (map)
> >> the one that is currently used?
> >
> > Actually the syntax above doesn't imply any mapping at all, it
> > just describes how the hardware is wired up, so that really
> > needs to list all windows, and then the ranges property in the
> > soc node can statically map the ones that are used on the
> > particular machine.
>
> I see. But with this we are back to statically mapping the MBus
> windows that are used. Resulting in potentially multiple windows
> per SPI controller, which is not necessary (Andrew and Mark
> objected against that).
I'm not following here. Do you mean we should set up and tear
down the windows in the runtime PM callbacks so they are only
present when we actually access a device instead?
If a controller has multiple high-speed devices connected to
it, and we want them all to use the direct mapping, it doesn't
seem overly wasteful to have one mbus window per device, but
doing the dynamic switching doesn't seem wrong either.
Among the dts files we ship with the kernel, how many would
actually use more than one mapping in practice if we decide to
do the static ranges property? I had a quick look and could not
even find one that has more than one chip-select connected.
> > Alternatively, we might encode this in the 'reg' property in
> > some way?
> >
> > How do we know whether a device supports the mode or not?
>
> Currently, only a very limited number of SPI devices will support
> it. As its really only useful right now for full-speed tx-transfer.
> In my case its downloading a bitstream into a FPGA (only SPI
> writes). In the future, SPI NOR flash devices can be supported.
> But this needs additional work. So SPI devices should not use
> this direct access mode as default for now. It needs to get
> opted-in via some DT property.
Ok, so with the static mapping it could be done very easily, or
we need a more complex solution for the dynamic mapping.
Arnd
next prev parent reply other threads:[~2016-03-24 20:07 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 16:24 [PATCH v2] spi: orion.c: Add direct access mode Stefan Roese
2016-03-22 16:35 ` Thomas Petazzoni
2016-03-22 16:44 ` Stefan Roese
2016-03-23 11:33 ` Mark Brown
2016-03-23 11:59 ` Stefan Roese
2016-03-23 12:54 ` Mark Brown
2016-03-23 13:10 ` Stefan Roese
2016-03-23 13:26 ` Andrew Lunn
2016-03-23 13:36 ` Mark Brown
2016-03-23 13:56 ` Andrew Lunn
2016-03-23 19:51 ` Arnd Bergmann
2016-03-24 7:22 ` Stefan Roese
2016-03-24 12:42 ` Arnd Bergmann
2016-03-24 16:15 ` Stefan Roese
2016-03-24 16:42 ` Arnd Bergmann
2016-03-24 17:30 ` Stefan Roese
2016-03-24 16:48 ` Arnd Bergmann
2016-03-24 17:51 ` Stefan Roese
2016-03-24 20:07 ` Arnd Bergmann [this message]
2016-03-25 10:32 ` Mark Brown
2016-03-25 15:11 ` Arnd Bergmann
2016-03-25 15:50 ` Mark Brown
2016-03-25 20:58 ` Arnd Bergmann
2016-03-25 22:39 ` Mark Brown
2016-03-29 12:39 ` Arnd Bergmann
2016-03-29 16:47 ` Mark Brown
2016-03-29 19:49 ` Arnd Bergmann
2016-03-29 19:52 ` Mark Brown
2016-03-29 20:04 ` Arnd Bergmann
2016-03-29 21:00 ` Mark Brown
2016-03-29 21:08 ` Arnd Bergmann
2016-03-29 21:28 ` Mark Brown
2016-03-29 22:04 ` Arnd Bergmann
2016-04-05 7:11 ` Stefan Roese
2016-04-05 13:15 ` Andrew Lunn
2016-04-05 13:20 ` Stefan Roese
2016-04-05 13:31 ` Andrew Lunn
2016-03-23 13:27 ` Mark Brown
2016-03-23 17:25 ` Stefan Roese
2016-03-23 18:29 ` Mark Brown
2016-03-23 18:39 ` Andrew Lunn
2016-03-24 5:45 ` Stefan Roese
2016-03-24 11:23 ` Mark Brown
2016-03-24 12:05 ` Stefan Roese
2016-03-22 17:39 ` Mark Brown
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=12540712.SXPhdxqg9f@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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