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

Simon Glass
2018-09-02T23:35:13Z

Hi Marek,

On 2 September 2018 at 12:24, Marek Vasut <marek.vasut@gmail.com> wrote:
> On 09/02/2018 03:07 AM, Simon Glass wrote:
>> Hi Marek,
>>
>> On 1 September 2018 at 16:43, Marek Vasut <marek.vasut@gmail.com> wrote:
>>> On 09/01/2018 11:45 PM, Simon Glass wrote:
>>>> Hi Marek,
>>>>
>>>> On 30 August 2018 at 03:25, Marek Vasut <marek.vasut@gmail.com> 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