summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-23 02:54:38 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-23 02:54:38 +0000
commit68077ae3383a8da5aae3acc861f20cdf756df544 (patch)
treea24e592418aaa98b11624dc0a88f9376d9f45ac5 /IntelFrameworkModulePkg
parent8595bdaf5803d89d2283c24becd5d1e84339bad8 (diff)
downloadedk2-platforms-68077ae3383a8da5aae3acc861f20cdf756df544.tar.xz
add logic to check PCI device has option rom when degrading PCI resources. If one device has 64 bit memory bar and option rom bar. Its 64bit memory should be degraded to 32bit memory.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5550 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
index a827bab097..d8ebadf64b 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
@@ -1,6 +1,6 @@
/**@file
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -913,6 +913,25 @@ DegradeResource (
IN PCI_RESOURCE_NODE *PMem64Node
)
{
+ BOOLEAN HasOprom;
+ PCI_IO_DEVICE *Temp;
+ LIST_ENTRY *CurrentLink;
+
+ //
+ // For RootBridge, PPB , P2C, go recursively to traverse all its children
+ // to find if this bridge and downstream has OptionRom.
+ //
+ HasOprom = FALSE;
+ CurrentLink = Bridge->ChildList.ForwardLink;
+ while (CurrentLink && CurrentLink != &Bridge->ChildList) {
+
+ Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
+ if (Temp->RomSize != 0) {
+ HasOprom = TRUE;
+ break;
+ }
+ CurrentLink = CurrentLink->ForwardLink;
+ }
//
// If bridge doesn't support Prefetchable
@@ -926,9 +945,9 @@ DegradeResource (
);
} else {
//
- // if no PMem32 request, still keep PMem64. Otherwise degrade to PMem32
+ // if no PMem32 request and no OptionRom request, still keep PMem64. Otherwise degrade to PMem32
//
- if (PMem32Node != NULL && PMem32Node->Length != 0 && Bridge->Parent != NULL ) {
+ if ((PMem32Node != NULL && (PMem32Node->Length != 0 && Bridge->Parent != NULL)) || HasOprom) {
//
// Fixed the issue that there is no resource for 64-bit (above 4G)
//