]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
MdeModulePkg/PciBus: Revert "Enable BM on P2P bridges on demand"
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDeviceSupport.c
index 1ad863c96673642cb2f6d267dc08573785dd97d8..e76c8f00468a87e9db7d6b014b3cffa257cd2a89 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Supporting functions implementaion for PCI devices management.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -268,6 +268,7 @@ RegisterPciDevice (
                                        &PlatformOpRomSize\r
                                        );\r
       if (!EFI_ERROR (Status)) {\r
+        PciIoDevice->EmbeddedRom    = FALSE;\r
         PciIoDevice->RomSize        = PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomSize  = PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;\r
@@ -281,7 +282,7 @@ RegisterPciDevice (
           PciIoDevice->BusNumber,\r
           PciIoDevice->DeviceNumber,\r
           PciIoDevice->FunctionNumber,\r
-          (UINT64) (UINTN) PciIoDevice->PciIo.RomImage,\r
+          PciIoDevice->PciIo.RomImage,\r
           PciIoDevice->PciIo.RomSize\r
           );\r
       }\r
@@ -293,6 +294,7 @@ RegisterPciDevice (
                                        &PlatformOpRomSize\r
                                        );\r
       if (!EFI_ERROR (Status)) {\r
+        PciIoDevice->EmbeddedRom    = FALSE;\r
         PciIoDevice->RomSize        = PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomSize  = PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;\r
@@ -306,7 +308,7 @@ RegisterPciDevice (
           PciIoDevice->BusNumber,\r
           PciIoDevice->DeviceNumber,\r
           PciIoDevice->FunctionNumber,\r
-          (UINT64) (UINTN) PciIoDevice->PciIo.RomImage,\r
+          PciIoDevice->PciIo.RomImage,\r
           PciIoDevice->PciIo.RomSize\r
           );\r
       }   \r
@@ -694,7 +696,7 @@ StartPciDevicesOnBridge (
       //\r
       // If it is a PPB\r
       //\r
-      if (!IsListEmpty (&PciIoDevice->ChildList)) {\r
+      if (IS_PCI_BRIDGE (&PciIoDevice->Pci)) {\r
         Status = StartPciDevicesOnBridge (\r
                    Controller,\r
                    PciIoDevice,\r
@@ -709,7 +711,7 @@ StartPciDevicesOnBridge (
                              0,\r
                              &Supports\r
                              );\r
-        Supports &= EFI_PCI_DEVICE_ENABLE;\r
+        Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
         PciIoDevice->PciIo.Attributes (\r
                              &(PciIoDevice->PciIo),\r
                              EfiPciIoAttributeOperationEnable,\r
@@ -746,7 +748,7 @@ StartPciDevicesOnBridge (
         (*NumberOfChildren)++;\r
       }\r
 \r
-      if (!IsListEmpty (&PciIoDevice->ChildList)) {\r
+      if (IS_PCI_BRIDGE (&PciIoDevice->Pci)) {\r
         Status = StartPciDevicesOnBridge (\r
                    Controller,\r
                    PciIoDevice,\r
@@ -761,7 +763,7 @@ StartPciDevicesOnBridge (
                              0,\r
                              &Supports\r
                              );\r
-        Supports &= EFI_PCI_DEVICE_ENABLE;\r
+        Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
         PciIoDevice->PciIo.Attributes (\r
                              &(PciIoDevice->PciIo),\r
                              EfiPciIoAttributeOperationEnable,\r