2009-01-08 09:48:15 +01:00
|
|
|
/** @file
|
2007-06-28 16:02:17 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
2007-07-23 09:06:23 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
#ifndef _EFI_PCI_RESOURCE_SUPPORT_H_
|
|
|
|
#define _EFI_PCI_RESOURCE_SUPPORT_H_
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-12-16 16:31:57 +01:00
|
|
|
#define RESERVED_RESOURCE_SIGNATURE SIGNATURE_32 ('r', 's', 'v', 'd')
|
2007-06-28 16:02:17 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT64 Base;
|
|
|
|
UINT64 Length;
|
|
|
|
PCI_BAR_TYPE ResType;
|
|
|
|
} PCI_RESERVED_RESOURCE_NODE;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT32 Signature;
|
|
|
|
LIST_ENTRY Link;
|
|
|
|
PCI_RESERVED_RESOURCE_NODE Node;
|
|
|
|
} PCI_RESERVED_RESOURCE_LIST;
|
|
|
|
|
|
|
|
#define RESOURCED_LIST_FROM_NODE(a) \
|
|
|
|
CR (a, PCI_RESERVED_RESOURCE_LIST, Node, RESERVED_RESOURCE_SIGNATURE)
|
|
|
|
|
|
|
|
#define RESOURCED_LIST_FROM_LINK(a) \
|
|
|
|
CR (a, PCI_RESERVED_RESOURCE_LIST, Link, RESERVED_RESOURCE_SIGNATURE)
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
PciResUsageTypical = 0,
|
|
|
|
PciResUsagePadding,
|
|
|
|
PciResUsageOptionRomProcessing
|
|
|
|
} PCI_RESOURCE_USAGE;
|
|
|
|
|
2008-12-16 16:31:57 +01:00
|
|
|
#define PCI_RESOURCE_SIGNATURE SIGNATURE_32 ('p', 'c', 'r', 'c')
|
2007-06-28 16:02:17 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT32 Signature;
|
|
|
|
LIST_ENTRY Link;
|
|
|
|
LIST_ENTRY ChildList;
|
|
|
|
PCI_IO_DEVICE *PciDev;
|
|
|
|
UINT64 Alignment;
|
|
|
|
UINT64 Offset;
|
|
|
|
UINT8 Bar;
|
|
|
|
PCI_BAR_TYPE ResType;
|
|
|
|
UINT64 Length;
|
|
|
|
BOOLEAN Reserved;
|
|
|
|
PCI_RESOURCE_USAGE ResourceUsage;
|
|
|
|
} PCI_RESOURCE_NODE;
|
|
|
|
|
|
|
|
#define RESOURCE_NODE_FROM_LINK(a) \
|
|
|
|
CR (a, PCI_RESOURCE_NODE, Link, PCI_RESOURCE_SIGNATURE)
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
The function is used to skip VGA range
|
|
|
|
|
|
|
|
@param Start address including VGA range
|
|
|
|
@param Length length of VGA range.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
SkipVGAAperture (
|
|
|
|
OUT UINT64 *Start,
|
|
|
|
IN UINT64 Length
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
This function is used to skip ISA aliasing aperture.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Start address including ISA aliasing aperture.
|
|
|
|
@param Length length of ISA aliasing aperture.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
SkipIsaAliasAperture (
|
|
|
|
OUT UINT64 *Start,
|
|
|
|
IN UINT64 Length
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
This function inserts a resource node into the resource list.
|
|
|
|
The resource list is sorted in descend order.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge PCI resource node for bridge.
|
|
|
|
@param ResNode Resource node want to be inserted.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
InsertResourceNode (
|
|
|
|
PCI_RESOURCE_NODE *Bridge,
|
|
|
|
PCI_RESOURCE_NODE *ResNode
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
/**
|
2007-06-28 16:02:17 +02:00
|
|
|
|
|
|
|
Routine Description:
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
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.
|
|
|
|
|
|
|
|
If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource
|
|
|
|
type.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Dst Point to destination resource tree.
|
|
|
|
@param Res Point to source resource tree.
|
2008-04-16 11:24:58 +02:00
|
|
|
@param TypeMerge If the TypeMerge is TRUE, Res resource type is changed to the type of
|
|
|
|
destination resource type.
|
|
|
|
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Success
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
MergeResourceTree (
|
|
|
|
PCI_RESOURCE_NODE *Dst,
|
|
|
|
PCI_RESOURCE_NODE *Res,
|
|
|
|
BOOLEAN TypeMerge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
This function is used to calculate the IO16 aperture
|
|
|
|
for a bridge.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
@param Bridge PCI resource node for bridge.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
CalculateApertureIo16 (
|
|
|
|
IN PCI_RESOURCE_NODE *Bridge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
This function is used to calculate the resource aperture
|
2009-01-08 09:48:15 +01:00
|
|
|
for a given bridge device.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Give bridge device.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
CalculateResourceAperture (
|
|
|
|
IN PCI_RESOURCE_NODE *Bridge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Get IO/Memory resource infor for given PCI device.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@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.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
GetResourceFromDevice (
|
|
|
|
PCI_IO_DEVICE *PciDev,
|
|
|
|
PCI_RESOURCE_NODE *IoNode,
|
|
|
|
PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem64Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
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 ResUsage Resource usage.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
PCI_RESOURCE_NODE *
|
|
|
|
CreateResourceNode (
|
|
|
|
IN PCI_IO_DEVICE *PciDev,
|
|
|
|
IN UINT64 Length,
|
|
|
|
IN UINT64 Alignment,
|
|
|
|
IN UINT8 Bar,
|
|
|
|
IN PCI_BAR_TYPE ResType,
|
|
|
|
IN PCI_RESOURCE_USAGE ResUsage
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
This routine is used to extract resource request from
|
|
|
|
device node list.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@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.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
CreateResourceMap (
|
|
|
|
IN PCI_IO_DEVICE *Bridge,
|
|
|
|
IN PCI_RESOURCE_NODE *IoNode,
|
|
|
|
IN PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
IN PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
IN PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
IN PCI_RESOURCE_NODE *PMem64Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
This function is used to do the resource padding for a specific platform.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@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.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ResourcePaddingPolicy (
|
|
|
|
PCI_IO_DEVICE *PciDev,
|
|
|
|
PCI_RESOURCE_NODE *IoNode,
|
|
|
|
PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem64Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
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
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Pci device instance.
|
|
|
|
@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.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
DegradeResource (
|
|
|
|
IN PCI_IO_DEVICE *Bridge,
|
|
|
|
IN PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
IN PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
IN PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
IN PCI_RESOURCE_NODE *PMem64Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Test whether bridge device support decode resource.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Bridge device instance.
|
|
|
|
@param Decode Decode type according to resource type.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@return whether bridge device support decode resource.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
BOOLEAN
|
|
|
|
BridgeSupportResourceDecode (
|
|
|
|
IN PCI_IO_DEVICE *Bridge,
|
|
|
|
IN UINT32 Decode
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
This function is used to program the resource allocated
|
2009-01-08 09:48:15 +01:00
|
|
|
for each resource node.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Base Base address of resource.
|
|
|
|
@param Bridge Bridge device instance.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ProgramResource (
|
|
|
|
IN UINT64 Base,
|
|
|
|
IN PCI_RESOURCE_NODE *Bridge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
Program Bar register.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Base Base address for resource.
|
|
|
|
@param Node Point to resoure node structure.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ProgramBar (
|
|
|
|
IN UINT64 Base,
|
|
|
|
IN PCI_RESOURCE_NODE *Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Program PPB apperture.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Base Base address for resource.
|
|
|
|
@param Node Point to resoure node structure.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ProgramPpbApperture (
|
|
|
|
IN UINT64 Base,
|
|
|
|
IN PCI_RESOURCE_NODE *Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Program parent bridge for oprom.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param PciDevice Pci deivce instance.
|
|
|
|
@param OptionRomBase Base address for oprom.
|
|
|
|
@param Enable Enable/Disable.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ProgrameUpstreamBridgeForRom (
|
|
|
|
IN PCI_IO_DEVICE *PciDevice,
|
|
|
|
IN UINT32 OptionRomBase,
|
|
|
|
IN BOOLEAN Enable
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Test whether resource exists for a bridge.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Point to resource node for a bridge.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@return whether resource exists.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
BOOLEAN
|
|
|
|
ResourceRequestExisted (
|
|
|
|
IN PCI_RESOURCE_NODE *Bridge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
Initialize resource pool structure.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param ResourcePool Point to resource pool structure.
|
|
|
|
@param ResourceType Type of resource.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
InitializeResourcePool (
|
|
|
|
PCI_RESOURCE_NODE *ResourcePool,
|
|
|
|
PCI_BAR_TYPE ResourceType
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
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.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
GetResourceMap (
|
|
|
|
PCI_IO_DEVICE *PciDev,
|
|
|
|
PCI_RESOURCE_NODE **IoBridge,
|
|
|
|
PCI_RESOURCE_NODE **Mem32Bridge,
|
|
|
|
PCI_RESOURCE_NODE **PMem32Bridge,
|
|
|
|
PCI_RESOURCE_NODE **Mem64Bridge,
|
|
|
|
PCI_RESOURCE_NODE **PMem64Bridge,
|
|
|
|
PCI_RESOURCE_NODE *IoPool,
|
|
|
|
PCI_RESOURCE_NODE *Mem32Pool,
|
|
|
|
PCI_RESOURCE_NODE *PMem32Pool,
|
|
|
|
PCI_RESOURCE_NODE *Mem64Pool,
|
|
|
|
PCI_RESOURCE_NODE *PMem64Pool
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Destory given resource tree.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge root node of resource tree.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
DestroyResourceTree (
|
|
|
|
IN PCI_RESOURCE_NODE *Bridge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
Record the reserved resource and insert to reserved list.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Base Base address of reserved resourse.
|
|
|
|
@param Length Length of reserved resource.
|
|
|
|
@param ResType Resource type.
|
|
|
|
@param Bridge Pci device instance.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
RecordReservedResource (
|
|
|
|
IN UINT64 Base,
|
|
|
|
IN UINT64 Length,
|
|
|
|
IN PCI_BAR_TYPE ResType,
|
|
|
|
IN PCI_IO_DEVICE *Bridge
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Insert resource padding for P2C.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@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.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ResourcePaddingForCardBusBridge (
|
|
|
|
PCI_IO_DEVICE *PciDev,
|
|
|
|
PCI_RESOURCE_NODE *IoNode,
|
|
|
|
PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem64Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Program P2C register for given resource node.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Base Base address of P2C device.
|
2008-04-16 11:24:58 +02:00
|
|
|
@param Node Given resource node.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@retval EFI_SUCCESS Success.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ProgramP2C (
|
|
|
|
IN UINT64 Base,
|
|
|
|
IN PCI_RESOURCE_NODE *Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
Create padding resource node.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@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.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Success
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
|
|
|
ApplyResourcePadding (
|
|
|
|
PCI_IO_DEVICE *PciDev,
|
|
|
|
PCI_RESOURCE_NODE *IoNode,
|
|
|
|
PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
PCI_RESOURCE_NODE *PMem64Node
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
Get padding resource for PPB
|
|
|
|
Light PCI bus driver woundn't support hotplug root device
|
2009-01-08 09:48:15 +01:00
|
|
|
So no need to pad resource for them.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param PciIoDevice Pci device instance.
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
VOID
|
|
|
|
GetResourcePaddingPpb (
|
|
|
|
IN PCI_IO_DEVICE *PciIoDevice
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
/**
|
|
|
|
Reset and all bus number from specific bridge.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Parent specific bridge.
|
|
|
|
@param StartBusNumber start bus number.
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
EFI_STATUS
|
2007-09-28 06:40:49 +02:00
|
|
|
ResetAllPpbBusNumber (
|
2007-06-28 16:02:17 +02:00
|
|
|
IN PCI_IO_DEVICE *Bridge,
|
|
|
|
IN UINT8 StartBusNumber
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-28 16:02:17 +02:00
|
|
|
|
|
|
|
#endif
|