From ea5632e56d882e39ae60e8de85711298f627b9e5 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Wed, 23 Jan 2008 09:41:04 +0000 Subject: 1. Remove USB HC Protocol installing from Uhci module. It only installs USB2 HC protocol. 2. Restore Incompatible Pci Device Support Protocol in PciBus module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4617 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Bus/Pci/PciBusDxe/PciBusDxe.inf | 5 +- .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 75 +++++++++++++++------- IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.c | 7 ++ IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.h | 18 +++--- 4 files changed, 73 insertions(+), 32 deletions(-) (limited to 'IntelFrameworkModulePkg/Bus/Pci') diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf index 3e43bc7328..beb9bfcd80 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf @@ -32,8 +32,8 @@ # # VALID_ARCHITECTURES = IA32 X64 IPF EBC # -# DRIVER_BINDING = gPciBusDriverBinding -# COMPONENT_NAME = gPciBusComponentName +# DRIVER_BINDING = gPciBusDriverBinding +# COMPONENT_NAME = gPciBusComponentName # [Sources.common] @@ -106,6 +106,7 @@ gEfiPciPlatformProtocolGuid # PROTOCOL TO_START gEfiPciRootBridgeIoProtocolGuid # PROTOCOL TO_START gEfiDevicePathProtocolGuid # PROTOCOL TO_START + gEfiIncompatiblePciDeviceSupportProtocolGuid # PROTOCOL TO_START [FeaturePcd.common] diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 4c9c800147..be316effdc 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -1,13 +1,13 @@ /**@file -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, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +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, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -294,9 +294,7 @@ Returns: // // Update the bar information for this PCI device so as to support some specific device // - if (PcdGet8 (PcdPciIncompatibleDeviceSupportMask) & PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT) { - UpdatePciInfo (PciIoDevice); - } + UpdatePciInfo (PciIoDevice); if (PciIoDevice->DevicePath == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1216,21 +1214,54 @@ Returns: EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr; Configuration = NULL; + Status = EFI_SUCCESS; - // - // Check whether the device belongs to incompatible devices or not - // If it is , then get its special requirement in the ACPI table - // - PciDeviceInfo.VendorID = PciIoDevice->Pci.Hdr.VendorId; - PciDeviceInfo.DeviceID = PciIoDevice->Pci.Hdr.DeviceId; - PciDeviceInfo.RevisionID = PciIoDevice->Pci.Hdr.RevisionID; - PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID; - PciDeviceInfo.SubsystemID = PciIoDevice->Pci.Device.SubsystemID; + if (gEfiIncompatiblePciDeviceSupport == NULL) { + // + // It can only be supported after the Incompatible PCI Device + // Support Protocol has been installed + // + Status = gBS->LocateProtocol ( + &gEfiIncompatiblePciDeviceSupportProtocolGuid, + NULL, + (VOID **) &gEfiIncompatiblePciDeviceSupport + ); + } + if (Status == EFI_SUCCESS) { + // + // Check whether the device belongs to incompatible devices from protocol or not + // If it is , then get its special requirement in the ACPI table + // + Status = gEfiIncompatiblePciDeviceSupport->CheckDevice ( + gEfiIncompatiblePciDeviceSupport, + PciIoDevice->Pci.Hdr.VendorId, + PciIoDevice->Pci.Hdr.DeviceId, + PciIoDevice->Pci.Hdr.RevisionID, + PciIoDevice->Pci.Device.SubsystemVendorID, + PciIoDevice->Pci.Device.SubsystemID, + &Configuration + ); - Status = PciResourceUpdateCheck (&PciDeviceInfo, &Configuration); + } if (EFI_ERROR (Status)) { - return Status; + // + // Check whether the device belongs to incompatible devices from library or not + // If it is , then get its special requirement in the ACPI table + // + if (PcdGet8 (PcdPciIncompatibleDeviceSupportMask) & PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT) { + PciDeviceInfo.VendorID = PciIoDevice->Pci.Hdr.VendorId; + PciDeviceInfo.DeviceID = PciIoDevice->Pci.Hdr.DeviceId; + PciDeviceInfo.RevisionID = PciIoDevice->Pci.Hdr.RevisionID; + PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID; + PciDeviceInfo.SubsystemID = PciIoDevice->Pci.Device.SubsystemID; + + Status = PciResourceUpdateCheck (&PciDeviceInfo, &Configuration); + } + } + + if (EFI_ERROR (Status)) { + return EFI_UNSUPPORTED; } // diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.c index ebf817b96f..a8e50fcb28 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.c +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.c @@ -27,6 +27,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding = { NULL }; +EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gEfiIncompatiblePciDeviceSupport = NULL; EFI_HANDLE gPciHostBrigeHandles[PCI_MAX_HOST_BRIDGE_NUM]; UINTN gPciHostBridgeNumber; BOOLEAN gFullEnumeration; @@ -215,6 +216,12 @@ Returns: { EFI_STATUS Status; + Status = gBS->LocateProtocol ( + &gEfiIncompatiblePciDeviceSupportProtocolGuid, + NULL, + (VOID **) &gEfiIncompatiblePciDeviceSupport + ); + // // If PCI Platform protocol is available, get it now. // If the platform implements this, it must be installed before BDS phase diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.h b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.h index 448a9dbb16..9db1dde553 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.h +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.h @@ -1,13 +1,13 @@ /**@file -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, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +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, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -32,6 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include @@ -237,6 +238,7 @@ typedef struct _PCI_IO_DEVICE { // // Global Variables // +extern EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gEfiIncompatiblePciDeviceSupport; extern EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding; extern EFI_COMPONENT_NAME_PROTOCOL gPciBusComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gPciBusComponentName2; -- cgit v1.2.3