This is the documentation for the latest (master) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

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.

Defines

PECI_RW_PKG_CFG_RSP_PASS

PECI read/write supported responses

PECI_RW_PKG_CFG_RSP_TIMEOUT
PECI_RW_PKG_CFG_RSP_ILLEGAL
PECI_PING_WR_LEN

Ping command format.

PECI_PING_RD_LEN
PECI_PING_LEN
PECI_GET_DIB_WR_LEN

GetDIB command format.

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
PECI_GET_TEMP_WR_LEN

GetTemp command format.

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
PECI_RD_PKG_WR_LEN

RdPkgConfig command format.

PECI_RD_PKG_LEN_BYTE
PECI_RD_PKG_LEN_WORD
PECI_RD_PKG_LEN_DWORD
PECI_RD_PKG_CMD_LEN
PECI_WR_PKG_RD_LEN

WrPkgConfig command format

PECI_WR_PKG_LEN_BYTE
PECI_WR_PKG_LEN_WORD
PECI_WR_PKG_LEN_DWORD
PECI_WR_PKG_CMD_LEN
PECI_RD_IAMSR_WR_LEN

RdIAMSR command format

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
PECI_WR_IAMSR_RD_LEN

WrIAMSR command format

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
PECI_RD_PCICFG_WR_LEN

RdPCIConfig command format

PECI_RD_PCICFG_LEN_BYTE
PECI_RD_PCICFG_LEN_WORD
PECI_RD_PCICFG_LEN_DWORD
PECI_RD_PCICFG_CMD_LEN
PECI_WR_PCICFG_RD_LEN

WrPCIConfig command format

PECI_WR_PCICFG_LEN_BYTE
PECI_WR_PCICFG_LEN_WORD
PECI_WR_PCICFG_LEN_DWORD
PECI_WR_PCICFG_CMD_LEN
PECI_RD_PCICFGL_WR_LEN

RdPCIConfigLocal command format

PECI_RD_PCICFGL_RD_LEN_BYTE
PECI_RD_PCICFGL_RD_LEN_WORD
PECI_RD_PCICFGL_RD_LEN_DWORD
PECI_RD_PCICFGL_CMD_LEN
PECI_WR_PCICFGL_RD_LEN

WrPCIConfigLocal command format

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:

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

PECI commands.

Values:

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

Functions

int peci_config(struct device *dev, u32_t bitrate)

Configures the PECI interface.

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

  • bitrate: the selected expressed in Kbps. command or when an event needs to be sent to the client application.

Return Value
  • 0: If successful.

  • Negative: errno code if failure.

int peci_enable(struct device *dev)

Enable PECI interface.

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

Return Value
  • 0: If successful.

  • Negative: errno code if failure.

int peci_disable(struct device *dev)

Disable PECI interface.

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

Return Value
  • 0: If successful.

  • Negative: errno code if failure.

int peci_transfer(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 Value
  • 0: If successful.

  • Negative: errno code if failure.

struct peci_buf
#include <peci.h>

PECI buffer structure.

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

Parameters
  • buf: is a valid pointer on a data buffer, or NULL otherwise.

  • len: is the length of the data buffer expected to received without considering the frame check sequence byte.

struct peci_msg
#include <peci.h>

PECI transaction packet format.