1. used PciPlatfromProtocolGuid to get VgaIo and IsaIo supported capability.

2. Fixed ECC issues.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8591 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2009-06-18 03:03:59 +00:00
parent 432bdae1f5
commit 94b9d5c6da
6 changed files with 147 additions and 66 deletions

View File

@@ -196,13 +196,15 @@ CalculateApertureIo16 (
IN PCI_RESOURCE_NODE *Bridge
)
{
UINT64 Aperture;
LIST_ENTRY *CurrentLink;
PCI_RESOURCE_NODE *Node;
UINT64 Offset;
BOOLEAN IsaEnable;
BOOLEAN VGAEnable;
EFI_STATUS Status;
UINT64 Aperture;
LIST_ENTRY *CurrentLink;
PCI_RESOURCE_NODE *Node;
UINT64 Offset;
BOOLEAN IsaEnable;
BOOLEAN VGAEnable;
EFI_PCI_PLATFORM_POLICY PciPolicy;
//
// Always assume there is ISA device and VGA device on the platform
@@ -211,12 +213,22 @@ CalculateApertureIo16 (
IsaEnable = FALSE;
VGAEnable = FALSE;
if (FeaturePcdGet (PcdPciIsaEnable)){
IsaEnable = TRUE;
}
if (FeaturePcdGet (PcdPciVgaEnable)){
VGAEnable = TRUE;
//
// Check PciPlatform policy
//
if (gPciPlatformProtocol != NULL) {
Status = gPciPlatformProtocol->GetPlatformPolicy (
gPciPlatformProtocol,
&PciPolicy
);
if (!EFI_ERROR (Status)) {
if (PciPolicy & EFI_RESERVE_ISA_IO_ALIAS) {
IsaEnable = TRUE;
}
if (PciPolicy & EFI_RESERVE_VGA_IO_ALIAS) {
VGAEnable = TRUE;
}
}
}
Aperture = 0;
@@ -1386,10 +1398,10 @@ ProgrameUpstreamBridgeForRom (
//
if (Enable) {
ProgramPpbApperture (OptionRomBase, &Node);
PciEnableCommandRegister (Parent, EFI_PCI_COMMAND_MEMORY_SPACE);
PCI_ENABLE_COMMAND_REGISTER (Parent, EFI_PCI_COMMAND_MEMORY_SPACE);
} else {
InitializePpb (Parent);
PciDisableCommandRegister (Parent, EFI_PCI_COMMAND_MEMORY_SPACE);
PCI_DISABLE_COMMAND_REGISTER (Parent, EFI_PCI_COMMAND_MEMORY_SPACE);
}
Parent = Parent->Parent;