We have several functions/macros named arm_mem_* returning the different addresses for early memory locations. Add one for OP-Tee as well. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- arch/arm/include/asm/barebox-arm.h | 5 +++++ arch/arm/mach-imx/atf.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h index 6e6606d005..8ab1e90e94 100644 --- a/arch/arm/include/asm/barebox-arm.h +++ b/arch/arm/include/asm/barebox-arm.h @@ -71,6 +71,11 @@ static inline void arm_fixup_vectors(void) void *barebox_arm_boot_dtb(void); +static inline unsigned long arm_mem_optee(unsigned long endmem) +{ + return endmem - OPTEE_SIZE; +} + #define arm_mem_scratch(endmem) ((endmem) - OPTEE_SIZE - SZ_32K) static inline const void *arm_mem_scratch_get(void) diff --git a/arch/arm/mach-imx/atf.c b/arch/arm/mach-imx/atf.c index c5e6817aad..659798b95f 100644 --- a/arch/arm/mach-imx/atf.c +++ b/arch/arm/mach-imx/atf.c @@ -141,7 +141,7 @@ __noreturn void imx8mm_load_and_start_image_via_tfa(void) imx8mm_load_bl33(bl33); if (IS_ENABLED(CONFIG_FIRMWARE_IMX8MM_OPTEE)) - imx8m_load_and_start_optee_via_tfa(imx8mm, endmem - OPTEE_SIZE, bl33); + imx8m_load_and_start_optee_via_tfa(imx8mm, arm_mem_optee(endmem), bl33); else imx8mm_load_and_start_tfa(imx8mm_bl31_bin); } @@ -189,7 +189,7 @@ __noreturn void imx8mp_load_and_start_image_via_tfa(void) imx8mp_load_bl33(bl33); if (IS_ENABLED(CONFIG_FIRMWARE_IMX8MP_OPTEE)) - imx8m_load_and_start_optee_via_tfa(imx8mp, endmem - OPTEE_SIZE, bl33); + imx8m_load_and_start_optee_via_tfa(imx8mp, arm_mem_optee(endmem), bl33); else imx8mp_load_and_start_tfa(imx8mp_bl31_bin); } @@ -238,7 +238,7 @@ __noreturn void imx8mn_load_and_start_image_via_tfa(void) imx8mn_load_bl33(bl33); if (IS_ENABLED(CONFIG_FIRMWARE_IMX8MN_OPTEE)) - imx8m_load_and_start_optee_via_tfa(imx8mn, endmem - OPTEE_SIZE, bl33); + imx8m_load_and_start_optee_via_tfa(imx8mn, arm_mem_optee(endmem), bl33); else imx8mn_load_and_start_tfa(imx8mn_bl31_bin); } -- 2.39.2