]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - include/tee/optee.h
9446928fd4896de4e728a3940c586e47315cad8f
1 /* SPDX-License-Identifier: BSD-2-Clause */
3 * OP-TEE related definitions
5 * (C) Copyright 2016 Linaro Limited
6 * Andrew F. Davis <andrew.davis@linaro.org>
12 #include <linux/errno.h>
14 #define OPTEE_MAGIC 0x4554504f
15 #define OPTEE_VERSION 1
16 #define OPTEE_ARCH_ARM32 0
17 #define OPTEE_ARCH_ARM64 1
25 uint32_t init_load_addr_hi
;
26 uint32_t init_load_addr_lo
;
27 uint32_t init_mem_usage
;
31 static inline uint32_t optee_image_get_entry_point(const image_header_t
*hdr
)
33 struct optee_header
*optee_hdr
= (struct optee_header
*)(hdr
+ 1);
35 return optee_hdr
->init_load_addr_lo
;
38 static inline uint32_t optee_image_get_load_addr(const image_header_t
*hdr
)
40 return optee_image_get_entry_point(hdr
) - sizeof(struct optee_header
);
43 #if defined(CONFIG_OPTEE)
44 int optee_verify_image(struct optee_header
*hdr
, unsigned long tzdram_start
,
45 unsigned long tzdram_len
, unsigned long image_len
);
47 static inline int optee_verify_image(struct optee_header
*hdr
,
48 unsigned long tzdram_start
,
49 unsigned long tzdram_len
,
50 unsigned long image_len
)
57 #if defined(CONFIG_OPTEE)
58 int optee_verify_bootm_image(unsigned long image_addr
,
59 unsigned long image_load_addr
,
60 unsigned long image_len
);
62 static inline int optee_verify_bootm_image(unsigned long image_addr
,
63 unsigned long image_load_addr
,
64 unsigned long image_len
)