Revision: 16898
          http://sourceforge.net/p/edk2/code/16898
Author:   lersek
Date:     2015-02-23 16:03:11 +0000 (Mon, 23 Feb 2015)
Log Message:
-----------
ArmVirtualizationPkg/PciHostBridgeDxe: abort if there's no PCI host bridge

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 <[email protected]>
Reviewed-by: Olivier Martin <[email protected]>

Modified Paths:
--------------
    
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c
    
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf

Modified: 
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c
===================================================================
--- 
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c 
    2015-02-23 16:03:06 UTC (rev 16897)
+++ 
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c 
    2015-02-23 16:03:11 UTC (rev 16898)
@@ -85,6 +85,7 @@
   @param ImageHandle     Handle of driver image
   @param SystemTable     Point to EFI_SYSTEM_TABLE
 
+  @retval EFI_ABORTED           PCI host bridge not present
   @retval EFI_OUT_OF_RESOURCES  Can not allocate memory resource
   @retval EFI_DEVICE_ERROR      Can not install the protocol instance
   @retval EFI_SUCCESS           Success to initialize the Pci host bridge.
@@ -102,6 +103,11 @@
   PCI_HOST_BRIDGE_INSTANCE    *HostBridge;
   PCI_ROOT_BRIDGE_INSTANCE    *PrivateData;
  
+  if (PcdGet64 (PcdPciExpressBaseAddress) == 0) {
+    DEBUG ((EFI_D_INFO, "%a: PCI host bridge not present\n", __FUNCTION__));
+    return EFI_ABORTED;
+  }
+
   mDriverImageHandle = ImageHandle;
   
   mResAperture[0][0].BusBase  = PcdGet32 (PcdPciBusMin);

Modified: 
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
===================================================================
--- 
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
        2015-02-23 16:03:06 UTC (rev 16897)
+++ 
trunk/edk2/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
        2015-02-23 16:03:11 UTC (rev 16898)
@@ -58,6 +58,7 @@
   gArmPlatformTokenSpaceGuid.PcdPciIoTranslation
   gArmPlatformTokenSpaceGuid.PcdPciMmio32Base
   gArmPlatformTokenSpaceGuid.PcdPciMmio32Size
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
 
 [depex]
   gEfiMetronomeArchProtocolGuid


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to