Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
PECI Interface

PECI Interface 3.0. More...

Data Structures

struct  peci_buf
 PECI buffer structure. More...
 
struct  peci_msg
 PECI transaction packet format. More...
 

Macros

#define PECI_CC_RSP_SUCCESS   (0x40U)
 
#define PECI_CC_RSP_TIMEOUT   (0x80U)
 
#define PECI_CC_OUT_OF_RESOURCES_TIMEOUT   (0x81U)
 
#define PECI_CC_RESOURCES_LOWPWR_TIMEOUT   (0x82U)
 
#define PECI_CC_ILLEGAL_REQUEST   (0x90U)
 
#define PECI_PING_WR_LEN   (0U)
 
#define PECI_PING_RD_LEN   (0U)
 
#define PECI_PING_LEN   (3U)
 
#define PECI_GET_DIB_WR_LEN   (1U)
 
#define PECI_GET_DIB_RD_LEN   (8U)
 
#define PECI_GET_DIB_CMD_LEN   (4U)
 
#define PECI_GET_DIB_DEVINFO   (0U)
 
#define PECI_GET_DIB_REVNUM   (1U)
 
#define PECI_GET_DIB_DOMAIN_BIT_MASK   (0x4U)
 
#define PECI_GET_DIB_MAJOR_REV_MASK   0xF0
 
#define PECI_GET_DIB_MINOR_REV_MASK   0x0F
 
#define PECI_GET_TEMP_WR_LEN   (1U)
 
#define PECI_GET_TEMP_RD_LEN   (2U)
 
#define PECI_GET_TEMP_CMD_LEN   (4U)
 
#define PECI_GET_TEMP_LSB   (0U)
 
#define PECI_GET_TEMP_MSB   (1U)
 
#define PECI_GET_TEMP_ERR_MSB   (0x80U)
 
#define PECI_GET_TEMP_ERR_LSB_GENERAL   (0x0U)
 
#define PECI_GET_TEMP_ERR_LSB_RES   (0x1U)
 
#define PECI_GET_TEMP_ERR_LSB_TEMP_LO   (0x2U)
 
#define PECI_GET_TEMP_ERR_LSB_TEMP_HI   (0x3U)
 
#define PECI_RD_PKG_WR_LEN   (5U)
 
#define PECI_RD_PKG_LEN_BYTE   (2U)
 
#define PECI_RD_PKG_LEN_WORD   (3U)
 
#define PECI_RD_PKG_LEN_DWORD   (5U)
 
#define PECI_RD_PKG_CMD_LEN   (8U)
 
#define PECI_WR_PKG_RD_LEN   (1U)
 
#define PECI_WR_PKG_LEN_BYTE   (7U)
 
#define PECI_WR_PKG_LEN_WORD   (8U)
 
#define PECI_WR_PKG_LEN_DWORD   (10U)
 
#define PECI_WR_PKG_CMD_LEN   (9U)
 
#define PECI_RD_IAMSR_WR_LEN   (5U)
 
#define PECI_RD_IAMSR_LEN_BYTE   (2U)
 
#define PECI_RD_IAMSR_LEN_WORD   (3U)
 
#define PECI_RD_IAMSR_LEN_DWORD   (5U)
 
#define PECI_RD_IAMSR_LEN_QWORD   (9U)
 
#define PECI_RD_IAMSR_CMD_LEN   (8U)
 
#define PECI_WR_IAMSR_RD_LEN   (1U)
 
#define PECI_WR_IAMSR_LEN_BYTE   (7U)
 
#define PECI_WR_IAMSR_LEN_WORD   (8U)
 
#define PECI_WR_IAMSR_LEN_DWORD   (10U)
 
#define PECI_WR_IAMSR_LEN_QWORD   (14U)
 
#define PECI_WR_IAMSR_CMD_LEN   (9U)
 
#define PECI_RD_PCICFG_WR_LEN   (6U)
 
#define PECI_RD_PCICFG_LEN_BYTE   (2U)
 
#define PECI_RD_PCICFG_LEN_WORD   (3U)
 
#define PECI_RD_PCICFG_LEN_DWORD   (5U)
 
#define PECI_RD_PCICFG_CMD_LEN   (9U)
 
#define PECI_WR_PCICFG_RD_LEN   (1U)
 
#define PECI_WR_PCICFG_LEN_BYTE   (8U)
 
#define PECI_WR_PCICFG_LEN_WORD   (9U)
 
#define PECI_WR_PCICFG_LEN_DWORD   (11U)
 
#define PECI_WR_PCICFG_CMD_LEN   (10U)
 
#define PECI_RD_PCICFGL_WR_LEN   (5U)
 
#define PECI_RD_PCICFGL_RD_LEN_BYTE   (2U)
 
#define PECI_RD_PCICFGL_RD_LEN_WORD   (3U)
 
#define PECI_RD_PCICFGL_RD_LEN_DWORD   (5U)
 
#define PECI_RD_PCICFGL_CMD_LEN   (8U)
 
#define PECI_WR_PCICFGL_RD_LEN   (1U)
 
#define PECI_WR_PCICFGL_WR_LEN_BYTE   (7U)
 
#define PECI_WR_PCICFGL_WR_LEN_WORD   (8U)
 
#define PECI_WR_PCICFGL_WR_LEN_DWORD   (10U)
 
#define PECI_WR_PCICFGL_CMD_LEN   (9U)
 

Enumerations

enum  peci_error_code { PECI_GENERAL_SENSOR_ERROR = 0x8000 , PECI_UNDERFLOW_SENSOR_ERROR = 0x8002 , PECI_OVERFLOW_SENSOR_ERROR = 0x8003 }
 PECI error codes. More...
 
enum  peci_command_code {
  PECI_CMD_PING = 0x00 , PECI_CMD_GET_TEMP0 = 0x01 , PECI_CMD_GET_TEMP1 = 0x02 , PECI_CMD_RD_PCI_CFG0 = 0x61 ,
  PECI_CMD_RD_PCI_CFG1 = 0x62 , PECI_CMD_WR_PCI_CFG0 = 0x65 , PECI_CMD_WR_PCI_CFG1 = 0x66 , PECI_CMD_RD_PKG_CFG0 = 0xA1 ,
  PECI_CMD_RD_PKG_CFG1 = 0xA , PECI_CMD_WR_PKG_CFG0 = 0xA5 , PECI_CMD_WR_PKG_CFG1 = 0xA6 , PECI_CMD_RD_IAMSR0 = 0xB1 ,
  PECI_CMD_RD_IAMSR1 = 0xB2 , PECI_CMD_WR_IAMSR0 = 0xB5 , PECI_CMD_WR_IAMSR1 = 0xB6 , PECI_CMD_RD_PCI_CFG_LOCAL0 = 0xE1 ,
  PECI_CMD_RD_PCI_CFG_LOCAL1 = 0xE2 , PECI_CMD_WR_PCI_CFG_LOCAL0 = 0xE5 , PECI_CMD_WR_PCI_CFG_LOCAL1 = 0xE6 , PECI_CMD_GET_DIB = 0xF7
}
 PECI commands. More...
 

Functions

int peci_config (const struct device *dev, uint32_t bitrate)
 Configures the PECI interface. More...
 
int peci_enable (const struct device *dev)
 Enable PECI interface. More...
 
int peci_disable (const struct device *dev)
 Disable PECI interface. More...
 
int peci_transfer (const struct device *dev, struct peci_msg *msg)
 Performs a PECI transaction. More...
 

Detailed Description

PECI Interface 3.0.

Macro Definition Documentation

◆ PECI_CC_ILLEGAL_REQUEST

#define PECI_CC_ILLEGAL_REQUEST   (0x90U)

◆ PECI_CC_OUT_OF_RESOURCES_TIMEOUT

#define PECI_CC_OUT_OF_RESOURCES_TIMEOUT   (0x81U)

◆ PECI_CC_RESOURCES_LOWPWR_TIMEOUT

#define PECI_CC_RESOURCES_LOWPWR_TIMEOUT   (0x82U)

◆ PECI_CC_RSP_SUCCESS

#define PECI_CC_RSP_SUCCESS   (0x40U)

#include <include/drivers/peci.h>

PECI read/write supported responses

◆ PECI_CC_RSP_TIMEOUT

#define PECI_CC_RSP_TIMEOUT   (0x80U)

◆ PECI_GET_DIB_CMD_LEN

#define PECI_GET_DIB_CMD_LEN   (4U)

◆ PECI_GET_DIB_DEVINFO

#define PECI_GET_DIB_DEVINFO   (0U)

◆ PECI_GET_DIB_DOMAIN_BIT_MASK

#define PECI_GET_DIB_DOMAIN_BIT_MASK   (0x4U)

◆ PECI_GET_DIB_MAJOR_REV_MASK

#define PECI_GET_DIB_MAJOR_REV_MASK   0xF0

◆ PECI_GET_DIB_MINOR_REV_MASK

#define PECI_GET_DIB_MINOR_REV_MASK   0x0F

◆ PECI_GET_DIB_RD_LEN

#define PECI_GET_DIB_RD_LEN   (8U)

◆ PECI_GET_DIB_REVNUM

#define PECI_GET_DIB_REVNUM   (1U)

◆ PECI_GET_DIB_WR_LEN

#define PECI_GET_DIB_WR_LEN   (1U)

#include <include/drivers/peci.h>

GetDIB command format.

◆ PECI_GET_TEMP_CMD_LEN

#define PECI_GET_TEMP_CMD_LEN   (4U)

◆ PECI_GET_TEMP_ERR_LSB_GENERAL

#define PECI_GET_TEMP_ERR_LSB_GENERAL   (0x0U)

◆ PECI_GET_TEMP_ERR_LSB_RES

#define PECI_GET_TEMP_ERR_LSB_RES   (0x1U)

◆ PECI_GET_TEMP_ERR_LSB_TEMP_HI

#define PECI_GET_TEMP_ERR_LSB_TEMP_HI   (0x3U)

◆ PECI_GET_TEMP_ERR_LSB_TEMP_LO

#define PECI_GET_TEMP_ERR_LSB_TEMP_LO   (0x2U)

◆ PECI_GET_TEMP_ERR_MSB

#define PECI_GET_TEMP_ERR_MSB   (0x80U)

◆ PECI_GET_TEMP_LSB

#define PECI_GET_TEMP_LSB   (0U)

◆ PECI_GET_TEMP_MSB

#define PECI_GET_TEMP_MSB   (1U)

◆ PECI_GET_TEMP_RD_LEN

#define PECI_GET_TEMP_RD_LEN   (2U)

◆ PECI_GET_TEMP_WR_LEN

#define PECI_GET_TEMP_WR_LEN   (1U)

#include <include/drivers/peci.h>

GetTemp command format.

◆ PECI_PING_LEN

#define PECI_PING_LEN   (3U)

◆ PECI_PING_RD_LEN

#define PECI_PING_RD_LEN   (0U)

◆ PECI_PING_WR_LEN

#define PECI_PING_WR_LEN   (0U)

#include <include/drivers/peci.h>

Ping command format.

◆ PECI_RD_IAMSR_CMD_LEN

#define PECI_RD_IAMSR_CMD_LEN   (8U)

◆ PECI_RD_IAMSR_LEN_BYTE

#define PECI_RD_IAMSR_LEN_BYTE   (2U)

◆ PECI_RD_IAMSR_LEN_DWORD

#define PECI_RD_IAMSR_LEN_DWORD   (5U)

◆ PECI_RD_IAMSR_LEN_QWORD

#define PECI_RD_IAMSR_LEN_QWORD   (9U)

◆ PECI_RD_IAMSR_LEN_WORD

#define PECI_RD_IAMSR_LEN_WORD   (3U)

◆ PECI_RD_IAMSR_WR_LEN

#define PECI_RD_IAMSR_WR_LEN   (5U)

#include <include/drivers/peci.h>

RdIAMSR command format

◆ PECI_RD_PCICFG_CMD_LEN

#define PECI_RD_PCICFG_CMD_LEN   (9U)

◆ PECI_RD_PCICFG_LEN_BYTE

#define PECI_RD_PCICFG_LEN_BYTE   (2U)

◆ PECI_RD_PCICFG_LEN_DWORD

#define PECI_RD_PCICFG_LEN_DWORD   (5U)

◆ PECI_RD_PCICFG_LEN_WORD

#define PECI_RD_PCICFG_LEN_WORD   (3U)

◆ PECI_RD_PCICFG_WR_LEN

#define PECI_RD_PCICFG_WR_LEN   (6U)

#include <include/drivers/peci.h>

RdPCIConfig command format

◆ PECI_RD_PCICFGL_CMD_LEN

#define PECI_RD_PCICFGL_CMD_LEN   (8U)

◆ PECI_RD_PCICFGL_RD_LEN_BYTE

#define PECI_RD_PCICFGL_RD_LEN_BYTE   (2U)

◆ PECI_RD_PCICFGL_RD_LEN_DWORD

#define PECI_RD_PCICFGL_RD_LEN_DWORD   (5U)

◆ PECI_RD_PCICFGL_RD_LEN_WORD

#define PECI_RD_PCICFGL_RD_LEN_WORD   (3U)

◆ PECI_RD_PCICFGL_WR_LEN

#define PECI_RD_PCICFGL_WR_LEN   (5U)

#include <include/drivers/peci.h>

RdPCIConfigLocal command format

◆ PECI_RD_PKG_CMD_LEN

#define PECI_RD_PKG_CMD_LEN   (8U)

◆ PECI_RD_PKG_LEN_BYTE

#define PECI_RD_PKG_LEN_BYTE   (2U)

◆ PECI_RD_PKG_LEN_DWORD

#define PECI_RD_PKG_LEN_DWORD   (5U)

◆ PECI_RD_PKG_LEN_WORD

#define PECI_RD_PKG_LEN_WORD   (3U)

◆ PECI_RD_PKG_WR_LEN

#define PECI_RD_PKG_WR_LEN   (5U)

#include <include/drivers/peci.h>

RdPkgConfig command format.

◆ PECI_WR_IAMSR_CMD_LEN

#define PECI_WR_IAMSR_CMD_LEN   (9U)

◆ PECI_WR_IAMSR_LEN_BYTE

#define PECI_WR_IAMSR_LEN_BYTE   (7U)

◆ PECI_WR_IAMSR_LEN_DWORD

#define PECI_WR_IAMSR_LEN_DWORD   (10U)

◆ PECI_WR_IAMSR_LEN_QWORD

#define PECI_WR_IAMSR_LEN_QWORD   (14U)

◆ PECI_WR_IAMSR_LEN_WORD

#define PECI_WR_IAMSR_LEN_WORD   (8U)

◆ PECI_WR_IAMSR_RD_LEN

#define PECI_WR_IAMSR_RD_LEN   (1U)

#include <include/drivers/peci.h>

WrIAMSR command format

◆ PECI_WR_PCICFG_CMD_LEN

#define PECI_WR_PCICFG_CMD_LEN   (10U)

◆ PECI_WR_PCICFG_LEN_BYTE

#define PECI_WR_PCICFG_LEN_BYTE   (8U)

◆ PECI_WR_PCICFG_LEN_DWORD

#define PECI_WR_PCICFG_LEN_DWORD   (11U)

◆ PECI_WR_PCICFG_LEN_WORD

#define PECI_WR_PCICFG_LEN_WORD   (9U)

◆ PECI_WR_PCICFG_RD_LEN

#define PECI_WR_PCICFG_RD_LEN   (1U)

#include <include/drivers/peci.h>

WrPCIConfig command format

◆ PECI_WR_PCICFGL_CMD_LEN

#define PECI_WR_PCICFGL_CMD_LEN   (9U)

◆ PECI_WR_PCICFGL_RD_LEN

#define PECI_WR_PCICFGL_RD_LEN   (1U)

#include <include/drivers/peci.h>

WrPCIConfigLocal command format

◆ PECI_WR_PCICFGL_WR_LEN_BYTE

#define PECI_WR_PCICFGL_WR_LEN_BYTE   (7U)

◆ PECI_WR_PCICFGL_WR_LEN_DWORD

#define PECI_WR_PCICFGL_WR_LEN_DWORD   (10U)

◆ PECI_WR_PCICFGL_WR_LEN_WORD

#define PECI_WR_PCICFGL_WR_LEN_WORD   (8U)

◆ PECI_WR_PKG_CMD_LEN

#define PECI_WR_PKG_CMD_LEN   (9U)

◆ PECI_WR_PKG_LEN_BYTE

#define PECI_WR_PKG_LEN_BYTE   (7U)

◆ PECI_WR_PKG_LEN_DWORD

#define PECI_WR_PKG_LEN_DWORD   (10U)

◆ PECI_WR_PKG_LEN_WORD

#define PECI_WR_PKG_LEN_WORD   (8U)

◆ PECI_WR_PKG_RD_LEN

#define PECI_WR_PKG_RD_LEN   (1U)

#include <include/drivers/peci.h>

WrPkgConfig command format

Enumeration Type Documentation

◆ peci_command_code

#include <include/drivers/peci.h>

PECI commands.

Enumerator
PECI_CMD_PING 
PECI_CMD_GET_TEMP0 
PECI_CMD_GET_TEMP1 
PECI_CMD_RD_PCI_CFG0 
PECI_CMD_RD_PCI_CFG1 
PECI_CMD_WR_PCI_CFG0 
PECI_CMD_WR_PCI_CFG1 
PECI_CMD_RD_PKG_CFG0 
PECI_CMD_RD_PKG_CFG1 
PECI_CMD_WR_PKG_CFG0 
PECI_CMD_WR_PKG_CFG1 
PECI_CMD_RD_IAMSR0 
PECI_CMD_RD_IAMSR1 
PECI_CMD_WR_IAMSR0 
PECI_CMD_WR_IAMSR1 
PECI_CMD_RD_PCI_CFG_LOCAL0 
PECI_CMD_RD_PCI_CFG_LOCAL1 
PECI_CMD_WR_PCI_CFG_LOCAL0 
PECI_CMD_WR_PCI_CFG_LOCAL1 
PECI_CMD_GET_DIB 

◆ peci_error_code

#include <include/drivers/peci.h>

PECI error codes.

Enumerator
PECI_GENERAL_SENSOR_ERROR 
PECI_UNDERFLOW_SENSOR_ERROR 
PECI_OVERFLOW_SENSOR_ERROR 

Function Documentation

◆ peci_config()

int peci_config ( const struct device dev,
uint32_t  bitrate 
)

#include <include/drivers/peci.h>

Configures the PECI interface.

Parameters
devPointer to the device structure for the driver instance.
bitratethe selected expressed in Kbps. command or when an event needs to be sent to the client application.
Return values
0If successful.
Negativeerrno code if failure.

◆ peci_disable()

int peci_disable ( const struct device dev)

#include <include/drivers/peci.h>

Disable PECI interface.

Parameters
devPointer to the device structure for the driver instance.
Return values
0If successful.
Negativeerrno code if failure.

◆ peci_enable()

int peci_enable ( const struct device dev)

#include <include/drivers/peci.h>

Enable PECI interface.

Parameters
devPointer to the device structure for the driver instance.
Return values
0If successful.
Negativeerrno code if failure.

◆ peci_transfer()

int peci_transfer ( const struct device dev,
struct peci_msg msg 
)

#include <include/drivers/peci.h>

Performs a PECI transaction.

Parameters
devPointer to the device structure for the driver instance.
msgStructure representing a PECI transaction.
Return values
0If successful.
Negativeerrno code if failure.