Zephyr API 3.6.99
Loading...
Searching...
No Matches
eSPI Emulation Interface

eSPI Emulation Interface More...

Data Structures

struct  emul_espi_device_api
 Definition of the eSPI device emulator API. More...
 
struct  espi_emul
 Node in a linked list of emulators for eSPI devices. More...
 
struct  emul_espi_driver_api
 Definition of the eSPI controller emulator API. More...
 

Macros

#define EMUL_ESPI_HOST_CHIPSEL   0
 

Typedefs

typedef int(* emul_espi_api_set_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t level)
 Passes eSPI virtual wires set request (virtual wire packet) to the emulator.
 
typedef int(* emul_espi_api_get_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t *level)
 Passes eSPI virtual wires get request (virtual wire packet) to the emulator.
 
typedef struct espi_emul *(* emul_find_emul) (const struct device *dev, unsigned int chipsel)
 Find an emulator present on a eSPI bus.
 
typedef int(* emul_trigger_event) (const struct device *dev, struct espi_event *evt)
 Triggers an event on the emulator of eSPI controller side which causes calling specific callbacks.
 

Functions

int espi_emul_register (const struct device *dev, struct espi_emul *emul)
 Register an emulated device on the controller.
 
int emul_espi_host_send_vw (const struct device *espi_dev, enum espi_vwire_signal vw, uint8_t level)
 Sets the eSPI virtual wire on the host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller.
 
int emul_espi_host_port80_write (const struct device *espi_dev, uint32_t data)
 Perform port80 write on the emulated host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller.
 

Detailed Description

eSPI Emulation Interface

Macro Definition Documentation

◆ EMUL_ESPI_HOST_CHIPSEL

#define EMUL_ESPI_HOST_CHIPSEL   0

Typedef Documentation

◆ emul_espi_api_get_vw

typedef int(* emul_espi_api_get_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t *level)

#include <zephyr/drivers/espi_emul.h>

Passes eSPI virtual wires get request (virtual wire packet) to the emulator.

The emulator returns the state (level) of its virtual wire.

Parameters
targetThe device Emulator instance
vwThe signal to be get.
levelThe level of the signal to be get.
Return values
0If successful.
-EIOGeneral input / output error.

◆ emul_espi_api_set_vw

typedef int(* emul_espi_api_set_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t level)

#include <zephyr/drivers/espi_emul.h>

Passes eSPI virtual wires set request (virtual wire packet) to the emulator.

The emulator updates the state (level) of its virtual wire.

Parameters
targetThe device Emulator instance
vwThe signal to be set.
levelThe level of signal requested LOW(0) or HIGH(1).
Return values
0If successful.
-EIOGeneral input / output error.

◆ emul_find_emul

typedef struct espi_emul *(* emul_find_emul) (const struct device *dev, unsigned int chipsel)

#include <zephyr/drivers/espi_emul.h>

Find an emulator present on a eSPI bus.

At present the function is used only to find an emulator of the host device. It may be useful in systems with the SPI flash chips.

Parameters
deveSPI emulation controller device
chipselChip-select value
Returns
espi_emul to use
NULL if not found

◆ emul_trigger_event

typedef int(* emul_trigger_event) (const struct device *dev, struct espi_event *evt)

#include <zephyr/drivers/espi_emul.h>

Triggers an event on the emulator of eSPI controller side which causes calling specific callbacks.

Parameters
devDevice instance of emulated eSPI controller
evtEvent to be triggered
Return values
0If successful.
-EIOGeneral input / output error.

Function Documentation

◆ emul_espi_host_port80_write()

int emul_espi_host_port80_write ( const struct device * espi_dev,
uint32_t data )

#include <zephyr/drivers/espi_emul.h>

Perform port80 write on the emulated host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller.

Parameters
espi_deveSPI emulation controller device
dataThe date to be written.
Return values
0If successful.
-EIOGeneral input / output error.

◆ emul_espi_host_send_vw()

int emul_espi_host_send_vw ( const struct device * espi_dev,
enum espi_vwire_signal vw,
uint8_t level )

#include <zephyr/drivers/espi_emul.h>

Sets the eSPI virtual wire on the host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller.

Parameters
espi_deveSPI emulation controller device
vwThe signal to be set.
levelThe level of the signal to be set.
Return values
0If successful.
-EIOGeneral input / output error.

◆ espi_emul_register()

int espi_emul_register ( const struct device * dev,
struct espi_emul * emul )

#include <zephyr/drivers/espi_emul.h>

Register an emulated device on the controller.

Parameters
devDevice that will use the emulator
emuleSPI emulator to use
Returns
0 indicating success (always)