Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
espi.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_ESPI_H_
13#define ZEPHYR_INCLUDE_ESPI_H_
14
15#include <errno.h>
16
17#include <zephyr/sys/__assert.h>
18#include <zephyr/types.h>
19#include <zephyr/device.h>
20#include <zephyr/sys/slist.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
40};
41
107};
108
121};
122
131};
132
137#define ESPI_PERIPHERAL_INDEX_0 0ul
138#define ESPI_PERIPHERAL_INDEX_1 1ul
139#define ESPI_PERIPHERAL_INDEX_2 2ul
140
141#define ESPI_TARGET_TO_CONTROLLER 0ul
142#define ESPI_CONTROLLER_TO_TARGET 1ul
143
144#define ESPI_VWIRE_SRC_ID0 0ul
145#define ESPI_VWIRE_SRC_ID1 1ul
146#define ESPI_VWIRE_SRC_ID2 2ul
147#define ESPI_VWIRE_SRC_ID3 3ul
148#define ESPI_VWIRE_SRC_ID_MAX 4ul
149
150#define ESPI_PERIPHERAL_NODATA 0ul
151
152#define E8042_START_OPCODE 0x50
153#define E8042_MAX_OPCODE 0x5F
154
155#define EACPI_START_OPCODE 0x60
156#define EACPI_MAX_OPCODE 0x6F
157
158#define ECUSTOM_START_OPCODE 0xF0
159#define ECUSTOM_MAX_OPCODE 0xFF
160
175#if defined(CONFIG_ESPI_PERIPHERAL_EC_HOST_CMD)
176 ESPI_PERIPHERAL_EC_HOST_CMD,
177#endif /* CONFIG_ESPI_PERIPHERAL_EC_HOST_CMD */
178};
179
193};
194
200 /* Virtual wires that can only be send from controller to target */
217 /* Virtual wires that can only be sent from target to controller */
227 /* System management interrupt */
229 /* System control interrupt */
233 /*
234 * Virtual wire GPIOs that can be sent from target to controller for
235 * platform specific usage.
236 */
249
250 /* Number of Virtual Wires */
253
254/* USB-C port over current */
255#define ESPI_VWIRE_SIGNAL_OCB_0 ESPI_VWIRE_SIGNAL_TARGET_GPIO_0
256#define ESPI_VWIRE_SIGNAL_OCB_1 ESPI_VWIRE_SIGNAL_TARGET_GPIO_1
257#define ESPI_VWIRE_SIGNAL_OCB_2 ESPI_VWIRE_SIGNAL_TARGET_GPIO_2
258#define ESPI_VWIRE_SIGNAL_OCB_3 ESPI_VWIRE_SIGNAL_TARGET_GPIO_3
259
260/* eSPI LPC peripherals. */
262 /* Read transactions */
265 /* Write transactions */
268 /* Write transactions without input parameters */
272 /* Status transactions */
276 /* ACPI read transactions */
277 EACPI_OBF_HAS_CHAR = EACPI_START_OPCODE,
279 /* ACPI write transactions */
281 /* ACPI status transactions */
284#if defined(CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION)
285 /* Shared memory region support to return the ACPI response data */
286 EACPI_GET_SHARED_MEMORY,
287#endif /* CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION */
288#if defined(CONFIG_ESPI_PERIPHERAL_CUSTOM_OPCODE)
289 /* Other customized transactions */
290 ECUSTOM_HOST_SUBS_INTERRUPT_EN = ECUSTOM_START_OPCODE,
291 ECUSTOM_HOST_CMD_GET_PARAM_MEMORY,
292 ECUSTOM_HOST_CMD_GET_PARAM_MEMORY_SIZE,
293 ECUSTOM_HOST_CMD_SEND_RESULT,
294#endif /* CONFIG_ESPI_PERIPHERAL_CUSTOM_OPCODE */
295};
296
297/* KBC 8042 event: Input Buffer Full */
298#define HOST_KBC_EVT_IBF BIT(0)
299/* KBC 8042 event: Output Buffer Empty */
300#define HOST_KBC_EVT_OBE BIT(1)
309};
310
318};
319
330};
331
335struct espi_cfg {
342};
343
353};
354
361};
362
370};
371
372struct espi_callback;
373
383typedef void (*espi_callback_handler_t) (const struct device *dev,
384 struct espi_callback *cb,
385 struct espi_event espi_evt);
386
397struct espi_callback {
399 sys_snode_t node;
400
403
409 enum espi_bus_event evt_type;
410};
420typedef int (*espi_api_config)(const struct device *dev, struct espi_cfg *cfg);
421typedef bool (*espi_api_get_channel_status)(const struct device *dev,
422 enum espi_channel ch);
423/* Logical Channel 0 APIs */
424typedef int (*espi_api_read_request)(const struct device *dev,
425 struct espi_request_packet *req);
426typedef int (*espi_api_write_request)(const struct device *dev,
427 struct espi_request_packet *req);
428typedef int (*espi_api_lpc_read_request)(const struct device *dev,
429 enum lpc_peripheral_opcode op,
430 uint32_t *data);
431typedef int (*espi_api_lpc_write_request)(const struct device *dev,
432 enum lpc_peripheral_opcode op,
433 uint32_t *data);
434/* Logical Channel 1 APIs */
435typedef int (*espi_api_send_vwire)(const struct device *dev,
436 enum espi_vwire_signal vw,
437 uint8_t level);
438typedef int (*espi_api_receive_vwire)(const struct device *dev,
439 enum espi_vwire_signal vw,
440 uint8_t *level);
441/* Logical Channel 2 APIs */
442typedef int (*espi_api_send_oob)(const struct device *dev,
443 struct espi_oob_packet *pckt);
444typedef int (*espi_api_receive_oob)(const struct device *dev,
445 struct espi_oob_packet *pckt);
446/* Logical Channel 3 APIs */
447typedef int (*espi_api_flash_read)(const struct device *dev,
448 struct espi_flash_packet *pckt);
449typedef int (*espi_api_flash_write)(const struct device *dev,
450 struct espi_flash_packet *pckt);
451typedef int (*espi_api_flash_erase)(const struct device *dev,
452 struct espi_flash_packet *pckt);
453/* Callbacks and traffic intercept */
454typedef int (*espi_api_manage_callback)(const struct device *dev,
455 struct espi_callback *callback,
456 bool set);
457
458__subsystem struct espi_driver_api {
459 espi_api_config config;
460 espi_api_get_channel_status get_channel_status;
461 espi_api_read_request read_request;
462 espi_api_write_request write_request;
463 espi_api_lpc_read_request read_lpc_request;
464 espi_api_lpc_write_request write_lpc_request;
465 espi_api_send_vwire send_vwire;
466 espi_api_receive_vwire receive_vwire;
467 espi_api_send_oob send_oob;
468 espi_api_receive_oob receive_oob;
469 espi_api_flash_read flash_read;
470 espi_api_flash_write flash_write;
471 espi_api_flash_erase flash_erase;
472 espi_api_manage_callback manage_callback;
473};
474
527__syscall int espi_config(const struct device *dev, struct espi_cfg *cfg);
528
529static inline int z_impl_espi_config(const struct device *dev,
530 struct espi_cfg *cfg)
531{
532 const struct espi_driver_api *api =
533 (const struct espi_driver_api *)dev->api;
534
535 return api->config(dev, cfg);
536}
537
550__syscall bool espi_get_channel_status(const struct device *dev,
551 enum espi_channel ch);
552
553static inline bool z_impl_espi_get_channel_status(const struct device *dev,
554 enum espi_channel ch)
555{
556 const struct espi_driver_api *api =
557 (const struct espi_driver_api *)dev->api;
558
559 return api->get_channel_status(dev, ch);
560}
561
576__syscall int espi_read_request(const struct device *dev,
577 struct espi_request_packet *req);
578
579static inline int z_impl_espi_read_request(const struct device *dev,
580 struct espi_request_packet *req)
581{
582 const struct espi_driver_api *api =
583 (const struct espi_driver_api *)dev->api;
584
585 if (!api->read_request) {
586 return -ENOTSUP;
587 }
588
589 return api->read_request(dev, req);
590}
591
606__syscall int espi_write_request(const struct device *dev,
607 struct espi_request_packet *req);
608
609static inline int z_impl_espi_write_request(const struct device *dev,
610 struct espi_request_packet *req)
611{
612 const struct espi_driver_api *api =
613 (const struct espi_driver_api *)dev->api;
614
615 if (!api->write_request) {
616 return -ENOTSUP;
617 }
618
619 return api->write_request(dev, req);
620}
621
638__syscall int espi_read_lpc_request(const struct device *dev,
639 enum lpc_peripheral_opcode op,
640 uint32_t *data);
641
642static inline int z_impl_espi_read_lpc_request(const struct device *dev,
643 enum lpc_peripheral_opcode op,
644 uint32_t *data)
645{
646 const struct espi_driver_api *api =
647 (const struct espi_driver_api *)dev->api;
648
649 if (!api->read_lpc_request) {
650 return -ENOTSUP;
651 }
652
653 return api->read_lpc_request(dev, op, data);
654}
655
671__syscall int espi_write_lpc_request(const struct device *dev,
672 enum lpc_peripheral_opcode op,
673 uint32_t *data);
674
675static inline int z_impl_espi_write_lpc_request(const struct device *dev,
676 enum lpc_peripheral_opcode op,
677 uint32_t *data)
678{
679 const struct espi_driver_api *api =
680 (const struct espi_driver_api *)dev->api;
681
682 if (!api->write_lpc_request) {
683 return -ENOTSUP;
684 }
685
686 return api->write_lpc_request(dev, op, data);
687}
688
702__syscall int espi_send_vwire(const struct device *dev,
703 enum espi_vwire_signal signal,
704 uint8_t level);
705
706static inline int z_impl_espi_send_vwire(const struct device *dev,
707 enum espi_vwire_signal signal,
708 uint8_t level)
709{
710 const struct espi_driver_api *api =
711 (const struct espi_driver_api *)dev->api;
712
713 return api->send_vwire(dev, signal, level);
714}
715
728__syscall int espi_receive_vwire(const struct device *dev,
729 enum espi_vwire_signal signal,
730 uint8_t *level);
731
732static inline int z_impl_espi_receive_vwire(const struct device *dev,
733 enum espi_vwire_signal signal,
734 uint8_t *level)
735{
736 const struct espi_driver_api *api =
737 (const struct espi_driver_api *)dev->api;
738
739 return api->receive_vwire(dev, signal, level);
740}
741
753__syscall int espi_send_oob(const struct device *dev,
754 struct espi_oob_packet *pckt);
755
756static inline int z_impl_espi_send_oob(const struct device *dev,
757 struct espi_oob_packet *pckt)
758{
759 const struct espi_driver_api *api =
760 (const struct espi_driver_api *)dev->api;
761
762 if (!api->send_oob) {
763 return -ENOTSUP;
764 }
765
766 return api->send_oob(dev, pckt);
767}
768
780__syscall int espi_receive_oob(const struct device *dev,
781 struct espi_oob_packet *pckt);
782
783static inline int z_impl_espi_receive_oob(const struct device *dev,
784 struct espi_oob_packet *pckt)
785{
786 const struct espi_driver_api *api =
787 (const struct espi_driver_api *)dev->api;
788
789 if (!api->receive_oob) {
790 return -ENOTSUP;
791 }
792
793 return api->receive_oob(dev, pckt);
794}
795
809__syscall int espi_read_flash(const struct device *dev,
810 struct espi_flash_packet *pckt);
811
812static inline int z_impl_espi_read_flash(const struct device *dev,
813 struct espi_flash_packet *pckt)
814{
815 const struct espi_driver_api *api =
816 (const struct espi_driver_api *)dev->api;
817
818 if (!api->flash_read) {
819 return -ENOTSUP;
820 }
821
822 return api->flash_read(dev, pckt);
823}
824
838__syscall int espi_write_flash(const struct device *dev,
839 struct espi_flash_packet *pckt);
840
841static inline int z_impl_espi_write_flash(const struct device *dev,
842 struct espi_flash_packet *pckt)
843{
844 const struct espi_driver_api *api =
845 (const struct espi_driver_api *)dev->api;
846
847 if (!api->flash_write) {
848 return -ENOTSUP;
849 }
850
851 return api->flash_write(dev, pckt);
852}
853
867__syscall int espi_flash_erase(const struct device *dev,
868 struct espi_flash_packet *pckt);
869
870static inline int z_impl_espi_flash_erase(const struct device *dev,
871 struct espi_flash_packet *pckt)
872{
873 const struct espi_driver_api *api =
874 (const struct espi_driver_api *)dev->api;
875
876 if (!api->flash_erase) {
877 return -ENOTSUP;
878 }
879
880 return api->flash_erase(dev, pckt);
881}
882
953static inline void espi_init_callback(struct espi_callback *callback,
955 enum espi_bus_event evt_type)
956{
957 __ASSERT(callback, "Callback pointer should not be NULL");
958 __ASSERT(handler, "Callback handler pointer should not be NULL");
959
960 callback->handler = handler;
961 callback->evt_type = evt_type;
962}
963
976static inline int espi_add_callback(const struct device *dev,
977 struct espi_callback *callback)
978{
979 const struct espi_driver_api *api =
980 (const struct espi_driver_api *)dev->api;
981
982 if (!api->manage_callback) {
983 return -ENOTSUP;
984 }
985
986 return api->manage_callback(dev, callback, true);
987}
988
1005static inline int espi_remove_callback(const struct device *dev,
1006 struct espi_callback *callback)
1007{
1008 const struct espi_driver_api *api =
1009 (const struct espi_driver_api *)dev->api;
1010
1011 if (!api->manage_callback) {
1012 return -ENOTSUP;
1013 }
1014
1015 return api->manage_callback(dev, callback, false);
1016}
1017
1018#ifdef __cplusplus
1019}
1020#endif
1021
1025#include <syscalls/espi.h>
1026#endif /* ZEPHYR_INCLUDE_ESPI_H_ */
System error numbers.
int espi_read_flash(const struct device *dev, struct espi_flash_packet *pckt)
Sends a read request packet for shared flash.
espi_io_mode
eSPI I/O mode capabilities
Definition: espi.h:36
int espi_read_request(const struct device *dev, struct espi_request_packet *req)
Sends memory, I/O or message read request over eSPI.
int espi_write_request(const struct device *dev, struct espi_request_packet *req)
Sends memory, I/O or message write request over eSPI.
int espi_send_oob(const struct device *dev, struct espi_oob_packet *pckt)
Sends SMBus transaction (out-of-band) packet over eSPI bus.
espi_virtual_peripheral
eSPI peripheral notification type.
Definition: espi.h:169
void(* espi_callback_handler_t)(const struct device *dev, struct espi_callback *cb, struct espi_event espi_evt)
Define the application callback handler function signature.
Definition: espi.h:383
espi_bus_event
eSPI bus event.
Definition: espi.h:114
espi_cycle_type
eSPI cycle types supported over eSPI peripheral channel
Definition: espi.h:183
int espi_receive_oob(const struct device *dev, struct espi_oob_packet *pckt)
Receives SMBus transaction (out-of-band) packet from eSPI bus.
int espi_config(const struct device *dev, struct espi_cfg *cfg)
Configure operation of a eSPI controller.
static int espi_remove_callback(const struct device *dev, struct espi_callback *callback)
Remove an application callback.
Definition: espi.h:1005
bool espi_get_channel_status(const struct device *dev, enum espi_channel ch)
Query to see if it a channel is ready.
int espi_write_lpc_request(const struct device *dev, enum lpc_peripheral_opcode op, uint32_t *data)
Writes data to a LPC peripheral which generates an eSPI transaction.
static void espi_init_callback(struct espi_callback *callback, espi_callback_handler_t handler, enum espi_bus_event evt_type)
Callback model.
Definition: espi.h:953
int espi_receive_vwire(const struct device *dev, enum espi_vwire_signal signal, uint8_t *level)
Retrieves level status for a signal encapsulated in a virtual wire.
int espi_write_flash(const struct device *dev, struct espi_flash_packet *pckt)
Sends a write request packet for shared flash.
int espi_flash_erase(const struct device *dev, struct espi_flash_packet *pckt)
Sends a write request packet for shared flash.
espi_vwire_signal
eSPI system platform signals that can be send or receive through virtual wire channel
Definition: espi.h:199
static int espi_add_callback(const struct device *dev, struct espi_callback *callback)
Add an application callback.
Definition: espi.h:976
espi_pc_event
eSPI peripheral channel events.
Definition: espi.h:128
int espi_send_vwire(const struct device *dev, enum espi_vwire_signal signal, uint8_t level)
Sends system/platform signal as a virtual wire packet.
lpc_peripheral_opcode
Definition: espi.h:261
int espi_read_lpc_request(const struct device *dev, enum lpc_peripheral_opcode op, uint32_t *data)
Reads SOC data from a LPC peripheral with information updated over eSPI.
espi_channel
eSPI channel.
Definition: espi.h:102
@ ESPI_IO_MODE_QUAD_LINES
Definition: espi.h:39
@ ESPI_IO_MODE_SINGLE_LINE
Definition: espi.h:37
@ ESPI_IO_MODE_DUAL_LINES
Definition: espi.h:38
@ ESPI_PERIPHERAL_UART
Definition: espi.h:170
@ ESPI_PERIPHERAL_HOST_IO
Definition: espi.h:172
@ ESPI_PERIPHERAL_HOST_IO_PVT
Definition: espi.h:174
@ ESPI_PERIPHERAL_8042_KBC
Definition: espi.h:171
@ ESPI_PERIPHERAL_DEBUG_PORT80
Definition: espi.h:173
@ ESPI_BUS_EVENT_OOB_RECEIVED
Definition: espi.h:118
@ ESPI_BUS_SAF_NOTIFICATION
Definition: espi.h:120
@ ESPI_BUS_EVENT_CHANNEL_READY
Definition: espi.h:116
@ ESPI_BUS_PERIPHERAL_NOTIFICATION
Definition: espi.h:119
@ ESPI_BUS_EVENT_VWIRE_RECEIVED
Definition: espi.h:117
@ ESPI_BUS_RESET
Definition: espi.h:115
@ ESPI_CYCLE_OK_COMPLETION_NODATA
Definition: espi.h:190
@ ESPI_CYCLE_NOK_COMPLETION_NODATA
Definition: espi.h:192
@ ESPI_CYCLE_MEMORY_WRITE32
Definition: espi.h:186
@ ESPI_CYCLE_MESSAGE_DATA
Definition: espi.h:189
@ ESPI_CYCLE_MEMORY_WRITE64
Definition: espi.h:187
@ ESPI_CYCLE_MEMORY_READ32
Definition: espi.h:184
@ ESPI_CYCLE_MESSAGE_NODATA
Definition: espi.h:188
@ ESPI_CYCLE_MEMORY_READ64
Definition: espi.h:185
@ ESPI_CYCLE_OKCOMPLETION_DATA
Definition: espi.h:191
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_11
Definition: espi.h:248
@ ESPI_VWIRE_SIGNAL_PLTRST
Definition: espi.h:205
@ ESPI_VWIRE_SIGNAL_SUS_STAT
Definition: espi.h:206
@ ESPI_VWIRE_SIGNAL_RST_CPU_INIT
Definition: espi.h:226
@ ESPI_VWIRE_SIGNAL_SMIOUT
Definition: espi.h:208
@ ESPI_VWIRE_SIGNAL_TARGET_BOOT_STS
Definition: espi.h:221
@ ESPI_VWIRE_SIGNAL_SMI
Definition: espi.h:228
@ ESPI_VWIRE_SIGNAL_OOB_RST_WARN
Definition: espi.h:204
@ ESPI_VWIRE_SIGNAL_SLP_WLAN
Definition: espi.h:213
@ ESPI_VWIRE_SIGNAL_SLP_S4
Definition: espi.h:202
@ ESPI_VWIRE_SIGNAL_ERR_NON_FATAL
Definition: espi.h:222
@ ESPI_VWIRE_SIGNAL_DNX_ACK
Definition: espi.h:231
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_2
Definition: espi.h:239
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_10
Definition: espi.h:247
@ ESPI_VWIRE_SIGNAL_WAKE
Definition: espi.h:219
@ ESPI_VWIRE_SIGNAL_HOST_RST_ACK
Definition: espi.h:225
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_8
Definition: espi.h:245
@ ESPI_VWIRE_SIGNAL_OOB_RST_ACK
Definition: espi.h:220
@ ESPI_VWIRE_SIGNAL_DNX_WARN
Definition: espi.h:216
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_9
Definition: espi.h:246
@ ESPI_VWIRE_SIGNAL_SUS_WARN
Definition: espi.h:212
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_0
Definition: espi.h:237
@ ESPI_VWIRE_SIGNAL_SLP_A
Definition: espi.h:210
@ ESPI_VWIRE_SIGNAL_PME
Definition: espi.h:218
@ ESPI_VWIRE_SIGNAL_ERR_FATAL
Definition: espi.h:223
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_1
Definition: espi.h:238
@ ESPI_VWIRE_SIGNAL_SUS_PWRDN_ACK
Definition: espi.h:211
@ ESPI_VWIRE_SIGNAL_SLP_S3
Definition: espi.h:201
@ ESPI_VWIRE_SIGNAL_HOST_C10
Definition: espi.h:215
@ ESPI_VWIRE_SIGNAL_SLP_LAN
Definition: espi.h:214
@ ESPI_VWIRE_SIGNAL_SUS_ACK
Definition: espi.h:232
@ ESPI_VWIRE_SIGNAL_SLP_S5
Definition: espi.h:203
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_3
Definition: espi.h:240
@ ESPI_VWIRE_SIGNAL_NMIOUT
Definition: espi.h:207
@ ESPI_VWIRE_SIGNAL_COUNT
Definition: espi.h:251
@ ESPI_VWIRE_SIGNAL_TARGET_BOOT_DONE
Definition: espi.h:224
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_4
Definition: espi.h:241
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_7
Definition: espi.h:244
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_6
Definition: espi.h:243
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_5
Definition: espi.h:242
@ ESPI_VWIRE_SIGNAL_HOST_RST_WARN
Definition: espi.h:209
@ ESPI_VWIRE_SIGNAL_SCI
Definition: espi.h:230
@ ESPI_PC_EVT_BUS_MASTER_ENABLE
Definition: espi.h:130
@ ESPI_PC_EVT_BUS_CHANNEL_READY
Definition: espi.h:129
@ EACPI_READ_STS
Definition: espi.h:282
@ EACPI_WRITE_STS
Definition: espi.h:283
@ EACPI_IBF_HAS_CHAR
Definition: espi.h:278
@ EACPI_OBF_HAS_CHAR
Definition: espi.h:277
@ E8042_CLEAR_FLAG
Definition: espi.h:275
@ E8042_PAUSE_IRQ
Definition: espi.h:270
@ EACPI_WRITE_CHAR
Definition: espi.h:280
@ E8042_SET_FLAG
Definition: espi.h:274
@ E8042_READ_KB_STS
Definition: espi.h:273
@ E8042_WRITE_KB_CHAR
Definition: espi.h:266
@ E8042_WRITE_MB_CHAR
Definition: espi.h:267
@ E8042_IBF_HAS_CHAR
Definition: espi.h:264
@ E8042_OBF_HAS_CHAR
Definition: espi.h:263
@ E8042_RESUME_IRQ
Definition: espi.h:269
@ E8042_CLEAR_OBF
Definition: espi.h:271
@ ESPI_CHANNEL_OOB
Definition: espi.h:105
@ ESPI_CHANNEL_PERIPHERAL
Definition: espi.h:103
@ ESPI_CHANNEL_FLASH
Definition: espi.h:106
@ ESPI_CHANNEL_VWIRE
Definition: espi.h:104
int flash_erase(const struct device *dev, off_t offset, size_t size)
Erase part or all of a flash memory.
int flash_write(const struct device *dev, off_t offset, const void *data, size_t len)
Write buffer into flash memory.
int flash_read(const struct device *dev, off_t offset, void *data, size_t len)
Read data from flash.
struct _snode sys_snode_t
Single-linked list node structure.
Definition: slist.h:39
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
#define ENOTSUP
Unsupported value.
Definition: errno.h:115
#define bool
Definition: stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
void * data
Address of the device instance private data.
Definition: device.h:409
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:405
eSPI bus configuration parameters
Definition: espi.h:335
enum espi_io_mode io_caps
Supported I/O mode.
Definition: espi.h:337
enum espi_channel channel_caps
Supported channels.
Definition: espi.h:339
uint8_t max_freq
Maximum supported frequency in MHz.
Definition: espi.h:341
eSPI event
Definition: espi.h:323
uint32_t evt_data
Data associated to the event.
Definition: espi.h:329
enum espi_bus_event evt_type
Event type.
Definition: espi.h:325
uint32_t evt_details
Additional details for bus event type.
Definition: espi.h:327
Bit field definition of evt_data in struct espi_event for ACPI.
Definition: espi.h:314
uint32_t data
Definition: espi.h:316
uint32_t type
Definition: espi.h:315
uint32_t reserved
Definition: espi.h:317
Bit field definition of evt_data in struct espi_event for KBC.
Definition: espi.h:304
uint32_t reserved
Definition: espi.h:308
uint32_t evt
Definition: espi.h:307
uint32_t data
Definition: espi.h:306
uint32_t type
Definition: espi.h:305
eSPI flash transactions packet format
Definition: espi.h:366
uint8_t * buf
Definition: espi.h:367
uint32_t flash_addr
Definition: espi.h:368
uint16_t len
Definition: espi.h:369
eSPI out-of-band transaction packet format
Definition: espi.h:358
uint8_t * buf
Definition: espi.h:359
uint16_t len
Definition: espi.h:360
eSPI peripheral request packet format
Definition: espi.h:347
uint8_t tag
Definition: espi.h:349
uint32_t address
Definition: espi.h:351
uint8_t * data
Definition: espi.h:352
enum espi_cycle_type cycle_type
Definition: espi.h:348
uint16_t len
Definition: espi.h:350