From: Arnd Bergmann <arnd@arndb.de>
To: Kenneth Heitke <kheitke@codeaurora.org>
Cc: sdharia@codeaurora.org, David Brown <davidb@codeaurora.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
bryanh@codeaurora.org, linux-arm-msm@vger.kernel.org,
rdunlap@xenotime.net, rmk+kernel@arm.linux.org.uk,
john.stultz@linaro.org, akpm@linux-foundation.org,
ohad@wizery.com, gregkh@suse.de, stefanr@s5r6.in-berlin.de,
lethal@linux-sh.org, linville@tuxdriver.com, zajec5@gmail.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] slimbus: Linux driver framework for SLIMbus.
Date: Wed, 17 Aug 2011 09:09:44 +0200 [thread overview]
Message-ID: <1772239.ndMLD9ec3r@wuerfel> (raw)
In-Reply-To: <4E4AFCC9.7020109@codeaurora.org>
On Tuesday 16 August 2011 17:27:05 Kenneth Heitke wrote:
> On 08/16/2011 01:49 PM, Arnd Bergmann wrote:
> > Or does the 48-bit number actually tell us something about what
> > device we're talking to, e.g. 24 bit vendor plus 24 bit device
> > type and revision or such. If that's the case, the number needs
> > to be the primary key that gets used to identify the driver,
> > just like we do it in case of USB or PCI devices.
>
> The 8-bit address is a logical address that is assigned by the SLIMbus
> framework. The framework maintains the mapping of logical addresses to
> the 48-bit Enumeration Address (EA). The 8-bit logical address is then
> used for any further SLIMbus device addressing.
>
> The slim_get_logical_addr() API call is used by the client drivers to
> get the logical address that has been assigned to the device.
>
> For the proposed implementation, the client drivers are probed before
> their devices are discovered because the client driver may need to
> power-up the device or pull it out of reset. Once the device is powered
> up, the call to get_logical_address() will let the client know whether
> or not their device has enumerated.
Hmm, I looked at http://www.national.com/assets/en/other/intro_to_SLIMbus.pdf
which contains:
| SLIMbusTM uses a 48-bit Enumeration Addresses (EA) to
| uniquely identify Devices which can announce
| their presence on the bus. Each Device has an EA,
| which incorporates Manufacturer ID, Product Code,
| Device Index, and Instance Value for a Device. The
| Manufacturer ID code is supplied by the MIPI
| Alliance and uniquely identifies the manufacturer
| of the Device, similar to the manufacturer IDs used with
| PCI bus components. The Device Index code uniquely
| identifies multiple Devices within a single
| Component. The Instance Value code is for the case
| where multiple Devices of the same type or Class
| are attached to the bus.
Based on this, I would strongly suggest a different model to the
one that you are suggesting:
* Make each device driver assume that the device is powered on when
talking to it.
* Make the EA (minus the index/instance ID) the primary identifier for a
device driver, not an arbitrary string.
* Move the logic for enabling and disabling devices into a host specific
driver that takes care of powering the devices up initially, identifying
them and putting them into run-time PM disabled state when no driver was
found or the device is unused.
This will make it possible to reuse the same driver for multiple machines
that have the same endpoint devices, while moving all the board specific
clock and reset logic into a separate driver, which can be very small in
many cases.
I would guess that in many cases, the logic for enabling the devices
fits into the slimbus host driver. If that is not the case, e.g. when
a lot of machines have the same host controller but each of them uses
a different way to get the devices out of reset, you can turn the host
driver into a library that contains the actual code accessing the host
controller registers, but provide a per-machine platform_driver that
known how to enable the individual devices and uses the library code
from the main host driver to talk to the devices.
Arnd
next prev parent reply other threads:[~2011-08-17 7:11 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 23:31 [RFC PATCH] slimbus: Linux driver framework for SLIMbus Kenneth Heitke
2011-08-11 12:55 ` Arnd Bergmann
2011-08-11 20:51 ` Kenneth Heitke
2011-08-12 16:46 ` Mark Brown
2011-08-16 13:37 ` Arnd Bergmann
2011-08-16 13:50 ` David Brown
2011-08-16 14:32 ` Arnd Bergmann
2011-08-16 15:40 ` Mark Brown
2011-08-16 17:13 ` Kenneth Heitke
2011-08-16 17:16 ` Kenneth Heitke
2011-08-16 17:44 ` sdharia
2011-08-16 19:49 ` Arnd Bergmann
2011-08-16 23:27 ` Kenneth Heitke
2011-08-17 0:59 ` Mark Brown
2011-08-17 1:54 ` Sagar Dharia
2011-08-17 6:32 ` Mark Brown
2011-08-17 7:09 ` Arnd Bergmann [this message]
2011-08-17 8:03 ` Mark Brown
2011-08-17 10:42 ` Arnd Bergmann
2011-08-17 13:04 ` Mark Brown
2011-08-17 13:17 ` Linus Walleij
2011-08-18 3:00 ` Mark Brown
2011-08-24 9:15 ` Linus Walleij
2011-08-24 9:21 ` Mark Brown
2011-08-25 7:10 ` Linus Walleij
2011-08-25 9:44 ` Mark Brown
2011-08-17 14:00 ` Arnd Bergmann
2011-08-19 3:24 ` Mark Brown
2011-08-21 22:10 ` Sagar Dharia
2011-08-22 13:47 ` Arnd Bergmann
2011-08-16 15:23 ` Mark Brown
2011-08-14 14:34 ` Mark Brown
2011-08-15 17:55 ` Kenneth Heitke
2011-08-15 19:37 ` Russell King
2011-08-15 20:12 ` Kenneth Heitke
2011-08-16 19:33 ` Jean Delvare
2011-08-17 13:12 ` Mark Brown
2011-08-23 23:24 ` Randy Dunlap
2011-08-23 23:32 ` Kenneth Heitke
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=1772239.ndMLD9ec3r@wuerfel \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=gregkh@suse.de \
--cc=john.stultz@linaro.org \
--cc=kheitke@codeaurora.org \
--cc=lethal@linux-sh.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=ohad@wizery.com \
--cc=rdunlap@xenotime.net \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=sdharia@codeaurora.org \
--cc=stefanr@s5r6.in-berlin.de \
--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