public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	Peter Batard <pete@akeo.ie>,
	 Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Andrei Warkentin <awarkentin@vmware.com>,
	 Sunny Wang <Sunny.Wang@arm.com>,
	Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Subject: Re: [PATCH v3 5/7] Silicon/Broadcom/Bcm27xx: Move linkup check into the cfg accessor
Date: Sun, 22 Aug 2021 15:47:58 +0200	[thread overview]
Message-ID: <CAMj1kXHkU3k-OaGap=OHjXyF1qaiYKf4YKgA8ne9SO3JH_WBAA@mail.gmail.com> (raw)
In-Reply-To: <CAMj1kXFPA_RmZfO4ppK6m3vOKu7V8wOx9B0tqnx1wvsqZUJyow@mail.gmail.com>

On Sun, 22 Aug 2021 at 15:37, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 20 Aug 2021 at 06:16, Jeremy Linton <jeremy.linton@arm.com> wrote:
> >
> > The existing code fails to create/finish configuring the
> > pcie subsystem if it fails to get a linkup. This is reasonable
> > on the RPi4 because it generally won't happen, and the OS
> > could not see the root port. Now that the OS can see the
> > root port, its a bit odd if it only shows up when
> > something is plugged into the first slot. Lets move the
> > link up check into the config accessor where it will be used
> > to restrict sending CFG TLP's out the port when nothing is
> > plugged in. Thus avoiding a SERROR during probe.
> >
> > Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
>
> How will this work when the PCIE/XHCI switch is in 'platform device' mode?
>

Never mind, that only affects the OS whereas this affects UEFI itself only.

> > ---
> >  .../Bcm2711PciHostBridgeLib/Bcm2711PciHostBridgeLibConstructor.c   | 5 -----
> >  .../Broadcom/Bcm27xx/Library/Bcm2711PciSegmentLib/PciSegmentLib.c  | 7 +++++++
> >  2 files changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciHostBridgeLib/Bcm2711PciHostBridgeLibConstructor.c b/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciHostBridgeLib/Bcm2711PciHostBridgeLibConstructor.c
> > index 8587d2d36d..4d4c584726 100644
> > --- a/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciHostBridgeLib/Bcm2711PciHostBridgeLibConstructor.c
> > +++ b/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciHostBridgeLib/Bcm2711PciHostBridgeLibConstructor.c
> > @@ -204,11 +204,6 @@ Bcm2711PciHostBridgeLibConstructor (
> >    } while (((Data & 0x30) != 0x030) && (Timeout));
> >    DEBUG ((DEBUG_VERBOSE, "PCIe link ready (status=%x) Timeout=%d\n", Data, Timeout));
> >
> > -  if ((Data & 0x30) != 0x30) {
> > -    DEBUG ((DEBUG_ERROR, "PCIe link not ready (status=%x)\n", Data));
> > -    return EFI_DEVICE_ERROR;
> > -  }
> > -
> >    if ((Data & 0x80) != 0x80) {
> >      DEBUG ((DEBUG_ERROR, "PCIe link not in RC mode (status=%x)\n", Data));
> >      return EFI_UNSUPPORTED;
> > diff --git a/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciSegmentLib/PciSegmentLib.c b/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciSegmentLib/PciSegmentLib.c
> > index 6d15e82fa2..b627e5730b 100644
> > --- a/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciSegmentLib/PciSegmentLib.c
> > +++ b/Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciSegmentLib/PciSegmentLib.c
> > @@ -105,6 +105,13 @@ PciSegmentLibGetConfigBase (
> >            return 0xFFFFFFFF;
> >        }
> >
> > +      /* Don't probe slots if the link is down */
> > +      Data = MmioRead32 (PCIE_REG_BASE + PCIE_MISC_PCIE_STATUS);
> > +      if ((Data & 0x30) != 0x30) {
> > +          DEBUG ((DEBUG_ERROR, "PCIe link not ready (status=%x)\n", Data));
> > +          return 0xFFFFFFFF;
> > +      }
> > +
> >        MmioWrite32 (PCIE_REG_BASE + PCIE_EXT_CFG_INDEX, Address);
> >        mPciSegmentLastAccess = Address;
> >      }
> > --
> > 2.13.7
> >

  reply	other threads:[~2021-08-22 13:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  4:16 [PATCH v3 0/7] RPi4: Enable ACPI PCIe conduit Jeremy Linton
2021-08-20  4:16 ` [PATCH v3 1/7] Platform/RaspberryPi: Add XHCI/PCI selection menu Jeremy Linton
2021-08-20 20:14   ` Andrei Warkentin
2021-08-20 20:31   ` Samer El-Haj-Mahmoud
2021-08-20  4:16 ` [PATCH v3 2/7] Platform/RaspberryPi: Break XHCI into its own SSDT Jeremy Linton
2021-08-20 20:15   ` Andrei Warkentin
2021-08-20  4:16 ` [PATCH v3 3/7] Platform/RaspberryPi: Add PCIe SSDT Jeremy Linton
2021-08-20 20:15   ` Andrei Warkentin
2021-08-20  4:16 ` [PATCH v3 4/7] Silicon/Broadcom/Bcm27xx: Relax PCIe device restriction Jeremy Linton
2021-08-20 20:16   ` Andrei Warkentin
2021-08-20  4:16 ` [PATCH v3 5/7] Silicon/Broadcom/Bcm27xx: Move linkup check into the cfg accessor Jeremy Linton
2021-08-20 20:16   ` Andrei Warkentin
2021-08-22 13:37   ` Ard Biesheuvel
2021-08-22 13:47     ` Ard Biesheuvel [this message]
2021-08-20  4:16 ` [PATCH v3 6/7] Platform/RaspberryPi: Enable NVMe boot on CM4 Jeremy Linton
2021-08-20 20:16   ` Andrei Warkentin
2021-08-20 20:37   ` Samer El-Haj-Mahmoud
2021-08-20  4:16 ` [PATCH v3 7/7] Platform/RaspberryPi: Add Linux quirk support Jeremy Linton
2021-08-20 20:15   ` Andrei Warkentin
2021-08-20 20:35   ` Samer El-Haj-Mahmoud
2021-08-20 20:27 ` [PATCH v3 0/7] RPi4: Enable ACPI PCIe conduit Samer El-Haj-Mahmoud
     [not found]   ` <7d39c23-6578-6bb9-ab5f-9d242d7ff42d@invisible.ca>
2021-08-22 13:55     ` Ard Biesheuvel

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-list 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='CAMj1kXHkU3k-OaGap=OHjXyF1qaiYKf4YKgA8ne9SO3JH_WBAA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /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