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
This commit is contained in:
vanjeff 2008-07-23 02:54:38 +00:00
parent 8595bdaf58
commit 68077ae338
1 changed files with 22 additions and 3 deletions

View File

@ -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)
//