]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtualizationPkg/PciHostBridgeDxe: abort if there's no PCI host bridge
authorLaszlo Ersek <lersek@redhat.com>
Mon, 23 Feb 2015 16:03:11 +0000 (16:03 +0000)
committerlersek <lersek@Edk2>
Mon, 23 Feb 2015 16:03:11 +0000 (16:03 +0000)
If VirtFdtDxe found no PCI host in the DTB, then the config space base
address will be left at zero -- the default is set in the DSC --, and we
should exit PciHostBridgeDxe immediately.

This causes gEfiPciRootBridgeIoProtocolGuid not to be installed, which in
turn prevents MdeModulePkg/Bus/Pci/PciBusDxe from binding (see
PciBusDriverBindingSupported()).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Olivier Martin <Olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16898 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c
ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf

index ced7528a2ea49fa932fc68438b4ab500f895f8d3..50f61cbfff7c0f15392b1272469eaf0b96aba53f 100644 (file)
@@ -85,6 +85,7 @@ PCI_HOST_BRIDGE_INSTANCE mPciHostBridgeInstanceTemplate = {
   @param ImageHandle     Handle of driver image\r
   @param SystemTable     Point to EFI_SYSTEM_TABLE\r
 \r
+  @retval EFI_ABORTED           PCI host bridge not present\r
   @retval EFI_OUT_OF_RESOURCES  Can not allocate memory resource\r
   @retval EFI_DEVICE_ERROR      Can not install the protocol instance\r
   @retval EFI_SUCCESS           Success to initialize the Pci host bridge.\r
@@ -102,6 +103,11 @@ InitializePciHostBridge (
   PCI_HOST_BRIDGE_INSTANCE    *HostBridge;\r
   PCI_ROOT_BRIDGE_INSTANCE    *PrivateData;\r
  \r
+  if (PcdGet64 (PcdPciExpressBaseAddress) == 0) {\r
+    DEBUG ((EFI_D_INFO, "%a: PCI host bridge not present\n", __FUNCTION__));\r
+    return EFI_ABORTED;\r
+  }\r
+\r
   mDriverImageHandle = ImageHandle;\r
   \r
   mResAperture[0][0].BusBase  = PcdGet32 (PcdPciBusMin);\r
index be3200dedb32075262a7c4609cfdde4c34145f8d..5497fa61d2aa23ee32ec04fa65cb145ffd68704f 100644 (file)
@@ -58,6 +58,7 @@
   gArmPlatformTokenSpaceGuid.PcdPciIoTranslation\r
   gArmPlatformTokenSpaceGuid.PcdPciMmio32Base\r
   gArmPlatformTokenSpaceGuid.PcdPciMmio32Size\r
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress\r
 \r
 [depex]\r
   gEfiMetronomeArchProtocolGuid\r