From: Bryan O'Donoghue Date: Tue, 13 Mar 2018 16:50:31 +0000 (+0000) Subject: optee: Add optee_image_get_entry_point() X-Git-Tag: v2018.05-rc1~36 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f79443684b60beb7cb281fc0becb6b69aa0a1a4a;p=oweals%2Fu-boot.git optee: Add optee_image_get_entry_point() Add a helper function for extracting the least significant 32 bits from the OPTEE entry point address, which will be good enough to load OPTEE binaries up to (2^32)-1 bytes. We may need to extend this out later on but for now (2^32)-1 should be fine. Signed-off-by: Bryan O'Donoghue Cc: Harinarayan Bhatta Cc: Andrew F. Davis Cc: Tom Rini Cc: Kever Yang Cc: Philipp Tomsich Cc: Peng Fan Tested-by: Peng Fan --- diff --git a/include/tee/optee.h b/include/tee/optee.h index 8943afb439..eb328d3cc6 100644 --- a/include/tee/optee.h +++ b/include/tee/optee.h @@ -29,6 +29,13 @@ struct optee_header { uint32_t paged_size; }; +static inline uint32_t optee_image_get_entry_point(const image_header_t *hdr) +{ + struct optee_header *optee_hdr = (struct optee_header *)(hdr + 1); + + return optee_hdr->init_load_addr_lo; +} + #if defined(CONFIG_OPTEE) int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start, unsigned long tzdram_len, unsigned long image_len);