1. Remove unnecessary CONST.
2. Remove Unnecessarily including <ProcessorBind.h>. 3. Add comments for struct definition. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5806 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1fb24cc445
commit
11227adb14
|
@ -22,7 +22,6 @@
|
||||||
#ifndef __PEI_PCI_CFG2_H__
|
#ifndef __PEI_PCI_CFG2_H__
|
||||||
#define __PEI_PCI_CFG2_H__
|
#define __PEI_PCI_CFG2_H__
|
||||||
|
|
||||||
#include <ProcessorBind.h>
|
|
||||||
#include <Pi/PiPeiCis.h>
|
#include <Pi/PiPeiCis.h>
|
||||||
|
|
||||||
#define EFI_PEI_PCI_CFG2_PPI_GUID \
|
#define EFI_PEI_PCI_CFG2_PPI_GUID \
|
||||||
|
@ -52,10 +51,29 @@ typedef enum {
|
||||||
/// EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS
|
/// EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
///
|
||||||
|
/// 8-bit register offset within the PCI configuration space for a given device's function
|
||||||
|
/// space.
|
||||||
|
///
|
||||||
UINT8 Register;
|
UINT8 Register;
|
||||||
|
///
|
||||||
|
/// Only the 3 least-significant bits are used to encode one of 8 possible functions within a
|
||||||
|
/// given device.
|
||||||
|
///
|
||||||
UINT8 Function;
|
UINT8 Function;
|
||||||
|
///
|
||||||
|
/// Only the 5 least-significant bits are used to encode one of 32 possible devices.
|
||||||
|
///
|
||||||
UINT8 Device;
|
UINT8 Device;
|
||||||
|
///
|
||||||
|
/// 8-bit value to encode between 0 and 255 buses.
|
||||||
|
///
|
||||||
UINT8 Bus;
|
UINT8 Bus;
|
||||||
|
///
|
||||||
|
/// Register number in PCI configuration space. If this field is zero, then Register is used
|
||||||
|
/// for the register number. If this field is non-zero, then Register is ignored and this field
|
||||||
|
/// is used for the register number.
|
||||||
|
///
|
||||||
UINT32 ExtendedRegister;
|
UINT32 ExtendedRegister;
|
||||||
} EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS;
|
} EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS;
|
||||||
|
|
||||||
|
@ -131,8 +149,8 @@ EFI_STATUS
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
||||||
IN UINT64 Address,
|
IN UINT64 Address,
|
||||||
IN CONST VOID *SetBits,
|
IN VOID *SetBits,
|
||||||
IN CONST VOID *ClearBits
|
IN VOID *ClearBits
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#ifndef __PEI_SMBUS2_PPI_H__
|
#ifndef __PEI_SMBUS2_PPI_H__
|
||||||
#define __PEI_SMBUS2_PPI_H__
|
#define __PEI_SMBUS2_PPI_H__
|
||||||
|
|
||||||
#include <PiPei.h>
|
#include <PiPei.h>
|
||||||
#include <IndustryStandard/SmBus.h>
|
#include <IndustryStandard/SmBus.h>
|
||||||
|
|
||||||
|
@ -47,19 +48,15 @@ typedef UINTN EFI_SMBUS_DEVICE_COMMAND;
|
||||||
It can mean the offset to a list of functions inside
|
It can mean the offset to a list of functions inside
|
||||||
an SMBus slave device. Not all operations or slave devices support
|
an SMBus slave device. Not all operations or slave devices support
|
||||||
this command's registers.
|
this command's registers.
|
||||||
|
|
||||||
@param Operation Signifies which particular SMBus hardware protocol instance that it
|
@param Operation Signifies which particular SMBus hardware protocol instance that it
|
||||||
will use to execute the SMBus transactions.
|
will use to execute the SMBus transactions.
|
||||||
This SMBus hardware protocol is defined by the System Management Bus (SMBus)
|
This SMBus hardware protocol is defined by the System Management Bus (SMBus)
|
||||||
Specification and is not related to UEFI.
|
Specification and is not related to UEFI.
|
||||||
|
|
||||||
@param PecCheck Defines if Packet Error Code (PEC) checking is required for this operation.
|
@param PecCheck Defines if Packet Error Code (PEC) checking is required for this operation.
|
||||||
|
|
||||||
@param Length Signifies the number of bytes that this operation will do.
|
@param Length Signifies the number of bytes that this operation will do.
|
||||||
The maximum number of bytes can be revision specific and operation specific.
|
The maximum number of bytes can be revision specific and operation specific.
|
||||||
This parameter will contain the actual number of bytes that are executed
|
This parameter will contain the actual number of bytes that are executed
|
||||||
for this operation. Not all operations require this argument.
|
for this operation. Not all operations require this argument.
|
||||||
|
|
||||||
@param Buffer Contains the value of data to execute to the SMBus slave device.
|
@param Buffer Contains the value of data to execute to the SMBus slave device.
|
||||||
Not all operations require this argument.
|
Not all operations require this argument.
|
||||||
The length of this buffer is identified by Length.
|
The length of this buffer is identified by Length.
|
||||||
|
@ -85,10 +82,10 @@ typedef
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
(EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION)(
|
(EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION)(
|
||||||
IN CONST EFI_PEI_SMBUS2_PPI *This,
|
IN CONST EFI_PEI_SMBUS2_PPI *This,
|
||||||
IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
|
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
|
||||||
IN CONST EFI_SMBUS_DEVICE_COMMAND Command,
|
IN EFI_SMBUS_DEVICE_COMMAND Command,
|
||||||
IN CONST EFI_SMBUS_OPERATION Operation,
|
IN EFI_SMBUS_OPERATION Operation,
|
||||||
IN CONST BOOLEAN PecCheck,
|
IN BOOLEAN PecCheck,
|
||||||
IN OUT UINTN *Length,
|
IN OUT UINTN *Length,
|
||||||
IN OUT VOID *Buffer
|
IN OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
|
@ -121,14 +118,22 @@ typedef
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
(EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE)(
|
(EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE)(
|
||||||
IN CONST EFI_PEI_SMBUS2_PPI *This,
|
IN CONST EFI_PEI_SMBUS2_PPI *This,
|
||||||
IN CONST BOOLEAN ArpAll,
|
IN BOOLEAN ArpAll,
|
||||||
IN CONST EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
|
IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
|
||||||
IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
|
IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
///
|
||||||
|
/// The SMBUS hardware address to which the SMBUS device is preassigned or
|
||||||
|
/// allocated. Type EFI_SMBUS_DEVICE_ADDRESS is defined in EFI_PEI_SMBUS2_PPI.Execute().
|
||||||
|
///
|
||||||
EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
|
EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
|
||||||
|
///
|
||||||
|
/// The SMBUS Unique Device Identifier (UDID) as defined in EFI_SMBUS_UDID.
|
||||||
|
/// Type EFI_SMBUS_UDID is defined in EFI_PEI_SMBUS2_PPI.ArpDevice().
|
||||||
|
///
|
||||||
EFI_SMBUS_UDID SmbusDeviceUdid;
|
EFI_SMBUS_UDID SmbusDeviceUdid;
|
||||||
} EFI_SMBUS_DEVICE_MAP;
|
} EFI_SMBUS_DEVICE_MAP;
|
||||||
|
|
||||||
|
@ -162,14 +167,17 @@ EFI_STATUS
|
||||||
@param Data Data of the SMBus host notify command that
|
@param Data Data of the SMBus host notify command that
|
||||||
the caller wants to be called.
|
the caller wants to be called.
|
||||||
|
|
||||||
@return Status
|
@retval EFI_SUCCESS NotifyFunction has been registered.
|
||||||
|
@retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are not
|
||||||
|
implemented by this PEIM.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
typedef
|
typedef
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
(EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION)(
|
(EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION)(
|
||||||
IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi,
|
IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi,
|
||||||
IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
|
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
|
||||||
IN CONST UINTN Data
|
IN UINTN Data
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,40 +199,38 @@ EFI_STATUS
|
||||||
typedef
|
typedef
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
(EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY)(
|
(EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY)(
|
||||||
IN CONST EFI_PEI_SMBUS2_PPI *This,
|
IN CONST EFI_PEI_SMBUS2_PPI *This,
|
||||||
IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
|
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
|
||||||
IN CONST UINTN Data,
|
IN UINTN Data,
|
||||||
IN CONST EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction
|
IN EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
///
|
||||||
@par Ppi Description:
|
/// Provides the basic I/O interfaces that a PEIM uses to access
|
||||||
Provides the basic I/O interfaces that a PEIM uses to access
|
/// its SMBus controller and the slave devices attached to it.
|
||||||
its SMBus controller and the slave devices attached to it.
|
///
|
||||||
|
|
||||||
@param Execute
|
|
||||||
Executes the SMBus operation to an SMBus slave device.
|
|
||||||
|
|
||||||
@param ArpDevice
|
|
||||||
Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)
|
|
||||||
|
|
||||||
@param GetArpMap
|
|
||||||
Allows a PEIM to retrieve the address that was allocated by the SMBus
|
|
||||||
host controller during enumeration/ARP.
|
|
||||||
|
|
||||||
@param Notify
|
|
||||||
Allows a driver to register for a callback to the SMBus host
|
|
||||||
controller driver when the bus issues a notification to the bus controller PEIM.
|
|
||||||
|
|
||||||
@param Identifier
|
|
||||||
Identifier which uniquely identifies this SMBus controller in a system.
|
|
||||||
|
|
||||||
**/
|
|
||||||
struct _EFI_PEI_SMBUS2_PPI {
|
struct _EFI_PEI_SMBUS2_PPI {
|
||||||
|
///
|
||||||
|
/// Executes the SMBus operation to an SMBus slave device.
|
||||||
|
///
|
||||||
EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION Execute;
|
EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION Execute;
|
||||||
|
///
|
||||||
|
/// Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP).
|
||||||
|
///
|
||||||
EFI_PEI_SMBUS2_PPI_ARP_DEVICE ArpDevice;
|
EFI_PEI_SMBUS2_PPI_ARP_DEVICE ArpDevice;
|
||||||
|
///
|
||||||
|
/// Allows a PEIM to retrieve the address that was allocated by the SMBus
|
||||||
|
/// host controller during enumeration/ARP.
|
||||||
|
///
|
||||||
EFI_PEI_SMBUS2_PPI_GET_ARP_MAP GetArpMap;
|
EFI_PEI_SMBUS2_PPI_GET_ARP_MAP GetArpMap;
|
||||||
|
///
|
||||||
|
/// Allows a driver to register for a callback to the SMBus host
|
||||||
|
/// controller driver when the bus issues a notification to the bus controller PEIM.
|
||||||
|
///
|
||||||
EFI_PEI_SMBUS2_PPI_NOTIFY Notify;
|
EFI_PEI_SMBUS2_PPI_NOTIFY Notify;
|
||||||
|
///
|
||||||
|
/// Identifier which uniquely identifies this SMBus controller in a system.
|
||||||
|
///
|
||||||
EFI_GUID Identifier;
|
EFI_GUID Identifier;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue