13#ifndef ZEPHYR_INCLUDE_DRIVERS_ESPI_SPI_EMUL_H_
14#define ZEPHYR_INCLUDE_DRIVERS_ESPI_SPI_EMUL_H_
34#define EMUL_ESPI_HOST_CHIPSEL 0
88typedef struct espi_emul *(*emul_find_emul)(
const struct device *dev,
unsigned int chipsel);
108#if defined(CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION) || defined(__DOXYGEN__)
APIs and macros for the Zephyr device model.
#define DEVICE_API_EXTENDS(_child, _parent, _member)
Declare that API class _child is an extension of device API class _parent.
Definition device.h:1451
Public APIs for the device emulation framework.
Main header file for eSPI (Enhanced Serial Peripheral Interface) driver API.
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.
Definition espi_emul.h:63
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 t...
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.
Definition espi_emul.h:100
uintptr_t(* emul_espi_api_get_acpi_shm)(const struct emul *target)
Get the ACPI shared memory address owned by the emulator.
Definition espi_emul.h:75
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 ...
struct espi_emul *(* emul_find_emul)(const struct device *dev, unsigned int chipsel)
Find an emulator present on a eSPI bus.
Definition espi_emul.h:88
uintptr_t emul_espi_host_get_acpi_shm(const struct device *espi_dev)
Get the host device's ACPI shared memory start address.
int espi_emul_register(const struct device *dev, struct espi_emul *emul)
Register an emulated device on the controller.
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.
Definition espi_emul.h:49
espi_vwire_signal
eSPI system platform signals that can be sent or received through virtual wire channel
Definition espi.h:303
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:44
Header file for the single-linked list API.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:543
Definition of the eSPI device emulator API.
Definition espi_emul.h:103
emul_espi_api_set_vw set_vw
eSPI virtual wires set handler
Definition espi_emul.h:105
emul_espi_api_get_vw get_vw
eSPI virtual wires get handler
Definition espi_emul.h:107
emul_espi_api_get_acpi_shm get_acpi_shm
ACPI shared memory address get handler.
Definition espi_emul.h:112
Definition of the eSPI controller emulator API.
Definition espi_emul.h:128
emul_trigger_event trigger_event
Definition espi_emul.h:134
struct espi_driver_api espi_api
Definition espi_emul.h:132
emul_find_emul find_emul
Definition espi_emul.h:135
An emulator instance - represents the target emulated device/peripheral that is interacted with throu...
Definition emul.h:88
@driver_ops{eSPI}
Definition espi.h:738
Node in a linked list of emulators for eSPI devices.
Definition espi_emul.h:117
const struct emul_espi_device_api * api
API provided for this device.
Definition espi_emul.h:122
const struct emul * target
Target emulator - REQUIRED for all emulated bus nodes of any type.
Definition espi_emul.h:120
uint16_t chipsel
eSPI chip-select of the emulated device
Definition espi_emul.h:124
sys_snode_t node
Definition espi_emul.h:118
eSPI event
Definition espi.h:499