summaryrefslogtreecommitdiff
path: root/include/tee
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2018-03-13 16:50:27 +0000
committerTom Rini <trini@konsulko.com>2018-03-19 16:14:23 -0400
commit32ce6179fb99544fa9d7348e4641ccdf6c1e6067 (patch)
tree20e3729866df4646bbfeaa109e2ad67ee3663e10 /include/tee
parent5cf32518eaaa49d12584fc86777e30f8b91db7ad (diff)
downloadu-boot-32ce6179fb99544fa9d7348e4641ccdf6c1e6067.tar.gz
optee: Add lib entries for sharing OPTEE code across ports
This patch adds code to lib to enable sharing of useful OPTEE code between board-ports and architectures. The code on lib/optee/optee.c comes from the TI omap2 port. Eventually the OMAP2 code will be patched to include the shared code. The intention here is to add more useful OPTEE specific code as more functionality gets added. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Harinarayan Bhatta <harinarayan@ti.com> Cc: Andrew F. Davis <afd@ti.com> Cc: Tom Rini <trini@konsulko.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Peng Fan <peng.fan@nxp.com> Tested-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'include/tee')
-rw-r--r--include/tee/optee.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/tee/optee.h b/include/tee/optee.h
index 9ab0d08634..8943afb439 100644
--- a/include/tee/optee.h
+++ b/include/tee/optee.h
@@ -10,6 +10,8 @@
#ifndef _OPTEE_H
#define _OPTEE_H
+#include <linux/errno.h>
+
#define OPTEE_MAGIC 0x4554504f
#define OPTEE_VERSION 1
#define OPTEE_ARCH_ARM32 0
@@ -27,4 +29,18 @@ struct optee_header {
uint32_t paged_size;
};
+#if defined(CONFIG_OPTEE)
+int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start,
+ unsigned long tzdram_len, unsigned long image_len);
+#else
+static inline int optee_verify_image(struct optee_header *hdr,
+ unsigned long tzdram_start,
+ unsigned long tzdram_len,
+ unsigned long image_len)
+{
+ return -EPERM;
+}
+
+#endif
+
#endif /* _OPTEE_H */