]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update the PCI bus driver to correctly set the EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM...
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 14 Dec 2010 02:33:15 +0000 (02:33 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 14 Dec 2010 02:33:15 +0000 (02:33 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11159 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h
MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c

index 8517c60f72cf13ab57f3b0625a814855ee1d8e31..e268014d346a02ac35a0f16e38194776c308d95d 100644 (file)
@@ -223,6 +223,11 @@ struct _PCI_IO_DEVICE {
   //\r
   UINT32                                    Decodes;\r
 \r
+  //\r
+  // TRUE if the ROM image is from the PCI Option ROM BAR\r
+  //\r
+  BOOLEAN                                   EmbeddedRom;\r
+\r
   //\r
   // The OptionRom Size\r
   //\r
index d0b17250e0578e71230950700c5c8e73ce757245..8ba5fc57ead108a59ae7f6c473cbd44f6a099f48 100644 (file)
@@ -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
@@ -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
index f2108284d3aa7631b205b53bfef093033d8dd48b..2a399c2ec2a6b2985bc5729809e0ad92cb54c4ba 100644 (file)
@@ -940,6 +940,15 @@ PciSetDeviceAttribute (
                                EFI_PCI_IO_ATTRIBUTE_BUS_MASTER );\r
 \r
   } else {\r
+    //\r
+    // When this attribute is clear, the RomImage and RomSize fields in the PCI IO were\r
+    // initialized based on the PCI option ROM found through the ROM BAR of the PCI controller.\r
+    // When this attribute is set, the PCI option ROM described by the RomImage and RomSize\r
+    // fields is not from the the ROM BAR of the PCI controller.\r
+    //\r
+    if (!PciIoDevice->EmbeddedRom) {\r
+      Attributes |= EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM;\r
+    }\r
     PciIoDevice->Attributes = Attributes;\r
   }\r
 }\r
index 5f8ffe2c05b245184115175991995a2f42e7e368..eb02112d9a0851ae16fdcc34d01e5e47179cc69b 100644 (file)
@@ -500,6 +500,7 @@ LoadOpRomImage (
 \r
   RomDecode (PciDevice, RomBarIndex, RomBar, FALSE);\r
 \r
+  PciDevice->EmbeddedRom    = TRUE;\r
   PciDevice->PciIo.RomSize  = RomImageSize;\r
   PciDevice->PciIo.RomImage = RomInMemory;\r
 \r