From 99c0794d820afa8089cc0ee40e7b496a48e220cf Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Tue, 16 Jan 2024 18:07:30 +0100 Subject: optee: add helper functions to set/get the optee memory base Provide helper functions to set/get the optee memory base address gathered previously from the builtin optee binary header. Signed-off-by: Marco Felsch Link: https://lore.barebox.org/20240116170738.209954-11-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer --- include/tee/optee.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/tee/optee.h') diff --git a/include/tee/optee.h b/include/tee/optee.h index b5ba0a71d7..0cdf828a6d 100644 --- a/include/tee/optee.h +++ b/include/tee/optee.h @@ -33,6 +33,24 @@ struct optee_header { int optee_verify_header (struct optee_header *hdr); +#ifdef CONFIG_HAVE_OPTEE + +void optee_set_membase(const struct optee_header *hdr); +int optee_get_membase(u64 *membase); + +#else + +static inline void optee_set_membase(const struct optee_header *hdr) +{ +} + +static inline int optee_get_membase(u64 *membase) +{ + return -ENOSYS; +} + +#endif /* CONFIG_HAVE_OPTEE */ + #ifdef __PBL__ int start_optee_early(void* fdt, void* tee); -- cgit v1.2.3