[U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes

Simon Glass
2018-08-22T18:08:46Z

Hi Marek,

On 20 August 2018 at 14:15, Marek Vasut <marek.vasut@gmail.com> wrote:
>
> On 08/20/2018 09:29 PM, Simon Glass wrote:
> [...]
>
> >>>>> So what is the conclusion here ? Patch the design document and apply
> >>>>> this patch as is ?
> >>>>>
> >>>>
> >>>> I think we should see Simon's comments before we move forward. The
> >>>> proposal I made before should come in a series, not just
> >>>> documentation.
> >>>
> >>> This thread is too long :-)
> >>>
> >>> From what I understand, Marek and Bin are discussing whether a
> >>> compatible string is needed to bind a driver.
> >>>
> >>> Generally it is. But with PCI and USB we have a search mechanism which
> >>> can be used instead.
> >>>
> >>> The patch Marek submitted does not seems at all desirable to me.
> >>
> >> Can you explain why ?
> >
> > We already have a compatible string as the standard way to attach
> > drivers to devices.
> >
> > For PCI, we already have PCI_DEVICE() and friends for when we can
> > attach a driver for a PCI device without using a compatible string.
> >
> > Both of these are defined in the DT specification.
> >
> > The patch seems to be a rework of PCI_DEVICE() and I cannot why it is necessary.
>
> This is explained in the patch description and the thread again. Please
> read the thread before replying. Take a look at the r8a7794.dtsi and its
> PCI bindings, there are PCI controller subnodes which add extra
> information for PCI devices on the bus. These nodes do not have a
> compatible string, only a BFD.
>
> This is perfectly valid, since you can match a driver on the PCI IDs or
> classes (PCI_DEVICE()), but the driver doesn't have a DT node associated
> with it. If there is a DT node with a matching BFD, it is associated
> with the driver instance by this patch.
>
> This allows ie. the EHCI PCI driver to access that DT node and extract
> information about PHYs from the DT (in case of the r8a7794).

But the code to do this already exists in pci_bind_bus_devices().

I know I am late to this thread but no one is going to read 45 messages, sorry.

Why is pci_bus_find_devfn() failing?

Regards,
Simon