diff options
5 files changed, 321 insertions, 321 deletions
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc index b24d0969e0..d01b3e9c84 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc +++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc @@ -71,7 +71,7 @@ RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVirtualizationPkg/Include
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVirtualizationPkg/Include
GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVirtualizationPkg/Include
-
+
################################################################################
#
# Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/BaseCachingPciExpressLib/PciExpressLib.c b/ArmPlatformPkg/ArmVirtualizationPkg/Library/BaseCachingPciExpressLib/PciExpressLib.c index f2eb03894d..6479f53b37 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/Library/BaseCachingPciExpressLib/PciExpressLib.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/Library/BaseCachingPciExpressLib/PciExpressLib.c @@ -37,20 +37,20 @@ ASSERT (((A) & ~0xfffffff) == 0)
/**
- Registers a PCI device so PCI configuration registers may be accessed after
+ Registers a PCI device so PCI configuration registers may be accessed after
SetVirtualAddressMap().
-
- Registers the PCI device specified by Address so all the PCI configuration
- registers associated with that PCI device may be accessed after SetVirtualAddressMap()
+
+ Registers the PCI device specified by Address so all the PCI configuration
+ registers associated with that PCI device may be accessed after SetVirtualAddressMap()
is called.
-
+
If Address > 0x0FFFFFFF, then ASSERT().
@param Address The address that encodes the PCI Bus, Device, Function and
Register.
-
+
@retval RETURN_SUCCESS The PCI device was registered for runtime access.
- @retval RETURN_UNSUPPORTED An attempt was made to call this function
+ @retval RETURN_UNSUPPORTED An attempt was made to call this function
after ExitBootServices().
@retval RETURN_UNSUPPORTED The resources required to access the PCI device
at runtime could not be mapped.
@@ -83,7 +83,7 @@ PciExpressLibInitialize ( /**
Gets the base address of PCI Express.
-
+
@return The base address of PCI Express.
**/
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c index 6332f79cbc..928cd7035f 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c @@ -10,7 +10,7 @@ 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 "PciHostBridge.h"
@@ -39,7 +39,7 @@ EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath[1][1] = { EISA_PNP_ID(0x0A03),
0
},
-
+
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
@@ -103,14 +103,14 @@ InitializePciHostBridge ( UINTN Loop2;
PCI_HOST_BRIDGE_INSTANCE *HostBridge;
PCI_ROOT_BRIDGE_INSTANCE *PrivateData;
-
+
if (PcdGet64 (PcdPciExpressBaseAddress) == 0) {
DEBUG ((EFI_D_INFO, "%a: PCI host bridge not present\n", __FUNCTION__));
return EFI_ABORTED;
}
mDriverImageHandle = ImageHandle;
-
+
mResAperture[0][0].BusBase = PcdGet32 (PcdPciBusMin);
mResAperture[0][0].BusLimit = PcdGet32 (PcdPciBusMax);
@@ -167,12 +167,12 @@ InitializePciHostBridge ( if (HostBridge == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
HostBridge->RootBridgeNumber = RootBridgeNumber[Loop1];
InitializeListHead (&HostBridge->Head);
Status = gBS->InstallMultipleProtocolInterfaces (
- &HostBridge->HostBridgeHandle,
+ &HostBridge->HostBridgeHandle,
&gEfiPciHostBridgeResourceAllocationProtocolGuid, &HostBridge->ResAlloc,
NULL
);
@@ -180,11 +180,11 @@ InitializePciHostBridge ( FreePool (HostBridge);
return EFI_DEVICE_ERROR;
}
-
+
//
// Create Root Bridge Device Handle in this Host Bridge
//
-
+
for (Loop2 = 0; Loop2 < HostBridge->RootBridgeNumber; Loop2++) {
PrivateData = AllocateZeroPool (sizeof(PCI_ROOT_BRIDGE_INSTANCE));
if (PrivateData == NULL) {
@@ -195,14 +195,14 @@ InitializePciHostBridge ( PrivateData->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)&mEfiPciRootBridgeDevicePath[Loop1][Loop2];
RootBridgeConstructor (
- &PrivateData->Io,
- HostBridge->HostBridgeHandle,
- RootBridgeAttribute[Loop1][Loop2],
+ &PrivateData->Io,
+ HostBridge->HostBridgeHandle,
+ RootBridgeAttribute[Loop1][Loop2],
&mResAperture[Loop1][Loop2]
);
-
+
Status = gBS->InstallMultipleProtocolInterfaces(
- &PrivateData->Handle,
+ &PrivateData->Handle,
&gEfiDevicePathProtocolGuid, PrivateData->DevicePath,
&gEfiPciRootBridgeIoProtocolGuid, &PrivateData->Io,
NULL
@@ -211,10 +211,10 @@ InitializePciHostBridge ( FreePool(PrivateData);
return EFI_DEVICE_ERROR;
}
-
+
InsertTailList (&HostBridge->Head, &PrivateData->Link);
}
- }
+ }
return EFI_SUCCESS;
}
@@ -300,18 +300,18 @@ NotifyPhase( UINTN BitsOfAlignment;
EFI_STATUS Status;
EFI_STATUS ReturnStatus;
-
+
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
-
+
switch (Phase) {
case EfiPciHostBridgeBeginEnumeration:
if (HostBridgeInstance->CanRestarted) {
//
- // Reset the Each Root Bridge
+ // Reset the Each Root Bridge
//
List = HostBridgeInstance->Head.ForwardLink;
-
+
while (List != &HostBridgeInstance->Head) {
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
for (Index = TypeIo; Index < TypeMax; Index++) {
@@ -320,18 +320,18 @@ NotifyPhase( RootBridgeInstance->ResAllocNode[Index].Length = 0;
RootBridgeInstance->ResAllocNode[Index].Status = ResNone;
}
-
+
List = List->ForwardLink;
}
-
+
HostBridgeInstance->ResourceSubmited = FALSE;
HostBridgeInstance->CanRestarted = TRUE;
} else {
//
// Can not restart
- //
+ //
return EFI_NOT_READY;
- }
+ }
break;
case EfiPciHostBridgeEndEnumeration:
@@ -362,7 +362,7 @@ NotifyPhase( ReturnStatus = EFI_SUCCESS;
if (HostBridgeInstance->ResourceSubmited) {
//
- // Take care of the resource dependencies between the root bridges
+ // Take care of the resource dependencies between the root bridges
//
List = HostBridgeInstance->Head.ForwardLink;
@@ -370,17 +370,17 @@ NotifyPhase( RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
for (Index = TypeIo; Index < TypeBus; Index++) {
if (RootBridgeInstance->ResAllocNode[Index].Status != ResNone) {
-
+
AddrLen = RootBridgeInstance->ResAllocNode[Index].Length;
-
+
//
// Get the number of '1' in Alignment.
//
BitsOfAlignment = (UINTN) (HighBitSet64 (RootBridgeInstance->ResAllocNode[Index].Alignment) + 1);
-
+
switch (Index) {
- case TypeIo:
+ case TypeIo:
//
// It is impossible for this chipset to align 0xFFFF for IO16
// So clear it
@@ -388,23 +388,23 @@ NotifyPhase( if (BitsOfAlignment >= 16) {
BitsOfAlignment = 0;
}
-
+
BaseAddress = mResAperture[0][0].IoLimit;
Status = gDS->AllocateIoSpace (
EfiGcdAllocateMaxAddressSearchTopDown,
- EfiGcdIoTypeIo,
+ EfiGcdIoTypeIo,
BitsOfAlignment,
AddrLen,
&BaseAddress,
mDriverImageHandle,
NULL
);
-
+
if (!EFI_ERROR (Status)) {
RootBridgeInstance->ResAllocNode[Index].Base = (UINTN)BaseAddress;
- RootBridgeInstance->ResAllocNode[Index].Status = ResAllocated;
+ RootBridgeInstance->ResAllocNode[Index].Status = ResAllocated;
} else {
- ReturnStatus = Status;
+ ReturnStatus = Status;
if (Status != EFI_OUT_OF_RESOURCES) {
RootBridgeInstance->ResAllocNode[Index].Length = 0;
}
@@ -416,55 +416,55 @@ NotifyPhase( case TypeMem32:
//
// It is impossible for this chipset to align 0xFFFFFFFF for Mem32
- // So clear it
+ // So clear it
//
-
+
if (BitsOfAlignment >= 32) {
BitsOfAlignment = 0;
}
-
+
BaseAddress = mResAperture[0][0].MemLimit;
Status = gDS->AllocateMemorySpace (
EfiGcdAllocateMaxAddressSearchTopDown,
- EfiGcdMemoryTypeMemoryMappedIo,
+ EfiGcdMemoryTypeMemoryMappedIo,
BitsOfAlignment,
AddrLen,
&BaseAddress,
mDriverImageHandle,
NULL
);
-
+
if (!EFI_ERROR (Status)) {
// We were able to allocate the PCI memory
RootBridgeInstance->ResAllocNode[Index].Base = (UINTN)BaseAddress;
RootBridgeInstance->ResAllocNode[Index].Status = ResAllocated;
-
+
} else {
// Not able to allocate enough PCI memory
- ReturnStatus = Status;
-
+ ReturnStatus = Status;
+
if (Status != EFI_OUT_OF_RESOURCES) {
RootBridgeInstance->ResAllocNode[Index].Length = 0;
- }
+ }
ASSERT (FALSE);
}
break;
-
- case TypePMem32:
- case TypeMem64:
+
+ case TypePMem32:
+ case TypeMem64:
case TypePMem64:
ReturnStatus = EFI_ABORTED;
- break;
+ break;
default:
ASSERT (FALSE);
break;
}; //end switch
}
}
-
+
List = List->ForwardLink;
}
-
+
return ReturnStatus;
} else {
@@ -486,8 +486,8 @@ NotifyPhase( BaseAddress = RootBridgeInstance->ResAllocNode[Index].Base;
switch (Index) {
- case TypeIo:
- Status = gDS->FreeIoSpace (BaseAddress, AddrLen);
+ case TypeIo:
+ Status = gDS->FreeIoSpace (BaseAddress, AddrLen);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
@@ -507,7 +507,7 @@ NotifyPhase( break;
case TypePMem64:
- break;
+ break;
default:
ASSERT (FALSE);
@@ -520,12 +520,12 @@ NotifyPhase( RootBridgeInstance->ResAllocNode[Index].Status = ResNone;
}
}
-
+
List = List->ForwardLink;
}
-
+
HostBridgeInstance->ResourceSubmited = FALSE;
- HostBridgeInstance->CanRestarted = TRUE;
+ HostBridgeInstance->CanRestarted = TRUE;
return ReturnStatus;
case EfiPciHostBridgeEndResourceAllocation:
@@ -535,8 +535,8 @@ NotifyPhase( default:
return EFI_INVALID_PARAMETER;
}
-
- return EFI_SUCCESS;
+
+ return EFI_SUCCESS;
}
/**
@@ -554,9 +554,9 @@ NotifyPhase( @param[in] This The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
@param[in, out] RootBridgeHandle Returns the device handle of the next PCI root bridge.
-
+
@retval EFI_SUCCESS If parameter RootBridgeHandle = NULL, then return the first Rootbridge handle of the
- specific Host bridge and return EFI_SUCCESS.
+ specific Host bridge and return EFI_SUCCESS.
@retval EFI_NOT_FOUND Can not find the any more root bridge in specific host bridge.
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not an EFI_HANDLE that was
returned on a previous call to GetNextRootBridge().
@@ -568,16 +568,16 @@ GetNextRootBridge( IN OUT EFI_HANDLE *RootBridgeHandle
)
{
- BOOLEAN NoRootBridge;
- LIST_ENTRY *List;
+ BOOLEAN NoRootBridge;
+ LIST_ENTRY *List;
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
-
+
NoRootBridge = TRUE;
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
-
-
+
+
while (List != &HostBridgeInstance->Head) {
NoRootBridge = FALSE;
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
@@ -596,16 +596,16 @@ GetNextRootBridge( if (List!=&HostBridgeInstance->Head) {
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
*RootBridgeHandle = RootBridgeInstance->Handle;
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
} else {
return EFI_NOT_FOUND;
}
}
}
-
+
List = List->ForwardLink;
} //end while
-
+
if (NoRootBridge) {
return EFI_NOT_FOUND;
} else {
@@ -623,11 +623,11 @@ GetNextRootBridge( handles of all the root bridges that are associated with this host bridge must be obtained by calling
GetNextRootBridge(). The attributes are static in the sense that they do not change during or
after the enumeration process. The hardware may provide mechanisms to change the attributes on
- the fly, but such changes must be completed before EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is
+ the fly, but such changes must be completed before EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is
installed. The permitted values of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES are defined in
"Related Definitions" below. The caller uses these attributes to combine multiple resource requests.
- For example, if the flag EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM is set, the PCI bus enumerator needs to
- include requests for the prefetchable memory in the nonprefetchable memory pool and not request any
+ For example, if the flag EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM is set, the PCI bus enumerator needs to
+ include requests for the prefetchable memory in the nonprefetchable memory pool and not request any
prefetchable memory.
Attribute Description
------------------------------------ ----------------------------------------------------------------------
@@ -645,7 +645,7 @@ GetNextRootBridge( @param[in] RootBridgeHandle The device handle of the PCI root bridge in which the caller is interested. Type
EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
@param[out] Attributes The pointer to attribte of root bridge, it is output parameter
-
+
@retval EFI_INVALID_PARAMETER Attribute pointer is NULL
@retval EFI_INVALID_PARAMETER RootBridgehandle is invalid.
@retval EFI_SUCCESS Success to get attribute of interested root bridge.
@@ -659,17 +659,17 @@ GetAttributes( OUT UINT64 *Attributes
)
{
- LIST_ENTRY *List;
+ LIST_ENTRY *List;
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
-
+
if (Attributes == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
-
+
while (List != &HostBridgeInstance->Head) {
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
if (RootBridgeHandle == RootBridgeInstance->Handle) {
@@ -678,9 +678,9 @@ GetAttributes( }
List = List->ForwardLink;
}
-
+
//
- // RootBridgeHandle is not an EFI_HANDLE
+ // RootBridgeHandle is not an EFI_HANDLE
// that was returned on a previous call to GetNextRootBridge()
//
return EFI_INVALID_PARAMETER;
@@ -695,7 +695,7 @@ GetAttributes( @param[in] This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance.
@param[in] RootBridgeHandle The PCI Root Bridge to be set up.
@param[out] Configuration Pointer to the pointer to the PCI bus resource descriptor.
-
+
@retval EFI_INVALID_PARAMETER Invalid Root bridge's handle
@retval EFI_OUT_OF_RESOURCES Fail to allocate ACPI resource descriptor tag.
@retval EFI_SUCCESS Sucess to allocate ACPI resource descriptor.
@@ -709,17 +709,17 @@ StartBusEnumeration( OUT VOID **Configuration
)
{
- LIST_ENTRY *List;
+ LIST_ENTRY *List;
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
VOID *Buffer;
UINT8 *Temp;
UINT64 BusStart;
UINT64 BusEnd;
-
+
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
-
+
while (List != &HostBridgeInstance->Head) {
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
if (RootBridgeHandle == RootBridgeInstance->Handle) {
@@ -731,35 +731,35 @@ StartBusEnumeration( //
// Program the Hardware(if needed) if error return EFI_DEVICE_ERROR
//
-
+
Buffer = AllocatePool (sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof(EFI_ACPI_END_TAG_DESCRIPTOR));
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
Temp = (UINT8 *)Buffer;
-
+
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->Desc = 0x8A;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->Len = 0x2B;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->ResType = 2;
- ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->GenFlag = 0;
+ ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->GenFlag = 0;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->SpecificFlag = 0;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->AddrSpaceGranularity = 0;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->AddrRangeMin = BusStart;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->AddrRangeMax = 0;
- ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->AddrTranslationOffset = 0;
+ ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->AddrTranslationOffset = 0;
((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Temp)->AddrLen = BusEnd - BusStart + 1;
-
+
Temp = Temp + sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);
- ((EFI_ACPI_END_TAG_DESCRIPTOR *)Temp)->Desc = 0x79;
+ ((EFI_ACPI_END_TAG_DESCRIPTOR *)Temp)->Desc = 0x79;
((EFI_ACPI_END_TAG_DESCRIPTOR *)Temp)->Checksum = 0x0;
-
- *Configuration = Buffer;
+
+ *Configuration = Buffer;
return EFI_SUCCESS;
}
List = List->ForwardLink;
}
-
+
return EFI_INVALID_PARAMETER;
}
@@ -773,12 +773,12 @@ StartBusEnumeration( @param[in] This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param[in] RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed
@param[in] Configuration The pointer to the PCI bus resource descriptor
-
+
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
@retval EFI_INVALID_PARAMETER Configuration is NULL.
@retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI 2.0 resource descriptor.
@retval EFI_INVALID_PARAMETER Configuration does not include a valid ACPI 2.0 bus resource descriptor.
- @retval EFI_INVALID_PARAMETER Configuration includes valid ACPI 2.0 resource descriptors other than
+ @retval EFI_INVALID_PARAMETER Configuration includes valid ACPI 2.0 resource descriptors other than
bus descriptors.
@retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptors.
@retval EFI_INVALID_PARAMETER "Address Range Minimum" is invalid for this root bridge.
@@ -795,27 +795,27 @@ SetBusNumbers( IN VOID *Configuration
)
{
- LIST_ENTRY *List;
+ LIST_ENTRY *List;
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
UINT8 *Ptr;
UINTN BusStart;
UINTN BusEnd;
UINTN BusLen;
-
+
if (Configuration == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
Ptr = Configuration;
-
+
//
// Check the Configuration is valid
//
if(*Ptr != ACPI_ADDRESS_SPACE_DESCRIPTOR) {
return EFI_INVALID_PARAMETER;
}
-
+
if (((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Ptr)->ResType != 2) {
return EFI_INVALID_PARAMETER;
}
@@ -824,44 +824,44 @@ SetBusNumbers( if (*Ptr != ACPI_END_TAG_DESCRIPTOR) {
return EFI_INVALID_PARAMETER;
}
-
+
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
-
+
Ptr = Configuration;
-
+
while (List != &HostBridgeInstance->Head) {
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
if (RootBridgeHandle == RootBridgeInstance->Handle) {
BusStart = (UINTN)((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Ptr)->AddrRangeMin;
BusLen = (UINTN)((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Ptr)->AddrLen;
BusEnd = BusStart + BusLen - 1;
-
+
if (BusStart > BusEnd) {
return EFI_INVALID_PARAMETER;
}
-
+
if ((BusStart < RootBridgeInstance->BusBase) || (BusEnd > RootBridgeInstance->BusLimit)) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// Update the Bus Range
//
RootBridgeInstance->ResAllocNode[TypeBus].Base = BusStart;
RootBridgeInstance->ResAllocNode[TypeBus].Length = BusLen;
RootBridgeInstance->ResAllocNode[TypeBus].Status = ResAllocated;
-
+
//
// Program the Root Bridge Hardware
//
-
+
return EFI_SUCCESS;
}
-
+
List = List->ForwardLink;
}
-
+
return EFI_INVALID_PARAMETER;
}
@@ -877,13 +877,13 @@ SetBusNumbers( @param[in] This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
@param[in] RootBridgeHandle The PCI root bridge whose I/O and memory resource requirements are being submitted.
@param[in] Configuration The pointer to the PCI I/O and PCI memory resource descriptor.
-
+
@retval EFI_SUCCESS The I/O and memory resource requests for a PCI root bridge were accepted.
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
@retval EFI_INVALID_PARAMETER Configuration is NULL.
@retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI 2.0 resource descriptor.
- @retval EFI_INVALID_PARAMETER Configuration includes requests for one or more resource types that are
- not supported by this PCI root bridge. This error will happen if the caller
+ @retval EFI_INVALID_PARAMETER Configuration includes requests for one or more resource types that are
+ not supported by this PCI root bridge. This error will happen if the caller
did not combine resources according to Attributes that were returned by
GetAllocAttributes().
@retval EFI_INVALID_PARAMETER Address Range Maximum" is invalid.
@@ -899,32 +899,32 @@ SubmitResources( IN VOID *Configuration
)
{
- LIST_ENTRY *List;
+ LIST_ENTRY *List;
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
UINT8 *Temp;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;
UINT64 AddrLen;
UINT64 Alignment;
-
+
//
// Check the input parameter: Configuration
//
if (Configuration == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
-
+
Temp = (UINT8 *)Configuration;
- while ( *Temp == 0x8A) {
+ while ( *Temp == 0x8A) {
Temp += sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) ;
}
if (*Temp != 0x79) {
return EFI_INVALID_PARAMETER;
}
-
+
Temp = (UINT8 *)Configuration;
while (List != &HostBridgeInstance->Head) {
RootBridgeInstance = DRIVER_INSTANCE_FROM_LIST_ENTRY (List);
@@ -952,18 +952,18 @@ SubmitResources( if (Ptr->AddrRangeMax >= 0xffffffff || Ptr->AddrRangeMax != (GetPowerOfTwo64 (Ptr->AddrRangeMax + 1) - 1)) {
return EFI_INVALID_PARAMETER;
}
-
+
switch (Ptr->ResType) {
case 0:
-
+
//
// Check invalid Address Sapce Granularity
//
if (Ptr->AddrSpaceGranularity != 32) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// check the memory resource request is supported by PCI root bridge
//
@@ -971,7 +971,7 @@ SubmitResources( Ptr->SpecificFlag == 0x06) {
return EFI_INVALID_PARAMETER;
}
-
+
AddrLen = Ptr->AddrLen;
Alignment = Ptr->AddrRangeMax;
if (Ptr->AddrSpaceGranularity == 32) {
@@ -983,7 +983,7 @@ SubmitResources( } else {
RootBridgeInstance->ResAllocNode[TypeMem32].Length = AddrLen;
RootBridgeInstance->ResAllocNode[TypeMem32].Alignment = Alignment;
- RootBridgeInstance->ResAllocNode[TypeMem32].Status = ResRequested;
+ RootBridgeInstance->ResAllocNode[TypeMem32].Status = ResRequested;
HostBridgeInstance->ResourceSubmited = TRUE;
}
}
@@ -1003,20 +1003,20 @@ SubmitResources( RootBridgeInstance->ResAllocNode[TypeIo].Length = AddrLen;
RootBridgeInstance->ResAllocNode[TypeIo].Alignment = Alignment;
RootBridgeInstance->ResAllocNode[TypeIo].Status = ResRequested;
- HostBridgeInstance->ResourceSubmited = TRUE;
+ HostBridgeInstance->ResourceSubmited = TRUE;
break;
default:
break;
};
- }
-
+ }
+
return EFI_SUCCESS;
}
-
+
List = List->ForwardLink;
}
-
+
return EFI_INVALID_PARAMETER;
}
@@ -1033,7 +1033,7 @@ SubmitResources( @param[in] This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
@param[in] RootBridgeHandle The PCI root bridge handle. Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
@param[out] Configuration The pointer to the pointer to the PCI I/O and memory resource descriptor.
-
+
@retval EFI_SUCCESS The requested parameters were returned.
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
@retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
@@ -1048,16 +1048,16 @@ GetProposedResources( OUT VOID **Configuration
)
{
- LIST_ENTRY *List;
+ LIST_ENTRY *List;
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
UINTN Index;
- UINTN Number;
- VOID *Buffer;
+ UINTN Number;
+ VOID *Buffer;
UINT8 *Temp;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;
UINT64 ResStatus;
-
+
Buffer = NULL;
Number = 0;
//
@@ -1065,7 +1065,7 @@ GetProposedResources( //
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
-
+
//
// Enumerate the root bridges in this host bridge
//
@@ -1075,9 +1075,9 @@ GetProposedResources( for (Index = 0; Index < TypeBus; Index ++) {
if (RootBridgeInstance->ResAllocNode[Index].Status != ResNone) {
Number ++;
- }
+ }
}
-
+
if (Number == 0) {
EFI_ACPI_END_TAG_DESCRIPTOR *End;
@@ -1094,13 +1094,13 @@ GetProposedResources( if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
Temp = Buffer;
for (Index = 0; Index < TypeBus; Index ++) {
if (RootBridgeInstance->ResAllocNode[Index].Status != ResNone) {
Ptr = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *) Temp ;
ResStatus = RootBridgeInstance->ResAllocNode[Index].Status;
-
+
switch (Index) {
case TypeIo:
@@ -1110,7 +1110,7 @@ GetProposedResources( Ptr->Desc = 0x8A;
Ptr->Len = 0x2B;
Ptr->ResType = 1;
- Ptr->GenFlag = 0;
+ Ptr->GenFlag = 0;
Ptr->SpecificFlag = 0;
Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base;
Ptr->AddrRangeMax = 0;
@@ -1122,17 +1122,17 @@ GetProposedResources( case TypeMem32:
//
// Memory 32
- //
+ //
Ptr->Desc = 0x8A;
Ptr->Len = 0x2B;
Ptr->ResType = 0;
- Ptr->GenFlag = 0;
+ Ptr->GenFlag = 0;
Ptr->SpecificFlag = 0;
Ptr->AddrSpaceGranularity = 32;
Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base;
Ptr->AddrRangeMax = 0;
Ptr->AddrTranslationOffset = \
- (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : EFI_RESOURCE_LESS;
+ (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : EFI_RESOURCE_LESS;
Ptr->AddrLen = RootBridgeInstance->ResAllocNode[Index].Length;
break;
@@ -1143,12 +1143,12 @@ GetProposedResources( Ptr->Desc = 0x8A;
Ptr->Len = 0x2B;
Ptr->ResType = 0;
- Ptr->GenFlag = 0;
+ Ptr->GenFlag = 0;
Ptr->SpecificFlag = 6;
Ptr->AddrSpaceGranularity = 32;
Ptr->AddrRangeMin = 0;
Ptr->AddrRangeMax = 0;
- Ptr->AddrTranslationOffset = EFI_RESOURCE_NONEXISTENT;
+ Ptr->AddrTranslationOffset = EFI_RESOURCE_NONEXISTENT;
Ptr->AddrLen = 0;
break;
@@ -1159,12 +1159,12 @@ GetProposedResources( Ptr->Desc = 0x8A;
Ptr->Len = 0x2B;
Ptr->ResType = 0;
- Ptr->GenFlag = 0;
+ Ptr->GenFlag = 0;
Ptr->SpecificFlag = 0;
Ptr->AddrSpaceGranularity = 64;
Ptr->AddrRangeMin = 0;
Ptr->AddrRangeMax = 0;
- Ptr->AddrTranslationOffset = EFI_RESOURCE_NONEXISTENT;
+ Ptr->AddrTranslationOffset = EFI_RESOURCE_NONEXISTENT;
Ptr->AddrLen = 0;
break;
@@ -1175,31 +1175,31 @@ GetProposedResources( Ptr->Desc = 0x8A;
Ptr->Len = 0x2B;
Ptr->ResType = 0;
- Ptr->GenFlag = 0;
+ Ptr->GenFlag = 0;
Ptr->SpecificFlag = 6;
Ptr->AddrSpaceGranularity = 64;
Ptr->AddrRangeMin = 0;
Ptr->AddrRangeMax = 0;
- Ptr->AddrTranslationOffset = EFI_RESOURCE_NONEXISTENT;
+ Ptr->AddrTranslationOffset = EFI_RESOURCE_NONEXISTENT;
Ptr->AddrLen = 0;
break;
};
-
+
Temp += sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);
- }
+ }
}
-
- ((EFI_ACPI_END_TAG_DESCRIPTOR *)Temp)->Desc = 0x79;
+
+ ((EFI_ACPI_END_TAG_DESCRIPTOR *)Temp)->Desc = 0x79;
((EFI_ACPI_END_TAG_DESCRIPTOR *)Temp)->Checksum = 0x0;
-
- *Configuration = Buffer;
-
+
+ *Configuration = Buffer;
+
return EFI_SUCCESS;
}
-
+
List = List->ForwardLink;
}
-
+
return EFI_INVALID_PARAMETER;
}
@@ -1219,8 +1219,8 @@ GetProposedResources( EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL member functions to access the PCI
configuration space of the device. See Table 12-1 in the UEFI 2.0 Specification for
the definition of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS.
- @param Phase The phase of the PCI device enumeration.
-
+ @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
@@ -1241,7 +1241,7 @@ PreprocessController ( {
PCI_HOST_BRIDGE_INSTANCE *HostBridgeInstance;
PCI_ROOT_BRIDGE_INSTANCE *RootBridgeInstance;
- LIST_ENTRY *List;
+ LIST_ENTRY *List;
HostBridgeInstance = INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This);
List = HostBridgeInstance->Head.ForwardLink;
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.h b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.h index cbceca4bcf..8161b546ff 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.h +++ b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.h @@ -1,16 +1,16 @@ /** @file
- The Header file of the Pci Host Bridge Driver
+ The Header file of the Pci Host Bridge Driver
Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
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.
-**/
+**/
#ifndef _PCI_HOST_BRIDGE_H_
#define _PCI_HOST_BRIDGE_H_
@@ -60,14 +60,14 @@ typedef struct { EFI_HANDLE HostBridgeHandle;
UINTN RootBridgeNumber;
LIST_ENTRY Head;
- BOOLEAN ResourceSubmited;
- BOOLEAN CanRestarted;
+ BOOLEAN ResourceSubmited;
+ BOOLEAN CanRestarted;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL ResAlloc;
} PCI_HOST_BRIDGE_INSTANCE;
#define INSTANCE_FROM_RESOURCE_ALLOCATION_THIS(a) \
CR(a, PCI_HOST_BRIDGE_INSTANCE, ResAlloc, PCI_HOST_BRIDGE_SIGNATURE)
-
+
//
// HostBridge Resource Allocation interface
//
@@ -158,9 +158,9 @@ NotifyPhase( @param[in] This The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
@param[in, out] RootBridgeHandle Returns the device handle of the next PCI root bridge.
-
+
@retval EFI_SUCCESS If parameter RootBridgeHandle = NULL, then return the first Rootbridge handle of the
- specific Host bridge and return EFI_SUCCESS.
+ specific Host bridge and return EFI_SUCCESS.
@retval EFI_NOT_FOUND Can not find the any more root bridge in specific host bridge.
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not an EFI_HANDLE that was
returned on a previous call to GetNextRootBridge().
@@ -171,7 +171,7 @@ GetNextRootBridge( IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN OUT EFI_HANDLE *RootBridgeHandle
);
-
+
/**
Returns the allocation attributes of a PCI root bridge.
@@ -182,11 +182,11 @@ GetNextRootBridge( handles of all the root bridges that are associated with this host bridge must be obtained by calling
GetNextRootBridge(). The attributes are static in the sense that they do not change during or
after the enumeration process. The hardware may provide mechanisms to change the attributes on
- the fly, but such changes must be completed before EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is
+ the fly, but such changes must be completed before EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is
installed. The permitted values of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES are defined in
"Related Definitions" below. The caller uses these attributes to combine multiple resource requests.
- For example, if the flag EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM is set, the PCI bus enumerator needs to
- include requests for the prefetchable memory in the nonprefetchable memory pool and not request any
+ For example, if the flag EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM is set, the PCI bus enumerator needs to
+ include requests for the prefetchable memory in the nonprefetchable memory pool and not request any
prefetchable memory.
Attribute Description
------------------------------------ ----------------------------------------------------------------------
@@ -204,12 +204,12 @@ GetNextRootBridge( @param[in] RootBridgeHandle The device handle of the PCI root bridge in which the caller is interested. Type
EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
@param[out] Attributes The pointer to attribte of root bridge, it is output parameter
-
+
@retval EFI_INVALID_PARAMETER Attribute pointer is NULL
@retval EFI_INVALID_PARAMETER RootBridgehandle is invalid.
@retval EFI_SUCCESS Success to get attribute of interested root bridge.
-**/
+**/
EFI_STATUS
EFIAPI
GetAttributes(
@@ -217,7 +217,7 @@ GetAttributes( IN EFI_HANDLE RootBridgeHandle,
OUT UINT64 *Attributes
);
-
+
/**
Sets up the specified PCI root bridge for the bus enumeration process.
@@ -227,7 +227,7 @@ GetAttributes( @param[in] This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance.
@param[in] RootBridgeHandle The PCI Root Bridge to be set up.
@param[out] Configuration Pointer to the pointer to the PCI bus resource descriptor.
-
+
@retval EFI_INVALID_PARAMETER Invalid Root bridge's handle
@retval EFI_OUT_OF_RESOURCES Fail to allocate ACPI resource descriptor tag.
@retval EFI_SUCCESS Sucess to allocate ACPI resource descriptor.
@@ -240,7 +240,7 @@ StartBusEnumeration( IN EFI_HANDLE RootBridgeHandle,
OUT VOID **Configuration
);
-
+
/**
Programs the PCI root bridge hardware so that it decodes the specified PCI bus range.
@@ -251,12 +251,12 @@ StartBusEnumeration( @param[in] This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param[in] RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed
@param[in] Configuration The pointer to the PCI bus resource descriptor
-
+
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
@retval EFI_INVALID_PARAMETER Configuration is NULL.
@retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI 2.0 resource descriptor.
@retval EFI_INVALID_PARAMETER Configuration does not include a valid ACPI 2.0 bus resource descriptor.
- @retval EFI_INVALID_PARAMETER Configuration includes valid ACPI 2.0 resource descriptors other than
+ @retval EFI_INVALID_PARAMETER Configuration includes valid ACPI 2.0 resource descriptors other than
bus descriptors.
@retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptors.
@retval EFI_INVALID_PARAMETER "Address Range Minimum" is invalid for this root bridge.
@@ -272,7 +272,7 @@ SetBusNumbers( IN EFI_HANDLE RootBridgeHandle,
IN VOID *Configuration
);
-
+
/**
Submits the I/O and memory resource requirements for the specified PCI root bridge.
@@ -284,13 +284,13 @@ SetBusNumbers( @param[in] This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
@param[in] RootBridgeHandle The PCI root bridge whose I/O and memory resource requirements are being submitted.
@param[in] Configuration The pointer to the PCI I/O and PCI memory resource descriptor.
-
+
@retval EFI_SUCCESS The I/O and memory resource requests for a PCI root bridge were accepted.
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
@retval EFI_INVALID_PARAMETER Configuration is NULL.
@retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI 2.0 resource descriptor.
- @retval EFI_INVALID_PARAMETER Configuration includes requests for one or more resource types that are
- not supported by this PCI root bridge. This error will happen if the caller
+ @retval EFI_INVALID_PARAMETER Configuration includes requests for one or more resource types that are
+ not supported by this PCI root bridge. This error will happen if the caller
did not combine resources according to Attributes that were returned by
GetAllocAttributes().
@retval EFI_INVALID_PARAMETER Address Range Maximum" is invalid.
@@ -305,7 +305,7 @@ SubmitResources( IN EFI_HANDLE RootBridgeHandle,
IN VOID *Configuration
);
-
+
/**
Returns the proposed resource settings for the specified PCI root bridge.
@@ -319,7 +319,7 @@ SubmitResources( @param[in] This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
@param[in] RootBridgeHandle The PCI root bridge handle. Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
@param[out] Configuration The pointer to the pointer to the PCI I/O and memory resource descriptor.
-
+
@retval EFI_SUCCESS The requested parameters were returned.
@retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
@retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
@@ -350,8 +350,8 @@ GetProposedResources( EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL member functions to access the PCI
configuration space of the device. See Table 12-1 in the UEFI 2.0 Specification for
the definition of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS.
- @param Phase The phase of the PCI device enumeration.
-
+ @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
@@ -372,7 +372,7 @@ PreprocessController ( //
-// Define resource status constant
+// Define resource status constant
//
#define EFI_RESOURCE_NONEXISTENT 0xFFFFFFFFFFFFFFFFULL
#define EFI_RESOURCE_LESS 0xFFFFFFFFFFFFFFFEULL
@@ -397,13 +397,13 @@ typedef struct { typedef struct {
UINT64 BusBase;
- UINT64 BusLimit;
-
- UINT64 MemBase;
- UINT64 MemLimit;
-
- UINT64 IoBase;
- UINT64 IoLimit;
+ UINT64 BusLimit;
+
+ UINT64 MemBase;
+ UINT64 MemLimit;
+
+ UINT64 IoBase;
+ UINT64 IoLimit;
UINT64 IoTranslation;
} PCI_ROOT_BRIDGE_RESOURCE_APERTURE;
@@ -442,21 +442,21 @@ typedef struct { UINT64 RootBridgeAttrib;
UINT64 Attributes;
UINT64 Supports;
-
+
//
// Specific for this memory controller: Bus, I/O, Mem
//
PCI_RES_NODE ResAllocNode[6];
-
+
//
// Addressing for Memory and I/O and Bus arrange
//
UINT64 BusBase;
- UINT64 MemBase;
- UINT64 IoBase;
- UINT64 BusLimit;
- UINT64 MemLimit;
- UINT64 IoLimit;
+ UINT64 MemBase;
+ UINT64 IoBase;
+ UINT64 BusLimit;
+ UINT64 MemLimit;
+ UINT64 IoLimit;
UINT64 IoTranslation;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciRootBridgeIo.c b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciRootBridgeIo.c index 8ff15734f4..c867887950 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciRootBridgeIo.c @@ -10,7 +10,7 @@ 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 "PciHostBridge.h"
@@ -21,7 +21,7 @@ typedef struct { RESOURCE_CONFIGURATION Configuration = {
{{0x8A, 0x2B, 1, 0, 0, 0, 0, 0, 0, 0},
- {0x8A, 0x2B, 0, 0, 0, 32, 0, 0, 0, 0},
+ {0x8A, 0x2B, 0, 0, 0, 32, 0, 0, 0, 0},
{0x8A, 0x2B, 0, 0, 6, 32, 0, 0, 0, 0},
{0x8A, 0x2B, 0, 0, 0, 64, 0, 0, 0, 0},
{0x8A, 0x2B, 0, 0, 6, 64, 0, 0, 0, 0},
@@ -34,8 +34,8 @@ RESOURCE_CONFIGURATION Configuration = { //
/**
- Polls an address in memory mapped I/O space until an exit condition is met, or
- a timeout occurs.
+ Polls an address in memory mapped I/O space until an exit condition is met, or
+ a timeout occurs.
This function provides a standard way to poll a PCI memory location. A PCI memory read
operation is performed at the PCI memory address specified by Address for the width specified
@@ -54,7 +54,7 @@ RESOURCE_CONFIGURATION Configuration = { @param[in] Delay The number of 100 ns units to poll. Note that timer available may
be of poorer granularity.
@param[out] Result Pointer to the last value read from the memory location.
-
+
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_INVALID_PARAMETER Width is invalid.
@retval EFI_INVALID_PARAMETER Result is NULL.
@@ -64,7 +64,7 @@ RESOURCE_CONFIGURATION Configuration = { **/
EFI_STATUS
EFIAPI
-RootBridgeIoPollMem (
+RootBridgeIoPollMem (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
@@ -73,7 +73,7 @@ RootBridgeIoPollMem ( IN UINT64 Delay,
OUT UINT64 *Result
);
-
+
/**
Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is
satisfied or after a defined duration.
@@ -95,7 +95,7 @@ RootBridgeIoPollMem ( @param[in] Delay The number of 100 ns units to poll. Note that timer available may
be of poorer granularity.
@param[out] Result Pointer to the last value read from the memory location.
-
+
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_INVALID_PARAMETER Width is invalid.
@retval EFI_INVALID_PARAMETER Result is NULL.
@@ -105,7 +105,7 @@ RootBridgeIoPollMem ( **/
EFI_STATUS
EFIAPI
-RootBridgeIoPollIo (
+RootBridgeIoPollIo (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
@@ -114,7 +114,7 @@ RootBridgeIoPollIo ( IN UINT64 Delay,
OUT UINT64 *Result
);
-
+
/**
Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.
@@ -131,7 +131,7 @@ RootBridgeIoPollIo ( Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -164,7 +164,7 @@ RootBridgeIoMemRead ( Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -191,7 +191,7 @@ RootBridgeIoMemWrite ( size * Count, starting at Address.
@param[out] UserBuffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -219,7 +219,7 @@ RootBridgeIoIoRead ( size * Count, starting at Address.
@param[in] UserBuffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -254,7 +254,7 @@ RootBridgeIoIoWrite ( responsible for aligning the SrcAddress if required.
@param[in] Count The number of memory operations to perform. Bytes moved is
Width size * Count, starting at DestAddress and SrcAddress.
-
+
@retval EFI_SUCCESS The data was copied from one memory region to another memory region.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@@ -286,7 +286,7 @@ RootBridgeIoCopyMem ( moved is Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -319,7 +319,7 @@ RootBridgeIoPciRead ( moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -350,7 +350,7 @@ RootBridgeIoPciWrite ( @param[out] DeviceAddress The resulting map address for the bus master PCI controller to use
to access the system memory's HostAddress.
@param[out] Mapping The value to pass to Unmap() when the bus master DMA operation is complete.
-
+
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
@retval EFI_INVALID_PARAMETER Operation is invalid.
@retval EFI_INVALID_PARAMETER HostAddress is NULL.
@@ -379,11 +379,11 @@ RootBridgeIoMap ( The Unmap() function completes the Map() operation and releases any corresponding resources.
If the operation was an EfiPciOperationBusMasterWrite or
EfiPciOperationBusMasterWrite64, the data is committed to the target system memory.
- Any resources used for the mapping are freed.
+ Any resources used for the mapping are freed.
@param[in] This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param[in] Mapping The mapping value returned from Map().
-
+
@retval EFI_SUCCESS The range was unmapped.
@retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
@@ -399,16 +399,16 @@ RootBridgeIoUnmap ( /**
Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or
EfiPciOperationBusMasterCommonBuffer64 mapping.
-
+
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Type This parameter is not used and must be ignored.
@param MemoryType The type of memory to allocate, EfiBootServicesData or EfiRuntimeServicesData.
@param Pages The number of pages to allocate.
@param HostAddress A pointer to store the base system memory address of the allocated range.
@param Attributes The requested bit mask of attributes for the allocated range. Only
- the attributes EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE, EFI_PCI_ATTRIBUTE_MEMORY_CACHED,
+ the attributes EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE, EFI_PCI_ATTRIBUTE_MEMORY_CACHED,
and EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE may be used with this function.
-
+
@retval EFI_SUCCESS The requested memory pages were allocated.
@retval EFI_INVALID_PARAMETER MemoryType is invalid.
@retval EFI_INVALID_PARAMETER HostAddress is NULL.
@@ -436,7 +436,7 @@ RootBridgeIoAllocateBuffer ( @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Pages The number of pages to free.
@param HostAddress The base system memory address of the allocated range.
-
+
@retval EFI_SUCCESS The requested memory pages were freed.
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
was not allocated with AllocateBuffer().
@@ -462,7 +462,7 @@ RootBridgeIoFreeBuffer ( a PCI read transaction from the PCI controller prior to calling Flush().
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
-
+
@retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
bridge to system memory.
@retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
@@ -477,7 +477,7 @@ RootBridgeIoFlush ( /**
Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the
- attributes that a PCI root bridge is currently using.
+ attributes that a PCI root bridge is currently using.
The GetAttributes() function returns the mask of attributes that this PCI root bridge supports
and the mask of attributes that the PCI root bridge is currently using.
@@ -487,7 +487,7 @@ RootBridgeIoFlush ( supports setting with SetAttributes().
@param Attributes A pointer to the mask of attributes that this PCI root bridge is
currently using.
-
+
@retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI root
bridge supports is returned in Supports. If Attributes is
not NULL, then the attributes that the PCI root bridge is currently
@@ -527,7 +527,7 @@ RootBridgeIoGetAttributes ( by the attributes specified by Attributes.
@param[in, out] ResourceLength A pointer to the length of the resource range to be modified by the
attributes specified by Attributes.
-
+
@retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in Resources.
@retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be retrieved.
@retval EFI_INVALID_PARAMETER Invalid pointer of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
@@ -539,8 +539,8 @@ RootBridgeIoSetAttributes ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN UINT64 Attributes,
IN OUT UINT64 *ResourceBase,
- IN OUT UINT64 *ResourceLength
- );
+ IN OUT UINT64 *ResourceLength
+ );
/**
Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI 2.0
@@ -559,7 +559,7 @@ RootBridgeIoSetAttributes ( ACPI 2.0 resource descriptors is allocated by this function. The
caller must treat the return buffer as read-only data, and the buffer
must not be freed by the caller.
-
+
@retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in Resources.
@retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be retrieved.
@retval EFI_INVALID_PARAMETER Invalid pointer of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
@@ -660,7 +660,7 @@ RootBridgeConstructor ( //
PrivateData->BusBase = ResAperture->BusBase;
PrivateData->BusLimit = ResAperture->BusLimit;
-
+
//
// Specific for this chipset
//
@@ -670,9 +670,9 @@ RootBridgeConstructor ( PrivateData->ResAllocNode[Index].Length = 0;
PrivateData->ResAllocNode[Index].Status = ResNone;
}
-
+
PrivateData->RootBridgeAttrib = Attri;
-
+
PrivateData->Supports = EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO | \
EFI_PCI_ATTRIBUTE_ISA_IO_16 | EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO | \
EFI_PCI_ATTRIBUTE_VGA_MEMORY | \
@@ -680,7 +680,7 @@ RootBridgeConstructor ( PrivateData->Attributes = PrivateData->Supports;
Protocol->ParentHandle = HostBridgeHandle;
-
+
Protocol->PollMem = RootBridgeIoPollMem;
Protocol->PollIo = RootBridgeIoPollIo;
@@ -719,17 +719,17 @@ RootBridgeConstructor ( /**
Check parameters for IO,MMIO,PCI read/write services of PCI Root Bridge IO.
- The I/O operations are carried out exactly as requested. The caller is responsible
- for satisfying any alignment and I/O width restrictions that a PI System on a
- platform might require. For example on some platforms, width requests of
- EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
+ The I/O operations are carried out exactly as requested. The caller is responsible
+ for satisfying any alignment and I/O width restrictions that a PI System on a
+ platform might require. For example on some platforms, width requests of
+ EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver.
-
+
@param[in] This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param[in] OperationType I/O operation type: IO/MMIO/PCI.
@param[in] Width Signifies the width of the I/O or Memory operation.
- @param[in] Address The base address of the I/O operation.
- @param[in] Count The number of I/O operations to perform. The number of
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data.
@@ -738,7 +738,7 @@ RootBridgeConstructor ( @retval EFI_INVALID_PARAMETER Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
- @retval EFI_UNSUPPORTED The address range specified by Address, Width,
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,
and Count is not valid for this PI system.
**/
@@ -800,14 +800,14 @@ RootBridgeIoCheckParameter ( PrivateData = DRIVER_INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS (This);
//
- // Check to see if any address associated with this transfer exceeds the maximum
+ // Check to see if any address associated with this transfer exceeds the maximum
// allowed address. The maximum address implied by the parameters passed in is
// Address + Size * Count. If the following condition is met, then the transfer
// is not supported.
//
// Address + Size * Count > Limit + 1
//
- // Since Limit can be the maximum integer value supported by the CPU and Count
+ // Since Limit can be the maximum integer value supported by the CPU and Count
// can also be the maximum integer value supported by the CPU, this range
// check must be adjusted to avoid all oveflow conditions.
//
@@ -879,7 +879,7 @@ RootBridgeIoCheckParameter ( moved is Width size * Count, starting at Address.
@param[in, out] UserBuffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -957,7 +957,7 @@ RootBridgeIoMemRW ( }
}
}
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
/**
@@ -971,7 +971,7 @@ RootBridgeIoMemRW ( moved is Width size * Count, starting at Address.
@param[in, out] UserBuffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1068,7 +1068,7 @@ RootBridgeIoIoRW ( moved is Width size * Count, starting at Address.
@param[in, out] UserBuffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1158,8 +1158,8 @@ RootBridgeIoPciRW ( }
/**
- Polls an address in memory mapped I/O space until an exit condition is met, or
- a timeout occurs.
+ Polls an address in memory mapped I/O space until an exit condition is met, or
+ a timeout occurs.
This function provides a standard way to poll a PCI memory location. A PCI memory read
operation is performed at the PCI memory address specified by Address for the width specified
@@ -1178,7 +1178,7 @@ RootBridgeIoPciRW ( @param[in] Delay The number of 100 ns units to poll. Note that timer available may
be of poorer granularity.
@param[out] Result Pointer to the last value read from the memory location.
-
+
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_INVALID_PARAMETER Width is invalid.
@retval EFI_INVALID_PARAMETER Result is NULL.
@@ -1188,7 +1188,7 @@ RootBridgeIoPciRW ( **/
EFI_STATUS
EFIAPI
-RootBridgeIoPollMem (
+RootBridgeIoPollMem (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
@@ -1216,14 +1216,14 @@ RootBridgeIoPollMem ( Status = This->Mem.Read (This, Width, Address, 1, Result);
if (EFI_ERROR (Status)) {
return Status;
- }
+ }
if ((*Result & Mask) == Value) {
return EFI_SUCCESS;
}
if (Delay == 0) {
return EFI_SUCCESS;
-
+
} else {
//
@@ -1240,16 +1240,16 @@ RootBridgeIoPollMem ( NumberOfTicks += 1;
}
NumberOfTicks += 1;
-
+
while (NumberOfTicks != 0) {
mMetronome->WaitForTick (mMetronome, 1);
-
+
Status = This->Mem.Read (This, Width, Address, 1, Result);
if (EFI_ERROR (Status)) {
return Status;
}
-
+
if ((*Result & Mask) == Value) {
return EFI_SUCCESS;
}
@@ -1259,7 +1259,7 @@ RootBridgeIoPollMem ( }
return EFI_TIMEOUT;
}
-
+
/**
Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is
satisfied or after a defined duration.
@@ -1281,7 +1281,7 @@ RootBridgeIoPollMem ( @param[in] Delay The number of 100 ns units to poll. Note that timer available may
be of poorer granularity.
@param[out] Result Pointer to the last value read from the memory location.
-
+
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_INVALID_PARAMETER Width is invalid.
@retval EFI_INVALID_PARAMETER Result is NULL.
@@ -1291,7 +1291,7 @@ RootBridgeIoPollMem ( **/
EFI_STATUS
EFIAPI
-RootBridgeIoPollIo (
+RootBridgeIoPollIo (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
@@ -1316,18 +1316,18 @@ RootBridgeIoPollIo ( if ((UINT32)Width > EfiPciWidthUint64) {
return EFI_INVALID_PARAMETER;
}
-
+
Status = This->Io.Read (This, Width, Address, 1, Result);
if (EFI_ERROR (Status)) {
return Status;
- }
+ }
if ((*Result & Mask) == Value) {
return EFI_SUCCESS;
}
if (Delay == 0) {
return EFI_SUCCESS;
-
+
} else {
//
@@ -1341,16 +1341,16 @@ RootBridgeIoPollIo ( NumberOfTicks += 1;
}
NumberOfTicks += 1;
-
+
while (NumberOfTicks != 0) {
mMetronome->WaitForTick (mMetronome, 1);
-
+
Status = This->Io.Read (This, Width, Address, 1, Result);
if (EFI_ERROR (Status)) {
return Status;
}
-
+
if ((*Result & Mask) == Value) {
return EFI_SUCCESS;
}
@@ -1377,7 +1377,7 @@ RootBridgeIoPollIo ( Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1413,7 +1413,7 @@ RootBridgeIoMemRead ( Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1429,7 +1429,7 @@ RootBridgeIoMemWrite ( IN VOID *Buffer
)
{
- return RootBridgeIoMemRW (This, TRUE, Width, Address, Count, Buffer);
+ return RootBridgeIoMemRW (This, TRUE, Width, Address, Count, Buffer);
}
/**
@@ -1443,7 +1443,7 @@ RootBridgeIoMemWrite ( size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1460,7 +1460,7 @@ RootBridgeIoIoRead ( OUT VOID *Buffer
)
{
- return RootBridgeIoIoRW (This, FALSE, Width, Address, Count, Buffer);
+ return RootBridgeIoIoRW (This, FALSE, Width, Address, Count, Buffer);
}
/**
@@ -1474,7 +1474,7 @@ RootBridgeIoIoRead ( size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1491,7 +1491,7 @@ RootBridgeIoIoWrite ( IN VOID *Buffer
)
{
- return RootBridgeIoIoRW (This, TRUE, Width, Address, Count, Buffer);
+ return RootBridgeIoIoRW (This, TRUE, Width, Address, Count, Buffer);
}
/**
@@ -1512,7 +1512,7 @@ RootBridgeIoIoWrite ( responsible for aligning the SrcAddress if required.
@param[in] Count The number of memory operations to perform. Bytes moved is
Width size * Count, starting at DestAddress and SrcAddress.
-
+
@retval EFI_SUCCESS The data was copied from one memory region to another memory region.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@@ -1536,7 +1536,7 @@ RootBridgeIoCopyMem ( if ((UINT32)Width > EfiPciWidthUint64) {
return EFI_INVALID_PARAMETER;
- }
+ }
if (DestAddress == SrcAddress) {
return EFI_SUCCESS;
@@ -1599,7 +1599,7 @@ RootBridgeIoCopyMem ( moved is Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1635,7 +1635,7 @@ RootBridgeIoPciRead ( moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. For
write operations, the source buffer to write data from.
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@@ -1669,7 +1669,7 @@ RootBridgeIoPciWrite ( @param[out] DeviceAddress The resulting map address for the bus master PCI controller to use
to access the system memory's HostAddress.
@param[out] Mapping The value to pass to Unmap() when the bus master DMA operation is complete.
-
+
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
@retval EFI_INVALID_PARAMETER Operation is invalid.
@retval EFI_INVALID_PARAMETER HostAddress is NULL.
@@ -1699,7 +1699,7 @@ RootBridgeIoMap ( if (HostAddress == NULL || NumberOfBytes == NULL || DeviceAddress == NULL || Mapping == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// Initialize the return values to their defaults
//
@@ -1722,7 +1722,7 @@ RootBridgeIoMap ( //
// Common Buffer operations can not be remapped. If the common buffer
- // if above 4GB, then it is not possible to generate a mapping, so return
+ // if above 4GB, then it is not possible to generate a mapping, so return
// an error.
//
if (Operation == EfiPciOperationBusMasterCommonBuffer || Operation == EfiPciOperationBusMasterCommonBuffer64) {
@@ -1734,8 +1734,8 @@ RootBridgeIoMap ( // called later.
//
Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof(MAP_INFO),
+ EfiBootServicesData,
+ sizeof(MAP_INFO),
(VOID **)&MapInfo
);
if (EFI_ERROR (Status)) {
@@ -1761,8 +1761,8 @@ RootBridgeIoMap ( // Allocate a buffer below 4GB to map the transfer to.
//
Status = gBS->AllocatePages (
- AllocateMaxAddress,
- EfiBootServicesData,
+ AllocateMaxAddress,
+ EfiBootServicesData,
MapInfo->NumberOfPages,
&MapInfo->MappedHostAddress
);
@@ -1779,7 +1779,7 @@ RootBridgeIoMap ( //
if (Operation == EfiPciOperationBusMasterRead || Operation == EfiPciOperationBusMasterRead64) {
CopyMem (
- (VOID *)(UINTN)MapInfo->MappedHostAddress,
+ (VOID *)(UINTN)MapInfo->MappedHostAddress,
(VOID *)(UINTN)MapInfo->HostAddress,
MapInfo->NumberOfBytes
);
@@ -1805,11 +1805,11 @@ RootBridgeIoMap ( The Unmap() function completes the Map() operation and releases any corresponding resources.
If the operation was an EfiPciOperationBusMasterWrite or
EfiPciOperationBusMasterWrite64, the data is committed to the target system memory.
- Any resources used for the mapping are freed.
+ Any resources used for the mapping are freed.
@param[in] This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param[in] Mapping The mapping value returned from Map().
-
+
@retval EFI_SUCCESS The range was unmapped.
@retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
@@ -1841,7 +1841,7 @@ RootBridgeIoUnmap ( //
if (MapInfo->Operation == EfiPciOperationBusMasterWrite || MapInfo->Operation == EfiPciOperationBusMasterWrite64) {
CopyMem (
- (VOID *)(UINTN)MapInfo->HostAddress,
+ (VOID *)(UINTN)MapInfo->HostAddress,
(VOID *)(UINTN)MapInfo->MappedHostAddress,
MapInfo->NumberOfBytes
);
@@ -1859,16 +1859,16 @@ RootBridgeIoUnmap ( /**
Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or
EfiPciOperationBusMasterCommonBuffer64 mapping.
-
+
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Type This parameter is not used and must be ignored.
@param MemoryType The type of memory to allocate, EfiBootServicesData or EfiRuntimeServicesData.
@param Pages The number of pages to allocate.
@param HostAddress A pointer to store the base system memory address of the allocated range.
@param Attributes The requested bit mask of attributes for the allocated range. Only
- the attributes EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE, EFI_PCI_ATTRIBUTE_MEMORY_CACHED,
+ the attributes EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE, EFI_PCI_ATTRIBUTE_MEMORY_CACHED,
and EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE may be used with this function.
-
+
@retval EFI_SUCCESS The requested memory pages were allocated.
@retval EFI_INVALID_PARAMETER MemoryType is invalid.
@retval EFI_INVALID_PARAMETER HostAddress is NULL.
@@ -1904,7 +1904,7 @@ RootBridgeIoAllocateBuffer ( if (HostAddress == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// The only valid memory types are EfiBootServicesData and EfiRuntimeServicesData
//
@@ -1935,7 +1935,7 @@ RootBridgeIoAllocateBuffer ( @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Pages The number of pages to free.
@param HostAddress The base system memory address of the allocated range.
-
+
@retval EFI_SUCCESS The requested memory pages were freed.
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
was not allocated with AllocateBuffer().
@@ -1964,7 +1964,7 @@ RootBridgeIoFreeBuffer ( a PCI read transaction from the PCI controller prior to calling Flush().
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
-
+
@retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
bridge to system memory.
@retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
@@ -1985,7 +1985,7 @@ RootBridgeIoFlush ( /**
Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the
- attributes that a PCI root bridge is currently using.
+ attributes that a PCI root bridge is currently using.
The GetAttributes() function returns the mask of attributes that this PCI root bridge supports
and the mask of attributes that the PCI root bridge is currently using.
@@ -1995,7 +1995,7 @@ RootBridgeIoFlush ( supports setting with SetAttributes().
@param Attributes A pointer to the mask of attributes that this PCI root bridge is
currently using.
-
+
@retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI root
bridge supports is returned in Supports. If Attributes is
not NULL, then the attributes that the PCI root bridge is currently
@@ -2023,13 +2023,13 @@ RootBridgeIoGetAttributes ( // Set the return value for Supported and Attributes
//
if (Supported != NULL) {
- *Supported = PrivateData->Supports;
+ *Supported = PrivateData->Supports;
}
if (Attributes != NULL) {
*Attributes = PrivateData->Attributes;
}
-
+
return EFI_SUCCESS;
}
@@ -2057,7 +2057,7 @@ RootBridgeIoGetAttributes ( by the attributes specified by Attributes.
@param[in, out] ResourceLength A pointer to the length of the resource range to be modified by the
attributes specified by Attributes.
-
+
@retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in Resources.
@retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be retrieved.
@retval EFI_INVALID_PARAMETER Invalid pointer of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
@@ -2069,23 +2069,23 @@ RootBridgeIoSetAttributes ( IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN UINT64 Attributes,
IN OUT UINT64 *ResourceBase,
- IN OUT UINT64 *ResourceLength
+ IN OUT UINT64 *ResourceLength
)
{
PCI_ROOT_BRIDGE_INSTANCE *PrivateData;
-
+
PrivateData = DRIVER_INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS(This);
-
+
if (Attributes != 0) {
if ((Attributes & (~(PrivateData->Supports))) != 0) {
return EFI_UNSUPPORTED;
}
}
-
+
//
// This is a generic driver for a PC-AT class system. It does not have any
- // chipset specific knowlegde, so none of the attributes can be set or
- // cleared. Any attempt to set attribute that are already set will succeed,
+ // chipset specific knowlegde, so none of the attributes can be set or
+ // cleared. Any attempt to set attribute that are already set will succeed,
// and any attempt to set an attribute that is not supported will fail.
//
if (Attributes & (~PrivateData->Attributes)) {
@@ -2112,7 +2112,7 @@ RootBridgeIoSetAttributes ( ACPI 2.0 resource descriptors is allocated by this function. The
caller must treat the return buffer as read-only data, and the buffer
must not be freed by the caller.
-
+
@retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in Resources.
@retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be retrieved.
@retval EFI_INVALID_PARAMETER Invalid pointer of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
@@ -2129,16 +2129,16 @@ RootBridgeIoConfiguration ( UINTN Index;
PrivateData = DRIVER_INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS (This);
-
+
for (Index = 0; Index < TypeMax; Index++) {
if (PrivateData->ResAllocNode[Index].Status == ResAllocated) {
Configuration.SpaceDesp[Index].AddrRangeMin = PrivateData->ResAllocNode[Index].Base;
Configuration.SpaceDesp[Index].AddrRangeMax = PrivateData->ResAllocNode[Index].Base + PrivateData->ResAllocNode[Index].Length - 1;
Configuration.SpaceDesp[Index].AddrLen = PrivateData->ResAllocNode[Index].Length;
- }
- }
-
- *Resources = &Configuration;
+ }
+ }
+
+ *Resources = &Configuration;
return EFI_SUCCESS;
}
|