mirror of https://github.com/acidanthera/audk.git
Add function doxygen header for PciBus module.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5071 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
0915f6dce4
commit
57076f4585
|
@ -1,5 +1,6 @@
|
|||
/**@file
|
||||
|
||||
This module provide support function for hot plug device.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -20,25 +21,18 @@ EFI_HPC_LOCATION *gPciRootHpcPool;
|
|||
UINTN gPciRootHpcCount;
|
||||
ROOT_HPC_DATA *gPciRootHpcData;
|
||||
|
||||
/**
|
||||
Init HPC private data.
|
||||
|
||||
@param Event event object
|
||||
@param Context HPC private data.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PciHPCInitialized (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Event - add argument and description to function comment
|
||||
// TODO: Context - add argument and description to function comment
|
||||
{
|
||||
ROOT_HPC_DATA *HpcData;
|
||||
|
||||
|
@ -47,24 +41,20 @@ Returns:
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
Compare two device path
|
||||
|
||||
@param DevicePath1 the first device path want to be compared
|
||||
@param DevicePath2 the first device path want to be compared
|
||||
|
||||
@retval TRUE equal
|
||||
@retval FALSE different
|
||||
**/
|
||||
BOOLEAN
|
||||
EfiCompareDevicePath (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: DevicePath1 - add argument and description to function comment
|
||||
// TODO: DevicePath2 - add argument and description to function comment
|
||||
{
|
||||
UINTN Size1;
|
||||
UINTN Size2;
|
||||
|
@ -83,24 +73,14 @@ Returns:
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Init hot plug support and root hot plug private data.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitializeHotPlugSupport (
|
||||
VOID
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: EFI_UNSUPPORTED - add return value to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HPC_LOCATION *HpcList;
|
||||
|
@ -148,26 +128,20 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether device path is for root pci hot plug bus
|
||||
|
||||
@param HpbdevicePath tested device path
|
||||
@param HpIndex Return the index of root hot plug in global array.
|
||||
|
||||
@retval TRUE device path is for root pci hot plug
|
||||
@retval FALSE device path is not for root pci hot plug
|
||||
**/
|
||||
BOOLEAN
|
||||
IsRootPciHotPlugBus (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath,
|
||||
OUT UINTN *HpIndex
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
HpcDevicePath - A pointer to the EFI_DEVICE_PATH_PROTOCOL.
|
||||
HpIndex - A pointer to the Index.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: HpbDevicePath - add argument and description to function comment
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
|
@ -186,25 +160,20 @@ Returns:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether device path is for root pci hot plug controller
|
||||
|
||||
@param HpbdevicePath tested device path
|
||||
@param HpIndex Return the index of root hot plug in global array.
|
||||
|
||||
@retval TRUE device path is for root pci hot plug controller
|
||||
@retval FALSE device path is not for root pci hot plug controller
|
||||
**/
|
||||
BOOLEAN
|
||||
IsRootPciHotPlugController (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
|
||||
OUT UINTN *HpIndex
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
HpcDevicePath - A pointer to the EFI_DEVICE_PATH_PROTOCOL.
|
||||
HpIndex - A pointer to the Index.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
|
@ -223,24 +192,19 @@ Returns:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Wrapper for creating event object for HPC
|
||||
|
||||
@param HpIndex index of hot plug device in global array
|
||||
@param Event event object
|
||||
|
||||
@return status of create event invoken
|
||||
**/
|
||||
EFI_STATUS
|
||||
CreateEventForHpc (
|
||||
IN UINTN HpIndex,
|
||||
OUT EFI_EVENT *Event
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: HpIndex - add argument and description to function comment
|
||||
// TODO: Event - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
@ -259,22 +223,15 @@ Returns:
|
|||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Wait for all root HPC initialized.
|
||||
|
||||
@param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization
|
||||
**/
|
||||
EFI_STATUS
|
||||
AllRootHPCInitialized (
|
||||
IN UINTN TimeoutInMicroSeconds
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - All root hpc's initialization is finished before the timeout
|
||||
EFI_TIMEOUT - Time out
|
||||
|
||||
**/
|
||||
{
|
||||
UINT32 Delay;
|
||||
UINTN Index;
|
||||
|
@ -305,25 +262,18 @@ Returns:
|
|||
return EFI_TIMEOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
Check HPC capability register block
|
||||
|
||||
@param PciIoDevice PCI device instance
|
||||
|
||||
@retval EFI_SUCCESS PCI device is HPC
|
||||
@retval EFI_NOT_FOUND PCI device is not HPC
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsSHPC (
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciIoDevice - add argument and description to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
{
|
||||
|
||||
EFI_STATUS Status;
|
||||
|
@ -352,6 +302,14 @@ Returns:
|
|||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
Get resource padding for hot plug bus
|
||||
|
||||
@param PciIoDevice PCI device instance
|
||||
|
||||
@retval EFI_SUCCESS success get padding and set it into PCI device instance
|
||||
@retval EFI_NOT_FOUND PCI device is not a hot plug bus.
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourcePaddingForHpb (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
|
@ -405,25 +363,18 @@ Returns:
|
|||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether PCI device is hot plug bus.
|
||||
|
||||
@param PciIoDevice PCI device instance
|
||||
|
||||
@retval EFI_SUCCESS PCI device is hot plug bus
|
||||
@retval EFI_NOT_FOUND PCI device is not hot plug bus
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsPciHotPlugBus (
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciIoDevice - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
{
|
||||
BOOLEAN Result;
|
||||
EFI_STATUS Status;
|
||||
|
@ -449,3 +400,4 @@ Returns:
|
|||
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,224 +32,144 @@ extern EFI_HPC_LOCATION *gPciRootHpcPool;
|
|||
extern UINTN gPciRootHpcCount;
|
||||
extern ROOT_HPC_DATA *gPciRootHpcData;
|
||||
|
||||
/**
|
||||
Init HPC private data.
|
||||
|
||||
@param Event event object
|
||||
@param Context HPC private data.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PciHPCInitialized (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Event - TODO: add argument description
|
||||
Context - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Compare two device path
|
||||
|
||||
@param DevicePath1 the first device path want to be compared
|
||||
@param DevicePath2 the first device path want to be compared
|
||||
|
||||
@retval TRUE equal
|
||||
@retval FALSE different
|
||||
**/
|
||||
BOOLEAN
|
||||
EfiCompareDevicePath (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
DevicePath1 - TODO: add argument description
|
||||
DevicePath2 - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Init hot plug support and root hot plug private data.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitializeHotPlugSupport (
|
||||
VOID
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
None
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Test whether PCI device is hot plug bus.
|
||||
|
||||
@param PciIoDevice PCI device instance
|
||||
|
||||
@retval EFI_SUCCESS PCI device is hot plug bus
|
||||
@retval EFI_NOT_FOUND PCI device is not hot plug bus
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsPciHotPlugBus (
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Test whether device path is for root pci hot plug bus
|
||||
|
||||
@param HpbdevicePath tested device path
|
||||
@param HpIndex Return the index of root hot plug in global array.
|
||||
|
||||
@retval TRUE device path is for root pci hot plug
|
||||
@retval FALSE device path is not for root pci hot plug
|
||||
**/
|
||||
BOOLEAN
|
||||
IsRootPciHotPlugBus (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath,
|
||||
OUT UINTN *HpIndex
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
HpbDevicePath - TODO: add argument description
|
||||
HpIndex - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Test whether device path is for root pci hot plug controller
|
||||
|
||||
@param HpbdevicePath tested device path
|
||||
@param HpIndex Return the index of root hot plug in global array.
|
||||
|
||||
@retval TRUE device path is for root pci hot plug controller
|
||||
@retval FALSE device path is not for root pci hot plug controller
|
||||
**/
|
||||
BOOLEAN
|
||||
IsRootPciHotPlugController (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
|
||||
OUT UINTN *HpIndex
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
HpcDevicePath - TODO: add argument description
|
||||
HpIndex - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Wrapper for creating event object for HPC
|
||||
|
||||
@param HpIndex index of hot plug device in global array
|
||||
@param Event event object
|
||||
|
||||
@return status of create event invoken
|
||||
**/
|
||||
EFI_STATUS
|
||||
CreateEventForHpc (
|
||||
IN UINTN HpIndex,
|
||||
OUT EFI_EVENT *Event
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
HpIndex - TODO: add argument description
|
||||
Event - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Wait for all root HPC initialized.
|
||||
|
||||
@param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization
|
||||
**/
|
||||
EFI_STATUS
|
||||
AllRootHPCInitialized (
|
||||
IN UINTN TimeoutInMicroSeconds
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - All root hpc's initialization is finished before the timeout
|
||||
EFI_TIMEOUT - Time out
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Check HPC capability register block
|
||||
|
||||
@param PciIoDevice PCI device instance
|
||||
|
||||
@retval EFI_SUCCESS PCI device is HPC
|
||||
@retval EFI_NOT_FOUND PCI device is not HPC
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsSHPC (
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Get resource padding for hot plug bus
|
||||
|
||||
@param PciIoDevice PCI device instance
|
||||
|
||||
@retval EFI_SUCCESS success get padding and set it into PCI device instance
|
||||
@retval EFI_NOT_FOUND PCI device is not a hot plug bus.
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourcePaddingForHpb (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -21,23 +21,14 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PCI_HOTPLUG_REQUEST_PROTOCOL gPciHotPlugReques
|
|||
PciHotPlugRequestNotify
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Install protocol gEfiPciHotPlugRequestProtocolGuid
|
||||
@param Status return status of protocol installation.
|
||||
**/
|
||||
VOID
|
||||
InstallHotPlugRequestProtocol (
|
||||
IN EFI_STATUS *Status
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
Status - A pointer to the status.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
|
@ -54,23 +45,17 @@ Returns:
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Install protocol gEfiPciHotplugDeviceGuid into hotplug device
|
||||
instance
|
||||
|
||||
@param PciIoDevice hotplug device instance
|
||||
|
||||
**/
|
||||
VOID
|
||||
InstallPciHotplugGuid (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - A pointer to the PCI_IO_DEVICE.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
@ -90,23 +75,17 @@ Returns:
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
UnInstall protocol gEfiPciHotplugDeviceGuid into hotplug device
|
||||
instance
|
||||
|
||||
@param PciIoDevice hotplug device instance
|
||||
|
||||
**/
|
||||
VOID
|
||||
UninstallPciHotplugGuid (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - A pointer to the PCI_IO_DEVICE.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
@ -136,24 +115,15 @@ Returns:
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Retrieve the BAR information via PciIo interface
|
||||
|
||||
@param PciIoDevice Pci device instance
|
||||
**/
|
||||
VOID
|
||||
GetBackPcCardBar (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - A pointer to the PCI_IO_DEVICE.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
UINT32 Address;
|
||||
|
||||
|
@ -222,27 +192,20 @@ Returns:
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Remove rejected pci device from specific root bridge
|
||||
handle.
|
||||
|
||||
@param RootBridgeHandle specific parent root bridge handle
|
||||
@param Bridge Bridge device instance
|
||||
|
||||
@retval EFI_SUCCESS Success operation.
|
||||
**/
|
||||
EFI_STATUS
|
||||
RemoveRejectedPciDevices (
|
||||
EFI_HANDLE RootBridgeHandle,
|
||||
IN PCI_IO_DEVICE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
|
||||
Arguments:
|
||||
|
||||
RootBridgeHandle - An efi handle.
|
||||
Bridge - An pointer to the PCI_IO_DEVICE.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_IO_DEVICE *Temp;
|
||||
LIST_ENTRY *CurrentLink;
|
||||
|
@ -295,6 +258,12 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Wrapper function for allocating resource for pci host bridge.
|
||||
|
||||
@param PciResAlloc Point to protocol instance EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeResourceAllocator (
|
||||
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
|
@ -311,27 +280,17 @@ PciHostBridgeResourceAllocator (
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Submits the I/O and memory resource requirements for the specified PCI Root Bridge
|
||||
|
||||
@param PciResAlloc Point to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeResourceAllocator_WithoutHotPlugDeviceSupport (
|
||||
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciResAlloc - add argument and description to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_IO_DEVICE *RootBridgeDev;
|
||||
EFI_HANDLE RootBridgeHandle;
|
||||
|
@ -684,30 +643,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Submits the I/O and memory resource requirements for the specified PCI Root Bridge
|
||||
|
||||
@param PciResAlloc Point to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
|
||||
EFI_STATUS
|
||||
PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (
|
||||
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Host brige resource allocator.
|
||||
|
||||
Arguments:
|
||||
|
||||
PciResAlloc - A pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI Status.
|
||||
|
||||
**/
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_IO_DEVICE *RootBridgeDev;
|
||||
EFI_HANDLE RootBridgeHandle;
|
||||
|
@ -1190,7 +1137,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Wapper function of scanning pci bus and assign bus number to the given PCI bus system
|
||||
Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug
|
||||
|
||||
@param Bridge Bridge device instance
|
||||
@param StartBusNumber start point
|
||||
@param SubBusNumber Point to sub bus number
|
||||
@param PaddedBusRange Customized bus number
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
@retval EFI_DEVICE_ERROR Fail to scan bus
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciScanBus (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -1216,7 +1174,18 @@ PciScanBus (
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Wapper function of scanning pci bus and assign bus number to the given PCI bus system
|
||||
Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug
|
||||
|
||||
@param Bridge Bridge device instance
|
||||
@param StartBusNumber start point
|
||||
@param SubBusNumber Point to sub bus number
|
||||
@param PaddedBusRange Customized bus number
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
@retval EFI_DEVICE_ERROR Fail to scan bus
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciScanBus_WithoutHotPlugDeviceSupport (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -1224,25 +1193,6 @@ PciScanBus_WithoutHotPlugDeviceSupport (
|
|||
OUT UINT8 *SubBusNumber,
|
||||
OUT UINT8 *PaddedBusRange
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This routine is used to assign bus number to the given PCI bus system
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: StartBusNumber - add argument and description to function comment
|
||||
// TODO: SubBusNumber - add argument and description to function comment
|
||||
// TODO: PaddedBusRange - add argument and description to function comment
|
||||
// TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
PCI_TYPE00 Pci;
|
||||
|
@ -1402,6 +1352,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Wapper function of scanning pci bus and assign bus number to the given PCI bus system
|
||||
Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug
|
||||
|
||||
@param Bridge Bridge device instance
|
||||
@param StartBusNumber start point
|
||||
@param SubBusNumber Point to sub bus number
|
||||
@param PaddedBusRange Customized bus number
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
@retval EFI_DEVICE_ERROR Fail to scan bus
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciScanBus_WithHotPlugDeviceSupport (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -1409,26 +1371,6 @@ PciScanBus_WithHotPlugDeviceSupport (
|
|||
OUT UINT8 *SubBusNumber,
|
||||
OUT UINT8 *PaddedBusRange
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This routine is used to assign bus number to the given PCI bus system
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - A pointer to the PCI_IO_DEVICE structure.
|
||||
StartBusNumber - The start bus number.
|
||||
SubBusNumber - A pointer to the sub bus number.
|
||||
PaddedBusRange - A pointer to the padded bus range.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
PCI_TYPE00 Pci;
|
||||
|
@ -1700,25 +1642,17 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Process Option Rom on this host bridge
|
||||
|
||||
@param Bridge Pci bridge device instance
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciRootBridgeP2CProcess (
|
||||
IN PCI_IO_DEVICE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Process Option Rom on this host bridge
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
LIST_ENTRY *CurrentLink;
|
||||
PCI_IO_DEVICE *Temp;
|
||||
|
@ -1823,30 +1757,20 @@ PciHostBridgeP2CProcess (
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to enumerate the entire host bridge
|
||||
in a given platform
|
||||
|
||||
@param PciResAlloc A pointer to the resource allocate protocol.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES no enough resource
|
||||
@retval EFI_SUCCESS Success
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeEnumerator (
|
||||
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to enumerate the entire host bridge
|
||||
in a given platform
|
||||
|
||||
Arguments:
|
||||
|
||||
PciResAlloc - A pointer to the resource allocate protocol.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_HANDLE RootBridgeHandle;
|
||||
PCI_IO_DEVICE *RootBridgeDev;
|
||||
|
@ -2933,3 +2857,4 @@ PciIoWrite (
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,132 +49,79 @@ typedef struct {
|
|||
UINT8 *AllocRes;
|
||||
} EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD;
|
||||
|
||||
/**
|
||||
Install protocol gEfiPciHotPlugRequestProtocolGuid
|
||||
@param Status return status of protocol installation.
|
||||
**/
|
||||
void
|
||||
InstallHotPlugRequestProtocol (
|
||||
IN EFI_STATUS *Status
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Status - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Install protocol gEfiPciHotplugDeviceGuid into hotplug device
|
||||
instance
|
||||
|
||||
@param PciIoDevice hotplug device instance
|
||||
|
||||
**/
|
||||
VOID
|
||||
InstallPciHotplugGuid (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
UnInstall protocol gEfiPciHotplugDeviceGuid into hotplug device
|
||||
instance
|
||||
|
||||
@param PciIoDevice hotplug device instance
|
||||
|
||||
**/
|
||||
VOID
|
||||
UninstallPciHotplugGuid (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Retrieve the BAR information via PciIo interface
|
||||
|
||||
@param PciIoDevice Pci device instance
|
||||
**/
|
||||
VOID
|
||||
GetBackPcCardBar (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Remove rejected pci device from specific root bridge
|
||||
handle.
|
||||
|
||||
@param RootBridgeHandle specific parent root bridge handle
|
||||
@param Bridge Bridge device instance
|
||||
|
||||
@retval EFI_SUCCESS Success operation.
|
||||
**/
|
||||
EFI_STATUS
|
||||
RemoveRejectedPciDevices (
|
||||
EFI_HANDLE RootBridgeHandle,
|
||||
IN PCI_IO_DEVICE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
RootBridgeHandle - TODO: add argument description
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Wrapper function for allocating resource for pci host bridge.
|
||||
|
||||
@param PciResAlloc Point to protocol instance EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeResourceAllocator (
|
||||
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciResAlloc - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -189,6 +136,18 @@ PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (
|
|||
)
|
||||
;
|
||||
|
||||
/**
|
||||
Wapper function of scanning pci bus and assign bus number to the given PCI bus system
|
||||
Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug
|
||||
|
||||
@param Bridge Bridge device instance
|
||||
@param StartBusNumber start point
|
||||
@param SubBusNumber Point to sub bus number
|
||||
@param PaddedBusRange Customized bus number
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
@retval EFI_DEVICE_ERROR Fail to scan bus
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciScanBus (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -196,24 +155,6 @@ PciScanBus (
|
|||
OUT UINT8 *SubBusNumber,
|
||||
OUT UINT8 *PaddedBusRange
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
StartBusNumber - TODO: add argument description
|
||||
SubBusNumber - TODO: add argument description
|
||||
PaddedBusRange - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -234,67 +175,49 @@ PciScanBus_WithoutHotPlugDeviceSupport (
|
|||
)
|
||||
;
|
||||
|
||||
/**
|
||||
Process Option Rom on this host bridge
|
||||
|
||||
@param Bridge Pci bridge device instance
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
|
||||
EFI_STATUS
|
||||
PciRootBridgeP2CProcess (
|
||||
IN PCI_IO_DEVICE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Process Option Rom on this host bridge
|
||||
|
||||
@param PciResAlloc Pointer to instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
|
||||
|
||||
@retval EFI_NOT_FOUND Can not find the root bridge instance
|
||||
@retval EFI_SUCCESS Success process
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciHostBridgeP2CProcess (
|
||||
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
)
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to enumerate the entire host bridge
|
||||
in a given platform
|
||||
|
||||
Routine Description:
|
||||
@param PciResAlloc A pointer to the resource allocate protocol.
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciResAlloc - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
@retval EFI_OUT_OF_RESOURCES no enough resource
|
||||
@retval EFI_SUCCESS Success
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
PciHostBridgeEnumerator (
|
||||
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciResAlloc - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,22 +30,16 @@ MEMMAP_DEVICE_PATH mPciOptionRomImageDevicePathNodeTemplate = {
|
|||
0
|
||||
};
|
||||
|
||||
/**
|
||||
Get Pci device's oprom infor bits.
|
||||
|
||||
@retval EFI_NOT_FOUND Pci device has not oprom
|
||||
@retval EFI_SUCCESS Pci device has oprom
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetOpRomInfo (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
**/
|
||||
// TODO: PciIoDevice - add argument and description to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
UINT8 RomBarIndex;
|
||||
UINT32 AllOnes;
|
||||
|
@ -125,27 +119,20 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Load option rom image for specified PCI device
|
||||
|
||||
@param PciDevice Pci device instance
|
||||
@param RomBase Base address of oprom.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES not enough memory to hold image
|
||||
@retval EFI_SUCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
LoadOpRomImage (
|
||||
IN PCI_IO_DEVICE *PciDevice,
|
||||
IN UINT64 RomBase
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Load option rom image for specified PCI device
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
**/
|
||||
// TODO: PciDevice - add argument and description to function comment
|
||||
// TODO: RomBase - add argument and description to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
{
|
||||
UINT8 RomBarIndex;
|
||||
UINT8 Indicator;
|
||||
|
@ -307,6 +294,17 @@ Returns:
|
|||
return retStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
enable/disable oprom decode
|
||||
|
||||
@param PciDevice pci device instance
|
||||
@param RomBarIndex The BAR index of the standard PCI Configuration header to use as the
|
||||
base address for resource range. The legal range for this field is 0..5.
|
||||
@param RomBar Base address of rom
|
||||
@param Enable Flag for enable/disable decode.
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
RomDecode (
|
||||
IN PCI_IO_DEVICE *PciDevice,
|
||||
|
@ -314,20 +312,6 @@ RomDecode (
|
|||
IN UINT32 RomBar,
|
||||
IN BOOLEAN Enable
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
**/
|
||||
// TODO: PciDevice - add argument and description to function comment
|
||||
// TODO: RomBarIndex - add argument and description to function comment
|
||||
// TODO: RomBar - add argument and description to function comment
|
||||
// TODO: Enable - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
UINT32 Value32;
|
||||
UINT32 Offset;
|
||||
|
@ -395,24 +379,15 @@ Returns:
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
Process the oprom image.
|
||||
|
||||
@param PciDevice Pci device instance
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessOpRomImage (
|
||||
PCI_IO_DEVICE *PciDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Process the oprom image.
|
||||
|
||||
Arguments:
|
||||
PciDevice A pointer to a pci device.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI Status.
|
||||
|
||||
**/
|
||||
{
|
||||
UINT8 Indicator;
|
||||
UINT32 ImageSize;
|
||||
|
@ -580,3 +555,4 @@ Returns:
|
|||
return retStatus;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -14,50 +14,45 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _EFI_PCI_OP_ROM_SUPPORT_H
|
||||
#define _EFI_PCI_OP_ROM_SUPPORT_H
|
||||
|
||||
/**
|
||||
Get Pci device's oprom infor bits.
|
||||
|
||||
@retval EFI_NOT_FOUND Pci device has not oprom
|
||||
@retval EFI_SUCCESS Pci device has oprom
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetOpRomInfo (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Load option rom image for specified PCI device
|
||||
|
||||
@param PciDevice Pci device instance
|
||||
@param RomBase Base address of oprom.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES not enough memory to hold image
|
||||
@retval EFI_SUCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
LoadOpRomImage (
|
||||
IN PCI_IO_DEVICE *PciDevice,
|
||||
IN UINT64 RomBase
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDevice - TODO: add argument description
|
||||
RomBase - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
enable/disable oprom decode
|
||||
|
||||
@param PciDevice pci device instance
|
||||
@param RomBarIndex The BAR index of the standard PCI Configuration header to use as the
|
||||
base address for resource range. The legal range for this field is 0..5.
|
||||
@param RomBar Base address of rom
|
||||
@param Enable Flag for enable/disable decode.
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
RomDecode (
|
||||
IN PCI_IO_DEVICE *PciDevice,
|
||||
|
@ -65,45 +60,17 @@ RomDecode (
|
|||
IN UINT32 RomBar,
|
||||
IN BOOLEAN Enable
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDevice - TODO: add argument description
|
||||
RomBarIndex - TODO: add argument description
|
||||
RomBar - TODO: add argument description
|
||||
Enable - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Process the oprom image.
|
||||
|
||||
@param PciDevice Pci device instance
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessOpRomImage (
|
||||
PCI_IO_DEVICE *PciDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,28 +13,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
#include "pcibus.h"
|
||||
|
||||
EFI_STATUS
|
||||
ResetPowerManagementFeature (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is intended to turn off PWE assertion and
|
||||
put the device to D0 state if the device supports
|
||||
PCI Power Management.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
@param PciIoDevice Pci device instance
|
||||
|
||||
@retval EFI_UNSUPPORTED Device do not support power management
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
// TODO: PciIoDevice - add argument and description to function comment
|
||||
// TODO: EFI_UNSUPPORTED - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
EFI_STATUS
|
||||
ResetPowerManagementFeature (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 PowerManagementRegBlock;
|
||||
|
@ -71,3 +63,4 @@ Returns:
|
|||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,25 +14,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _EFI_PCI_POWER_MANAGEMENT_H
|
||||
#define _EFI_PCI_POWER_MANAGEMENT_H
|
||||
|
||||
/**
|
||||
This function is intended to turn off PWE assertion and
|
||||
put the device to D0 state if the device supports
|
||||
PCI Power Management.
|
||||
|
||||
@param PciIoDevice Pci device instance
|
||||
|
||||
@retval EFI_UNSUPPORTED Device do not support power management
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ResetPowerManagementFeature (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,27 +15,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include "PciResourceSupport.h"
|
||||
#include "PciCommand.h"
|
||||
|
||||
/**
|
||||
The function is used to skip VGA range
|
||||
|
||||
@param Start address including VGA range
|
||||
@param Length length of VGA range.
|
||||
|
||||
@retval EFI_SUCCESS success
|
||||
**/
|
||||
EFI_STATUS
|
||||
SkipVGAAperture (
|
||||
OUT UINT64 *Start,
|
||||
IN UINT64 Length
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
The function is used to skip VGA range
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Start - add argument and description to function comment
|
||||
// TODO: Length - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
UINT64 Original;
|
||||
UINT64 Mask;
|
||||
|
@ -57,27 +49,19 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to skip ISA aliasing aperture
|
||||
|
||||
@param Start address including ISA aliasing aperture
|
||||
@param Length length of ISA aliasing aperture
|
||||
|
||||
@retval EFI_SUCCESS success
|
||||
**/
|
||||
EFI_STATUS
|
||||
SkipIsaAliasAperture (
|
||||
OUT UINT64 *Start,
|
||||
IN UINT64 Length
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to skip ISA aliasing aperture
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Start - add argument and description to function comment
|
||||
// TODO: Length - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
|
||||
UINT64 Original;
|
||||
|
@ -101,28 +85,20 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function inserts a resource node into the resource list.
|
||||
The resource list is sorted in descend order.
|
||||
|
||||
@param Bridge PCI resource node for bridge
|
||||
@param ResNode Resource node want to be inserted
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
InsertResourceNode (
|
||||
PCI_RESOURCE_NODE *Bridge,
|
||||
PCI_RESOURCE_NODE *ResNode
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function inserts a resource node into the resource list.
|
||||
The resource list is sorted in descend order.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: ResNode - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
LIST_ENTRY *CurrentLink;
|
||||
PCI_RESOURCE_NODE *Temp;
|
||||
|
@ -153,12 +129,6 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
MergeResourceTree (
|
||||
PCI_RESOURCE_NODE *Dst,
|
||||
PCI_RESOURCE_NODE *Res,
|
||||
BOOLEAN TypeMerge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
@ -171,17 +141,20 @@ Routine Description:
|
|||
If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource
|
||||
type.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
@param Dst Point to destination resource tree
|
||||
@param Res Point to source resource tree
|
||||
@param TypeMerge If the TypeMerge is TRUE, Res resource type is changed to the type of
|
||||
destination resource type.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
// TODO: Dst - add argument and description to function comment
|
||||
// TODO: Res - add argument and description to function comment
|
||||
// TODO: TypeMerge - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
EFI_STATUS
|
||||
MergeResourceTree (
|
||||
PCI_RESOURCE_NODE *Dst,
|
||||
PCI_RESOURCE_NODE *Res,
|
||||
BOOLEAN TypeMerge
|
||||
)
|
||||
{
|
||||
|
||||
LIST_ENTRY *CurrentLink;
|
||||
|
@ -204,27 +177,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to calculate the IO16 aperture
|
||||
for a bridge.
|
||||
|
||||
@param Bridge PCI resource node for bridge.
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
CalculateApertureIo16 (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to calculate the IO16 aperture
|
||||
for a bridge.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
|
||||
UINT64 Aperture;
|
||||
|
@ -345,27 +309,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to calculate the resource aperture
|
||||
for a given bridge device
|
||||
|
||||
@param Bridge Give bridge device
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
CalculateResourceAperture (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to calculate the resource aperture
|
||||
for a given bridge device
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
UINT64 Aperture;
|
||||
LIST_ENTRY *CurrentLink;
|
||||
|
@ -455,6 +410,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Get IO/Memory resource infor for given PCI device
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourceFromDevice (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -464,24 +431,6 @@ GetResourceFromDevice (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciDev - add argument and description to function comment
|
||||
// TODO: IoNode - add argument and description to function comment
|
||||
// TODO: Mem32Node - add argument and description to function comment
|
||||
// TODO: PMem32Node - add argument and description to function comment
|
||||
// TODO: Mem64Node - add argument and description to function comment
|
||||
// TODO: PMem64Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
|
||||
UINT8 Index;
|
||||
|
@ -608,6 +557,16 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to create a resource node
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param Length Length of Io/Memory resource
|
||||
@param Alignment Alignment of resource
|
||||
@param Bar Bar index
|
||||
@param ResType Type of resource: IO/Memory
|
||||
@param ResUage Resource usage
|
||||
**/
|
||||
PCI_RESOURCE_NODE *
|
||||
CreateResourceNode (
|
||||
IN PCI_IO_DEVICE *PciDev,
|
||||
|
@ -617,25 +576,6 @@ CreateResourceNode (
|
|||
IN PCI_BAR_TYPE ResType,
|
||||
IN PCI_RESOURCE_USAGE ResUsage
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to create a resource node
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciDev - add argument and description to function comment
|
||||
// TODO: Length - add argument and description to function comment
|
||||
// TODO: Alignment - add argument and description to function comment
|
||||
// TODO: Bar - add argument and description to function comment
|
||||
// TODO: ResType - add argument and description to function comment
|
||||
// TODO: ResUsage - add argument and description to function comment
|
||||
{
|
||||
PCI_RESOURCE_NODE *Node;
|
||||
|
||||
|
@ -668,6 +608,19 @@ Returns:
|
|||
return Node;
|
||||
}
|
||||
|
||||
/**
|
||||
This routine is used to extract resource request from
|
||||
device node list.
|
||||
|
||||
@param Bridge Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
CreateResourceMap (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -677,27 +630,6 @@ CreateResourceMap (
|
|||
IN PCI_RESOURCE_NODE *Mem64Node,
|
||||
IN PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This routine is used to extract resource request from
|
||||
device node list.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: IoNode - add argument and description to function comment
|
||||
// TODO: Mem32Node - add argument and description to function comment
|
||||
// TODO: PMem32Node - add argument and description to function comment
|
||||
// TODO: Mem64Node - add argument and description to function comment
|
||||
// TODO: PMem64Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_IO_DEVICE *Temp;
|
||||
PCI_RESOURCE_NODE *IoBridge;
|
||||
|
@ -923,6 +855,18 @@ Returns:
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to do the resource padding for a specific platform
|
||||
|
||||
@param Bridge Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ResourcePaddingPolicy (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -932,28 +876,6 @@ ResourcePaddingPolicy (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to do the resource padding for a specific platform
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - A pointer to the PCI_IO_DEVICE structrue.
|
||||
IoNode - A pointer to the PCI_RESOURCE_NODE structrue.
|
||||
Mem32Node - A pointer to the PCI_RESOURCE_NODE structrue.
|
||||
PMem32Node - A pointer to the PCI_RESOURCE_NODE structrue.
|
||||
Mem64Node - A pointer to the PCI_RESOURCE_NODE structrue.
|
||||
PMem64Node - A pointer to the PCI_RESOURCE_NODE structrue.
|
||||
|
||||
Returns:
|
||||
Status code
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
//
|
||||
// Create padding resource node
|
||||
|
@ -973,6 +895,22 @@ Returns:
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to degrade resource if the upstream bridge
|
||||
doesn't support certain resource. Degradation path is
|
||||
PMEM64 -> MEM64 -> MEM32
|
||||
PMEM64 -> PMEM32 -> MEM32
|
||||
IO32 -> IO16
|
||||
|
||||
@param Bridge Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
DegradeResource (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -981,29 +919,6 @@ DegradeResource (
|
|||
IN PCI_RESOURCE_NODE *Mem64Node,
|
||||
IN PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to degrade resource if the upstream bridge
|
||||
doesn't support certain resource. Degradation path is
|
||||
PMEM64 -> MEM64 -> MEM32
|
||||
PMEM64 -> PMEM32 -> MEM32
|
||||
IO32 -> IO16
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: Mem32Node - add argument and description to function comment
|
||||
// TODO: PMem32Node - add argument and description to function comment
|
||||
// TODO: Mem64Node - add argument and description to function comment
|
||||
// TODO: PMem64Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
|
||||
//
|
||||
|
@ -1078,39 +993,22 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether bridge device support decode resource
|
||||
|
||||
@param Bridge Bridge device instance
|
||||
@param Decode Decode type according to resource type
|
||||
|
||||
@return whether bridge device support decode resource
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
BridgeSupportResourceDecode (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
IN UINT32 Decode
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
Decode - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
{
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
if ((Bridge->Decodes) & Decode) {
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1118,29 +1016,21 @@ Returns:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to program the resource allocated
|
||||
for each resource node
|
||||
|
||||
|
||||
@param Base Base address of resource
|
||||
@param Bridge Bridge device instance
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramResource (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to program the resource allocated
|
||||
for each resource node
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Base - add argument and description to function comment
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
LIST_ENTRY *CurrentLink;
|
||||
PCI_RESOURCE_NODE *Node;
|
||||
|
@ -1179,25 +1069,19 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Program Bar register.
|
||||
|
||||
@param Base Base address for resource
|
||||
@param Node Point to resoure node structure
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramBar (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Base - add argument and description to function comment
|
||||
// TODO: Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
UINT64 Address;
|
||||
|
@ -1269,26 +1153,19 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Program PPB apperture
|
||||
|
||||
@param Base Base address for resource
|
||||
@param Node Point to resoure node structure
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramPpbApperture (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Base - add argument and description to function comment
|
||||
// TODO: Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
UINT64 Address;
|
||||
|
@ -1450,25 +1327,21 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Program parent bridge for oprom
|
||||
|
||||
@param PciDevice Pci deivce instance
|
||||
@param OptionRomBase Base address for oprom
|
||||
@param Enable Enable/Disable
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgrameUpstreamBridgeForRom (
|
||||
IN PCI_IO_DEVICE *PciDevice,
|
||||
IN UINT32 OptionRomBase,
|
||||
IN BOOLEAN Enable
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
**/
|
||||
// TODO: PciDevice - add argument and description to function comment
|
||||
// TODO: OptionRomBase - add argument and description to function comment
|
||||
// TODO: Enable - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_IO_DEVICE *Parent;
|
||||
PCI_RESOURCE_NODE Node;
|
||||
|
@ -1506,23 +1379,17 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Test whether resource exists for a bridge
|
||||
|
||||
@param Bridge Point to resource node for a bridge
|
||||
|
||||
@return whether resource exists
|
||||
**/
|
||||
BOOLEAN
|
||||
ResourceRequestExisted (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - A pointer to the PCI_RESOURCE_NODE.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
if (Bridge != NULL) {
|
||||
if (!IsListEmpty (&Bridge->ChildList) || Bridge->Length != 0) {
|
||||
|
@ -1533,25 +1400,17 @@ Returns:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Initialize resource pool structure.
|
||||
|
||||
@param ResourcePool Point to resource pool structure
|
||||
@param ResourceType Type of resource
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitializeResourcePool (
|
||||
PCI_RESOURCE_NODE *ResourcePool,
|
||||
PCI_BAR_TYPE ResourceType
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: ResourcePool - add argument and description to function comment
|
||||
// TODO: ResourceType - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
|
||||
ZeroMem (ResourcePool, sizeof (PCI_RESOURCE_NODE));
|
||||
|
@ -1562,6 +1421,23 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Get all resource information for given Pci device
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoBridge Io resource node
|
||||
@param Mem32Bridge 32-bit memory node
|
||||
@param PMem32Bridge 32-bit Pmemory node
|
||||
@param Mem64Bridge 64-bit memory node
|
||||
@param PMem64Bridge 64-bit PMemory node
|
||||
@param IoPool Link list header for Io resource
|
||||
@param Mem32Pool Link list header for 32-bit memory
|
||||
@param PMem32Pool Link list header for 32-bit Pmemory
|
||||
@param Mem64Pool Link list header for 64-bit memory
|
||||
@param PMem64Pool Link list header for 64-bit Pmemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourceMap (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -1576,29 +1452,6 @@ GetResourceMap (
|
|||
PCI_RESOURCE_NODE *Mem64Pool,
|
||||
PCI_RESOURCE_NODE *PMem64Pool
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciDev - add argument and description to function comment
|
||||
// TODO: IoBridge - add argument and description to function comment
|
||||
// TODO: Mem32Bridge - add argument and description to function comment
|
||||
// TODO: PMem32Bridge - add argument and description to function comment
|
||||
// TODO: Mem64Bridge - add argument and description to function comment
|
||||
// TODO: PMem64Bridge - add argument and description to function comment
|
||||
// TODO: IoPool - add argument and description to function comment
|
||||
// TODO: Mem32Pool - add argument and description to function comment
|
||||
// TODO: PMem32Pool - add argument and description to function comment
|
||||
// TODO: Mem64Pool - add argument and description to function comment
|
||||
// TODO: PMem64Pool - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
|
||||
PCI_RESOURCE_NODE *Temp;
|
||||
|
@ -1687,23 +1540,17 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Destory given resource tree
|
||||
|
||||
@param Bridge root node of resource tree
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
DestroyResourceTree (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_RESOURCE_NODE *Temp;
|
||||
LIST_ENTRY *CurrentLink;
|
||||
|
@ -1726,6 +1573,14 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Record the reserved resource and insert to reserved list.
|
||||
|
||||
@param Base Base address of reserved resourse
|
||||
@param Length Length of reserved resource
|
||||
@param ResType Resource type
|
||||
@param Bridge Pci device instance
|
||||
**/
|
||||
EFI_STATUS
|
||||
RecordReservedResource (
|
||||
IN UINT64 Base,
|
||||
|
@ -1733,23 +1588,6 @@ RecordReservedResource (
|
|||
IN PCI_BAR_TYPE ResType,
|
||||
IN PCI_IO_DEVICE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Base - add argument and description to function comment
|
||||
// TODO: Length - add argument and description to function comment
|
||||
// TODO: ResType - add argument and description to function comment
|
||||
// TODO: Bridge - add argument and description to function comment
|
||||
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_RESERVED_RESOURCE_LIST *ReservedNode;
|
||||
|
||||
|
@ -1768,6 +1606,18 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Insert resource padding for P2C
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ResourcePaddingForCardBusBridge (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -1777,24 +1627,6 @@ ResourcePaddingForCardBusBridge (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciDev - add argument and description to function comment
|
||||
// TODO: IoNode - add argument and description to function comment
|
||||
// TODO: Mem32Node - add argument and description to function comment
|
||||
// TODO: PMem32Node - add argument and description to function comment
|
||||
// TODO: Mem64Node - add argument and description to function comment
|
||||
// TODO: PMem64Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
PCI_RESOURCE_NODE *Node;
|
||||
|
||||
|
@ -1875,25 +1707,19 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Program P2C register for given resource node
|
||||
|
||||
@param Base Base address of P2C device
|
||||
@param Node Given resource node.
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramP2C (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: Base - add argument and description to function comment
|
||||
// TODO: Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
UINT64 Address;
|
||||
|
@ -2118,6 +1944,19 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Create padding resource node.
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ApplyResourcePadding (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -2127,24 +1966,6 @@ ApplyResourcePadding (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
// TODO: PciDev - add argument and description to function comment
|
||||
// TODO: IoNode - add argument and description to function comment
|
||||
// TODO: Mem32Node - add argument and description to function comment
|
||||
// TODO: PMem32Node - add argument and description to function comment
|
||||
// TODO: Mem64Node - add argument and description to function comment
|
||||
// TODO: PMem64Node - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;
|
||||
PCI_RESOURCE_NODE *Node;
|
||||
|
@ -2283,29 +2104,17 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Light PCI bus driver woundn't support hotplug root device
|
||||
// So no need to pad resource for them
|
||||
//
|
||||
/**
|
||||
Get padding resource for PPB
|
||||
Light PCI bus driver woundn't support hotplug root device
|
||||
So no need to pad resource for them
|
||||
|
||||
@param PciIoDevice Pci device instance
|
||||
**/
|
||||
VOID
|
||||
GetResourcePaddingPpb (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Get resource.
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice A pointer to a pci device.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
{
|
||||
if (gPciHotPlugInit) {
|
||||
if (PciIoDevice->ResourcePaddingDescriptors == NULL) {
|
||||
|
@ -2313,3 +2122,4 @@ Returns:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,142 +59,120 @@ typedef struct {
|
|||
#define RESOURCE_NODE_FROM_LINK(a) \
|
||||
CR (a, PCI_RESOURCE_NODE, Link, PCI_RESOURCE_SIGNATURE)
|
||||
|
||||
/**
|
||||
The function is used to skip VGA range
|
||||
|
||||
@param Start address including VGA range
|
||||
@param Length length of VGA range.
|
||||
|
||||
@retval EFI_SUCCESS success
|
||||
**/
|
||||
EFI_STATUS
|
||||
SkipVGAAperture (
|
||||
OUT UINT64 *Start,
|
||||
IN UINT64 Length
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Start - TODO: add argument description
|
||||
Length - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to skip ISA aliasing aperture
|
||||
|
||||
@param Start address including ISA aliasing aperture
|
||||
@param Length length of ISA aliasing aperture
|
||||
|
||||
@retval EFI_SUCCESS success
|
||||
**/
|
||||
EFI_STATUS
|
||||
SkipIsaAliasAperture (
|
||||
OUT UINT64 *Start,
|
||||
IN UINT64 Length
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Start - TODO: add argument description
|
||||
Length - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function inserts a resource node into the resource list.
|
||||
The resource list is sorted in descend order.
|
||||
|
||||
@param Bridge PCI resource node for bridge
|
||||
@param ResNode Resource node want to be inserted
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
InsertResourceNode (
|
||||
PCI_RESOURCE_NODE *Bridge,
|
||||
PCI_RESOURCE_NODE *ResNode
|
||||
)
|
||||
;
|
||||
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
This routine is used to merge two different resource tree in need of
|
||||
resoure degradation. For example, if a upstream PPB doesn't support,
|
||||
prefetchable memory decoding, the PCI bus driver will choose to call this function
|
||||
to merge prefectchable memory resource list into normal memory list.
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
ResNode - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource
|
||||
type.
|
||||
|
||||
@param Dst Point to destination resource tree
|
||||
@param Res Point to source resource tree
|
||||
@param TypeMerge If the TypeMerge is TRUE, Res resource type is changed to the type of
|
||||
destination resource type.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
MergeResourceTree (
|
||||
PCI_RESOURCE_NODE *Dst,
|
||||
PCI_RESOURCE_NODE *Res,
|
||||
BOOLEAN TypeMerge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Dst - TODO: add argument description
|
||||
Res - TODO: add argument description
|
||||
TypeMerge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to calculate the IO16 aperture
|
||||
for a bridge.
|
||||
|
||||
@param Bridge PCI resource node for bridge.
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
CalculateApertureIo16 (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to calculate the resource aperture
|
||||
for a given bridge device
|
||||
|
||||
@param Bridge Give bridge device
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
CalculateResourceAperture (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Get IO/Memory resource infor for given PCI device
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourceFromDevice (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -204,28 +182,18 @@ GetResourceFromDevice (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - TODO: add argument description
|
||||
IoNode - TODO: add argument description
|
||||
Mem32Node - TODO: add argument description
|
||||
PMem32Node - TODO: add argument description
|
||||
Mem64Node - TODO: add argument description
|
||||
PMem64Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to create a resource node
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param Length Length of Io/Memory resource
|
||||
@param Alignment Alignment of resource
|
||||
@param Bar Bar index
|
||||
@param ResType Type of resource: IO/Memory
|
||||
@param ResUage Resource usage
|
||||
**/
|
||||
PCI_RESOURCE_NODE *
|
||||
CreateResourceNode (
|
||||
IN PCI_IO_DEVICE *PciDev,
|
||||
|
@ -235,28 +203,21 @@ CreateResourceNode (
|
|||
IN PCI_BAR_TYPE ResType,
|
||||
IN PCI_RESOURCE_USAGE ResUsage
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - TODO: add argument description
|
||||
Length - TODO: add argument description
|
||||
Alignment - TODO: add argument description
|
||||
Bar - TODO: add argument description
|
||||
ResType - TODO: add argument description
|
||||
ResUsage - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This routine is used to extract resource request from
|
||||
device node list.
|
||||
|
||||
@param Bridge Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
CreateResourceMap (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -266,28 +227,20 @@ CreateResourceMap (
|
|||
IN PCI_RESOURCE_NODE *Mem64Node,
|
||||
IN PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
IoNode - TODO: add argument description
|
||||
Mem32Node - TODO: add argument description
|
||||
PMem32Node - TODO: add argument description
|
||||
Mem64Node - TODO: add argument description
|
||||
PMem64Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to do the resource padding for a specific platform
|
||||
|
||||
@param Bridge Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ResourcePaddingPolicy (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -297,28 +250,24 @@ ResourcePaddingPolicy (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - TODO: add argument description
|
||||
IoNode - TODO: add argument description
|
||||
Mem32Node - TODO: add argument description
|
||||
PMem32Node - TODO: add argument description
|
||||
Mem64Node - TODO: add argument description
|
||||
PMem64Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to degrade resource if the upstream bridge
|
||||
doesn't support certain resource. Degradation path is
|
||||
PMEM64 -> MEM64 -> MEM32
|
||||
PMEM64 -> PMEM32 -> MEM32
|
||||
IO32 -> IO16
|
||||
|
||||
@param Bridge Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
DegradeResource (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
|
@ -327,188 +276,131 @@ DegradeResource (
|
|||
IN PCI_RESOURCE_NODE *Mem64Node,
|
||||
IN PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
Mem32Node - TODO: add argument description
|
||||
PMem32Node - TODO: add argument description
|
||||
Mem64Node - TODO: add argument description
|
||||
PMem64Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Test whether bridge device support decode resource
|
||||
|
||||
@param Bridge Bridge device instance
|
||||
@param Decode Decode type according to resource type
|
||||
|
||||
@return whether bridge device support decode resource
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
BridgeSupportResourceDecode (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
IN UINT32 Decode
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
Decode - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
This function is used to program the resource allocated
|
||||
for each resource node
|
||||
|
||||
|
||||
@param Base Base address of resource
|
||||
@param Bridge Bridge device instance
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramResource (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Base - TODO: add argument description
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Program Bar register.
|
||||
|
||||
@param Base Base address for resource
|
||||
@param Node Point to resoure node structure
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramBar (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Base - TODO: add argument description
|
||||
Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Program PPB apperture
|
||||
|
||||
@param Base Base address for resource
|
||||
@param Node Point to resoure node structure
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramPpbApperture (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Base - TODO: add argument description
|
||||
Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Program parent bridge for oprom
|
||||
|
||||
@param PciDevice Pci deivce instance
|
||||
@param OptionRomBase Base address for oprom
|
||||
@param Enable Enable/Disable
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgrameUpstreamBridgeForRom (
|
||||
IN PCI_IO_DEVICE *PciDevice,
|
||||
IN UINT32 OptionRomBase,
|
||||
IN BOOLEAN Enable
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDevice - TODO: add argument description
|
||||
OptionRomBase - TODO: add argument description
|
||||
Enable - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Test whether resource exists for a bridge
|
||||
|
||||
@param Bridge Point to resource node for a bridge
|
||||
|
||||
@return whether resource exists
|
||||
**/
|
||||
BOOLEAN
|
||||
ResourceRequestExisted (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Initialize resource pool structure.
|
||||
|
||||
@param ResourcePool Point to resource pool structure
|
||||
@param ResourceType Type of resource
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitializeResourcePool (
|
||||
PCI_RESOURCE_NODE *ResourcePool,
|
||||
PCI_BAR_TYPE ResourceType
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ResourcePool - TODO: add argument description
|
||||
ResourceType - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Get all resource information for given Pci device
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoBridge Io resource node
|
||||
@param Mem32Bridge 32-bit memory node
|
||||
@param PMem32Bridge 32-bit Pmemory node
|
||||
@param Mem64Bridge 64-bit memory node
|
||||
@param PMem64Bridge 64-bit PMemory node
|
||||
@param IoPool Link list header for Io resource
|
||||
@param Mem32Pool Link list header for 32-bit memory
|
||||
@param PMem32Pool Link list header for 32-bit Pmemory
|
||||
@param Mem64Pool Link list header for 64-bit memory
|
||||
@param PMem64Pool Link list header for 64-bit Pmemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetResourceMap (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -523,54 +415,29 @@ GetResourceMap (
|
|||
PCI_RESOURCE_NODE *Mem64Pool,
|
||||
PCI_RESOURCE_NODE *PMem64Pool
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - TODO: add argument description
|
||||
IoBridge - TODO: add argument description
|
||||
Mem32Bridge - TODO: add argument description
|
||||
PMem32Bridge - TODO: add argument description
|
||||
Mem64Bridge - TODO: add argument description
|
||||
PMem64Bridge - TODO: add argument description
|
||||
IoPool - TODO: add argument description
|
||||
Mem32Pool - TODO: add argument description
|
||||
PMem32Pool - TODO: add argument description
|
||||
Mem64Pool - TODO: add argument description
|
||||
PMem64Pool - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Destory given resource tree
|
||||
|
||||
@param Bridge root node of resource tree
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
DestroyResourceTree (
|
||||
IN PCI_RESOURCE_NODE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Record the reserved resource and insert to reserved list.
|
||||
|
||||
@param Base Base address of reserved resourse
|
||||
@param Length Length of reserved resource
|
||||
@param ResType Resource type
|
||||
@param Bridge Pci device instance
|
||||
**/
|
||||
EFI_STATUS
|
||||
RecordReservedResource (
|
||||
IN UINT64 Base,
|
||||
|
@ -578,26 +445,20 @@ RecordReservedResource (
|
|||
IN PCI_BAR_TYPE ResType,
|
||||
IN PCI_IO_DEVICE *Bridge
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Base - TODO: add argument description
|
||||
Length - TODO: add argument description
|
||||
ResType - TODO: add argument description
|
||||
Bridge - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Insert resource padding for P2C
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ResourcePaddingForCardBusBridge (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -607,51 +468,36 @@ ResourcePaddingForCardBusBridge (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - TODO: add argument description
|
||||
IoNode - TODO: add argument description
|
||||
Mem32Node - TODO: add argument description
|
||||
PMem32Node - TODO: add argument description
|
||||
Mem64Node - TODO: add argument description
|
||||
PMem64Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Program P2C register for given resource node
|
||||
|
||||
@param Base Base address of P2C device
|
||||
@param Node Given resource node.
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProgramP2C (
|
||||
IN UINT64 Base,
|
||||
IN PCI_RESOURCE_NODE *Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Base - TODO: add argument description
|
||||
Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Create padding resource node.
|
||||
|
||||
@param PciDev Pci device instance
|
||||
@param IoNode Resource info node for IO
|
||||
@param Mem32Node Resource info node for 32-bit memory
|
||||
@param PMem32Node Resource info node for 32-bit PMemory
|
||||
@param Mem64Node Resource info node for 64-bit memory
|
||||
@param PMem64Node Resource info node for 64-bit PMemory
|
||||
|
||||
@retval EFI_SUCCESS Success
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ApplyResourcePadding (
|
||||
PCI_IO_DEVICE *PciDev,
|
||||
|
@ -661,70 +507,32 @@ ApplyResourcePadding (
|
|||
PCI_RESOURCE_NODE *Mem64Node,
|
||||
PCI_RESOURCE_NODE *PMem64Node
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciDev - TODO: add argument description
|
||||
IoNode - TODO: add argument description
|
||||
Mem32Node - TODO: add argument description
|
||||
PMem32Node - TODO: add argument description
|
||||
Mem64Node - TODO: add argument description
|
||||
PMem64Node - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Get padding resource for PPB
|
||||
Light PCI bus driver woundn't support hotplug root device
|
||||
So no need to pad resource for them
|
||||
|
||||
@param PciIoDevice Pci device instance
|
||||
**/
|
||||
VOID
|
||||
GetResourcePaddingPpb (
|
||||
IN PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Reset and all bus number from specific bridge.
|
||||
|
||||
@param Bridge Parent specific bridge
|
||||
@param StartBusNumber start bus number
|
||||
**/
|
||||
EFI_STATUS
|
||||
ResetAllPpbBusNumber (
|
||||
IN PCI_IO_DEVICE *Bridge,
|
||||
IN UINT8 StartBusNumber
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Reset bus register
|
||||
|
||||
Arguments:
|
||||
|
||||
Bridge - a pointer to the PCI_IO_DEVICE
|
||||
StartBusNumber - the number of bus
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,17 @@ static UINTN mNumberOfPciRomImages = 0;
|
|||
static UINTN mMaxNumberOfPciRomImages = 0;
|
||||
static EFI_PCI_ROM_IMAGE_MAPPING *mRomImageTable = NULL;
|
||||
|
||||
/**
|
||||
Add the Rom Image to internal database for later PCI light enumeration
|
||||
|
||||
@param ImageHandle Option Rom image handle
|
||||
@param Seg Segment of PCI space
|
||||
@param Bus Bus NO of PCI space
|
||||
@param Dev Dev NO of PCI space
|
||||
@param Func Func NO of PCI space
|
||||
@param RomAddress Base address of OptionRom
|
||||
@param RomLength Length of rom image.
|
||||
**/
|
||||
VOID
|
||||
PciRomAddImageMapping (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
|
@ -39,27 +50,6 @@ PciRomAddImageMapping (
|
|||
IN UINT64 RomAddress,
|
||||
IN UINT64 RomLength
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ImageHandle - TODO: add argument description
|
||||
Seg - TODO: add argument description
|
||||
Bus - TODO: add argument description
|
||||
Dev - TODO: add argument description
|
||||
Func - TODO: add argument description
|
||||
RomAddress - TODO: add argument description
|
||||
RomLength - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
{
|
||||
EFI_PCI_ROM_IMAGE_MAPPING *TempMapping;
|
||||
|
||||
|
@ -92,26 +82,19 @@ Returns:
|
|||
mNumberOfPciRomImages++;
|
||||
}
|
||||
|
||||
/**
|
||||
Load all option rom image to PCI driver list.
|
||||
|
||||
@param This Pointer to protocol instance EFI_DRIVER_BINDING_PROTOCOL
|
||||
@param PciRootBridgeIo Root bridge Io instance
|
||||
@param PciIoDevice device instance
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciRomGetRomResourceFromPciOptionRomTable (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
**/
|
||||
// TODO: This - add argument and description to function comment
|
||||
// TODO: PciRootBridgeIo - add argument and description to function comment
|
||||
// TODO: PciIoDevice - add argument and description to function comment
|
||||
// TODO: EFI_NOT_FOUND - add return value to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_OPTION_ROM_TABLE *PciOptionRomTable;
|
||||
|
@ -148,21 +131,16 @@ Returns:
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Get Option rom driver's mapping for PCI device.
|
||||
|
||||
@param PciIoDevice Device instance.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciRomGetImageMapping (
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
**/
|
||||
// TODO: PciIoDevice - add argument and description to function comment
|
||||
// TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
|
||||
UINTN Index;
|
||||
|
|
|
@ -15,6 +15,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _EFI_PCI_ROM_TABLE_H
|
||||
#define _EFI_PCI_ROM_TABLE_H
|
||||
|
||||
/**
|
||||
Add the Rom Image to internal database for later PCI light enumeration
|
||||
|
||||
@param ImageHandle Option Rom image handle
|
||||
@param Seg Segment of PCI space
|
||||
@param Bus Bus NO of PCI space
|
||||
@param Dev Dev NO of PCI space
|
||||
@param Func Func NO of PCI space
|
||||
@param RomAddress Base address of OptionRom
|
||||
@param RomLength Length of rom image.
|
||||
**/
|
||||
VOID
|
||||
PciRomAddImageMapping (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
|
@ -25,74 +36,32 @@ PciRomAddImageMapping (
|
|||
IN UINT64 RomAddress,
|
||||
IN UINT64 RomLength
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ImageHandle - TODO: add argument description
|
||||
Seg - TODO: add argument description
|
||||
Bus - TODO: add argument description
|
||||
Dev - TODO: add argument description
|
||||
Func - TODO: add argument description
|
||||
RomAddress - TODO: add argument description
|
||||
RomLength - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
|
||||
/**
|
||||
Load all option rom image to PCI driver list.
|
||||
|
||||
@param This Pointer to protocol instance EFI_DRIVER_BINDING_PROTOCOL
|
||||
@param PciRootBridgeIo Root bridge Io instance
|
||||
@param PciIoDevice device instance
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciRomGetRomResourceFromPciOptionRomTable (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - TODO: add argument description
|
||||
PciRootBridgeIo - TODO: add argument description
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
/**
|
||||
Get Option rom driver's mapping for PCI device.
|
||||
|
||||
@param PciIoDevice Device instance.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PciRomGetImageMapping (
|
||||
PCI_IO_DEVICE *PciIoDevice
|
||||
)
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
PciIoDevice - TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue