All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v3 13/28] pci: Update to use new sequence numbers
Date: Wed, 14 Apr 2021 20:37:02 +0100	[thread overview]
Message-ID: <CAPnjgZ1bxwZO2_n2gdBN6E-EH7Jh+n82GN61rWoqK+ii=G62qw@mail.gmail.com> (raw)
In-Reply-To: <CAJ+vNU02vRjM=r68p+ABEo6m3iLf4DHjCydjpLAjeDsLrTQNMw@mail.gmail.com>

Hi Tim,

On Wed, 14 Apr 2021 at 06:32, Tim Harvey <tharvey@gateworks.com> wrote:
>
> On Sat, Dec 19, 2020 at 8:43 AM Simon Glass <sjg@chromium.org> wrote:
> >
> > Now that we know the sequence number at bind time, there is no need for
> > special-case code in dm_pci_hose_probe_bus().
> >
> > Note: the PCI_CAP_ID_EA code may need a look, but there are no test
> > failures so I have left it as is.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> > Changes in v3:
> > - Update PCI to use manual sequence numbering
> >
> > Changes in v2:
> > - Use the sequence number directly instead of max bus
> >
> >  drivers/pci/pci-uclass.c | 45 ++++++++++++++++++++++++----------------
> >  drivers/pci/pci_auto.c   | 10 ++++-----
> >  2 files changed, 32 insertions(+), 23 deletions(-)
> >
> > Applied to u-boot-dm/next, thanks!
>
> Hi Simon,
>
> I have a (not yet submitted) pending patch to migrate the gwventana
> board to DM_PCI / DM_ETH that this particular patch broke and I'm
> trying to understand why.
>
> The Gateworks Ventana boards have a PCIe switch where the downstream
> PERST#'s are GPIO's off the switch and a e1000 PCIe GBe device is on
> one of those downstream ports. For non-dm PCI I have a
> 'board_pci_fixup_dev' function that allows board support to configure
> the switch's GPIO and toggle downstream PERST# during enumeration.
> When I add this function to dm_pci I end up getting a data abort when
> the e1000 driver tries to initialize (after PCI enumeration).

Firstly, I think I did the PCI conversion about 6 years ago so it is
not fresh in my memory.

>
> Any idea what is causing this and what I need to do to work around it?
> Nothing in my patch deals with device sequence numbers.

An abort presumably indicates that the memory is not there, so perhaps
the e1000 is still in reset, or has been set up to appear at a
different address?

You should be abe to use 'pci hdr 0.4.0' or whatever to look at the
BARs and make sure they are value with 'md', etc.

> Additionally I feel like the best way to add support for the custom
> downstream PCI switch reset requirements is to add a UCLASS_PCI driver
> for the switch in my board support but when I attempted that solution
> I run into an issue where pci read/write's cause a prefetch abort
> because I need to use imx_pcie_dm_{read,write}_config instead of the
> default ops. I'm not quite sure how to get hold of the ops for the imx

If you write a PCI driver then you can provide the access operations
yourself....see drivers/pci for some examples. I suggest you add
subnodes to the devicetree and specify the compatible string of your
PCI switch so it picks up the right driver.

> controller to set this up properly. Furthermore if I do end up with
> that solution I later need to be able to walk the PCI bus to perform
> various dt fixups on pci device nodes - do you have an example of how
> I could walk the bus using DM_PCI?

Do you mean a breadth-first search? It is something like:

struct udevice *dev;

static void do_something(struct udevice *parent)
{
   device_foreach_child_probe(dev, parent) {
       do_something((dev);
   }

...

struct udevice *bus;
int  ret;

ret = uclass_first_device_err(UCLASS_PCI, &bus);
if (ret)
   return log_msg_ret("pci", ret);
do_something(bus);

>
> Best regards,
>
> Tim

Regards,
Simon

  reply	other threads:[~2021-04-14 19:37 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  4:20 [PATCH v3 00/28] dm: Change the way sequence numbers are implemented Simon Glass
2020-12-17  4:20 ` [PATCH v3 01/28] linker_lists: Fix alignment issue Simon Glass
2021-04-15  7:39   ` Heinrich Schuchardt
2021-04-21  7:14     ` Simon Glass
2020-12-17  4:20 ` [PATCH v3 02/28] dm: Avoid accessing seq directly Simon Glass
2020-12-17  4:20 ` [PATCH v3 03/28] dm: core: Update uclass_find_next_free_req_seq() args Simon Glass
2020-12-17  4:20 ` [PATCH v3 04/28] dm: core: Add a new sequence number for devices Simon Glass
2020-12-17  4:20 ` [PATCH v3 05/28] dm: test: Check all devices have a sequence numbers Simon Glass
2020-12-17  4:20 ` [PATCH v3 06/28] dm: core: Switch binding to use new " Simon Glass
2020-12-17  4:20 ` [PATCH v3 07/28] dm: Fix return value in dev_read_alias_seq() Simon Glass
2020-12-17  4:20 ` [PATCH v3 08/28] dm: test: Drop assumptions of no sequence numbers Simon Glass
2020-12-17  4:20 ` [PATCH v3 09/28] octeon: Don't attempt to set the sequence number Simon Glass
2020-12-17  4:20 ` [PATCH v3 10/28] i2c: Update for new sequence numbers Simon Glass
2020-12-17  4:20 ` [PATCH v3 11/28] net: Update to use " Simon Glass
2020-12-17  4:20 ` [PATCH v3 12/28] dm: core: Allow manual sequence numbering Simon Glass
2020-12-17  4:20 ` [PATCH v3 13/28] pci: Update to use new sequence numbers Simon Glass
2020-12-17  4:20 ` [PATCH v3 14/28] spi: Update for " Simon Glass
2020-12-17  4:20 ` [PATCH v3 15/28] usb: ehci-mx6: Drop assignment of sequence number Simon Glass
2020-12-17  4:20 ` [PATCH v3 16/28] usb: Update for new sequence numbers Simon Glass
2020-12-17  4:20 ` [PATCH v3 17/28] x86: Drop unnecessary mp_init logic Simon Glass
2020-12-17  4:20 ` [PATCH v3 18/28] x86: Simplify acpi_device_infer_name() Simon Glass
2020-12-17  4:20 ` [PATCH v3 19/28] gpio: Update for new sequence numbers Simon Glass
2020-12-17  4:20 ` [PATCH v3 20/28] pinctrl: " Simon Glass
2020-12-17  4:20 ` [PATCH v3 21/28] dm: Switch over to use new sequence number for dev_seq() Simon Glass
2020-12-17  4:20 ` [PATCH v3 22/28] dm: test: Add a test for DM_UC_FLAG_NO_AUTO_SEQ Simon Glass
2020-12-17  4:20 ` [PATCH v3 23/28] dm: Drop uclass_resolve_seq() Simon Glass
2020-12-17  4:20 ` [PATCH v3 24/28] dm: Drop the unused arg in uclass_find_device_by_seq() Simon Glass
2020-12-17  4:20 ` [PATCH v3 25/28] dm: core: Update uclass_find_next_free_req_seq() for new scheme Simon Glass
2020-12-17  4:20 ` [PATCH v3 26/28] cmd: Drop use of old sequence numbers in commands Simon Glass
2020-12-17  4:20 ` [PATCH v3 27/28] dm: core: Drop seq and req_seq Simon Glass
2020-12-17  4:20 ` [PATCH v3 28/28] dm: Update documentation for new sequence numbers Simon Glass
2020-12-18 11:09 ` [PATCH v3 00/28] dm: Change the way sequence numbers are implemented Michael Walle
2020-12-19 16:40 ` [PATCH v3 28/28] dm: Update documentation for new sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 27/28] dm: core: Drop seq and req_seq Simon Glass
2020-12-19 16:40 ` [PATCH v3 25/28] dm: core: Update uclass_find_next_free_req_seq() for new scheme Simon Glass
2020-12-19 16:40 ` [PATCH v3 26/28] cmd: Drop use of old sequence numbers in commands Simon Glass
2020-12-19 16:40 ` [PATCH v3 24/28] dm: Drop the unused arg in uclass_find_device_by_seq() Simon Glass
2020-12-19 16:40 ` [PATCH v3 23/28] dm: Drop uclass_resolve_seq() Simon Glass
2020-12-19 16:40 ` [PATCH v3 22/28] dm: test: Add a test for DM_UC_FLAG_NO_AUTO_SEQ Simon Glass
2020-12-19 16:40 ` [PATCH v3 21/28] dm: Switch over to use new sequence number for dev_seq() Simon Glass
2020-12-19 16:40 ` [PATCH v3 20/28] pinctrl: Update for new sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 19/28] gpio: " Simon Glass
2020-12-19 16:40 ` [PATCH v3 18/28] x86: Simplify acpi_device_infer_name() Simon Glass
2020-12-19 16:40 ` [PATCH v3 17/28] x86: Drop unnecessary mp_init logic Simon Glass
2020-12-19 16:40 ` [PATCH v3 16/28] usb: Update for new sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 15/28] usb: ehci-mx6: Drop assignment of sequence number Simon Glass
2021-03-31 19:14   ` Marek Vasut
2021-03-31 19:27     ` Tom Rini
2021-03-31 22:20       ` Simon Glass
2020-12-19 16:40 ` [PATCH v3 14/28] spi: Update for new sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 13/28] pci: Update to use " Simon Glass
2021-04-13 18:32   ` Tim Harvey
2021-04-14 19:37     ` Simon Glass [this message]
2021-04-15  0:28       ` Tim Harvey
2021-04-15  0:44         ` Simon Glass
2020-12-19 16:40 ` [PATCH v3 12/28] dm: core: Allow manual sequence numbering Simon Glass
2020-12-19 16:40 ` [PATCH v3 11/28] net: Update to use new sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 10/28] i2c: Update for " Simon Glass
2020-12-19 16:40 ` [PATCH v3 09/28] octeon: Don't attempt to set the sequence number Simon Glass
2020-12-19 16:40 ` [PATCH v3 08/28] dm: test: Drop assumptions of no sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 07/28] dm: Fix return value in dev_read_alias_seq() Simon Glass
2020-12-19 16:40 ` [PATCH v3 06/28] dm: core: Switch binding to use new sequence numbers Simon Glass
2020-12-19 16:40 ` [PATCH v3 05/28] dm: test: Check all devices have a " Simon Glass
2020-12-19 16:40 ` [PATCH v3 04/28] dm: core: Add a new sequence number for devices Simon Glass
2020-12-19 16:40 ` [PATCH v3 03/28] dm: core: Update uclass_find_next_free_req_seq() args Simon Glass
2020-12-19 16:40 ` [PATCH v3 02/28] dm: Avoid accessing seq directly Simon Glass
2020-12-19 16:40 ` [PATCH v3 01/28] linker_lists: Fix alignment issue Simon Glass

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='CAPnjgZ1bxwZO2_n2gdBN6E-EH7Jh+n82GN61rWoqK+ii=G62qw@mail.gmail.com' \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.