public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, edk2-devel@ml01.01.org
Cc: leif.lindholm@linaro.org
Subject: Re: [PATCH v2 5/6] ArmVirtPkg/FdtPciHostBridgeLib: add MMIO64 support
Date: Fri, 2 Sep 2016 12:44:34 +0200	[thread overview]
Message-ID: <bba745ed-b454-e812-85bc-f4fa9d4e797a@redhat.com> (raw)
In-Reply-To: <1472666379-25426-6-git-send-email-ard.biesheuvel@linaro.org>

On 08/31/16 19:59, Ard Biesheuvel wrote:

> @@ -308,8 +329,21 @@ PciHostBridgeGetRootBridges (
>    mRootBridge.Io.Limit              = IoBase + IoSize - 1;
>    mRootBridge.Mem.Base              = Mmio32Base;
>    mRootBridge.Mem.Limit             = Mmio32Base + Mmio32Size - 1;
> -  mRootBridge.MemAbove4G.Base       = MAX_UINT64;
> -  mRootBridge.MemAbove4G.Limit      = 0;
> +
> +  if (sizeof (UINTN) == sizeof (UINT64)) {
> +    mRootBridge.MemAbove4G.Base       = Mmio64Base;
> +    mRootBridge.MemAbove4G.Limit      = Mmio64Base + Mmio64Size - 1;
> +    mRootBridge.AllocationAttributes |= EFI_PCI_HOST_BRIDGE_MEM64_DECODE;
> +  } else {
> +    //
> +    // UEFI mandates a 1:1 virtual-to-physical mapping, so on a 32-bit
> +    // architecture such as ARM, we will not be able to access 64-bit MMIO
> +    // BARs unless they are allocated below 4 GB. So ignore the range above
> +    // 4 GB in this case.
> +    //
> +    mRootBridge.MemAbove4G.Base       = MAX_UINT64;
> +    mRootBridge.MemAbove4G.Limit      = 0;
> +  }
>  
>    //
>    // No separate ranges for prefetchable and non-prefetchable BARs

Please further restrict the one assignment

  mRootBridge.AllocationAttributes |= EFI_PCI_HOST_BRIDGE_MEM64_DECODE;

(while keeping it in its current location) with the following condition:

  if (Mmio64Size > 0) {
    mRootBridge.AllocationAttributes |= EFI_PCI_HOST_BRIDGE_MEM64_DECODE;
  }

We should only set this bit if there's actually a 64-bit MMIO aperture.

With that,

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

(No need to repost the series just because of this; you can implement the above on commit.)

Thanks!
Laszlo


  reply	other threads:[~2016-09-02 10:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 17:59 [PATCH v2 0/6] ArmVirtQemu: move to generic PciHostBridgeDxe Ard Biesheuvel
2016-08-31 17:59 ` [PATCH v2 1/6] ArmVirtPkg/PciHostBridgeDxe: don't set linux, pci-probe-only DT property Ard Biesheuvel
2016-08-31 17:59 ` [PATCH v2 2/6] ArmVirtPkg/FdtPciPcdProducerLib: add handling of PcdPciIoTranslation Ard Biesheuvel
2016-09-02 11:19   ` Laszlo Ersek
2016-08-31 17:59 ` [PATCH v2 3/6] ArmVirtPkg: implement FdtPciHostBridgeLib Ard Biesheuvel
2016-09-02 10:15   ` Laszlo Ersek
2016-08-31 17:59 ` [PATCH v2 4/6] ArmVirtPkg/ArmVirtQemu: switch to generic PciHostBridgeDxe Ard Biesheuvel
2016-08-31 17:59 ` [PATCH v2 5/6] ArmVirtPkg/FdtPciHostBridgeLib: add MMIO64 support Ard Biesheuvel
2016-09-02 10:44   ` Laszlo Ersek [this message]
2016-08-31 17:59 ` [PATCH v2 6/6] ArmVirtPkg: remove now unused PciHostBridgeDxe Ard Biesheuvel
2016-09-02 13:09 ` [PATCH v2 0/6] ArmVirtQemu: move to generic PciHostBridgeDxe Laszlo Ersek
2016-09-02 13:17   ` Laszlo Ersek
2016-09-02 14:58   ` Ard Biesheuvel
2016-09-02 15:27     ` Laszlo Ersek
2016-09-02 16:13       ` Laszlo Ersek
2016-09-02 16:26         ` Ard Biesheuvel
2016-09-02 17:21           ` Laszlo Ersek

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=bba745ed-b454-e812-85bc-f4fa9d4e797a@redhat.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