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
This commit is contained in:
vanjeff
2008-01-23 09:41:04 +00:00
parent 7113867d54
commit ea5632e56d
9 changed files with 307 additions and 803 deletions

View File

@ -32,8 +32,8 @@
# #
# VALID_ARCHITECTURES = IA32 X64 IPF EBC # VALID_ARCHITECTURES = IA32 X64 IPF EBC
# #
# DRIVER_BINDING = gPciBusDriverBinding # DRIVER_BINDING = gPciBusDriverBinding
# COMPONENT_NAME = gPciBusComponentName # COMPONENT_NAME = gPciBusComponentName
# #
[Sources.common] [Sources.common]
@ -106,6 +106,7 @@
gEfiPciPlatformProtocolGuid # PROTOCOL TO_START gEfiPciPlatformProtocolGuid # PROTOCOL TO_START
gEfiPciRootBridgeIoProtocolGuid # PROTOCOL TO_START gEfiPciRootBridgeIoProtocolGuid # PROTOCOL TO_START
gEfiDevicePathProtocolGuid # PROTOCOL TO_START gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiIncompatiblePciDeviceSupportProtocolGuid # PROTOCOL TO_START
[FeaturePcd.common] [FeaturePcd.common]

View File

@ -1,13 +1,13 @@
/**@file /**@file
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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 // 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) { if (PciIoDevice->DevicePath == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -1216,21 +1214,54 @@ Returns:
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr; EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;
Configuration = NULL; Configuration = NULL;
Status = EFI_SUCCESS;
// if (gEfiIncompatiblePciDeviceSupport == NULL) {
// Check whether the device belongs to incompatible devices or not //
// If it is , then get its special requirement in the ACPI table // It can only be supported after the Incompatible PCI Device
// // Support Protocol has been installed
PciDeviceInfo.VendorID = PciIoDevice->Pci.Hdr.VendorId; //
PciDeviceInfo.DeviceID = PciIoDevice->Pci.Hdr.DeviceId; Status = gBS->LocateProtocol (
PciDeviceInfo.RevisionID = PciIoDevice->Pci.Hdr.RevisionID; &gEfiIncompatiblePciDeviceSupportProtocolGuid,
PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID; NULL,
PciDeviceInfo.SubsystemID = PciIoDevice->Pci.Device.SubsystemID; (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)) { 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;
} }
// //

View File

@ -27,6 +27,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding = {
NULL NULL
}; };
EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gEfiIncompatiblePciDeviceSupport = NULL;
EFI_HANDLE gPciHostBrigeHandles[PCI_MAX_HOST_BRIDGE_NUM]; EFI_HANDLE gPciHostBrigeHandles[PCI_MAX_HOST_BRIDGE_NUM];
UINTN gPciHostBridgeNumber; UINTN gPciHostBridgeNumber;
BOOLEAN gFullEnumeration; BOOLEAN gFullEnumeration;
@ -215,6 +216,12 @@ Returns:
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = gBS->LocateProtocol (
&gEfiIncompatiblePciDeviceSupportProtocolGuid,
NULL,
(VOID **) &gEfiIncompatiblePciDeviceSupport
);
// //
// If PCI Platform protocol is available, get it now. // If PCI Platform protocol is available, get it now.
// If the platform implements this, it must be installed before BDS phase // If the platform implements this, it must be installed before BDS phase

View File

@ -1,13 +1,13 @@
/**@file /**@file
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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 <Guid/PciOptionRomTable.h> #include <Guid/PciOptionRomTable.h>
#include <Protocol/BusSpecificDriverOverride.h> #include <Protocol/BusSpecificDriverOverride.h>
#include <Protocol/UgaIo.h> #include <Protocol/UgaIo.h>
#include <Protocol/IncompatiblePciDeviceSupport.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h> #include <Library/UefiDriverEntryPoint.h>
@ -237,6 +238,7 @@ typedef struct _PCI_IO_DEVICE {
// //
// Global Variables // Global Variables
// //
extern EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gEfiIncompatiblePciDeviceSupport;
extern EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding; extern EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gPciBusComponentName; extern EFI_COMPONENT_NAME_PROTOCOL gPciBusComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gPciBusComponentName2; extern EFI_COMPONENT_NAME2_PROTOCOL gPciBusComponentName2;

View File

@ -308,9 +308,9 @@ UhciComponentNameGetControllerName (
OUT CHAR16 **ControllerName OUT CHAR16 **ControllerName
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
USB_HC_DEV *UhciDev; USB_HC_DEV *UhciDev;
EFI_USB_HC_PROTOCOL *UsbHc; EFI_USB2_HC_PROTOCOL *Usb2Hc;
// //
// This is a device driver, so ChildHandle must be NULL. // This is a device driver, so ChildHandle must be NULL.
@ -336,8 +336,8 @@ UhciComponentNameGetControllerName (
// //
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
ControllerHandle, ControllerHandle,
&gEfiUsbHcProtocolGuid, &gEfiUsb2HcProtocolGuid,
(VOID **) &UsbHc, (VOID **) &Usb2Hc,
gUhciDriverBinding.DriverBindingHandle, gUhciDriverBinding.DriverBindingHandle,
ControllerHandle, ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
@ -347,7 +347,7 @@ UhciComponentNameGetControllerName (
return Status; return Status;
} }
UhciDev = UHC_FROM_USB_HC_PROTO (UsbHc); UhciDev = UHC_FROM_USB2_HC_PROTO (Usb2Hc);
return LookupUnicodeString2 ( return LookupUnicodeString2 (
Language, Language,

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,6 @@ typedef struct {
} USB_CLASSC; } USB_CLASSC;
#pragma pack() #pragma pack()
#define UHC_FROM_USB_HC_PROTO(This) CR(This, USB_HC_DEV, UsbHc, USB_HC_DEV_SIGNATURE)
#define UHC_FROM_USB2_HC_PROTO(This) CR(This, USB_HC_DEV, Usb2Hc, USB_HC_DEV_SIGNATURE) #define UHC_FROM_USB2_HC_PROTO(This) CR(This, USB_HC_DEV, Usb2Hc, USB_HC_DEV_SIGNATURE)
// //
@ -114,7 +113,6 @@ typedef struct {
// //
struct _USB_HC_DEV { struct _USB_HC_DEV {
UINT32 Signature; UINT32 Signature;
EFI_USB_HC_PROTOCOL UsbHc;
EFI_USB2_HC_PROTOCOL Usb2Hc; EFI_USB2_HC_PROTOCOL Usb2Hc;
EFI_PCI_IO_PROTOCOL *PciIo; EFI_PCI_IO_PROTOCOL *PciIo;
UINT64 OriginalPciAttributes; UINT64 OriginalPciAttributes;

View File

@ -63,6 +63,5 @@
[Protocols] [Protocols]
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiUsbHcProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiUsb2HcProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiUsb2HcProtocolGuid # PROTOCOL ALWAYS_CONSUMED

View File

@ -168,7 +168,7 @@ UhciAckAllInterrupt (
// //
if (!UhciIsHcWorking (Uhc->PciIo)) { if (!UhciIsHcWorking (Uhc->PciIo)) {
UHCI_ERROR (("UhciAckAllInterrupt: re-enable the UHCI from system error\n")); UHCI_ERROR (("UhciAckAllInterrupt: re-enable the UHCI from system error\n"));
Uhc->UsbHc.SetState (&Uhc->UsbHc, EfiUsbHcStateOperational); Uhc->Usb2Hc.SetState (&Uhc->Usb2Hc, EfiUsbHcStateOperational);
} }
} }
@ -186,8 +186,8 @@ UhciAckAllInterrupt (
**/ **/
EFI_STATUS EFI_STATUS
UhciStopHc ( UhciStopHc (
IN USB_HC_DEV *Uhc, IN USB_HC_DEV *Uhc,
IN UINTN Timeout IN UINTN Timeout
) )
{ {
UINT16 UsbSts; UINT16 UsbSts;