The latest development version of this page may be more current than this released 3.7.0 version.

Platform Environment Control Interface (PECI)

Overview

The Platform Environment Control Interface, abbreviated as PECI, is a thermal management standard introduced in 2006 with the Intel Core 2 Duo Microprocessors. The PECI interface allows external devices to read processor temperature, perform processor manageability functions, and manage processor interface tuning and diagnostics. The PECI bus driver APIs enable the interaction between Embedded Microcontrollers and CPUs.

Configuration Options

Related configuration options:

API Reference

group peci_interface

PECI Interface 3.0.

Since

2.1

Version

1.0.0

PECI read/write supported responses.

PECI_CC_RSP_SUCCESS
PECI_CC_RSP_TIMEOUT
PECI_CC_OUT_OF_RESOURCES_TIMEOUT
PECI_CC_RESOURCES_LOWPWR_TIMEOUT
PECI_CC_ILLEGAL_REQUEST

Ping command format.

PECI_PING_WR_LEN
PECI_PING_RD_LEN
PECI_PING_LEN

GetDIB command format.

PECI_GET_DIB_WR_LEN
PECI_GET_DIB_RD_LEN
PECI_GET_DIB_CMD_LEN
PECI_GET_DIB_DEVINFO
PECI_GET_DIB_REVNUM
PECI_GET_DIB_DOMAIN_BIT_MASK
PECI_GET_DIB_MAJOR_REV_MASK
PECI_GET_DIB_MINOR_REV_MASK

GetTemp command format.

PECI_GET_TEMP_WR_LEN
PECI_GET_TEMP_RD_LEN
PECI_GET_TEMP_CMD_LEN
PECI_GET_TEMP_LSB
PECI_GET_TEMP_MSB
PECI_GET_TEMP_ERR_MSB
PECI_GET_TEMP_ERR_LSB_GENERAL
PECI_GET_TEMP_ERR_LSB_RES
PECI_GET_TEMP_ERR_LSB_TEMP_LO
PECI_GET_TEMP_ERR_LSB_TEMP_HI

RdPkgConfig command format.

PECI_RD_PKG_WR_LEN
PECI_RD_PKG_LEN_BYTE
PECI_RD_PKG_LEN_WORD
PECI_RD_PKG_LEN_DWORD
PECI_RD_PKG_CMD_LEN

WrPkgConfig command format.

PECI_WR_PKG_RD_LEN
PECI_WR_PKG_LEN_BYTE
PECI_WR_PKG_LEN_WORD
PECI_WR_PKG_LEN_DWORD
PECI_WR_PKG_CMD_LEN

RdIAMSR command format.

PECI_RD_IAMSR_WR_LEN
PECI_RD_IAMSR_LEN_BYTE
PECI_RD_IAMSR_LEN_WORD
PECI_RD_IAMSR_LEN_DWORD
PECI_RD_IAMSR_LEN_QWORD
PECI_RD_IAMSR_CMD_LEN

WrIAMSR command format.

PECI_WR_IAMSR_RD_LEN
PECI_WR_IAMSR_LEN_BYTE
PECI_WR_IAMSR_LEN_WORD
PECI_WR_IAMSR_LEN_DWORD
PECI_WR_IAMSR_LEN_QWORD
PECI_WR_IAMSR_CMD_LEN

RdPCIConfig command format.

PECI_RD_PCICFG_WR_LEN
PECI_RD_PCICFG_LEN_BYTE
PECI_RD_PCICFG_LEN_WORD
PECI_RD_PCICFG_LEN_DWORD
PECI_RD_PCICFG_CMD_LEN

WrPCIConfig command format.

PECI_WR_PCICFG_RD_LEN
PECI_WR_PCICFG_LEN_BYTE
PECI_WR_PCICFG_LEN_WORD
PECI_WR_PCICFG_LEN_DWORD
PECI_WR_PCICFG_CMD_LEN

RdPCIConfigLocal command format.

PECI_RD_PCICFGL_WR_LEN
PECI_RD_PCICFGL_RD_LEN_BYTE
PECI_RD_PCICFGL_RD_LEN_WORD
PECI_RD_PCICFGL_RD_LEN_DWORD
PECI_RD_PCICFGL_CMD_LEN

WrPCIConfigLocal command format.

PECI_WR_PCICFGL_RD_LEN
PECI_WR_PCICFGL_WR_LEN_BYTE
PECI_WR_PCICFGL_WR_LEN_WORD
PECI_WR_PCICFGL_WR_LEN_DWORD
PECI_WR_PCICFGL_CMD_LEN

Enums

enum peci_error_code

PECI error codes.

Values:

enumerator PECI_GENERAL_SENSOR_ERROR = 0x8000
enumerator PECI_UNDERFLOW_SENSOR_ERROR = 0x8002
enumerator PECI_OVERFLOW_SENSOR_ERROR = 0x8003
enum peci_command_code

PECI commands.

Values:

enumerator PECI_CMD_PING = 0x00
enumerator PECI_CMD_GET_TEMP0 = 0x01
enumerator PECI_CMD_GET_TEMP1 = 0x02
enumerator PECI_CMD_RD_PCI_CFG0 = 0x61
enumerator PECI_CMD_RD_PCI_CFG1 = 0x62
enumerator PECI_CMD_WR_PCI_CFG0 = 0x65
enumerator PECI_CMD_WR_PCI_CFG1 = 0x66
enumerator PECI_CMD_RD_PKG_CFG0 = 0xA1
enumerator PECI_CMD_RD_PKG_CFG1 = 0xA
enumerator PECI_CMD_WR_PKG_CFG0 = 0xA5
enumerator PECI_CMD_WR_PKG_CFG1 = 0xA6
enumerator PECI_CMD_RD_IAMSR0 = 0xB1
enumerator PECI_CMD_RD_IAMSR1 = 0xB2
enumerator PECI_CMD_WR_IAMSR0 = 0xB5
enumerator PECI_CMD_WR_IAMSR1 = 0xB6
enumerator PECI_CMD_RD_PCI_CFG_LOCAL0 = 0xE1
enumerator PECI_CMD_RD_PCI_CFG_LOCAL1 = 0xE2
enumerator PECI_CMD_WR_PCI_CFG_LOCAL0 = 0xE5
enumerator PECI_CMD_WR_PCI_CFG_LOCAL1 = 0xE6
enumerator PECI_CMD_GET_DIB = 0xF7

Functions

int peci_config(const struct device *dev, uint32_t bitrate)

Configures the PECI interface.

Parameters:
  • dev – Pointer to the device structure for the driver instance.

  • bitrate – the selected bitrate expressed in Kbps.

Return values:
  • 0 – If successful.

  • Negative – errno code if failure.

int peci_enable(const struct device *dev)

Enable PECI interface.

Parameters:
  • dev – Pointer to the device structure for the driver instance.

Return values:
  • 0 – If successful.

  • Negative – errno code if failure.

int peci_disable(const struct device *dev)

Disable PECI interface.

Parameters:
  • dev – Pointer to the device structure for the driver instance.

Return values:
  • 0 – If successful.

  • Negative – errno code if failure.

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

Performs a PECI transaction.

Parameters:
  • dev – Pointer to the device structure for the driver instance.

  • msg – Structure representing a PECI transaction.

Return values:
  • 0 – If successful.

  • Negative – errno code if failure.

struct peci_buf
#include <peci.h>

PECI buffer structure.

Public Members

uint8_t *buf

Valid pointer on a data buffer, or NULL otherwise.

size_t len

Length of the data buffer expected to be received without considering the frame check sequence byte.

Note

Frame check sequence byte is added into rx buffer: need to allocate an additional byte for this in rx buffer.

struct peci_msg
#include <peci.h>

PECI transaction packet format.

Public Members

uint8_t addr

Client address.

enum peci_command_code cmd_code

Command code.

struct peci_buf tx_buffer

Pointer to buffer of write data.

struct peci_buf rx_buffer

Pointer to buffer of read data.

uint8_t flags

PECI msg flags.