Skip to content

Commit 5971867

Browse files
albertofloyddleach02
authored andcommitted
include: zephyr: drivers: eSPI API clarifications
Clarify eSPI reset bus event convention, which follows eSPI physical reset pin. Clarify eSPI OOB packet length expectations for eSPI driver clients and eSPI drivers implementation Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
1 parent edaa523 commit 5971867

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

include/zephyr/drivers/espi.h

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,38 @@ enum espi_channel {
112112
* eSPI bus event to indicate events for which user can register callbacks
113113
*/
114114
enum espi_bus_event {
115+
/** Indicates the eSPI bus was reset either via eSPI reset pin.
116+
* eSPI drivers should convey the eSPI reset status to eSPI driver clients
117+
* following eSPI specification reset pin convention:
118+
* 0-eSPI bus in reset, 1-eSPI bus out-of-reset
119+
*
120+
* Note: There is no need to send this callback for in-band reset.
121+
*/
115122
ESPI_BUS_RESET = BIT(0),
123+
124+
/** Indicates the eSPI HW has received channel enable notification from eSPI host,
125+
* once the eSPI channel is signal as ready to the eSPI host,
126+
* eSPI drivers should convey the eSPI channel ready to eSPI driver client via this event.
127+
*/
116128
ESPI_BUS_EVENT_CHANNEL_READY = BIT(1),
129+
130+
/** Indicates the eSPI HW has received a virtual wire message from eSPI host.
131+
* eSPI drivers should convey the eSPI virtual wire latest status.
132+
*/
117133
ESPI_BUS_EVENT_VWIRE_RECEIVED = BIT(2),
134+
135+
/** Indicates the eSPI HW has received a Out-of-band package from eSPI host.
136+
*/
118137
ESPI_BUS_EVENT_OOB_RECEIVED = BIT(3),
138+
139+
/** Indicates the eSPI HW has received a peripheral eSPI host event.
140+
* eSPI drivers should convey the peripheral type.
141+
*/
119142
ESPI_BUS_PERIPHERAL_NOTIFICATION = BIT(4),
120143
ESPI_BUS_SAF_NOTIFICATION = BIT(5),
121144
};
122145

146+
123147
/**
124148
* @brief eSPI peripheral channel events.
125149
*
@@ -354,6 +378,12 @@ struct espi_request_packet {
354378

355379
/**
356380
* @brief eSPI out-of-band transaction packet format
381+
*
382+
* For Tx packet, eSPI driver client shall specify the OOB payload data and its length in bytes.
383+
* For Rx packet, eSPI driver client shall indicate the maximum number of bytes that can receive,
384+
* while the eSPI driver should update the length field with the actual data received/available.
385+
*
386+
* In all cases, the length does not include OOB header size 3 bytes.
357387
*/
358388
struct espi_oob_packet {
359389
uint8_t *buf;
@@ -895,12 +925,11 @@ static inline int z_impl_espi_flash_erase(const struct device *dev,
895925
* | | | eSPI reset | eSPI host
896926
* | | IRQ +<------------+ resets the
897927
* | | <-----------+ | bus
898-
* | | | |
899-
* | | Processed | |
928+
* |<-----------------------------| | |
929+
* | Report eSPI bus reset | Processed | |
900930
* | | within the | |
901931
* | | driver | |
902932
* | | | |
903-
904933
* | | | VW CH ready| eSPI host
905934
* | | IRQ +<------------+ enables VW
906935
* | | <-----------+ | channel

0 commit comments

Comments
 (0)