blob: 67a67db39ed6271e97603d9bb0fb15300c86c41b [file] [log] [blame]
/*
* Copyright (c) 2019 The Fuchsia Authors
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _TA_HELPER_H_
#define _TA_HELPER_H_
#include <common.h>
#include <tee.h>
/**
* Context about an open session with a particular TA.
*/
struct ta_context {
struct udevice *tee;
uint32_t session;
};
/**
* Connect to TA, call specified function, and close connection.
*/
int ta_call(const struct tee_optee_ta_uuid *uuid, uint32_t func,
uint32_t num_params, struct tee_param *params);
/**
* Connect to a TA and return a context.
*/
int ta_open(const struct tee_optee_ta_uuid *uuid,
struct ta_context *out_context);
/**
* Close an open session with a TA.
*/
void ta_close(struct ta_context *context);
/**
* Invoke a function provided by a TA.
*/
int ta_invoke(const struct ta_context *context, uint32_t func,
uint32_t num_params, struct tee_param *params);
#endif // _TA_HELPER_H_