| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * Copyright (c) 2015-2016, Linaro Limited |
|---|
| 3 | | - * All rights reserved. |
|---|
| 4 | | - * |
|---|
| 5 | | - * Redistribution and use in source and binary forms, with or without |
|---|
| 6 | | - * modification, are permitted provided that the following conditions are met: |
|---|
| 7 | | - * |
|---|
| 8 | | - * 1. Redistributions of source code must retain the above copyright notice, |
|---|
| 9 | | - * this list of conditions and the following disclaimer. |
|---|
| 10 | | - * |
|---|
| 11 | | - * 2. Redistributions in binary form must reproduce the above copyright notice, |
|---|
| 12 | | - * this list of conditions and the following disclaimer in the documentation |
|---|
| 13 | | - * and/or other materials provided with the distribution. |
|---|
| 14 | | - * |
|---|
| 15 | | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|---|
| 16 | | - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|---|
| 17 | | - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|---|
| 18 | | - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|---|
| 19 | | - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|---|
| 20 | | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|---|
| 21 | | - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|---|
| 22 | | - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|---|
| 23 | | - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|---|
| 24 | | - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|---|
| 25 | | - * POSSIBILITY OF SUCH DAMAGE. |
|---|
| 3 | + * Copyright (c) 2015-2019, Linaro Limited |
|---|
| 26 | 4 | */ |
|---|
| 27 | 5 | #ifndef _OPTEE_MSG_H |
|---|
| 28 | 6 | #define _OPTEE_MSG_H |
|---|
| .. | .. |
|---|
| 31 | 9 | #include <linux/types.h> |
|---|
| 32 | 10 | |
|---|
| 33 | 11 | /* |
|---|
| 34 | | - * This file defines the OP-TEE message protocol used to communicate |
|---|
| 12 | + * This file defines the OP-TEE message protocol (ABI) used to communicate |
|---|
| 35 | 13 | * with an instance of OP-TEE running in secure world. |
|---|
| 36 | 14 | * |
|---|
| 37 | 15 | * This file is divided into three sections. |
|---|
| .. | .. |
|---|
| 168 | 146 | * @tmem: parameter by temporary memory reference |
|---|
| 169 | 147 | * @rmem: parameter by registered memory reference |
|---|
| 170 | 148 | * @value: parameter by opaque value |
|---|
| 149 | + * @octets: parameter by octet string |
|---|
| 171 | 150 | * |
|---|
| 172 | 151 | * @attr & OPTEE_MSG_ATTR_TYPE_MASK indicates if tmem, rmem or value is used in |
|---|
| 173 | | - * the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value, |
|---|
| 152 | + * the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value or octets, |
|---|
| 174 | 153 | * OPTEE_MSG_ATTR_TYPE_TMEM_* indicates @tmem and |
|---|
| 175 | 154 | * OPTEE_MSG_ATTR_TYPE_RMEM_* indicates @rmem, |
|---|
| 176 | 155 | * OPTEE_MSG_ATTR_TYPE_NONE indicates that none of the members are used. |
|---|
| .. | .. |
|---|
| 181 | 160 | struct optee_msg_param_tmem tmem; |
|---|
| 182 | 161 | struct optee_msg_param_rmem rmem; |
|---|
| 183 | 162 | struct optee_msg_param_value value; |
|---|
| 163 | + u8 octets[24]; |
|---|
| 184 | 164 | } u; |
|---|
| 185 | 165 | }; |
|---|
| 186 | 166 | |
|---|
| .. | .. |
|---|
| 441 | 421 | */ |
|---|
| 442 | 422 | #define OPTEE_MSG_RPC_CMD_SHM_FREE 7 |
|---|
| 443 | 423 | |
|---|
| 424 | +/* |
|---|
| 425 | + * Access a device on an i2c bus |
|---|
| 426 | + * |
|---|
| 427 | + * [in] param[0].u.value.a mode: RD(0), WR(1) |
|---|
| 428 | + * [in] param[0].u.value.b i2c adapter |
|---|
| 429 | + * [in] param[0].u.value.c i2c chip |
|---|
| 430 | + * |
|---|
| 431 | + * [in] param[1].u.value.a i2c control flags |
|---|
| 432 | + * |
|---|
| 433 | + * [in/out] memref[2] buffer to exchange the transfer data |
|---|
| 434 | + * with the secure world |
|---|
| 435 | + * |
|---|
| 436 | + * [out] param[3].u.value.a bytes transferred by the driver |
|---|
| 437 | + */ |
|---|
| 438 | +#define OPTEE_MSG_RPC_CMD_I2C_TRANSFER 21 |
|---|
| 439 | +/* I2C master transfer modes */ |
|---|
| 440 | +#define OPTEE_MSG_RPC_CMD_I2C_TRANSFER_RD 0 |
|---|
| 441 | +#define OPTEE_MSG_RPC_CMD_I2C_TRANSFER_WR 1 |
|---|
| 442 | +/* I2C master control flags */ |
|---|
| 443 | +#define OPTEE_MSG_RPC_CMD_I2C_FLAGS_TEN_BIT BIT(0) |
|---|
| 444 | + |
|---|
| 444 | 445 | #endif /* _OPTEE_MSG_H */ |
|---|