Andrew F. Davis | 537d3ff | 2018-05-04 19:06:08 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Texas Instruments K3 Secure Proxy Driver |
| 3 | * Based on Linux and U-Boot implementation |
| 4 | * |
| 5 | * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ |
| 6 | * |
| 7 | * SPDX-License-Identifier: BSD-3-Clause |
| 8 | */ |
| 9 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 10 | #ifndef SEC_PROXY_H |
| 11 | #define SEC_PROXY_H |
Andrew F. Davis | 537d3ff | 2018-05-04 19:06:08 +0000 | [diff] [blame] | 12 | |
| 13 | #include <stdint.h> |
| 14 | |
| 15 | /** |
| 16 | * enum k3_sec_proxy_chan_id - Secure Proxy thread IDs |
| 17 | * |
| 18 | * These the available IDs used in k3_sec_proxy_{send,recv}() |
| 19 | */ |
| 20 | enum k3_sec_proxy_chan_id { |
| 21 | SP_NOTIFY = 0, |
| 22 | SP_RESPONSE, |
| 23 | SP_HIGH_PRIORITY, |
| 24 | SP_LOW_PRIORITY, |
| 25 | SP_NOTIFY_RESP, |
| 26 | }; |
| 27 | |
| 28 | /** |
| 29 | * struct k3_sec_proxy_msg - Secure proxy message structure |
| 30 | * @len: Length of data in the Buffer |
| 31 | * @buf: Buffer pointer |
| 32 | * |
| 33 | * This is the structure for data used in k3_sec_proxy_{send,recv}() |
| 34 | */ |
| 35 | struct k3_sec_proxy_msg { |
| 36 | size_t len; |
| 37 | uint8_t *buf; |
| 38 | }; |
| 39 | |
| 40 | /** |
| 41 | * k3_sec_proxy_send() - Send data over a Secure Proxy thread |
| 42 | * @id: Channel Identifier |
| 43 | * @msg: Pointer to k3_sec_proxy_msg |
| 44 | * |
| 45 | * Return: 0 if all goes well, else appropriate error message |
| 46 | */ |
Andrew F. Davis | 82a3c1d | 2019-01-04 12:44:00 -0600 | [diff] [blame] | 47 | int k3_sec_proxy_clear_rx_thread(enum k3_sec_proxy_chan_id id); |
| 48 | |
| 49 | /** |
| 50 | * k3_sec_proxy_send() - Send data over a Secure Proxy thread |
| 51 | * @id: Channel Identifier |
| 52 | * @msg: Pointer to k3_sec_proxy_msg |
| 53 | * |
| 54 | * Return: 0 if all goes well, else appropriate error message |
| 55 | */ |
Andrew F. Davis | 537d3ff | 2018-05-04 19:06:08 +0000 | [diff] [blame] | 56 | int k3_sec_proxy_send(enum k3_sec_proxy_chan_id id, const struct k3_sec_proxy_msg *msg); |
| 57 | |
| 58 | /** |
| 59 | * k3_sec_proxy_recv() - Receive data from a Secure Proxy thread |
| 60 | * @id: Channel Identifier |
| 61 | * @msg: Pointer to k3_sec_proxy_msg |
| 62 | * |
| 63 | * Return: 0 if all goes well, else appropriate error message |
| 64 | */ |
| 65 | int k3_sec_proxy_recv(enum k3_sec_proxy_chan_id id, struct k3_sec_proxy_msg *msg); |
| 66 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 67 | #endif /* SEC_PROXY_H */ |