MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Smbus2.h File Reference

Data Structures

struct  _EFI_PEI_SMBUS2_PPI
 

Macros

#define EFI_PEI_SMBUS2_PPI_GUID   { 0x9ca93627, 0xb65b, 0x4324, { 0xa2, 0x2, 0xc0, 0xb4, 0x61, 0x76, 0x45, 0x43 } }
 

Typedefs

typedef struct _EFI_PEI_SMBUS2_PPI EFI_PEI_SMBUS2_PPI
 
typedef EFI_STATUS(EFIAPIEFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION )(IN CONST EFI_PEI_SMBUS2_PPI *This, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN EFI_SMBUS_DEVICE_COMMAND Command, IN EFI_SMBUS_OPERATION Operation, IN BOOLEAN PecCheck, IN OUT UINTN *Length, IN OUT VOID *Buffer)
 
typedef EFI_STATUS(EFIAPIEFI_PEI_SMBUS2_PPI_ARP_DEVICE )(IN CONST EFI_PEI_SMBUS2_PPI *This, IN BOOLEAN ArpAll, IN EFI_SMBUS_UDID *SmbusUdid, IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress)
 
typedef EFI_STATUS(EFIAPIEFI_PEI_SMBUS2_PPI_GET_ARP_MAP )(IN CONST EFI_PEI_SMBUS2_PPI *This, IN OUT UINTN *Length, IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap)
 
typedef EFI_STATUS(EFIAPIEFI_PEI_SMBUS_NOTIFY2_FUNCTION )(IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data)
 
typedef EFI_STATUS(EFIAPIEFI_PEI_SMBUS2_PPI_NOTIFY )(IN CONST EFI_PEI_SMBUS2_PPI *This, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data, IN EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction)
 

Variables

EFI_GUID gEfiPeiSmbus2PpiGuid
 

Detailed Description

This file declares Smbus2 PPI. This PPI provides the basic I/O interfaces that a PEIM uses to access its SMBus controller and the slave devices attached to it.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This PPI is introduced in PI Version 1.0.

Macro Definition Documentation

#define EFI_PEI_SMBUS2_PPI_GUID   { 0x9ca93627, 0xb65b, 0x4324, { 0xa2, 0x2, 0xc0, 0xb4, 0x61, 0x76, 0x45, 0x43 } }

Typedef Documentation

typedef EFI_STATUS(EFIAPI * EFI_PEI_SMBUS2_PPI_ARP_DEVICE)(IN CONST EFI_PEI_SMBUS2_PPI *This, IN BOOLEAN ArpAll, IN EFI_SMBUS_UDID *SmbusUdid, IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress)

The ArpDevice() function enumerates the entire bus or enumerates a specific device that is identified by SmbusUdid.

Parameters
ThisA pointer to the EFI_PEI_SMBUS2_PPI instance.
ArpAllA Boolean expression that indicates if the host drivers need to enumerate all the devices or enumerate only the device that is identified by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional. If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address will be at SlaveAddress.
SmbusUdidThe targeted SMBus Unique Device Identifier (UDID). The UDID may not exist for SMBus devices with fixed addresses.
SlaveAddressThe new SMBus address for the slave device for which the operation is targeted.
Return values
EFI_SUCCESSThe SMBus slave device address was set.
EFI_INVALID_PARAMETERSlaveAddress is NULL.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_TIMEOUTThe SMBus slave device did not respond.
EFI_DEVICE_ERRORThe request was not completed because the transaction failed.
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this PEIM.

Executes an SMBus operation to an SMBus controller. Returns when either the command has been executed or an error is encountered in doing the operation.

Parameters
ThisA pointer to the EFI_PEI_SMBUS2_PPI instance.
SlaveAddressThe SMBUS hardware address to which the SMBUS device is preassigned or allocated.
CommandThis command is transmitted by the SMBus host controller to the SMBus slave device and the interpretation is SMBus slave device specific. It can mean the offset to a list of functions inside an SMBus slave device. Not all operations or slave devices support this command's registers.
OperationSignifies which particular SMBus hardware protocol instance that it will use to execute the SMBus transactions. This SMBus hardware protocol is defined by the System Management Bus (SMBus) Specification and is not related to UEFI.
PecCheckDefines if Packet Error Code (PEC) checking is required for this operation.
LengthSignifies the number of bytes that this operation will do. The maximum number of bytes can be revision specific and operation specific. This parameter will contain the actual number of bytes that are executed for this operation. Not all operations require this argument.
BufferContains the value of data to execute to the SMBus slave device. Not all operations require this argument. The length of this buffer is identified by Length.
Return values
EFI_SUCCESSThe last data that was returned from the access matched the poll exit criteria.
EFI_CRC_ERRORThe checksum is not correct (PEC is incorrect)
EFI_TIMEOUTTimeout expired before the operation was completed. Timeout is determined by the SMBus host controller device.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
EFI_DEVICE_ERRORThe request was not completed because a failure reflected in the Host Status Register bit.
EFI_INVALID_PARAMETEROperation is not defined in EFI_SMBUS_OPERATION. Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and EfiSmbusQuickWrite. Or Length is outside the range of valid values.
EFI_UNSUPPORTEDThe SMBus operation or PEC is not supported.
EFI_BUFFER_TOO_SMALLBuffer is not sufficient for this operation.
typedef EFI_STATUS(EFIAPI * EFI_PEI_SMBUS2_PPI_GET_ARP_MAP)(IN CONST EFI_PEI_SMBUS2_PPI *This, IN OUT UINTN *Length, IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap)

The GetArpMap() function returns the mapping of all the SMBus devices that are enumerated by the SMBus host driver.

Parameters
ThisA pointer to the EFI_PEI_SMBUS2_PPI instance.
LengthSize of the buffer that contains the SMBus device map.
SmbusDeviceMapThe pointer to the device map as enumerated by the SMBus controller driver.
Return values
EFI_SUCCESSThe device map was returned correctly in the buffer.
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this PEIM.

The Notify() function registers all the callback functions to allow the bus driver to call these functions when the SlaveAddress/Data pair happens.

Parameters
ThisA pointer to the EFI_PEI_SMBUS2_PPI instance.
SlaveAddressAddress that the host controller detects as sending a message and calls all the registered functions.
DataData that the host controller detects as sending a message and calls all the registered functions.
NotifyFunctionThe function to call when the bus driver detects the SlaveAddress and Data pair.
Return values
EFI_SUCCESSNotifyFunction has been registered.
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this PEIM.
typedef EFI_STATUS(EFIAPI * EFI_PEI_SMBUS_NOTIFY2_FUNCTION)(IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data)

CallBack function can be registered in EFI_PEI_SMBUS2_PPI_NOTIFY.

Parameters
ThisA pointer to the EFI_PEI_SMBUS2_PPI instance.
SlaveAddressThe SMBUS hardware address to which the SMBUS device is preassigned or allocated.
DataData of the SMBus host notify command that the caller wants to be called.
Return values
EFI_SUCCESSNotifyFunction has been registered.
EFI_UNSUPPORTEDArpDevice, GetArpMap, and Notify are not implemented by this PEIM.

Variable Documentation

EFI_GUID gEfiPeiSmbus2PpiGuid