2009-01-08 09:48:15 +01:00
|
|
|
/** @file
|
2009-06-25 15:47:45 +02:00
|
|
|
PCI resouces support functions declaration for PCI Bus module.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
Copyright (c) 2006 - 2009, Intel Corporation
|
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
The function is used to skip VGA range.
|
|
|
|
|
|
|
|
@param Start Returned start address including VGA range.
|
|
|
|
@param Length The length of VGA range.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@param Start Returned start address including ISA aliasing aperture.
|
|
|
|
@param Length The length of ISA aliasing aperture.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
InsertResourceNode (
|
2009-07-07 06:00:44 +02:00
|
|
|
IN OUT PCI_RESOURCE_NODE *Bridge,
|
|
|
|
IN 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
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
This routine is used to merge two different resource trees in need of
|
|
|
|
resoure degradation.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
For example, if an upstream PPB doesn't support,
|
2008-04-16 11:24:58 +02:00
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
If Dst is NULL or Res is NULL, ASSERT ().
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Dst Point to destination resource tree.
|
|
|
|
@param Res Point to source resource tree.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param TypeMerge If the TypeMerge is TRUE, Res resource type is changed to the type of
|
2008-04-16 11:24:58 +02:00
|
|
|
destination resource type.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
MergeResourceTree (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_RESOURCE_NODE *Dst,
|
|
|
|
IN PCI_RESOURCE_NODE *Res,
|
|
|
|
IN 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
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
@param Bridge PCI resource node for bridge.
|
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
CalculateApertureIo16 (
|
2009-06-25 15:47:45 +02:00
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
@param Bridge PCI resouce node for given bridge device.
|
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
CalculateResourceAperture (
|
2009-06-25 15:47:45 +02:00
|
|
|
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.
|
2009-06-25 15:47:45 +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.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Node Resource info node for 32-bit Prefetchable Memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Node Resource info node for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Node Resource info node for 64-bit Prefetchable Memory.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
GetResourceFromDevice (
|
2009-07-07 06:00:44 +02:00
|
|
|
IN PCI_IO_DEVICE *PciDev,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *IoNode,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
IN OUT 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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@return PCI resource node created for given PCI device.
|
|
|
|
NULL means PCI resource node is not created.
|
|
|
|
|
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
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
This function is used to extract resource request from
|
2008-04-16 11:24:58 +02:00
|
|
|
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.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Node Resource info node for 32-bit Prefetchable Memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Node Resource info node for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Node Resource info node for 64-bit Prefetchable Memory.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
CreateResourceMap (
|
2009-07-07 06:00:44 +02:00
|
|
|
IN PCI_IO_DEVICE *Bridge,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *IoNode,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *Mem32Node,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *PMem32Node,
|
|
|
|
IN OUT PCI_RESOURCE_NODE *Mem64Node,
|
|
|
|
IN OUT 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.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param IoNode Resource info node for IO.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem32Node Resource info node for 32-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Node Resource info node for 32-bit Prefetchable Memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Node Resource info node for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Node Resource info node for 64-bit Prefetchable Memory.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
ResourcePaddingPolicy (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_IO_DEVICE *PciDev,
|
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
This function is used to degrade resource if the upstream bridge
|
|
|
|
doesn't support certain resource. Degradation path is
|
2008-04-16 11:24:58 +02:00
|
|
|
PMEM64 -> MEM64 -> MEM32
|
|
|
|
PMEM64 -> PMEM32 -> MEM32
|
2009-06-25 15:47:45 +02:00
|
|
|
IO32 -> IO16.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Pci device instance.
|
|
|
|
@param Mem32Node Resource info node for 32-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Node Resource info node for 32-bit Prefetchable Memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Node Resource info node for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Node Resource info node for 64-bit Prefetchable Memory.
|
2008-04-16 11:24:58 +02:00
|
|
|
|
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Bridge device instance.
|
|
|
|
@param Decode Decode type according to resource type.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@return TRUE The bridge device support decode resource.
|
|
|
|
@return FALSE The bridge device don't 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
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
This function is used to program the resource allocated
|
|
|
|
for each resource node under specified bridge.
|
|
|
|
|
|
|
|
@param Base Base address of resource to be progammed.
|
|
|
|
@param Bridge PCI resource node for the bridge device.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Successfully to program all resouces
|
|
|
|
on given PCI bridge device.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Base is all one.
|
|
|
|
|
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
|
|
|
/**
|
2009-06-25 15:47:45 +02:00
|
|
|
Program Bar register for PCI device.
|
|
|
|
|
|
|
|
@param Base Base address for PCI device resource to be progammed.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Node Point to resoure node structure.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
Program PCI-PCI bridge apperture.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Base Base address for resource.
|
|
|
|
@param Node Point to resoure node structure.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
Program parent bridge for Option Rom.
|
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param PciDevice Pci deivce instance.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param OptionRomBase Base address for Optiona Rom.
|
|
|
|
@param Enable Enable or disable PCI memory.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Bridge Point to resource node for a bridge.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@retval TRUE There is resource on the given bridge.
|
|
|
|
@retval FALSE There isn't resource on the given bridge.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2007-06-28 16:02:17 +02:00
|
|
|
BOOLEAN
|
|
|
|
ResourceRequestExisted (
|
2009-06-25 15:47:45 +02:00
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@param ResourcePool Point to resource pool structure. This pool
|
|
|
|
is reset to all zero when returned.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param ResourceType Type of resource.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
InitializeResourcePool (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN OUT PCI_RESOURCE_NODE *ResourcePool,
|
|
|
|
IN 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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@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.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Pool Link list header for 32-bit Prefetchable memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Pool Link list header for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Pool Link list header for 64-bit Prefetchable memory.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
GetResourceMap (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_IO_DEVICE *PciDev,
|
|
|
|
IN PCI_RESOURCE_NODE **IoBridge,
|
|
|
|
IN PCI_RESOURCE_NODE **Mem32Bridge,
|
|
|
|
IN PCI_RESOURCE_NODE **PMem32Bridge,
|
|
|
|
IN PCI_RESOURCE_NODE **Mem64Bridge,
|
|
|
|
IN PCI_RESOURCE_NODE **PMem64Bridge,
|
|
|
|
IN PCI_RESOURCE_NODE *IoPool,
|
|
|
|
IN PCI_RESOURCE_NODE *Mem32Pool,
|
|
|
|
IN PCI_RESOURCE_NODE *PMem32Pool,
|
|
|
|
IN PCI_RESOURCE_NODE *Mem64Pool,
|
|
|
|
IN 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.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
|
|
|
@param Bridge PCI resource root node of resource tree.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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
|
|
|
/**
|
2009-01-08 09:48:15 +01:00
|
|
|
Insert resource padding for P2C.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param PciDev Pci device instance.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param IoNode Resource info node for IO.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem32Node Resource info node for 32-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Node Resource info node for 32-bit Prefetchable Memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Node Resource info node for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Node Resource info node for 64-bit Prefetchable Memory.
|
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
ResourcePaddingForCardBusBridge (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_IO_DEVICE *PciDev,
|
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
Program PCI Card device register for given resource node.
|
|
|
|
|
|
|
|
@param Base Base address of PCI Card device to be programmed.
|
2008-04-16 11:24:58 +02:00
|
|
|
@param Node Given resource node.
|
2009-06-25 15:47:45 +02:00
|
|
|
|
2008-04-16 11:24:58 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
|
2009-01-08 09:48:15 +01:00
|
|
|
@param PciDev Pci device instance.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param IoNode Resource info node for IO.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem32Node Resource info node for 32-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem32Node Resource info node for 32-bit Prefetchable Memory.
|
2009-01-08 09:48:15 +01:00
|
|
|
@param Mem64Node Resource info node for 64-bit memory.
|
2009-06-25 15:47:45 +02:00
|
|
|
@param PMem64Node Resource info node for 64-bit Prefetchable Memory.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2008-04-14 05:12:57 +02:00
|
|
|
**/
|
2009-06-25 15:47:45 +02:00
|
|
|
VOID
|
2007-06-28 16:02:17 +02:00
|
|
|
ApplyResourcePadding (
|
2009-06-25 15:47:45 +02:00
|
|
|
IN PCI_IO_DEVICE *PciDev,
|
|
|
|
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-06-25 15:47:45 +02:00
|
|
|
Get padding resource for PCI-PCI bridge.
|
|
|
|
|
|
|
|
@param PciIoDevice PCI-PCI bridge device instance.
|
2007-06-28 16:02:17 +02:00
|
|
|
|
2009-06-25 15:47:45 +02:00
|
|
|
@note Feature flag PcdPciBusHotplugDeviceSupport determines
|
|
|
|
whether need to pad resource for them.
|
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
|
|
|
|
|
|
|
#endif
|