linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: pci-mvebu driver on km_kirkwood
Date: Tue, 5 Nov 2013 09:13:45 +0100	[thread overview]
Message-ID: <20131105081344.GA1088@ulmo.nvidia.com> (raw)
In-Reply-To: <5277B417.2030506@keymile.com>

On Mon, Nov 04, 2013 at 03:49:59PM +0100, Gerlando Falauto wrote:
> Hi folks,
> 
> thank you for your patience...
> 
> So, thanks to Thierry's example:
> 
> > https://gitorious.org/thierryreding/linux/commit/b85c03d73288f6e376fc158ceac30f29680b4192
> 
> and Jason's explanation:
> 
> > The reg must encode the bus number according to the OF format:
> >
> >                 33222222 22221111 11111100 00000000
> >                 10987654 32109876 54321098 76543210
> >   phys.hi cell: npt000ss bbbbbbbb dddddfff rrrrrrrr
> > phys.mid cell: hhhhhhhh hhhhhhhh hhhhhhhh hhhhhhhh
> >   phys.lo cell: llllllll llllllll llllllll llllllll
> >
> > bbbbbbbb is the 8-bit Bus Number
> > ddddd is the 5-bit Device Number
> > fff is the 3-bit Function Number
> >
> > Others are 0.
> 
> I'm finally starting to make some sense out of this, and I checked
> that Jason's statement is indeed true, at least on 3.10:
> 
> > Device tree can include the discovered PCI devices, you have to use
> > the special reg encoding and all that weirdness, but it does work. The
> > of_node will be attached to the struct pci device automatically.
> 
> [Hi latency was also due to other activities, not just the low
> throughput of my brain cells] ;-)
> 
> I have one last question for Thierry though: what's the point of
> things such as
> 
> +					pci at 0,0 {
> +						compatible = "opencores,spi";
> 
> (apart from clarity, of course)?
> I mean, wouldn't the driver be bound to the device through its PCI
> vendor ID / device ID?
> Are we also supposed to register a platform driver based on a
> compatible string instead?

I think that compatible property is completely bogus. Or at least the
value is. The primary reason why I included them was for descriptive
purposes.

According to section 2.5 of the PCI Bus Binding to Open Firmware[0] this
should be something like:

	compatible = "pciVVVV,DDDD";

where VVVV is the vendor ID and DDDD is the device ID, both in
hexadecimal. Section 2.5 lists a few more, but I'm not sure exactly
which would really be required.

I'm not even sure that they really are required at all. The drivers will
certainly be able to bind to them via the standard vendor and device ID
matching as you say. And no, no platform driver required.

Thierry

[0]: http://www.openfirmware.org/1275/bindings/pci/pci2_1.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131105/3402da29/attachment.sig>

      reply	other threads:[~2013-11-05  8:13 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 16:15 pci-mvebu driver on km_kirkwood Gerlando Falauto
2013-07-10 16:57 ` Thomas Petazzoni
2013-07-10 17:31   ` Gerlando Falauto
2013-07-10 19:56     ` Gerlando Falauto
2013-07-11  7:03     ` Valentin Longchamp
2013-07-12  8:59       ` Thomas Petazzoni
2013-07-15 15:46         ` Valentin Longchamp
2013-07-15 19:51           ` Thomas Petazzoni
2013-07-11 14:32     ` Thomas Petazzoni
2014-02-18 17:29       ` Gerlando Falauto
2014-02-18 20:27         ` Thomas Petazzoni
2014-02-19  8:38           ` Gerlando Falauto
2014-02-19  9:26             ` Thomas Petazzoni
2014-02-19  9:39               ` Gerlando Falauto
2014-02-19 13:37                 ` Thomas Petazzoni
2014-02-19 21:45                   ` Bjorn Helgaas
2014-02-20  8:55                     ` Thomas Petazzoni
2014-02-20 17:35                       ` Jason Gunthorpe
2014-02-20 20:29                         ` Thomas Petazzoni
2014-02-21  0:32                           ` Jason Gunthorpe
2014-02-21  8:34                             ` Thomas Petazzoni
2014-02-21  8:58                               ` Gerlando Falauto
2014-02-21  9:12                                 ` Thomas Petazzoni
2014-02-21  9:16                                   ` Gerlando Falauto
2014-02-21  9:39                                     ` Thomas Petazzoni
2014-02-21 12:24                                       ` Gerlando Falauto
2014-02-21 13:47                                         ` Thomas Petazzoni
2014-02-21 15:05                                           ` Arnd Bergmann
2014-02-21 15:11                                             ` Thomas Petazzoni
2014-02-21 15:20                                               ` Arnd Bergmann
2014-02-21 15:37                                                 ` Thomas Petazzoni
2014-02-21 16:39                                           ` Jason Gunthorpe
2014-02-21 17:05                                             ` Thomas Petazzoni
2014-02-21 17:31                                               ` Jason Gunthorpe
2014-02-21 18:05                                                 ` Arnd Bergmann
2014-02-21 18:29                                                   ` Gerlando Falauto
2014-02-21 18:18                                           ` Gerlando Falauto
2014-02-21 18:45                                             ` Thomas Petazzoni
2014-02-20 19:18                       ` Bjorn Helgaas
2014-02-21  0:24                         ` Jason Gunthorpe
2014-02-21 19:05                           ` Bjorn Helgaas
2014-02-21 19:21                             ` Thomas Petazzoni
2014-02-21 19:53                             ` Benjamin Herrenschmidt
2014-02-23  3:43                               ` Gavin Shan
2013-07-31  8:03 ` Thomas Petazzoni
2013-07-31  8:26   ` Gerlando Falauto
2013-07-31  9:00     ` Thomas Petazzoni
2013-07-31 20:50       ` Jason Gunthorpe
2013-08-09 14:01         ` Thierry Reding
2013-08-26  9:27           ` Gerlando Falauto
2013-08-26 12:02             ` Thierry Reding
2013-08-26 14:49               ` Gerlando Falauto
2013-08-26 19:16                 ` Jason Gunthorpe
2013-11-04 14:49                   ` Gerlando Falauto
2013-11-05  8:13                     ` Thierry Reding [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=20131105081344.GA1088@ulmo.nvidia.com \
    --to=thierry.reding@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).