summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2018-03-13 16:50:32 +0000
committerTom Rini <trini@konsulko.com>2018-03-19 16:14:24 -0400
commitdd5a12e28799366d3c64434f6b347550a4600231 (patch)
tree6c16ea414dfcd8ef6d560835d2e990236ed38ca9
parentf79443684b60beb7cb281fc0becb6b69aa0a1a4a (diff)
downloadu-boot-dd5a12e28799366d3c64434f6b347550a4600231.tar.gz
u-boot-dd5a12e28799366d3c64434f6b347550a4600231.tar.bz2
u-boot-dd5a12e28799366d3c64434f6b347550a4600231.zip
optee: Add optee_image_get_load_addr()
This patch adds optee_image_get_load_addr() a helper function used to calculate the load-address of an OPTEE image based on the lower entry-point address given in the OPTEE header. 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>
-rw-r--r--include/tee/optee.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/tee/optee.h b/include/tee/optee.h
index eb328d3cc6..e782cb0e0e 100644
--- a/include/tee/optee.h
+++ b/include/tee/optee.h
@@ -36,6 +36,11 @@ static inline uint32_t optee_image_get_entry_point(const image_header_t *hdr)
return optee_hdr->init_load_addr_lo;
}
+static inline uint32_t optee_image_get_load_addr(const image_header_t *hdr)
+{
+ return optee_image_get_entry_point(hdr) - sizeof(struct optee_header);
+}
+
#if defined(CONFIG_OPTEE)
int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start,
unsigned long tzdram_len, unsigned long image_len);