mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Simon Glass <sjg@chromium.org>
Cc: Matthias Brugger <mbrugger@suse.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Bin Meng <bmeng.cn@gmail.com>, Marek Vasut <marex@denx.de>,
	lk <linux-kernel@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [PATCH v4 4/5] dm: pci: Assign controller device node to root bridge
Date: Wed, 17 Jun 2020 21:15:16 +0200	[thread overview]
Message-ID: <954083bf13bd7c24c31c9673269ea0eedb925f43.camel@suse.de> (raw)
In-Reply-To: <CAPnjgZ3PwTWBQ2Vi4=Sc7JB699TrSxr=PAJupL_3POhJ00qSsA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2699 bytes --]

On Tue, 2020-06-16 at 17:31 -0600, Simon Glass wrote:
> Hi Nicolas,
>
> On Tue, 16 Jun 2020 at 08:09, Nicolas Saenz Julienne
> <nsaenzjulienne@suse.de> wrote:
> > On Tue, 2020-06-16 at 07:43 -0600, Simon Glass wrote:
> > > Hi Nicolas,
> > >
> > > On Fri, 12 Jun 2020 at 10:47, Nicolas Saenz Julienne
> > > <nsaenzjulienne@suse.de> wrote:
> > > > There is no distinction in DT between the PCI controller device and the
> > > > root bridge, whereas such distinction exists from dm's perspective. Make
> > > > sure the root bridge ofnode is assigned to the controller's platform
> > > > device node.
> > > >
> > > > This permits setups like this to work correctly:
> > > >
> > > >         pcie {
> > > >                 compatible = "...";
> > > >                 ...
> > > >                 dev {
> > > >                         reg = <0 0 0 0 0>;
> > > >                         ...
> > > >                 };
> > > >         };
> > > >
> > > > Without this the dev node is assigned to the root bridge and the
> > > > actual device search starts one level lower than expected.
> > > >
> > > > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > > > ---
> > > >  drivers/pci/pci-uclass.c | 15 ++++++++++++++-
> > > >  1 file changed, 14 insertions(+), 1 deletion(-)
> > >
> > > Can you update the tests to handle this case please?
> >
> > I'd be glad to, but I'm not familiar with the test FW in u-booy, coud give
> > me
> > some pointers on where/how to test this?
> >
>
> Yes it is at test/dm/pci.c and the device tree is test.dts
>
> 'make qcheck' to run all tests. To run one test, build for sandbox and
> then something like
>
> u-boot -T -c "ut dm pci_swapcase"
>
> for example.
>
> You can perhaps use an existing PCI controller in test.dts but feel
> free to add one more if you need it for your test. Make sure that you
> don't break other tests.

Thanks for the info.

Actually adding the tests made me doubleguess myself, and now I'm pretty sure
that what I shoudl've done in DT is the following:

	&pcie0 {
	       pci@0 {
		       #address-cells = <3>;
		       #size-cells = <2>;
		       ranges;

		       reg = <0 0 0 0 0>;

		       usb@1,0 {
			       reg = <0x10000 0 0 0 0>;
			       resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
		       };
	       };
	};


(with "lspci -tv": [0000:00]---00.0-[01]----00.0  VIA Technologies, Inc. VL805 USB 3.0 Host Controller)

With this the patch above isn't needed, which is great.

I'll send this to upstream Linux just to get a confirmation this is correct,
although if you have any comments it'll be appreciated.

Regards,
Nicolas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-06-17 19:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 16:46 [PATCH v4 0/5] usb: xhci: Load Raspberry Pi 4 VL805's firmware Nicolas Saenz Julienne
2020-06-12 16:46 ` [PATCH v4 1/5] arm: rpi: Add function to trigger VL805's firmware load Nicolas Saenz Julienne
2020-06-12 16:46 ` [PATCH v4 2/5] reset: Add Raspberry Pi 4 firmware reset controller Nicolas Saenz Julienne
2020-06-12 16:46 ` [PATCH v4 3/5] configs: Enable support for reset controllers on RPi4 Nicolas Saenz Julienne
2020-06-12 16:46 ` [PATCH v4 4/5] dm: pci: Assign controller device node to root bridge Nicolas Saenz Julienne
2020-06-16 13:43   ` Simon Glass
2020-06-16 14:09     ` Nicolas Saenz Julienne
2020-06-16 23:31       ` Simon Glass
2020-06-17 19:15         ` Nicolas Saenz Julienne [this message]
2020-06-26  1:12           ` Simon Glass
2020-06-12 16:46 ` [PATCH v4 5/5] usb: xhci-pci: Add reset controller support Nicolas Saenz Julienne
2020-06-12 17:08   ` Marek Vasut
2020-06-15  8:56     ` Nicolas Saenz Julienne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=954083bf13bd7c24c31c9673269ea0eedb925f43.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=bmeng.cn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marex@denx.de \
    --cc=mark.kettenis@xs4all.nl \
    --cc=mbrugger@suse.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®