summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-14 02:33:15 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-14 02:33:15 +0000
commit4ed4e19c084e03fcb8cfdcb159145136093d4180 (patch)
tree52d0fbe96877453f72c6d8aee3bff7c09d513ecc /MdeModulePkg/Bus
parentf92d103109d9884a553e28399a077b21792ade41 (diff)
downloadedk2-platforms-4ed4e19c084e03fcb8cfdcb159145136093d4180.tar.xz
Update the PCI bus driver to correctly set the EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM attribute of PCI IO. Per UEFI spec, this attribute is used to determine if the ROM image is from the ROM BAR or from a platform specific location.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11159 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h5
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c2
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c9
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c1
4 files changed, 17 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h
index 8517c60f72..e268014d34 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h
@@ -224,6 +224,11 @@ struct _PCI_IO_DEVICE {
UINT32 Decodes;
//
+ // TRUE if the ROM image is from the PCI Option ROM BAR
+ //
+ BOOLEAN EmbeddedRom;
+
+ //
// The OptionRom Size
//
UINT64 RomSize;
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
index d0b17250e0..8ba5fc57ea 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
@@ -268,6 +268,7 @@ RegisterPciDevice (
&PlatformOpRomSize
);
if (!EFI_ERROR (Status)) {
+ PciIoDevice->EmbeddedRom = FALSE;
PciIoDevice->RomSize = PlatformOpRomSize;
PciIoDevice->PciIo.RomSize = PlatformOpRomSize;
PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;
@@ -293,6 +294,7 @@ RegisterPciDevice (
&PlatformOpRomSize
);
if (!EFI_ERROR (Status)) {
+ PciIoDevice->EmbeddedRom = FALSE;
PciIoDevice->RomSize = PlatformOpRomSize;
PciIoDevice->PciIo.RomSize = PlatformOpRomSize;
PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index f2108284d3..2a399c2ec2 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -940,6 +940,15 @@ PciSetDeviceAttribute (
EFI_PCI_IO_ATTRIBUTE_BUS_MASTER );
} else {
+ //
+ // When this attribute is clear, the RomImage and RomSize fields in the PCI IO were
+ // initialized based on the PCI option ROM found through the ROM BAR of the PCI controller.
+ // When this attribute is set, the PCI option ROM described by the RomImage and RomSize
+ // fields is not from the the ROM BAR of the PCI controller.
+ //
+ if (!PciIoDevice->EmbeddedRom) {
+ Attributes |= EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM;
+ }
PciIoDevice->Attributes = Attributes;
}
}
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
index 5f8ffe2c05..eb02112d9a 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
@@ -500,6 +500,7 @@ LoadOpRomImage (
RomDecode (PciDevice, RomBarIndex, RomBar, FALSE);
+ PciDevice->EmbeddedRom = TRUE;
PciDevice->PciIo.RomSize = RomImageSize;
PciDevice->PciIo.RomImage = RomInMemory;