blob: 6729498aa5458ed59586926b12934d8a4817d760 [file] [log] [blame]
#ifndef _ASR_TE200_OPTEE_H_
#define _ASR_TE200_OPTEE_H_
#include <linux/crypto.h>
#include <crypto/algapi.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/miscdevice.h>
#include "../te200/asr-sha.h"
#include "asr-cipher-optee.h"
#include "asr-rsa-optee.h"
struct teec_uuid {
uint32_t timeLow;
uint16_t timeMid;
uint16_t timeHiAndVersion;
uint8_t clockSeqAndNode[8];
};
struct asrte200_tee_context {
struct tee_context *tee_ctx;
int session;
};
struct asr_te200_dev {
struct device *dev;
struct asr_te200_sha asr_sha;
struct asr_te200_cipher asr_cipher;
struct asr_te200_rsa asr_rsa;
};
struct asr_te200_ops {
int (*dev_get)(struct asr_te200_dev *);
int (*dev_put)(struct asr_te200_dev *);
};
int asrte200_optee_open_ta(struct asrte200_tee_context *ctx, struct teec_uuid *uuid);
int asrte200_optee_close_ta(struct asrte200_tee_context *ctx);
#ifdef CONFIG_ASR_TE200_CIPHER
int asr_te200_cipher_register(struct asr_te200_dev *te200_dd);
int asr_te200_cipher_unregister(struct asr_te200_dev *te200_dd);
#endif
#ifdef CONFIG_ASR_TE200_SHA
int asr_te200_sha_register(struct asr_te200_dev *te200_dd);
int asr_te200_sha_unregister(struct asr_te200_dev *te200_dd);
#endif
#ifdef CONFIG_ASR_TE200_RSA
int asr_te200_rsa_register(struct asr_te200_dev *te200_dd);
int asr_te200_rsa_unregister(struct asr_te200_dev *te200_dd);
#endif
#endif