/**@file\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
//\r
// Update the bar information for this PCI device so as to support some specific device\r
//\r
- if (PcdGet8 (PcdPciIncompatibleDeviceSupportMask) & PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT) {\r
- UpdatePciInfo (PciIoDevice);\r
- }\r
+ UpdatePciInfo (PciIoDevice);\r
\r
if (PciIoDevice->DevicePath == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;\r
\r
Configuration = NULL;\r
+ Status = EFI_SUCCESS;\r
\r
- //\r
- // Check whether the device belongs to incompatible devices or not\r
- // If it is , then get its special requirement in the ACPI table\r
- //\r
- PciDeviceInfo.VendorID = PciIoDevice->Pci.Hdr.VendorId;\r
- PciDeviceInfo.DeviceID = PciIoDevice->Pci.Hdr.DeviceId;\r
- PciDeviceInfo.RevisionID = PciIoDevice->Pci.Hdr.RevisionID;\r
- PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID;\r
- PciDeviceInfo.SubsystemID = PciIoDevice->Pci.Device.SubsystemID;\r
+ if (gEfiIncompatiblePciDeviceSupport == NULL) {\r
+ //\r
+ // It can only be supported after the Incompatible PCI Device\r
+ // Support Protocol has been installed\r
+ //\r
+ Status = gBS->LocateProtocol (\r
+ &gEfiIncompatiblePciDeviceSupportProtocolGuid,\r
+ NULL,\r
+ (VOID **) &gEfiIncompatiblePciDeviceSupport\r
+ );\r
+ }\r
+ if (Status == EFI_SUCCESS) {\r
+ //\r
+ // Check whether the device belongs to incompatible devices from protocol or not\r
+ // If it is , then get its special requirement in the ACPI table\r
+ //\r
+ Status = gEfiIncompatiblePciDeviceSupport->CheckDevice (\r
+ gEfiIncompatiblePciDeviceSupport,\r
+ PciIoDevice->Pci.Hdr.VendorId,\r
+ PciIoDevice->Pci.Hdr.DeviceId,\r
+ PciIoDevice->Pci.Hdr.RevisionID,\r
+ PciIoDevice->Pci.Device.SubsystemVendorID,\r
+ PciIoDevice->Pci.Device.SubsystemID,\r
+ &Configuration\r
+ );\r
\r
- Status = PciResourceUpdateCheck (&PciDeviceInfo, &Configuration);\r
+ }\r
\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ //\r
+ // Check whether the device belongs to incompatible devices from library or not\r
+ // If it is , then get its special requirement in the ACPI table\r
+ //\r
+ if (PcdGet8 (PcdPciIncompatibleDeviceSupportMask) & PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT) {\r
+ PciDeviceInfo.VendorID = PciIoDevice->Pci.Hdr.VendorId;\r
+ PciDeviceInfo.DeviceID = PciIoDevice->Pci.Hdr.DeviceId;\r
+ PciDeviceInfo.RevisionID = PciIoDevice->Pci.Hdr.RevisionID;\r
+ PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID;\r
+ PciDeviceInfo.SubsystemID = PciIoDevice->Pci.Device.SubsystemID;\r
+\r
+ Status = PciResourceUpdateCheck (&PciDeviceInfo, &Configuration);\r
+ }\r
+ }\r
+\r
+ if (EFI_ERROR (Status)) {\r
+ return EFI_UNSUPPORTED;\r
}\r
\r
//\r
}\r
\r
EFI_STATUS\r
-ResetAllPpbBusReg (\r
+ResetAllPpbBusNumber (\r
IN PCI_IO_DEVICE *Bridge,\r
IN UINT8 StartBusNumber\r
)\r
UINT32 Register;\r
UINT8 Func;\r
UINT64 Address;\r
+ UINT8 SecondaryBus;\r
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;\r
\r
PciRootBridgeIo = Bridge->PciRootBridgeIo;\r
);\r
\r
if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci))) {\r
+\r
Register = 0;\r
Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18);\r
Status = PciRootBridgeIoRead (\r
1,\r
&Register\r
);\r
+ SecondaryBus = (UINT8)(Register >> 8);\r
+\r
+ if (SecondaryBus != 0) {\r
+ ResetAllPpbBusNumber (Bridge, SecondaryBus);\r
+ }\r
+\r
//\r
// Reset register 18h, 19h, 1Ah on PCI Bridge\r
//\r