From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 2 Sep 2018 17:35:13 -0600 Subject: [U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes In-Reply-To: References: <20180815112540.GG30947@bill-the-cat> <911fd0e4-de0e-f1af-0314-0583f1c1d4e0@gmail.com> <510fa718-a5bb-bdec-b6bb-828acf10a13a@gmail.com> <0ba07f9b-c084-5d69-0acc-7246e65b0a03@gmail.com> <17551e87-1548-62d0-2378-27f51aaffc5a@gmail.com> 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 2 September 2018 at 12:24, Marek Vasut wrote: > On 09/02/2018 03:07 AM, Simon Glass wrote: >> Hi Marek, >> >> On 1 September 2018 at 16:43, Marek Vasut wrote: >>> On 09/01/2018 11:45 PM, Simon Glass wrote: >>>> Hi Marek, >>>> >>>> On 30 August 2018 at 03:25, Marek Vasut wrote: >>>>> >>>>> On 08/30/2018 02:29 AM, Simon Glass wrote: >>>>>> Hi Marek, >>>>> >>>>> Hi, >>>>> >>>>> [...] >>>>> >>>>>>>> If you have both EHCI and a xHCI controller which can occupy the same >>>>>>>> BFD, then how would you supply in the DT options needed by the >>>>>>>> controller itself? Don't you need two nodes in that case? >>>>>>> >>>>>>> For the PHY case, it's controller-type-independent. >>>>>> >>>>>> What do you mean? Your example of why you can't use compatible strings >>>>>> says you might have two different PHYs. But I think you should answer >>>>>> my questions: >>>>>> >>>>>>>> If you have both EHCI and a xHCI controller which can occupy the same >>>>>>>> BFD, then how would you supply in the DT options needed by the >>>>>>>> controller itself? Don't you need two nodes in that case? >>>>> >>>>> You need only one node (if the PHY works with both controller options), >>>>> which contains "reg" and "phy" properties. The driver matching is done >>>>> on the PCI ID/class and the node is associated with the driver based on >>>>> the "reg" property. >>>> >>>> I think you need two nodes if there are DT options that are different >>>> for each PHY. In fact I think this is impossible to do with the reg >>>> scheme. >>>> >>>> In effect the PHYs are different. They have different drivers, >>>> assuming drivers are needed. So I feel that using a common address to >>>> match two different devices is actually just weird. >>> >>> I think I lost you. But this discussion is really hypothetical. You >>> _can_ have a USB PHY which can attach to both USB 2 and USB 3 >>> controller, in which case you would have only one DT node to describe it. >> >> Can you point to an example of this? Otherwise it seems hypothetical. > > Nope, it's just electrically viable. OK, well I'm not sure that we can make any claims about any of this unless it is used somewhere. > >> As a counter-example, see exynos54xx.dtsi. > > What exactly am I looking for ? You can see a USB3 PHY which is attached to a USB3 host. > >> I believe the correct way to do this is to enable/disable DT nodes. Do >> you have any pointers to suggest that the same node should be used for >> two devices? > > Nope Then I believe that is incorrect, and it should be handled using two separate notes, with only one enabled at run-time. Regards, Simon