From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] mmc: add support for power-on sequencing through DT
Date: Sat, 15 Feb 2014 17:21:11 +0100 [thread overview]
Message-ID: <1528854.BAQRr94nzx@wuerfel> (raw)
In-Reply-To: <52FF6A16.5080201@gmail.com>
On Saturday 15 February 2014 14:22:30 Tomasz Figa wrote:
> On 15.02.2014 14:09, Arnd Bergmann wrote:
>
> > For spi-mode SDIO devices I'm assuming it's similar, except that
> > you'd describe the actual SDIO device in the board info rather than
> > create a fake SDIO controller. Still not discoverable unless I'm
> > missing your point.
>
> I'm not sure if we should assume that SPI = MMC over SPI. I believe
> there might be a custom protocol involved as well.
In case of SD/MMC, you essentially have three separate command sets:
SPI, MMC and SD, and each of them has multiple versions. MMC and SD
compatible devices generally also support the SPI command set (IIRC
it is required, but I'm not completely sure), and on the bus
the main difference seems to be that you have only 1-bit serial
signalling, while MMC also supports 4-bit and 8-bit parallel
transmission.
If a device supports both SDIO and SPI, I think a straightforward
implementation would be to use the exact same command set, but
you are right that this isn't the only possibility, and the SD/MMC
shows how they can be slightly different already.
> Stepping aside from SPI, I already gave an example of a WLAN chip that
> supports multiple control busses [1]. In addition to the commonly used
> SDIO, it supports USB and HSIC as well:
>
> [1] http://www.marvell.com/wireless/assets/marvell_avastar_88w8797.pdf
>
> Moreover, some of Samsung boards use HSIC to communicate with modem
> chips, which have exactly the same problem as we're trying to solve here
> - they need to be powered on to be discovered.
Thanks, this definitely makes a good example. I see that it also
supports SPI mode for SDIO as mentioned in your link.
> So I really don't think we should be limiting this to MMC alone by any
> means.
Agreed. Putting the same chip on USB or HSIC has the exact same
requirements, since we also have a discoverable bus, but actually
finding the device likely involves some power-on sequencing before
the bus controller can find it.
> Now I don't really know why we want that badly to represent low level
> control parts of such devices as children of control buses of their
> enumerable parts. Could you tell me what benefits it has to justify the
> added complexity of having to instantiate fake devices in respective
> devices, even though they can be fully detected later?
It's not that I "badly want" to do it one way or another, I'm just
trying to find arguments either way, since as Russell points out
whatever we decide to do in DT is what we're stuck with for the
long term future.
Let me try to summarize what we found so far:
* Common aspects:
* we need a way to attach properties for run-time configuration
to devices on discoverable buses when the configuration
is not discoverable. In your 88w8797 example, this includes
the use of the GPIO pins, runtime power management (clocks,
regulators) and the attached codecs.
* We may want to connect the same device to either a discoverable
or a nondiscoverable bus, ideally using the same binding and
sharing code whereever possible.
* Olof's proposal (add properties or a child node to the host
controller node with just power-on sequencing information):
+ We only need one implementation for each bus, possibly shared
across buses to some degree, and can handle lots of devices
without having to touch their individual drivers.
+ A logical extension of things we already do on SD cards
(CD/WP GPIOs, external clocks and voltages supplied to
standard compliant devices as part of the normal probing)
- The shared code may get rather complex to deal with all
possible corner cases we run into over the years.
- Somewhat harder to do if you have to attach the power
information to a device node for a USB hub port, rather
than an SDIO controller that only has one slave device.
* Arnd's proposal (change bus code to probe nonstandard devices
from DT if we can't easily detect them):
+ Matches what we already do for PCI (at least on powerpc)
and AMBA/Primecell devices: If a device can't be probed
using the standard method, we treat it as nondiscoverable
and describe it using DT.
+ Devices can have arbitrary complex requirements without
impacting the core, since all code is contained in the
driver for the nonstandard device.
+ Properties that are required for probing and runtime
configuration only have to be set once (e.g. you may
need clk_get() for probing and clk_set_rate() for
runtime-pm).
+ Devices that have alternative bus interfaces like 88w8797
can implement the power-on code in a central place per
driver, and can reuse the code they have for nondiscoverable
buses on the buses that are normally discoverable but
broken here.
- Still need to modify each subsystem to have alternate
ways of probing, and match up devices later.
- Has to be implemented in each driver that needs it, making
it harder to share code for drivers with the same need
(e.g. every device that just needs an external reset
trigger).
Arnd
next prev parent reply other threads:[~2014-02-15 16:21 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-20 3:56 [PATCH 0/3] RFC/RFT: Powering on MMC Wifi/BT modules in MMC core Olof Johansson
2014-01-20 3:56 ` [PATCH 1/3] mmc: add support for power-on sequencing through DT Olof Johansson
2014-01-20 8:44 ` Ulf Hansson
2014-01-20 19:13 ` Olof Johansson
2014-01-21 8:55 ` Ulf Hansson
2014-01-21 18:14 ` Olof Johansson
2014-01-22 11:30 ` Mark Brown
2014-01-20 16:36 ` Mark Brown
2014-01-20 16:48 ` Russell King - ARM Linux
2014-01-20 17:03 ` Fabio Estevam
2014-01-20 17:16 ` Russell King - ARM Linux
2014-01-20 18:47 ` Fabio Estevam
2014-01-21 19:19 ` Russell King - ARM Linux
2014-01-24 17:35 ` Fabio Estevam
2014-01-27 8:43 ` Jyri Sarha
2014-01-27 8:54 ` Chen-Yu Tsai
2014-01-27 9:48 ` Jyri Sarha
2014-01-20 18:58 ` Arnd Bergmann
2014-01-20 19:04 ` Olof Johansson
2014-01-20 19:12 ` Arnd Bergmann
2014-01-20 19:14 ` Fabio Estevam
2014-01-20 19:14 ` Olof Johansson
2014-01-21 7:24 ` Sascha Hauer
2014-01-21 7:25 ` Sascha Hauer
2014-01-21 18:34 ` Tomasz Figa
2014-01-21 21:30 ` Olof Johansson
2014-01-21 21:39 ` Tomasz Figa
2014-01-26 17:26 ` Tomasz Figa
2014-01-27 10:19 ` Ulf Hansson
2014-01-28 0:59 ` Tomasz Figa
2014-01-28 1:08 ` Chris Ball
2014-01-28 10:06 ` Ulf Hansson
2014-01-28 10:48 ` Arnd Bergmann
2014-02-12 18:33 ` Mark Brown
2014-02-13 8:56 ` Ulf Hansson
2014-02-13 9:01 ` Tomasz Figa
2014-02-13 10:42 ` Russell King - ARM Linux
2014-02-13 12:48 ` Arnd Bergmann
2014-02-13 14:41 ` Russell King - ARM Linux
2014-02-13 16:13 ` Arnd Bergmann
2014-02-13 17:31 ` Olof Johansson
2014-02-15 12:18 ` Arnd Bergmann
2014-02-15 12:27 ` Russell King - ARM Linux
2014-02-15 13:09 ` Arnd Bergmann
2014-02-15 13:22 ` Tomasz Figa
2014-02-15 16:21 ` Arnd Bergmann [this message]
2014-02-15 20:52 ` Russell King - ARM Linux
2014-02-15 21:35 ` Tomasz Figa
2014-02-15 22:03 ` Russell King - ARM Linux
2014-02-17 13:00 ` Arnd Bergmann
2014-02-17 23:25 ` Mark Brown
2014-01-20 3:56 ` [PATCH 2/3] mmc: dw_mmc: call mmc_of_parse to fill in common options Olof Johansson
2014-01-20 4:53 ` Jaehoon Chung
2014-01-20 3:56 ` [PATCH 3/3] ARM: dts: exynos5250-snow: Enable wifi power-on Olof Johansson
2014-01-30 21:49 ` [PATCH 0/3] RFC/RFT: Powering on MMC Wifi/BT modules in MMC core Russell King - ARM Linux
2014-02-01 16:14 ` Russell King - ARM Linux
2014-02-13 10:36 ` Russell King - ARM Linux
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=1528854.BAQRr94nzx@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