blob: 2d987f83a61c0eda409db4af32bdfa56f9752e3c [file] [log] [blame]
Andrew F. Davis537d3ff2018-05-04 19:06:08 +00001/*
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 Diaz5eb88372018-11-08 10:20:19 +000010#ifndef SEC_PROXY_H
11#define SEC_PROXY_H
Andrew F. Davis537d3ff2018-05-04 19:06:08 +000012
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 */
20enum 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 */
35struct 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 */
47int k3_sec_proxy_send(enum k3_sec_proxy_chan_id id, const struct k3_sec_proxy_msg *msg);
48
49/**
50 * k3_sec_proxy_recv() - Receive data from 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 */
56int k3_sec_proxy_recv(enum k3_sec_proxy_chan_id id, struct k3_sec_proxy_msg *msg);
57
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000058#endif /* SEC_PROXY_H */