From 3681d193ed5433c142fa05debc2ccb66cbd9b63a Mon Sep 17 00:00:00 2001 From: cwu11 Date: Mon, 6 Nov 2006 04:20:32 +0000 Subject: This check-in fixed the following bugs: 1. Pci22.h EFI_LEGACY_EXPANSION_ROM_HEADER definition error (MdePkg\Include\IndustryStandard\Pci22.h; Tools\CCode\Source\Include\IndustryStandard\Pci22.h) 2. SetVariable() with DataSize=0xffffffff will cause system hang (EdkModulePkg\Universal\Variable\RuntimeDxe\Variable.c) 3. Windows XP Pro & XP HOME Fails to Install from Retail CD (EdkModulePkg\Bus\Pci\Pcibus\Dxe\PciResourceSupport.c) 4. Pci22.h header file needs to add some recent type (MdePkg\Include\IndustryStandard\Pci22.h; Tools\CCode\Source\Include\IndustryStandard\Pci22.h) 5. Fix issues when ODD cannot boot from Sil0680 PCI-IDE controller (EdkModulePkg\Bus\Pci\PciBus\Dxe\PciOptionromSupport.c; EdkModulePkg\Bus\Pci\PciBus\Dxe\PciBus.msa; EdkModulePkg\ EdkModulePkg.spd) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1900 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa | 27 ++++++++++---- .../Bus/Pci/PciBus/Dxe/PciResourceSupport.c | 41 ++++++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) (limited to 'EdkModulePkg/Bus') diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa index f6c017cd76..4fe1dac4a9 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa @@ -6,14 +6,14 @@ 93B80004-9FB3-11d4-9A3A-0090273FC14D 1.0 Component description file for PciBus module. - PCI bus driver. This module will probe all PCI devices and allocate MMIO and IO + PCI bus driver. This module will probe all PCI devices and allocate MMIO and IO space for these devices. Copyright (c) 2006, 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 - http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + 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 + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 @@ -56,6 +56,9 @@ PeCoffGetEntryPointLib + + PcdLib + PciBus.h @@ -160,4 +163,16 @@ gPciBusComponentName + + + PcdPciIsaEnable + gEfiGenericPlatformTokenSpaceGuid + Whether ISA decoding is enabled on this platform so we should avoid those aliased resources + + + PcdPciVgaEnable + gEfiGenericPlatformTokenSpaceGuid + Whether VGA decoding is enabled on this platform so we should avoid those aliased resources + + \ No newline at end of file diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c index 8919b422a7..58dbc9fd4c 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c @@ -241,11 +241,24 @@ Returns: LIST_ENTRY *CurrentLink; PCI_RESOURCE_NODE *Node; UINT64 offset; + BOOLEAN IsaEnable; + BOOLEAN VGAEnable; // // Always assume there is ISA device and VGA device on the platform // will be customized later // + IsaEnable = FALSE; + VGAEnable = FALSE; + + if (FeaturePcdGet (PcdPciIsaEnable)){ + IsaEnable = TRUE; + } + + if (FeaturePcdGet (PcdPciVgaEnable)){ + VGAEnable = TRUE; + } + Aperture = 0; if (!Bridge) { @@ -278,6 +291,34 @@ Returns: // become too limited to meet the requirement of most of devices. // + if (IsaEnable || VGAEnable) { + if (!IS_PCI_BRIDGE (&(Node->PciDev->Pci)) && !IS_CARDBUS_BRIDGE (&(Node->PciDev->Pci))) { + // + // Check if there is need to support ISA/VGA decoding + // If so, we need to avoid isa/vga aliasing range + // + if (IsaEnable) { + SkipIsaAliasAperture ( + &Aperture, + Node->Length + ); + offset = Aperture & (Node->Alignment); + if (offset) { + Aperture = Aperture + (Node->Alignment + 1) - offset; + } + } else if (VGAEnable) { + SkipVGAAperture ( + &Aperture, + Node->Length + ); + offset = Aperture & (Node->Alignment); + if (offset) { + Aperture = Aperture + (Node->Alignment + 1) - offset; + } + } + } + } + Node->Offset = Aperture; // -- cgit v1.2.3