From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 20 Aug 2018 22:15:33 +0200 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 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). [...] -- Best regards, Marek Vasut