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.odonog...@linaro.org>
Cc: Harinarayan Bhatta <harinara...@ti.com>
Cc: Andrew F. Davis <a...@ti.com>
Cc: Tom Rini <tr...@konsulko.com>
Cc: Kever Yang <kever.y...@rock-chips.com>
Cc: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Cc: Peng Fan <peng....@nxp.com>
Tested-by: Peng Fan <peng....@nxp.com>
---
 include/tee/optee.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/tee/optee.h b/include/tee/optee.h
index eb328d3..e782cb0 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);
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to