Zephyr API Documentation  3.7.0
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
123
129
134
138
144};
145
146
155};
156
161#define ESPI_PERIPHERAL_INDEX_0 0ul
162#define ESPI_PERIPHERAL_INDEX_1 1ul
163#define ESPI_PERIPHERAL_INDEX_2 2ul
164
165#define ESPI_TARGET_TO_CONTROLLER 0ul
166#define ESPI_CONTROLLER_TO_TARGET 1ul
167
168#define ESPI_VWIRE_SRC_ID0 0ul
169#define ESPI_VWIRE_SRC_ID1 1ul
170#define ESPI_VWIRE_SRC_ID2 2ul
171#define ESPI_VWIRE_SRC_ID3 3ul
172#define ESPI_VWIRE_SRC_ID_MAX 4ul
173
174#define ESPI_PERIPHERAL_NODATA 0ul
175
176#define E8042_START_OPCODE 0x50
177#define E8042_MAX_OPCODE 0x5F
178
179#define EACPI_START_OPCODE 0x60
180#define EACPI_MAX_OPCODE 0x6F
181
182#define ECUSTOM_START_OPCODE 0xF0
183#define ECUSTOM_MAX_OPCODE 0xFF
184
199#if defined(CONFIG_ESPI_PERIPHERAL_EC_HOST_CMD)
200 ESPI_PERIPHERAL_EC_HOST_CMD,
201#endif /* CONFIG_ESPI_PERIPHERAL_EC_HOST_CMD */
202};
203
217};
218
224 /* Virtual wires that can only be send from controller to target */
241 /* Virtual wires that can only be sent from target to controller */
251 /* System management interrupt */
253 /* System control interrupt */
257 /*
258 * Virtual wire GPIOs that can be sent from target to controller for
259 * platform specific usage.
260 */
273
274 /* Number of Virtual Wires */
277
278/* USB-C port over current */
279#define ESPI_VWIRE_SIGNAL_OCB_0 ESPI_VWIRE_SIGNAL_TARGET_GPIO_0
280#define ESPI_VWIRE_SIGNAL_OCB_1 ESPI_VWIRE_SIGNAL_TARGET_GPIO_1
281#define ESPI_VWIRE_SIGNAL_OCB_2 ESPI_VWIRE_SIGNAL_TARGET_GPIO_2
282#define ESPI_VWIRE_SIGNAL_OCB_3 ESPI_VWIRE_SIGNAL_TARGET_GPIO_3
283
284/* eSPI LPC peripherals. */
286 /* Read transactions */
289 /* Write transactions */
292 /* Write transactions without input parameters */
296 /* Status transactions */
300 /* ACPI read transactions */
301 EACPI_OBF_HAS_CHAR = EACPI_START_OPCODE,
303 /* ACPI write transactions */
305 /* ACPI status transactions */
308#if defined(CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION)
309 /* Shared memory region support to return the ACPI response data */
310 EACPI_GET_SHARED_MEMORY,
311#endif /* CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION */
312#if defined(CONFIG_ESPI_PERIPHERAL_CUSTOM_OPCODE)
313 /* Other customized transactions */
314 ECUSTOM_HOST_SUBS_INTERRUPT_EN = ECUSTOM_START_OPCODE,
315 ECUSTOM_HOST_CMD_GET_PARAM_MEMORY,
316 ECUSTOM_HOST_CMD_GET_PARAM_MEMORY_SIZE,
317 ECUSTOM_HOST_CMD_SEND_RESULT,
318#endif /* CONFIG_ESPI_PERIPHERAL_CUSTOM_OPCODE */
319};
320
321/* KBC 8042 event: Input Buffer Full */
322#define HOST_KBC_EVT_IBF BIT(0)
323/* KBC 8042 event: Output Buffer Empty */
324#define HOST_KBC_EVT_OBE BIT(1)
333};
334
342};
343
354};
355
359struct espi_cfg {
366};
367
377};
378
391};
392
400};
401
402struct espi_callback;
403
413typedef void (*espi_callback_handler_t) (const struct device *dev,
414 struct espi_callback *cb,
415 struct espi_event espi_evt);
416
427struct espi_callback {
429 sys_snode_t node;
430
433
439 enum espi_bus_event evt_type;
440};
450typedef int (*espi_api_config)(const struct device *dev, struct espi_cfg *cfg);
451typedef bool (*espi_api_get_channel_status)(const struct device *dev,
452 enum espi_channel ch);
453/* Logical Channel 0 APIs */
454typedef int (*espi_api_read_request)(const struct device *dev,
455 struct espi_request_packet *req);
456typedef int (*espi_api_write_request)(const struct device *dev,
457 struct espi_request_packet *req);
458typedef int (*espi_api_lpc_read_request)(const struct device *dev,
459 enum lpc_peripheral_opcode op,
460 uint32_t *data);
461typedef int (*espi_api_lpc_write_request)(const struct device *dev,
462 enum lpc_peripheral_opcode op,
463 uint32_t *data);
464/* Logical Channel 1 APIs */
465typedef int (*espi_api_send_vwire)(const struct device *dev,
466 enum espi_vwire_signal vw,
467 uint8_t level);
468typedef int (*espi_api_receive_vwire)(const struct device *dev,
469 enum espi_vwire_signal vw,
470 uint8_t *level);
471/* Logical Channel 2 APIs */
472typedef int (*espi_api_send_oob)(const struct device *dev,
473 struct espi_oob_packet *pckt);
474typedef int (*espi_api_receive_oob)(const struct device *dev,
475 struct espi_oob_packet *pckt);
476/* Logical Channel 3 APIs */
477typedef int (*espi_api_flash_read)(const struct device *dev,
478 struct espi_flash_packet *pckt);
479typedef int (*espi_api_flash_write)(const struct device *dev,
480 struct espi_flash_packet *pckt);
481typedef int (*espi_api_flash_erase)(const struct device *dev,
482 struct espi_flash_packet *pckt);
483/* Callbacks and traffic intercept */
484typedef int (*espi_api_manage_callback)(const struct device *dev,
485 struct espi_callback *callback,
486 bool set);
487
488__subsystem struct espi_driver_api {
489 espi_api_config config;
490 espi_api_get_channel_status get_channel_status;
491 espi_api_read_request read_request;
492 espi_api_write_request write_request;
493 espi_api_lpc_read_request read_lpc_request;
494 espi_api_lpc_write_request write_lpc_request;
495 espi_api_send_vwire send_vwire;
496 espi_api_receive_vwire receive_vwire;
497 espi_api_send_oob send_oob;
498 espi_api_receive_oob receive_oob;
499 espi_api_flash_read flash_read;
500 espi_api_flash_write flash_write;
501 espi_api_flash_erase flash_erase;
502 espi_api_manage_callback manage_callback;
503};
504
557__syscall int espi_config(const struct device *dev, struct espi_cfg *cfg);
558
559static inline int z_impl_espi_config(const struct device *dev,
560 struct espi_cfg *cfg)
561{
562 const struct espi_driver_api *api =
563 (const struct espi_driver_api *)dev->api;
564
565 return api->config(dev, cfg);
566}
567
580__syscall bool espi_get_channel_status(const struct device *dev,
581 enum espi_channel ch);
582
583static inline bool z_impl_espi_get_channel_status(const struct device *dev,
584 enum espi_channel ch)
585{
586 const struct espi_driver_api *api =
587 (const struct espi_driver_api *)dev->api;
588
589 return api->get_channel_status(dev, ch);
590}
591
606__syscall int espi_read_request(const struct device *dev,
607 struct espi_request_packet *req);
608
609static inline int z_impl_espi_read_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->read_request) {
616 return -ENOTSUP;
617 }
618
619 return api->read_request(dev, req);
620}
621
636__syscall int espi_write_request(const struct device *dev,
637 struct espi_request_packet *req);
638
639static inline int z_impl_espi_write_request(const struct device *dev,
640 struct espi_request_packet *req)
641{
642 const struct espi_driver_api *api =
643 (const struct espi_driver_api *)dev->api;
644
645 if (!api->write_request) {
646 return -ENOTSUP;
647 }
648
649 return api->write_request(dev, req);
650}
651
668__syscall int espi_read_lpc_request(const struct device *dev,
669 enum lpc_peripheral_opcode op,
670 uint32_t *data);
671
672static inline int z_impl_espi_read_lpc_request(const struct device *dev,
673 enum lpc_peripheral_opcode op,
674 uint32_t *data)
675{
676 const struct espi_driver_api *api =
677 (const struct espi_driver_api *)dev->api;
678
679 if (!api->read_lpc_request) {
680 return -ENOTSUP;
681 }
682
683 return api->read_lpc_request(dev, op, data);
684}
685
701__syscall int espi_write_lpc_request(const struct device *dev,
702 enum lpc_peripheral_opcode op,
703 uint32_t *data);
704
705static inline int z_impl_espi_write_lpc_request(const struct device *dev,
706 enum lpc_peripheral_opcode op,
707 uint32_t *data)
708{
709 const struct espi_driver_api *api =
710 (const struct espi_driver_api *)dev->api;
711
712 if (!api->write_lpc_request) {
713 return -ENOTSUP;
714 }
715
716 return api->write_lpc_request(dev, op, data);
717}
718
732__syscall int espi_send_vwire(const struct device *dev,
733 enum espi_vwire_signal signal,
734 uint8_t level);
735
736static inline int z_impl_espi_send_vwire(const struct device *dev,
737 enum espi_vwire_signal signal,
738 uint8_t level)
739{
740 const struct espi_driver_api *api =
741 (const struct espi_driver_api *)dev->api;
742
743 return api->send_vwire(dev, signal, level);
744}
745
758__syscall int espi_receive_vwire(const struct device *dev,
759 enum espi_vwire_signal signal,
760 uint8_t *level);
761
762static inline int z_impl_espi_receive_vwire(const struct device *dev,
763 enum espi_vwire_signal signal,
764 uint8_t *level)
765{
766 const struct espi_driver_api *api =
767 (const struct espi_driver_api *)dev->api;
768
769 return api->receive_vwire(dev, signal, level);
770}
771
783__syscall int espi_send_oob(const struct device *dev,
784 struct espi_oob_packet *pckt);
785
786static inline int z_impl_espi_send_oob(const struct device *dev,
787 struct espi_oob_packet *pckt)
788{
789 const struct espi_driver_api *api =
790 (const struct espi_driver_api *)dev->api;
791
792 if (!api->send_oob) {
793 return -ENOTSUP;
794 }
795
796 return api->send_oob(dev, pckt);
797}
798
810__syscall int espi_receive_oob(const struct device *dev,
811 struct espi_oob_packet *pckt);
812
813static inline int z_impl_espi_receive_oob(const struct device *dev,
814 struct espi_oob_packet *pckt)
815{
816 const struct espi_driver_api *api =
817 (const struct espi_driver_api *)dev->api;
818
819 if (!api->receive_oob) {
820 return -ENOTSUP;
821 }
822
823 return api->receive_oob(dev, pckt);
824}
825
839__syscall int espi_read_flash(const struct device *dev,
840 struct espi_flash_packet *pckt);
841
842static inline int z_impl_espi_read_flash(const struct device *dev,
843 struct espi_flash_packet *pckt)
844{
845 const struct espi_driver_api *api =
846 (const struct espi_driver_api *)dev->api;
847
848 if (!api->flash_read) {
849 return -ENOTSUP;
850 }
851
852 return api->flash_read(dev, pckt);
853}
854
868__syscall int espi_write_flash(const struct device *dev,
869 struct espi_flash_packet *pckt);
870
871static inline int z_impl_espi_write_flash(const struct device *dev,
872 struct espi_flash_packet *pckt)
873{
874 const struct espi_driver_api *api =
875 (const struct espi_driver_api *)dev->api;
876
877 if (!api->flash_write) {
878 return -ENOTSUP;
879 }
880
881 return api->flash_write(dev, pckt);
882}
883
897__syscall int espi_flash_erase(const struct device *dev,
898 struct espi_flash_packet *pckt);
899
900static inline int z_impl_espi_flash_erase(const struct device *dev,
901 struct espi_flash_packet *pckt)
902{
903 const struct espi_driver_api *api =
904 (const struct espi_driver_api *)dev->api;
905
906 if (!api->flash_erase) {
907 return -ENOTSUP;
908 }
909
910 return api->flash_erase(dev, pckt);
911}
912
982static inline void espi_init_callback(struct espi_callback *callback,
984 enum espi_bus_event evt_type)
985{
986 __ASSERT(callback, "Callback pointer should not be NULL");
987 __ASSERT(handler, "Callback handler pointer should not be NULL");
988
989 callback->handler = handler;
990 callback->evt_type = evt_type;
991}
992
1005static inline int espi_add_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, true);
1016}
1017
1034static inline int espi_remove_callback(const struct device *dev,
1035 struct espi_callback *callback)
1036{
1037 const struct espi_driver_api *api =
1038 (const struct espi_driver_api *)dev->api;
1039
1040 if (!api->manage_callback) {
1041 return -ENOTSUP;
1042 }
1043
1044 return api->manage_callback(dev, callback, false);
1045}
1046
1047#ifdef __cplusplus
1048}
1049#endif
1050
1054#include <zephyr/syscalls/espi.h>
1055#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:193
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:413
espi_bus_event
eSPI bus event.
Definition: espi.h:114
espi_cycle_type
eSPI cycle types supported over eSPI peripheral channel
Definition: espi.h:207
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:1034
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:982
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:223
static int espi_add_callback(const struct device *dev, struct espi_callback *callback)
Add an application callback.
Definition: espi.h:1005
espi_pc_event
eSPI peripheral channel events.
Definition: espi.h:152
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:285
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:194
@ ESPI_PERIPHERAL_HOST_IO
Definition: espi.h:196
@ ESPI_PERIPHERAL_HOST_IO_PVT
Definition: espi.h:198
@ ESPI_PERIPHERAL_8042_KBC
Definition: espi.h:195
@ ESPI_PERIPHERAL_DEBUG_PORT80
Definition: espi.h:197
@ ESPI_BUS_EVENT_OOB_RECEIVED
Indicates the eSPI HW has received a Out-of-band package from eSPI host.
Definition: espi.h:137
@ ESPI_BUS_EVENT_CHANNEL_READY
Indicates the eSPI HW has received channel enable notification from eSPI host, once the eSPI channel ...
Definition: espi.h:128
@ ESPI_BUS_PERIPHERAL_NOTIFICATION
Indicates the eSPI HW has received a peripheral eSPI host event.
Definition: espi.h:142
@ ESPI_BUS_TAF_NOTIFICATION
Definition: espi.h:143
@ ESPI_BUS_EVENT_VWIRE_RECEIVED
Indicates the eSPI HW has received a virtual wire message from eSPI host.
Definition: espi.h:133
@ ESPI_BUS_RESET
Indicates the eSPI bus was reset either via eSPI reset pin.
Definition: espi.h:122
@ ESPI_CYCLE_OK_COMPLETION_NODATA
Definition: espi.h:214
@ ESPI_CYCLE_NOK_COMPLETION_NODATA
Definition: espi.h:216
@ ESPI_CYCLE_MEMORY_WRITE32
Definition: espi.h:210
@ ESPI_CYCLE_MESSAGE_DATA
Definition: espi.h:213
@ ESPI_CYCLE_MEMORY_WRITE64
Definition: espi.h:211
@ ESPI_CYCLE_MEMORY_READ32
Definition: espi.h:208
@ ESPI_CYCLE_MESSAGE_NODATA
Definition: espi.h:212
@ ESPI_CYCLE_MEMORY_READ64
Definition: espi.h:209
@ ESPI_CYCLE_OKCOMPLETION_DATA
Definition: espi.h:215
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_11
Definition: espi.h:272
@ ESPI_VWIRE_SIGNAL_PLTRST
Definition: espi.h:229
@ ESPI_VWIRE_SIGNAL_SUS_STAT
Definition: espi.h:230
@ ESPI_VWIRE_SIGNAL_RST_CPU_INIT
Definition: espi.h:250
@ ESPI_VWIRE_SIGNAL_SMIOUT
Definition: espi.h:232
@ ESPI_VWIRE_SIGNAL_TARGET_BOOT_STS
Definition: espi.h:245
@ ESPI_VWIRE_SIGNAL_SMI
Definition: espi.h:252
@ ESPI_VWIRE_SIGNAL_OOB_RST_WARN
Definition: espi.h:228
@ ESPI_VWIRE_SIGNAL_SLP_WLAN
Definition: espi.h:237
@ ESPI_VWIRE_SIGNAL_SLP_S4
Definition: espi.h:226
@ ESPI_VWIRE_SIGNAL_ERR_NON_FATAL
Definition: espi.h:246
@ ESPI_VWIRE_SIGNAL_DNX_ACK
Definition: espi.h:255
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_2
Definition: espi.h:263
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_10
Definition: espi.h:271
@ ESPI_VWIRE_SIGNAL_WAKE
Definition: espi.h:243
@ ESPI_VWIRE_SIGNAL_HOST_RST_ACK
Definition: espi.h:249
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_8
Definition: espi.h:269
@ ESPI_VWIRE_SIGNAL_OOB_RST_ACK
Definition: espi.h:244
@ ESPI_VWIRE_SIGNAL_DNX_WARN
Definition: espi.h:240
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_9
Definition: espi.h:270
@ ESPI_VWIRE_SIGNAL_SUS_WARN
Definition: espi.h:236
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_0
Definition: espi.h:261
@ ESPI_VWIRE_SIGNAL_SLP_A
Definition: espi.h:234
@ ESPI_VWIRE_SIGNAL_PME
Definition: espi.h:242
@ ESPI_VWIRE_SIGNAL_ERR_FATAL
Definition: espi.h:247
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_1
Definition: espi.h:262
@ ESPI_VWIRE_SIGNAL_SUS_PWRDN_ACK
Definition: espi.h:235
@ ESPI_VWIRE_SIGNAL_SLP_S3
Definition: espi.h:225
@ ESPI_VWIRE_SIGNAL_HOST_C10
Definition: espi.h:239
@ ESPI_VWIRE_SIGNAL_SLP_LAN
Definition: espi.h:238
@ ESPI_VWIRE_SIGNAL_SUS_ACK
Definition: espi.h:256
@ ESPI_VWIRE_SIGNAL_SLP_S5
Definition: espi.h:227
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_3
Definition: espi.h:264
@ ESPI_VWIRE_SIGNAL_NMIOUT
Definition: espi.h:231
@ ESPI_VWIRE_SIGNAL_COUNT
Definition: espi.h:275
@ ESPI_VWIRE_SIGNAL_TARGET_BOOT_DONE
Definition: espi.h:248
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_4
Definition: espi.h:265
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_7
Definition: espi.h:268
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_6
Definition: espi.h:267
@ ESPI_VWIRE_SIGNAL_TARGET_GPIO_5
Definition: espi.h:266
@ ESPI_VWIRE_SIGNAL_HOST_RST_WARN
Definition: espi.h:233
@ ESPI_VWIRE_SIGNAL_SCI
Definition: espi.h:254
@ ESPI_PC_EVT_BUS_MASTER_ENABLE
Definition: espi.h:154
@ ESPI_PC_EVT_BUS_CHANNEL_READY
Definition: espi.h:153
@ EACPI_READ_STS
Definition: espi.h:306
@ EACPI_WRITE_STS
Definition: espi.h:307
@ EACPI_IBF_HAS_CHAR
Definition: espi.h:302
@ EACPI_OBF_HAS_CHAR
Definition: espi.h:301
@ E8042_CLEAR_FLAG
Definition: espi.h:299
@ E8042_PAUSE_IRQ
Definition: espi.h:294
@ EACPI_WRITE_CHAR
Definition: espi.h:304
@ E8042_SET_FLAG
Definition: espi.h:298
@ E8042_READ_KB_STS
Definition: espi.h:297
@ E8042_WRITE_KB_CHAR
Definition: espi.h:290
@ E8042_WRITE_MB_CHAR
Definition: espi.h:291
@ E8042_IBF_HAS_CHAR
Definition: espi.h:288
@ E8042_OBF_HAS_CHAR
Definition: espi.h:287
@ E8042_RESUME_IRQ
Definition: espi.h:293
@ E8042_CLEAR_OBF
Definition: espi.h:295
@ 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:114
#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:403
void * data
Address of the device instance private data.
Definition: device.h:413
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:409
eSPI bus configuration parameters
Definition: espi.h:359
enum espi_io_mode io_caps
Supported I/O mode.
Definition: espi.h:361
enum espi_channel channel_caps
Supported channels.
Definition: espi.h:363
uint8_t max_freq
Maximum supported frequency in MHz.
Definition: espi.h:365
eSPI event
Definition: espi.h:347
uint32_t evt_data
Data associated to the event.
Definition: espi.h:353
enum espi_bus_event evt_type
Event type.
Definition: espi.h:349
uint32_t evt_details
Additional details for bus event type.
Definition: espi.h:351
Bit field definition of evt_data in struct espi_event for ACPI.
Definition: espi.h:338
uint32_t data
Definition: espi.h:340
uint32_t type
Definition: espi.h:339
uint32_t reserved
Definition: espi.h:341
Bit field definition of evt_data in struct espi_event for KBC.
Definition: espi.h:328
uint32_t reserved
Definition: espi.h:332
uint32_t evt
Definition: espi.h:331
uint32_t data
Definition: espi.h:330
uint32_t type
Definition: espi.h:329
eSPI flash transactions packet format
Definition: espi.h:396
uint8_t * buf
Definition: espi.h:397
uint32_t flash_addr
Definition: espi.h:398
uint16_t len
Definition: espi.h:399
eSPI out-of-band transaction packet format
Definition: espi.h:388
uint8_t * buf
Definition: espi.h:389
uint16_t len
Definition: espi.h:390
eSPI peripheral request packet format
Definition: espi.h:371
uint8_t tag
Definition: espi.h:373
uint32_t address
Definition: espi.h:375
uint8_t * data
Definition: espi.h:376
enum espi_cycle_type cycle_type
Definition: espi.h:372
uint16_t len
Definition: espi.h:374