From: Marek Vasut Date: Wed, 26 Sep 2018 17:03:16 +0200 Subject: [U-Boot] [PATCH V2 1/2] pci: Support parsing PCI controller DT subnodes In-Reply-To: References: <20180824182718.10879-1-marek.vasut+renesas@gmail.com> <7b3336c0-f81f-1eb8-a3bc-c3336ab33dd5@gmail.com> <6b824114-8ae6-ca47-209c-56409ad5841c@gmail.com> <24318092-9156-9c0e-640e-11adc8eceb1f@gmail.com> Message-ID: <7b845181-c5e2-34bd-39b9-96b69468328e@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/26/2018 07:42 AM, Simon Glass wrote: > Hi Marek, > > On 20 September 2018 at 17:56, Marek Vasut 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 :-) No, that's a hack. > 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 > -- Best regards, Marek Vasut