Code scrub for PCI Bus module and PciIncompatibleDeviceSupportLib module.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8662 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
/** @file
|
||||
PCI eunmeration implementation on entire PCI bus system for PCI Bus module.
|
||||
|
||||
Copyright (c) 2006 - 2009, 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 - 2009, 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.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "PciBus.h"
|
||||
#include "PciEnumerator.h"
|
||||
#include "PciOptionRomSupport.h"
|
||||
|
||||
/**
|
||||
This routine is used to enumerate entire pci bus system
|
||||
in a given platform.
|
||||
|
||||
@param Controller Parent controller handle.
|
||||
|
||||
@return Status of enumerating.
|
||||
|
||||
@retval EFI_SUCCESS PCI enumeration finished successfully.
|
||||
@retval other Some error occurred when enumerating the pci bus system.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciEnumerator (
|
||||
@@ -125,14 +125,14 @@ PciEnumerator (
|
||||
}
|
||||
|
||||
/**
|
||||
Enumerate PCI root bridge
|
||||
|
||||
Enumerate PCI root bridge.
|
||||
|
||||
@param PciResAlloc Pointer to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
|
||||
@param RootBridgeDev Instance of root bridge device.
|
||||
|
||||
@retval EFI_SUCCESS Success to enumerate root bridge.
|
||||
@retval Others Fail to enumerate root bridge.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Successfully enumerated root bridge.
|
||||
@retval other Failed to enumerate root bridge.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciRootBridgeEnumerator (
|
||||
@@ -190,7 +190,7 @@ PciRootBridgeEnumerator (
|
||||
// Reset all assigned PCI bus number
|
||||
//
|
||||
ResetAllPpbBusNumber (
|
||||
RootBridgeDev,
|
||||
RootBridgeDev,
|
||||
StartBusNumber
|
||||
);
|
||||
|
||||
@@ -222,9 +222,9 @@ PciRootBridgeEnumerator (
|
||||
RootBridgeHandle,
|
||||
Configuration
|
||||
);
|
||||
|
||||
|
||||
FreePool (Configuration);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
@@ -233,15 +233,15 @@ PciRootBridgeEnumerator (
|
||||
}
|
||||
|
||||
/**
|
||||
This routine is used to process option rom on a certain root bridge
|
||||
|
||||
@param Bridge Given parent's root bridge
|
||||
@param RomBase Base address of ROM driver loaded from
|
||||
@param MaxLength Max rom size
|
||||
|
||||
@retval EFI_SUCCESS Success to process option rom image.
|
||||
This routine is used to process all PCI devices' Option Rom
|
||||
on a certain root bridge.
|
||||
|
||||
@param Bridge Given parent's root bridge.
|
||||
@param RomBase Base address of ROM driver loaded from.
|
||||
@param MaxLength Maximum rom size.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
VOID
|
||||
ProcessOptionRom (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
IN UINT64 RomBase,
|
||||
@@ -275,18 +275,18 @@ ProcessOptionRom (
|
||||
|
||||
CurrentLink = CurrentLink->ForwardLink;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This routine is used to assign bus number to the given PCI bus system
|
||||
|
||||
@param Bridge Parent root bridge instance.
|
||||
@param StartBusNumber Number of beginning.
|
||||
@param SubBusNumber the number of sub bus.
|
||||
|
||||
@retval EFI_SUCCESS Success to assign bus number.
|
||||
|
||||
@param Bridge Parent root bridge instance.
|
||||
@param StartBusNumber Number of beginning.
|
||||
@param SubBusNumber The number of sub bus.
|
||||
|
||||
@retval EFI_SUCCESS Successfully assigned bus number.
|
||||
@retval EFI_DEVICE_ERROR Failed to assign bus number.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciAssignBusNumber (
|
||||
@@ -321,7 +321,6 @@ PciAssignBusNumber (
|
||||
//
|
||||
// Check to see whether a pci device is present
|
||||
//
|
||||
|
||||
Status = PciDevicePresent (
|
||||
PciRootBridgeIo,
|
||||
&Pci,
|
||||
@@ -392,7 +391,6 @@ PciAssignBusNumber (
|
||||
//
|
||||
// Set the current maximum bus number under the PPB
|
||||
//
|
||||
|
||||
Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x1A);
|
||||
|
||||
Status = PciRootBridgeIoWrite (
|
||||
@@ -411,7 +409,6 @@ PciAssignBusNumber (
|
||||
//
|
||||
// Skip sub functions, this is not a multi function device
|
||||
//
|
||||
|
||||
Func = PCI_MAX_FUNC;
|
||||
}
|
||||
}
|
||||
@@ -426,9 +423,10 @@ PciAssignBusNumber (
|
||||
|
||||
@param PciResAlloc Protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
@param RootBridgeDev Root bridge instance
|
||||
|
||||
@retval EFI_SUCCESS Success to get root bridge's attribute
|
||||
@retval Others Fail to get attribute
|
||||
|
||||
@retval EFI_SUCCESS Successfully got root bridge's attribute.
|
||||
@retval other Failed to get attribute.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DetermineRootBridgeAttributes (
|
||||
@@ -460,7 +458,6 @@ DetermineRootBridgeAttributes (
|
||||
// Here is the point where PCI bus driver calls HOST bridge allocation protocol
|
||||
// Currently we hardcoded for ea815
|
||||
//
|
||||
|
||||
if ((Attributes & EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM) != 0) {
|
||||
RootBridgeDev->Decodes |= EFI_BRIDGE_PMEM_MEM_COMBINE_SUPPORTED;
|
||||
}
|
||||
@@ -477,10 +474,12 @@ DetermineRootBridgeAttributes (
|
||||
}
|
||||
|
||||
/**
|
||||
Get Max Option Rom size on this bridge
|
||||
|
||||
@param Bridge Bridge device instance.
|
||||
@return Max size of option rom.
|
||||
Get Max Option Rom size on specified bridge.
|
||||
|
||||
@param Bridge Given bridge device instance.
|
||||
|
||||
@return Max size of option rom needed.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
GetMaxOptionRomSize (
|
||||
@@ -538,12 +537,13 @@ GetMaxOptionRomSize (
|
||||
|
||||
/**
|
||||
Process attributes of devices on this host bridge
|
||||
|
||||
|
||||
@param PciResAlloc Protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Successfully process attribute.
|
||||
@retval EFI_NOT_FOUND Can not find the specific root bridge device.
|
||||
@retval EFI_SUCCESS Success Process attribute.
|
||||
@retval Others Can not determine the root bridge device's attribute.
|
||||
@retval other Failed to determine the root bridge device's attribute.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeDeviceAttribute (
|
||||
@@ -581,18 +581,17 @@ PciHostBridgeDeviceAttribute (
|
||||
}
|
||||
|
||||
/**
|
||||
Get resource allocation status from the ACPI pointer
|
||||
Get resource allocation status from the ACPI resource descriptor.
|
||||
|
||||
@param AcpiConfig Point to Acpi configuration table.
|
||||
@param IoResStatus Return the status of I/O resource.
|
||||
@param Mem32ResStatus Return the status of 32-bit Memory resource.
|
||||
@param PMem32ResStatus Return the status of 32-bit Prefetchable Memory resource.
|
||||
@param Mem64ResStatus Return the status of 64-bit Memory resource.
|
||||
@param PMem64ResStatus Return the status of 64-bit Prefetchable Memory resource.
|
||||
|
||||
@param AcpiConfig Point to Acpi configuration table
|
||||
@param IoResStatus Return the status of I/O resource
|
||||
@param Mem32ResStatus Return the status of 32-bit Memory resource
|
||||
@param PMem32ResStatus Return the status of 32-bit PMemory resource
|
||||
@param Mem64ResStatus Return the status of 64-bit Memory resource
|
||||
@param PMem64ResStatus Return the status of 64-bit PMemory resource
|
||||
|
||||
@retval EFI_SUCCESS Success to get resource allocation status from ACPI configuration table.
|
||||
**/
|
||||
EFI_STATUS
|
||||
VOID
|
||||
GetResourceAllocationStatus (
|
||||
VOID *AcpiConfig,
|
||||
OUT UINT64 *IoResStatus,
|
||||
@@ -602,7 +601,6 @@ GetResourceAllocationStatus (
|
||||
OUT UINT64 *PMem64ResStatus
|
||||
)
|
||||
{
|
||||
|
||||
UINT8 *Temp;
|
||||
UINT64 ResStatus;
|
||||
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *ACPIAddressDesc;
|
||||
@@ -659,17 +657,16 @@ GetResourceAllocationStatus (
|
||||
|
||||
Temp += sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove a PCI device from device pool and mark its bar
|
||||
|
||||
Remove a PCI device from device pool and mark its bar.
|
||||
|
||||
@param PciDevice Instance of Pci device.
|
||||
|
||||
@retval EFI_SUCCESS Success Operation.
|
||||
@retval EFI_ABORTED Pci device is a root bridge.
|
||||
|
||||
@retval EFI_SUCCESS Successfully remove the PCI device.
|
||||
@retval EFI_ABORTED Pci device is a root bridge or a PCI-PCI bridge.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
RejectPciDevice (
|
||||
@@ -683,7 +680,7 @@ RejectPciDevice (
|
||||
//
|
||||
// Remove the padding resource from a bridge
|
||||
//
|
||||
if ( IS_PCI_BRIDGE(&PciDevice->Pci) &&
|
||||
if ( IS_PCI_BRIDGE(&PciDevice->Pci) &&
|
||||
PciDevice->ResourcePaddingDescriptors != NULL ) {
|
||||
FreePool (PciDevice->ResourcePaddingDescriptors);
|
||||
PciDevice->ResourcePaddingDescriptors = NULL;
|
||||
@@ -736,10 +733,12 @@ RejectPciDevice (
|
||||
|
||||
/**
|
||||
Determine whethter a PCI device can be rejected.
|
||||
|
||||
@param PciResNode Pointer to Pci resource node instance.
|
||||
|
||||
@return whethter a PCI device can be rejected.
|
||||
|
||||
@param PciResNode Pointer to Pci resource node instance.
|
||||
|
||||
@retval TRUE The PCI device can be rejected.
|
||||
@retval TRUE The PCI device cannot be rejected.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsRejectiveDevice (
|
||||
@@ -782,12 +781,13 @@ IsRejectiveDevice (
|
||||
}
|
||||
|
||||
/**
|
||||
Compare two resource node and get the larger resource consumer
|
||||
|
||||
Compare two resource nodes and get the larger resource consumer.
|
||||
|
||||
@param PciResNode1 resource node 1 want to be compared
|
||||
@param PciResNode2 resource node 2 want to be compared
|
||||
|
||||
@return Larger resource consumer.
|
||||
|
||||
@return Larger resource node.
|
||||
|
||||
**/
|
||||
PCI_RESOURCE_NODE *
|
||||
GetLargerConsumerDevice (
|
||||
@@ -814,16 +814,16 @@ GetLargerConsumerDevice (
|
||||
}
|
||||
|
||||
return PciResNode2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Get the max resource consumer in the host resource pool.
|
||||
|
||||
|
||||
@param ResPool Pointer to resource pool node.
|
||||
|
||||
@return the max resource consumer in the host resource pool.
|
||||
|
||||
@return The max resource consumer in the host resource pool.
|
||||
|
||||
**/
|
||||
PCI_RESOURCE_NODE *
|
||||
GetMaxResourceConsumerDevice (
|
||||
@@ -864,17 +864,21 @@ GetMaxResourceConsumerDevice (
|
||||
|
||||
/**
|
||||
Adjust host bridge allocation so as to reduce resource requirement
|
||||
|
||||
|
||||
@param IoPool Pointer to instance of I/O resource Node.
|
||||
@param Mem32Pool Pointer to instance of 32-bit memory resource Node.
|
||||
@param PMem32Pool Pointer to instance of 32-bit Pmemory resource node.
|
||||
@param PMem32Pool Pointer to instance of 32-bit Prefetchable memory resource node.
|
||||
@param Mem64Pool Pointer to instance of 64-bit memory resource node.
|
||||
@param PMem64Pool Pointer to instance of 64-bit Pmemory resource node.
|
||||
@param PMem64Pool Pointer to instance of 64-bit Prefetchable memory resource node.
|
||||
@param IoResStatus Status of I/O resource Node.
|
||||
@param Mem32ResStatus Status of 32-bit memory resource Node.
|
||||
@param PMem32ResStatus Status of 32-bit Pmemory resource node.
|
||||
@param PMem32ResStatus Status of 32-bit Prefetchable memory resource node.
|
||||
@param Mem64ResStatus Status of 64-bit memory resource node.
|
||||
@param PMem64ResStatus Status of 64-bit Pmemory resource node.
|
||||
@param PMem64ResStatus Status of 64-bit Prefetchable memory resource node.
|
||||
|
||||
@retval EFI_SUCCESS Successfully adjusted resoruce on host bridge.
|
||||
@retval EFI_ABORTED Host bridge hasn't this resource type or no resource be adjusted.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeAdjustAllocation (
|
||||
@@ -927,7 +931,7 @@ PciHostBridgeAdjustAllocation (
|
||||
|
||||
if (ResStatus[ResType] == EFI_RESOURCE_NOT_SATISFIED) {
|
||||
//
|
||||
// Hostbridge hasn't this resource type
|
||||
// Host bridge hasn't this resource type
|
||||
//
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
@@ -998,7 +1002,7 @@ PciHostBridgeAdjustAllocation (
|
||||
/**
|
||||
Summary requests for all resource type, and contruct ACPI resource
|
||||
requestor instance.
|
||||
|
||||
|
||||
@param Bridge detecting bridge
|
||||
@param IoNode Pointer to instance of I/O resource Node
|
||||
@param Mem32Node Pointer to instance of 32-bit memory resource Node
|
||||
@@ -1006,6 +1010,10 @@ PciHostBridgeAdjustAllocation (
|
||||
@param Mem64Node Pointer to instance of 64-bit memory resource node
|
||||
@param PMem64Node Pointer to instance of 64-bit Pmemory resource node
|
||||
@param Config Output buffer holding new constructed APCI resource requestor
|
||||
|
||||
@retval EFI_SUCCESS Successfully constructed ACPI resource.
|
||||
@retval EFI_OUT_OF_RESOURCES No memory availabe.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ConstructAcpiResourceRequestor (
|
||||
@@ -1235,18 +1243,16 @@ ConstructAcpiResourceRequestor (
|
||||
|
||||
/**
|
||||
Get resource base from an acpi configuration descriptor.
|
||||
|
||||
@param Config an acpi configuration descriptor.
|
||||
@param IoBase output of I/O resource base address.
|
||||
@param Mem32Base output of 32-bit memory base address.
|
||||
@param PMem32Base output of 32-bit pmemory base address.
|
||||
@param Mem64Base output of 64-bit memory base address.
|
||||
@param PMem64Base output of 64-bit pmemory base address.
|
||||
|
||||
@return EFI_SUCCESS Get resource base address successfully.
|
||||
|
||||
@param Config An acpi configuration descriptor.
|
||||
@param IoBase Output of I/O resource base address.
|
||||
@param Mem32Base Output of 32-bit memory base address.
|
||||
@param PMem32Base Output of 32-bit prefetchable memory base address.
|
||||
@param Mem64Base Output of 64-bit memory base address.
|
||||
@param PMem64Base Output of 64-bit prefetchable memory base address.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
VOID
|
||||
GetResourceBase (
|
||||
IN VOID *Config,
|
||||
OUT UINT64 *IoBase,
|
||||
@@ -1325,18 +1331,17 @@ GetResourceBase (
|
||||
//
|
||||
Temp += sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Enumerate pci bridge, allocate resource and determine attribute
|
||||
for devices on this bridge
|
||||
|
||||
@param BridgeDev Pointer to instance of bridge device.
|
||||
|
||||
@retval EFI_SUCCESS Success operation.
|
||||
@retval Others Fail to enumerate.
|
||||
for devices on this bridge.
|
||||
|
||||
@param BridgeDev Pointer to instance of bridge device.
|
||||
|
||||
@retval EFI_SUCCESS Successfully enumerated PCI bridge.
|
||||
@retval other Failed to enumerate.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciBridgeEnumerator (
|
||||
@@ -1390,12 +1395,13 @@ PciBridgeEnumerator (
|
||||
}
|
||||
|
||||
/**
|
||||
Allocate all kinds of resource for bridge
|
||||
|
||||
@param Bridge Pointer to bridge instance.
|
||||
|
||||
@retval EFI_SUCCESS Success operation.
|
||||
@retval Others Fail to allocate resource for bridge.
|
||||
Allocate all kinds of resource for PCI bridge.
|
||||
|
||||
@param Bridge Pointer to bridge instance.
|
||||
|
||||
@retval EFI_SUCCESS Successfully allocated resource for PCI bridge.
|
||||
@retval other Failed to allocate resource for bridge.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciBridgeResourceAllocator (
|
||||
@@ -1415,13 +1421,13 @@ PciBridgeResourceAllocator (
|
||||
EFI_STATUS Status;
|
||||
|
||||
IoBridge = CreateResourceNode (
|
||||
Bridge,
|
||||
0,
|
||||
0xFFF,
|
||||
0,
|
||||
PciBarTypeIo16,
|
||||
PciResUsageTypical
|
||||
);
|
||||
Bridge,
|
||||
0,
|
||||
0xFFF,
|
||||
0,
|
||||
PciBarTypeIo16,
|
||||
PciResUsageTypical
|
||||
);
|
||||
|
||||
Mem32Bridge = CreateResourceNode (
|
||||
Bridge,
|
||||
@@ -1433,13 +1439,13 @@ PciBridgeResourceAllocator (
|
||||
);
|
||||
|
||||
PMem32Bridge = CreateResourceNode (
|
||||
Bridge,
|
||||
0,
|
||||
0xFFFFF,
|
||||
0,
|
||||
PciBarTypePMem32,
|
||||
PciResUsageTypical
|
||||
);
|
||||
Bridge,
|
||||
0,
|
||||
0xFFFFF,
|
||||
0,
|
||||
PciBarTypePMem32,
|
||||
PciResUsageTypical
|
||||
);
|
||||
|
||||
Mem64Bridge = CreateResourceNode (
|
||||
Bridge,
|
||||
@@ -1451,38 +1457,34 @@ PciBridgeResourceAllocator (
|
||||
);
|
||||
|
||||
PMem64Bridge = CreateResourceNode (
|
||||
Bridge,
|
||||
0,
|
||||
0xFFFFF,
|
||||
0,
|
||||
PciBarTypePMem64,
|
||||
PciResUsageTypical
|
||||
);
|
||||
Bridge,
|
||||
0,
|
||||
0xFFFFF,
|
||||
0,
|
||||
PciBarTypePMem64,
|
||||
PciResUsageTypical
|
||||
);
|
||||
|
||||
//
|
||||
// Create resourcemap by going through all the devices subject to this root bridge
|
||||
//
|
||||
Status = CreateResourceMap (
|
||||
Bridge,
|
||||
IoBridge,
|
||||
Mem32Bridge,
|
||||
PMem32Bridge,
|
||||
Mem64Bridge,
|
||||
PMem64Bridge
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
CreateResourceMap (
|
||||
Bridge,
|
||||
IoBridge,
|
||||
Mem32Bridge,
|
||||
PMem32Bridge,
|
||||
Mem64Bridge,
|
||||
PMem64Bridge
|
||||
);
|
||||
|
||||
Status = GetResourceBaseFromBridge (
|
||||
Bridge,
|
||||
&IoBase,
|
||||
&Mem32Base,
|
||||
&PMem32Base,
|
||||
&Mem64Base,
|
||||
&PMem64Base
|
||||
);
|
||||
Bridge,
|
||||
&IoBase,
|
||||
&Mem32Base,
|
||||
&PMem32Base,
|
||||
&Mem64Base,
|
||||
&PMem64Base
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
@@ -1544,16 +1546,18 @@ PciBridgeResourceAllocator (
|
||||
}
|
||||
|
||||
/**
|
||||
Get resource base address for a pci bridge device
|
||||
|
||||
@param Bridge Given Pci driver instance.
|
||||
@param IoBase output for base address of I/O type resource.
|
||||
@param Mem32Base output for base address of 32-bit memory type resource.
|
||||
@param PMem32Base output for base address of 32-bit Pmemory type resource.
|
||||
@param Mem64Base output for base address of 64-bit memory type resource.
|
||||
@param PMem64Base output for base address of 64-bit Pmemory type resource.
|
||||
|
||||
@retval EFI_SUCCESS Succes to get resource base address.
|
||||
Get resource base address for a pci bridge device.
|
||||
|
||||
@param Bridge Given Pci driver instance.
|
||||
@param IoBase Output for base address of I/O type resource.
|
||||
@param Mem32Base Output for base address of 32-bit memory type resource.
|
||||
@param PMem32Base Ooutput for base address of 32-bit Pmemory type resource.
|
||||
@param Mem64Base Output for base address of 64-bit memory type resource.
|
||||
@param PMem64Base Output for base address of 64-bit Pmemory type resource.
|
||||
|
||||
@retval EFI_SUCCESS Successfully got resource base address.
|
||||
@retval EFI_OUT_OF_RESOURCES PCI bridge is not available.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourceBaseFromBridge (
|
||||
@@ -1631,53 +1635,55 @@ GetResourceBaseFromBridge (
|
||||
}
|
||||
|
||||
/**
|
||||
These are the notifications from the PCI bus driver that it is about to enter a certain
|
||||
These are the notifications from the PCI bus driver that it is about to enter a certain
|
||||
phase of the PCI enumeration process.
|
||||
|
||||
This member function can be used to notify the host bridge driver to perform specific actions,
|
||||
including any chipset-specific initialization, so that the chipset is ready to enter the next phase.
|
||||
Eight notification points are defined at this time. See belows:
|
||||
EfiPciHostBridgeBeginEnumeration - Resets the host bridge PCI apertures and internal data
|
||||
EfiPciHostBridgeBeginEnumeration Resets the host bridge PCI apertures and internal data
|
||||
structures. The PCI enumerator should issue this notification
|
||||
before starting a fresh enumeration process. Enumeration cannot
|
||||
be restarted after sending any other notification such as
|
||||
EfiPciHostBridgeBeginBusAllocation.
|
||||
EfiPciHostBridgeBeginBusAllocation - The bus allocation phase is about to begin. No specific action is
|
||||
EfiPciHostBridgeBeginBusAllocation The bus allocation phase is about to begin. No specific action is
|
||||
required here. This notification can be used to perform any
|
||||
chipset-specific programming.
|
||||
EfiPciHostBridgeEndBusAllocation - The bus allocation and bus programming phase is complete. No
|
||||
EfiPciHostBridgeEndBusAllocation The bus allocation and bus programming phase is complete. No
|
||||
specific action is required here. This notification can be used to
|
||||
perform any chipset-specific programming.
|
||||
EfiPciHostBridgeBeginResourceAllocation - The resource allocation phase is about to begin. No specific
|
||||
action is required here. This notification can be used to perform
|
||||
any chipset-specific programming.
|
||||
EfiPciHostBridgeAllocateResources - Allocates resources per previously submitted requests for all the PCI
|
||||
EfiPciHostBridgeBeginResourceAllocation
|
||||
The resource allocation phase is about to begin. No specific
|
||||
action is required here. This notification can be used to perform
|
||||
any chipset-specific programming.
|
||||
EfiPciHostBridgeAllocateResources Allocates resources per previously submitted requests for all the PCI
|
||||
root bridges. These resource settings are returned on the next call to
|
||||
GetProposedResources(). Before calling NotifyPhase() with a Phase of
|
||||
EfiPciHostBridgeAllocateResource, the PCI bus enumerator is responsible for gathering I/O and memory requests for
|
||||
EfiPciHostBridgeAllocateResource, the PCI bus enumerator is responsible
|
||||
for gathering I/O and memory requests for
|
||||
all the PCI root bridges and submitting these requests using
|
||||
SubmitResources(). This function pads the resource amount
|
||||
to suit the root bridge hardware, takes care of dependencies between
|
||||
the PCI root bridges, and calls the Global Coherency Domain (GCD)
|
||||
with the allocation request. In the case of padding, the allocated range
|
||||
could be bigger than what was requested.
|
||||
EfiPciHostBridgeSetResources - Programs the host bridge hardware to decode previously allocated
|
||||
EfiPciHostBridgeSetResources Programs the host bridge hardware to decode previously allocated
|
||||
resources (proposed resources) for all the PCI root bridges. After the
|
||||
hardware is programmed, reassigning resources will not be supported.
|
||||
The bus settings are not affected.
|
||||
EfiPciHostBridgeFreeResources - Deallocates resources that were previously allocated for all the PCI
|
||||
EfiPciHostBridgeFreeResources Deallocates resources that were previously allocated for all the PCI
|
||||
root bridges and resets the I/O and memory apertures to their initial
|
||||
state. The bus settings are not affected. If the request to allocate
|
||||
resources fails, the PCI enumerator can use this notification to
|
||||
deallocate previous resources, adjust the requests, and retry
|
||||
allocation.
|
||||
EfiPciHostBridgeEndResourceAllocation- The resource allocation phase is completed. No specific action is
|
||||
EfiPciHostBridgeEndResourceAllocation The resource allocation phase is completed. No specific action is
|
||||
required here. This notification can be used to perform any chipsetspecific
|
||||
programming.
|
||||
|
||||
|
||||
@param[in] PciResAlloc The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
@param[in] Phase The phase during enumeration
|
||||
|
||||
|
||||
@retval EFI_NOT_READY This phase cannot be entered at this time. For example, this error
|
||||
is valid for a Phase of EfiPciHostBridgeAllocateResources if
|
||||
SubmitResources() has not been called for one or more
|
||||
@@ -1759,27 +1765,27 @@ NotifyPhase (
|
||||
}
|
||||
|
||||
/**
|
||||
Provides the hooks from the PCI bus driver to every PCI controller (device/function) at various
|
||||
stages of the PCI enumeration process that allow the host bridge driver to preinitialize individual
|
||||
PCI controllers before enumeration.
|
||||
Provides the hooks from the PCI bus driver to every PCI controller (device/function) at various
|
||||
stages of the PCI enumeration process that allow the host bridge driver to preinitialize individual
|
||||
PCI controllers before enumeration.
|
||||
|
||||
This function is called during the PCI enumeration process. No specific action is expected from this
|
||||
member function. It allows the host bridge driver to preinitialize individual PCI controllers before
|
||||
enumeration.
|
||||
This function is called during the PCI enumeration process. No specific action is expected from this
|
||||
member function. It allows the host bridge driver to preinitialize individual PCI controllers before
|
||||
enumeration.
|
||||
|
||||
@param Bridge Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
|
||||
@param Bus The bus number of the pci device.
|
||||
@param Device The device number of the pci device.
|
||||
@param Func The function number of the pci device.
|
||||
@param Phase The phase of the PCI device enumeration.
|
||||
|
||||
@retval EFI_SUCCESS The requested parameters were returned.
|
||||
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
|
||||
@retval EFI_INVALID_PARAMETER Phase is not a valid phase that is defined in
|
||||
EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE.
|
||||
@retval EFI_DEVICE_ERROR Programming failed due to a hardware error. The PCI enumerator should
|
||||
not enumerate this device, including its child devices if it is a PCI-to-PCI
|
||||
bridge.
|
||||
@param Bridge Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
|
||||
@param Bus The bus number of the pci device.
|
||||
@param Device The device number of the pci device.
|
||||
@param Func The function number of the pci device.
|
||||
@param Phase The phase of the PCI device enumeration.
|
||||
|
||||
@retval EFI_SUCCESS The requested parameters were returned.
|
||||
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
|
||||
@retval EFI_INVALID_PARAMETER Phase is not a valid phase that is defined in
|
||||
EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE.
|
||||
@retval EFI_DEVICE_ERROR Programming failed due to a hardware error. The PCI enumerator should
|
||||
not enumerate this device, including its child devices if it is a PCI-to-PCI
|
||||
bridge.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -1872,17 +1878,27 @@ PreprocessController (
|
||||
}
|
||||
|
||||
/**
|
||||
Hot plug request notify.
|
||||
|
||||
@param This - A pointer to the hot plug request protocol.
|
||||
@param Operation - The operation.
|
||||
@param Controller - A pointer to the controller.
|
||||
@param RemainingDevicePath - A pointer to the device path.
|
||||
@param NumberOfChildren - A the number of child handle in the ChildHandleBuffer.
|
||||
@param ChildHandleBuffer - A pointer to the array contain the child handle.
|
||||
|
||||
@retval EFI_NOT_FOUND Can not find bridge according to controller handle.
|
||||
@retval EFI_SUCCESS Success operating.
|
||||
This function allows the PCI bus driver to be notified to act as requested when a hot-plug event has
|
||||
happened on the hot-plug controller. Currently, the operations include add operation and remove operation..
|
||||
|
||||
@param This A pointer to the hot plug request protocol.
|
||||
@param Operation The operation the PCI bus driver is requested to make.
|
||||
@param Controller The handle of the hot-plug controller.
|
||||
@param RemainingDevicePath The remaining device path for the PCI-like hot-plug device.
|
||||
@param NumberOfChildren The number of child handles.
|
||||
For a add operation, it is an output parameter.
|
||||
For a remove operation, it?<3F><>s an input parameter.
|
||||
@param ChildHandleBuffer The buffer which contains the child handles.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Operation is not a legal value.
|
||||
Controller is NULL or not a valid handle.
|
||||
NumberOfChildren is NULL.
|
||||
ChildHandleBuffer is NULL while Operation is add.
|
||||
@retval EFI_OUT_OF_RESOURCES There are no enough resources to start the devices.
|
||||
@retval EFI_NOT_FOUND Can not find bridge according to controller handle.
|
||||
@retval EFI_SUCCESS The handles for the specified device have been created or destroyed
|
||||
as requested, and for an add operation, the new handles are
|
||||
returned in ChildHandleBuffer.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@@ -1986,11 +2002,12 @@ PciHotPlugRequestNotify (
|
||||
|
||||
/**
|
||||
Search hostbridge according to given handle
|
||||
|
||||
@param RootBridgeHandle - Host bridge handle.
|
||||
|
||||
@return TRUE Found.
|
||||
@return FALSE Not found.
|
||||
@param RootBridgeHandle Host bridge handle.
|
||||
|
||||
@retval TRUE Found host bridge handle.
|
||||
@retval FALSE Not found hot bridge handle.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
SearchHostBridgeHandle (
|
||||
@@ -2029,9 +2046,14 @@ SearchHostBridgeHandle (
|
||||
}
|
||||
|
||||
/**
|
||||
Add host bridge handle to global variable for enumating.
|
||||
|
||||
@param HostBridgeHandle host bridge handle.
|
||||
Add host bridge handle to global variable for enumerating.
|
||||
|
||||
@param HostBridgeHandle Host bridge handle.
|
||||
|
||||
@retval EFI_SUCCESS Successfully added host bridge.
|
||||
@retval EFI_ABORTED Host bridge is NULL, or given host bridge
|
||||
has been in host bridge list.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
AddHostBridgeEnumerator (
|
||||
|
Reference in New Issue
Block a user