PECI
Single-page view · as markdown
PECI Subsystem
Peios Kernel / Hardware and drivers / PECI
Overview
Peios Kernel / Hardware and drivers / PECI
The Platform Environment Control Interface (PECI) is a communication interface between Intel processor and management controllers (e.g. Baseboard Management Controller, BMC). PECI provides services that allow the management controller to configure, monitor and debug platform by accessing various registers. It defines a dedicated command protocol, where the management controller is acting as a PECI originator and the processor - as a PECI responder. PECI can be used in both single processor and multiple-processor based systems.
NOTE: Intel PECI specification is not released as a dedicated document, instead it is a part of External Design Specification (EDS) for given Intel CPU. External Design Specifications are usually not publicly available.
PECI Wire #
PECI Wire interface uses a single wire for self-clocking and data transfer. It does not require any additional control lines - the physical layer is a self-clocked one-wire bus signal that begins each bit with a driven, rising edge from an idle near zero volts. The duration of the signal driven high allows to determine whether the bit value is logic '0' or logic '1'. PECI Wire also includes variable data rate established with every message.
For PECI Wire, each processor package will utilize unique, fixed addresses within a defined range and that address should have a fixed relationship with the processor socket ID - if one of the processors is removed, it does not affect addresses of remaining processors.
PECI subsystem internals #
struct peci_controller_ops #
PECI controller specific methods
Definition
;
Members
xfer: PECI transfer function
Description
PECI controllers may have different hardware interfaces - the drivers implementing PECI controllers can use this structure to abstract away those differences by exposing a common interface for PECI core.
struct peci_controller #
PECI controller
Definition
;
Members
dev: device object to register PECI controller to the device modelops: pointer to device specific controller operationsbus_lock: lock used to protect multiple callersid: PECI controller ID
Description
PECI controllers usually connect to their drivers using non-PECI bus, such as the platform bus. Each PECI controller can communicate with one or more PECI devices.
struct peci_device #
PECI device
Definition
;
Members
dev: device object to register PECI device to the device modelinfo: PECI device characteristicsinfo.x86_vfm: device vendor-family-modelinfo.peci_revision: PECI revision supported by the PECI deviceinfo.socket_id: the socket ID represented by the PECI deviceaddr: address used on the PECI bus connected to the parent controllerdeleted: indicates that PECI device was already deleted
Description
A peci_device identifies a single device (i.e. CPU) connected to a PECI bus. The behaviour exposed to the rest of the system is defined by the PECI driver managing the device.
struct peci_request #
PECI request
Definition
;
Members
device: PECI device to which the request is sentrx: RX buffer specific datarx.buf: RX bufferrx.len: received data length in bytestx: TX buffer specific datatx.buf: TX buffertx.len: transfer data length in bytes
Description
A peci_request represents a request issued by PECI originator (TX) and a response received from PECI responder (RX).
struct peci_device_id #
PECI device data to match
Definition
;
Members
data: pointer to driver private data specific to devicex86_vfm: device vendor-family-model
struct peci_driver #
PECI driver
Definition
;
Members
driver: inherit device driverprobe: probe callbackremove: remove callbackid_table: PECI device match table to decide which device to bind
peci_driver_register() #
register PECI driver
Parameters
driver: the driver to be registered
Description
PECI drivers that don't need to do anything special in module init should use the convenience "module_peci_driver" macro instead
Return
zero on success, else a negative error code.
module_peci_driver() #
helper macro for registering a modular PECI driver
Parameters
__peci_driver: peci_driver struct
Description
Helper macro for PECI drivers which do not do anything special in module
init/exit. This eliminates a lot of boilerplate. Each module may only
use this macro once, and calling it replaces module_init() and module_exit()
devm_peci_controller_add() #
struct peci_controller * add PECI controller
Parameters
struct device *dev: device for devm operationsconst struct peci_controller_ops *ops: pointer to controller specific methods
Description
In final stage of its probe(), peci_controller driver calls
devm_peci_controller_add() to register itself with the PECI bus.
Return
Pointer to the newly allocated controller or ERR_PTR() in case of failure.
peci_request_status() #
int return -errno based on PECI completion code
Parameters
struct peci_request *req: the PECI request that contains response data with completion code
Description
It can't be used for Ping(), GetDIB() and GetTemp() - for those commands we
don't expect completion code in the response.
Return
-errno
peci_request_alloc() #
struct peci_request * allocate struct peci_requests
Parameters
struct peci_device *device: PECI device to which request is going to be sentu8 tx_len: TX lengthu8 rx_len: RX length
Return
A pointer to a newly allocated struct peci_request on success or NULL otherwise.
peci_request_free() #
void free peci_request
Parameters
struct peci_request *req: the PECI request to be freed
PECI CPU Driver API #
peci_temp_read() #
int read the maximum die temperature from PECI target device
Parameters
struct peci_device *device: PECI device to which request is going to be sents16 *temp_raw: where to store the read temperature
Description
It uses GetTemp PECI command.
Return
0 if succeeded, other values in case errors.
peci_pcs_read() #
int read PCS register
Parameters
struct peci_device *device: PECI device to which request is going to be sentu8 index: PCS indexu16 param: PCS parameteru32 *data: where to store the read data
Description
It uses RdPkgConfig PECI command.
Return
0 if succeeded, other values in case errors.
peci_pci_local_read() #
int read 32-bit memory location using raw address
Parameters
struct peci_device *device: PECI device to which request is going to be sentu8 bus: busu8 dev: deviceu8 func: functionu16 reg: registeru32 *data: where to store the read data
Description
It uses RdPCIConfigLocal PECI command.
Return
0 if succeeded, other values in case errors.
peci_ep_pci_local_read() #
int read 32-bit memory location using raw address
Parameters
struct peci_device *device: PECI device to which request is going to be sentu8 seg: PCI segmentu8 bus: busu8 dev: deviceu8 func: functionu16 reg: registeru32 *data: where to store the read data
Description
Like peci_pci_local_read, but it uses RdEndpointConfig PECI command.
Return
0 if succeeded, other values in case errors.
peci_mmio_read() #
int read 32-bit memory location using 64-bit bar offset address
Parameters
struct peci_device *device: PECI device to which request is going to be sentu8 bar: PCI baru8 seg: PCI segmentu8 bus: busu8 dev: deviceu8 func: functionu64 address: 64-bit MMIO addressu32 *data: where to store the read data
Description
It uses RdEndpointConfig PECI command.
Return
0 if succeeded, other values in case errors.