[U-Boot] [PATCH V2 1/2] pci: Support parsing PCI controller DT subnodes

Simon Glass sjg at chromium.org
Wed Sep 26 05:42:02 UTC 2018


Hi Marek,

On 20 September 2018 at 17:56, Marek Vasut <marek.vasut at gmail.com> wrote:
> On 09/20/2018 03:47 AM, Bin Meng wrote:
> [...]
>
>>>>>>>> I suspect the best answer is to move the emulator so it is a direct
>>>>>>>> child of the bus. You would need to update sandbox_pci_get_emul() to
>>>>>>>> call device_find_first_child() on 'bus' instead of 'dev'.
>>>>>>>
>>>>>>> Sounds to me _way_ out of scope for this patchset.
>>>>>>
>>>>>> Dynamic binding is already supported on Sandbox. I guess Simon may
>>>>>> have missed the part.
>>>>>
>>>>> Well, where is an example of that ? Because I am not seeing one.
>>>>>
>>>>
>>>> I already pointed out in the previous email. In
>>>> arch/sandbox/dts/test.dts, the 2nd PCI controller has two swap_case
>>>> devices and the 3rd controller has one.
>>>
>>> By "second" you mean pci1: or pci2: ? Because pci1: is second , after
>>> pci0 . It'd really help if you were clearer in what you refer to.
>>>
>>
>> It's pci1. You can see there is no subnode under pci1 there yet if you
>> type 'pci 1' from the U-Boot shell you see two PCI devices.
>
> I'd really appreciate it if you could be more precise when referring to
> things.
>
>>>> In swap_case.c, U_BOOT_PCI_DEVICE() is there which is also a clear
>>>> sign that the driver supports dynamic binding. Of course, the driver
>>>> supports "compatible" too as you noticed.
>>>
>>> Are you talking about sandbox,dev-info DT property here ?
>>
>> This is the property Sandbox uses to make the dynamic binding work.
>> You can bypass this.
>
> Why would I want to bypass this ?
>
>> The key here is that swap_case driver supports
>> both "compatible" and dynamic binding, so you can write test cases to
>> cover this newly added ofnode scenario.
>
> That's great, and after spending even more time on this (probably days
> by now), I just keep finding more and more limitations of the virtual
> PCI subsystem which makes writing this testcase really hard. And none of
> that really helps fixing the real problem on my real hardware, which
> really stays broken.

You could fix that with a 5-minute patch to add a compatible string :-)

The problem is that you want to do it a certain way. Yes the test
system has limitations but it is better than what we had before (no
tests). We should expand its capability as we add new functionality.

Regards,
Simon


More information about the U-Boot mailing list