From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Wed, 22 Aug 2018 12:08:46 -0600 Subject: [U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes In-Reply-To: References: <20180810120135.GH29229@bill-the-cat> <972158e3-e0bd-4798-699f-06a97d7100d1@gmail.com> <98561a43-18bf-3c76-d3c6-3320cdafdf4b@gmail.com> <7a1aa6ed-7ddd-551a-f445-171465dbbe46@gmail.com> <92b4b0cc-b3fb-45c8-20f9-a232c2891edf@gmail.com> <20180815112540.GG30947@bill-the-cat> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On 20 August 2018 at 14:15, Marek Vasut 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