2 * OP-TEE related definitions
4 * (C) Copyright 2016 Linaro Limited
5 * Andrew F. Davis <andrew.davis@linaro.org>
7 * SPDX-License-Identifier: BSD-2-Clause
13 #include <linux/errno.h>
15 #define OPTEE_MAGIC 0x4554504f
16 #define OPTEE_VERSION 1
17 #define OPTEE_ARCH_ARM32 0
18 #define OPTEE_ARCH_ARM64 1
26 uint32_t init_load_addr_hi;
27 uint32_t init_load_addr_lo;
28 uint32_t init_mem_usage;
32 static inline uint32_t optee_image_get_entry_point(const image_header_t *hdr)
34 struct optee_header *optee_hdr = (struct optee_header *)(hdr + 1);
36 return optee_hdr->init_load_addr_lo;
39 static inline uint32_t optee_image_get_load_addr(const image_header_t *hdr)
41 return optee_image_get_entry_point(hdr) - sizeof(struct optee_header);
44 #if defined(CONFIG_OPTEE)
45 int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start,
46 unsigned long tzdram_len, unsigned long image_len);
48 static inline int optee_verify_image(struct optee_header *hdr,
49 unsigned long tzdram_start,
50 unsigned long tzdram_len,
51 unsigned long image_len)
58 #if defined(CONFIG_OPTEE)
59 int optee_verify_bootm_image(unsigned long image_addr,
60 unsigned long image_load_addr,
61 unsigned long image_len);
63 static inline int optee_verify_bootm_image(unsigned long image_addr,
64 unsigned long image_load_addr,
65 unsigned long image_len)