Source
x
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
/*
* Copyright (c) 2015-2019, Linaro Limited
*/
/*
* This file defines the OP-TEE message protocol used to communicate
* with an instance of OP-TEE running in secure world.
*
* This file is divided into three sections.
* 1. Formatting of messages.
* 2. Requests from normal world
* 3. Requests from secure world, Remote Procedure Call (RPC), handled by
* tee-supplicant.
*/
/*****************************************************************************
* Part 1 - formatting of messages
*****************************************************************************/
/*
* Meta parameter to be absorbed by the Secure OS and not passed
* to the Trusted Application.
*
* Currently only used with OPTEE_MSG_CMD_OPEN_SESSION.
*/
/*
* Pointer to a list of pages used to register user-defined SHM buffer.
* Used with OPTEE_MSG_ATTR_TYPE_TMEM_*.
* buf_ptr should point to the beginning of the buffer. Buffer will contain
* list of page addresses. OP-TEE core can reconstruct contiguous buffer from
* that page addresses list. Page addresses are stored as 64 bit values.
* Last entry on a page should point to the next page of buffer.
* Every entry in buffer should point to a 4k page beginning (12 least
* significant bits must be equal to zero).
*
* 12 least significant bints of optee_msg_param.u.tmem.buf_ptr should hold page
* offset of the user buffer.
*
* So, entries should be placed like members of this structure:
*
* struct page_data {
* uint64_t pages_array[OPTEE_MSG_NONCONTIG_PAGE_SIZE/sizeof(uint64_t) - 1];
* uint64_t next_page_data;
* };
*
* Structure is designed to exactly fit into the page size
* OPTEE_MSG_NONCONTIG_PAGE_SIZE which is a standard 4KB page.
*
* The size of 4KB is chosen because this is the smallest page size for ARM
* architectures. If REE uses larger pages, it should divide them to 4KB ones.
*/
/*
* Memory attributes for caching passed with temp memrefs. The actual value
* used is defined outside the message protocol with the exception of
* OPTEE_MSG_ATTR_CACHE_PREDEFINED which means the attributes already
* defined for the memory range should be used. If optee_smc.h is used as
* bearer of this protocol OPTEE_SMC_SHM_* is used for values.
*/
/*
* Same values as TEE_LOGIN_* from TEE Internal API
*/