From patchwork Mon Mar 14 12:53:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 63809 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp17729lbc; Mon, 14 Mar 2016 05:53:16 -0700 (PDT) X-Received: by 10.98.13.130 with SMTP id 2mr29753018pfn.97.1457959996423; Mon, 14 Mar 2016 05:53:16 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id qe4si15134854pab.195.2016.03.14.05.53.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2016 05:53:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C4DF91A1ED5; Mon, 14 Mar 2016 05:53:33 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5952A1A1E63 for ; Mon, 14 Mar 2016 05:53:32 -0700 (PDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 2BA6415555; Mon, 14 Mar 2016 12:53:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-101.phx2.redhat.com [10.3.113.101]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2ECr3Zo003103; Mon, 14 Mar 2016 08:53:10 -0400 From: Laszlo Ersek To: edk2-devel@ml01.01.org Date: Mon, 14 Mar 2016 13:53:00 +0100 Message-Id: <1457959980-29438-4-git-send-email-lersek@redhat.com> In-Reply-To: <1457959980-29438-1-git-send-email-lersek@redhat.com> References: <56E6B2D9.5010507@redhat.com> <1457959980-29438-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: Marcel Apfelbaum , Jordan Justen Subject: [edk2] [wave 2 PATCH 3/3] OvmfPkg: PciHostBridgeLib: install 64-bit PCI host aperture X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" On the normal boot path (which is when PciHostBridgeDxe runs), the PCDs have been calculated; report the 64-bit PCI host aperture to PciHostBridgeDxe. In the Ia32 build, the PCD values (zeros) come directly from the DEC file, and this patch makes no difference. Cc: Gerd Hoffmann Cc: Jordan Justen Cc: Marcel Apfelbaum Cc: Thomas Lamprecht Ref: https://github.com/tianocore/edk2/issues/59 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 2 ++ OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 7 +++++++ 2 files changed, 9 insertions(+) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf index bbec74645c83..7a964c74c6cc 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -47,8 +47,10 @@ [LibraryClasses] QemuFwCfgLib [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size + gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base + gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c index 3e02778492a8..1d3d10ad7379 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -128,14 +128,21 @@ InitRootBridge ( RootBus->PMem.Base = 0; RootBus->PMem.Limit = 0; RootBus->PMemAbove4G.Base = 0; RootBus->PMemAbove4G.Limit = 0; RootBus->MemAbove4G.Base = 0; RootBus->MemAbove4G.Limit = 0; + if (PcdGet64 (PcdPciMmio64Size) > 0) { + RootBus->AllocationAttributes |= EFI_PCI_HOST_BRIDGE_MEM64_DECODE; + RootBus->MemAbove4G.Base = PcdGet64 (PcdPciMmio64Base); + RootBus->MemAbove4G.Limit = PcdGet64 (PcdPciMmio64Base) + + (PcdGet64 (PcdPciMmio64Size) - 1); + } + RootBus->Bus.Base = RootBusNumber; RootBus->Bus.Limit = MaxSubBusNumber; RootBus->Io.Base = PcdGet64 (PcdPciIoBase); RootBus->Io.Limit = PcdGet64 (PcdPciIoBase) + (PcdGet64 (PcdPciIoSize) - 1); RootBus->Mem.Base = PcdGet64 (PcdPciMmio32Base); RootBus->Mem.Limit = PcdGet64 (PcdPciMmio32Base) + (PcdGet64 (PcdPciMmio32Size) - 1);