1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Texas Instruments SCI Transport Protocol Header 4 * 5 * Copyright (C) 2018-2025 Texas Instruments Incorporated - https://www.ti.com/ 6 */ 7 8 #ifndef TI_SCI_TRANSPORT_H 9 #define TI_SCI_TRANSPORT_H 10 11 #include <stddef.h> 12 #include <stdint.h> 13 #include <tee_api_types.h> 14 15 #define THREAD_DIR_TX (0) 16 #define THREAD_DIR_RX (1) 17 18 /** 19 * struct ti_sci_msg - TISCI message structure 20 * @len: Length of data in the Buffer 21 * @buf: Buffer pointer 22 * 23 * This is the structure for data used in ti_sci_transport_{send,recv}() 24 */ 25 struct ti_sci_msg { 26 size_t len; 27 uint8_t *buf; 28 }; 29 30 /** 31 * ti_sci_transport_send() - Send data over a TISCI transport 32 * @msg: Pointer to ti_sci_msg 33 * 34 * This function sends a message over the TISCI transport. 35 */ 36 TEE_Result ti_sci_transport_send(const struct ti_sci_msg *msg); 37 38 /** 39 * ti_sci_transport_recv() - Receive data over a TISCI transport 40 * @msg: Pointer to ti_sci_msg 41 * 42 * This function receives a message over the TISCI transport. 43 */ 44 TEE_Result ti_sci_transport_recv(struct ti_sci_msg *msg); 45 46 /** 47 * ti_sci_transport_init() - Initialize the TISCI transport threads 48 * 49 * This function initializes the TISCI transport layer used for TISCI 50 * communication. 51 */ 52 TEE_Result ti_sci_transport_init(void); 53 54 #endif /* TI_SCI_TRANSPORT_H */ 55