2007-06-15 12:02:42 +02:00
|
|
|
/** @file
|
2009-07-03 08:46:14 +02:00
|
|
|
This file declares EFI PCI Hot Plug Init Protocol.
|
2008-04-08 09:40:30 +02:00
|
|
|
This protocol provides the necessary functionality to initialize the Hot Plug Controllers (HPCs) and
|
|
|
|
the buses that they control. This protocol also provides information regarding resource padding.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
2009-07-02 09:40:24 +02:00
|
|
|
Copyright (c) 2007 - 2009, Intel Corporation
|
2007-06-15 12:02:42 +02:00
|
|
|
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.
|
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
This protocol is defined in Framework of EFI Hot Plug Pci Initialization Protocol Spec
|
|
|
|
Version 0.9
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _EFI_PCI_HOT_PLUG_INIT_H_
|
|
|
|
#define _EFI_PCI_HOT_PLUG_INIT_H_
|
|
|
|
|
2007-06-28 14:23:11 +02:00
|
|
|
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// Global ID for the PCI Hot Plug Protocol
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \
|
2009-07-06 04:22:21 +02:00
|
|
|
{ \
|
|
|
|
0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } \
|
|
|
|
}
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;
|
|
|
|
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// Current state of an HPC
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
typedef UINT16 EFI_HPC_STATE;
|
|
|
|
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// The HPC initialization function was called and the HPC completed
|
|
|
|
/// initialization, but it was not enabled for some reason. The HPC may be
|
|
|
|
/// disabled in hardware, or it may be disabled due to user preferences,
|
|
|
|
/// hardware failure, or other reasons. No resource padding is required.
|
|
|
|
///
|
|
|
|
#define EFI_HPC_STATE_INITIALIZED 0x01
|
2007-06-15 12:02:42 +02:00
|
|
|
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// The HPC initialization function was called, the HPC completed
|
|
|
|
/// initialization, and it was enabled. Resource padding is required.
|
|
|
|
///
|
|
|
|
#define EFI_HPC_STATE_ENABLED 0x02
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Location definition for PCI Hot Plug Controller
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
typedef struct{
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// The device path to the Root HPC
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath;
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// The device path to the Hot Plug Bus (HPB) that is controlled by
|
|
|
|
/// the root HPC.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath;
|
|
|
|
} EFI_HPC_LOCATION;
|
|
|
|
|
|
|
|
|
2009-07-06 04:22:21 +02:00
|
|
|
///
|
|
|
|
/// Describes how resource padding should be applied
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
typedef enum{
|
|
|
|
EfiPaddingPciBus,
|
|
|
|
EfiPaddingPciRootBridge
|
|
|
|
} EFI_HPC_PADDING_ATTRIBUTES;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a list of root Hot Plug Controllers (HPCs) that require initialization
|
|
|
|
during the boot process.
|
|
|
|
|
2009-07-06 04:22:21 +02:00
|
|
|
This procedure returns a list of root HPCs. The PCI bus driver must initialize these controllers
|
|
|
|
during the boot process. The PCI bus driver may or may not be able to detect these HPCs. If the
|
|
|
|
platform includes a PCI-to-CardBus bridge, it can be included in this list if it requires initialization.
|
|
|
|
The HpcList must be self consistent. An HPC cannot control any of its parent buses. Only one HPC
|
|
|
|
can control a PCI bus. Because this list includes only root HPCs, no HPC in the list can be a child of
|
|
|
|
another HPC. This policy must be enforced by the EFI_PCI_HOT_PLUG_INIT_PROTOCOL.
|
|
|
|
The PCI bus driver may not check for such invalid conditions.
|
|
|
|
The callee allocates the buffer HpcList
|
|
|
|
|
2007-06-15 12:02:42 +02:00
|
|
|
@param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
|
|
|
|
@param HpcCount The number of root HPCs that were returned.
|
|
|
|
@param HpcList The list of root HPCs. HpcCount defines the number of
|
|
|
|
elements in this list.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS HpcList was returned.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient resources.
|
|
|
|
@retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_GET_ROOT_HPC_LIST)(
|
2009-07-06 05:15:53 +02:00
|
|
|
IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
|
2007-06-15 12:02:42 +02:00
|
|
|
OUT UINTN *HpcCount,
|
|
|
|
OUT EFI_HPC_LOCATION **HpcList
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Initializes one root Hot Plug Controller (HPC). This process may causes
|
|
|
|
initialization of its subordinate buses.
|
2009-07-06 04:22:21 +02:00
|
|
|
|
|
|
|
This function initializes the specified HPC. At the end of initialization, the hot-plug slots or sockets
|
|
|
|
(controlled by this HPC) are powered and are connected to the bus. All the necessary registers in the
|
|
|
|
HPC are set up. For a Standard (PCI) Hot Plug Controller (SHPC), the registers that must be set up
|
|
|
|
are defined in the PCI Standard Hot Plug Controller and Subsystem Specification.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
@param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
|
|
|
|
@param HpcDevicePath The device path to the HPC that is being initialized.
|
|
|
|
@param HpcPciAddress The address of the HPC function on the PCI bus.
|
|
|
|
@param Event The event that should be signaled when the HPC initialization
|
|
|
|
is complete.
|
2009-07-06 04:22:21 +02:00
|
|
|
@param HpcState The state of the HPC hardware. The state is EFI_HPC_STATE_INITIALIZED
|
|
|
|
or EFI_HPC_STATE_ENABLED.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully
|
|
|
|
initialized. If Event is not NULL, Event will be signaled at a later time
|
|
|
|
when initialization is complete.
|
|
|
|
@retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL
|
|
|
|
does not support the specified HPC.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient
|
|
|
|
resources.
|
|
|
|
@retval EFI_INVALID_PARAMETER HpcState is NULL.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_INITIALIZE_ROOT_HPC)(
|
2009-07-06 05:15:53 +02:00
|
|
|
IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
|
|
|
|
IN UINT64 HpcPciAddress,
|
|
|
|
IN EFI_EVENT Event, OPTIONAL
|
|
|
|
OUT EFI_HPC_STATE *HpcState
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the resource padding that is required by the PCI bus that is controlled
|
|
|
|
by the specified Hot Plug Controller (HPC).
|
|
|
|
|
2009-07-06 04:22:21 +02:00
|
|
|
This function returns the resource padding that is required by the PCI bus that is controlled by the
|
|
|
|
specified HPC. This member function is called for all the root HPCs and nonroot HPCs that are
|
|
|
|
detected by the PCI bus enumerator. This function will be called before PCI resource allocation is
|
|
|
|
completed. This function must be called after all the root HPCs, with the possible exception of a
|
|
|
|
PCI-to-CardBus bridge, have completed initialization.
|
|
|
|
|
2007-06-15 12:02:42 +02:00
|
|
|
@param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
|
|
|
|
@param HpcDevicePath The device path to the HPC.
|
|
|
|
@param HpcPciAddress The address of the HPC function on the PCI bus.
|
|
|
|
@param HpcState The state of the HPC hardware.
|
|
|
|
@param Padding The amount of resource padding that is required by the
|
|
|
|
PCI bus under the control of the specified HPC.
|
|
|
|
@param Attributes Describes how padding is accounted for. The padding
|
|
|
|
is returned in the form of ACPI 2.0 resource descriptors.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The resource padding was successfully returned.
|
|
|
|
@retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL
|
|
|
|
does not support the specified HPC.
|
|
|
|
@retval EFI_NOT_READY This function was called before HPC initialization is complete.
|
|
|
|
@retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding
|
|
|
|
cannot be allocated due to insufficient resources.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2009-07-06 04:22:21 +02:00
|
|
|
(EFIAPI *EFI_GET_HOT_PLUG_PADDING)(
|
2009-07-06 05:15:53 +02:00
|
|
|
IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
|
|
|
|
IN UINT64 HpcPciAddress,
|
|
|
|
OUT EFI_HPC_STATE *HpcState,
|
|
|
|
OUT VOID **Padding,
|
|
|
|
OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Prototypes for the PCI Hot Plug Init Protocol
|
|
|
|
//
|
|
|
|
|
2009-07-03 08:46:14 +02:00
|
|
|
///
|
|
|
|
/// This protocol provides the necessary functionality to initialize the
|
|
|
|
/// Hot Plug Controllers (HPCs) and the buses that they control. This protocol
|
|
|
|
/// also provides information regarding resource padding.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {
|
2009-07-02 09:40:24 +02:00
|
|
|
///
|
|
|
|
/// Returns a list of root HPCs and the buses that they control.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_GET_ROOT_HPC_LIST GetRootHpcList;
|
2009-07-02 09:40:24 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Initializes the specified root HPC.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_INITIALIZE_ROOT_HPC InitializeRootHpc;
|
2009-07-02 09:40:24 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Returns the resource padding that is required by the HPC.
|
|
|
|
///
|
2009-07-06 04:22:21 +02:00
|
|
|
EFI_GET_HOT_PLUG_PADDING GetResourcePadding;
|
2007-06-15 12:02:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|