On 17.05.23 11:03, Sascha Hauer wrote: > We want to reserve memory for OP-TEE at the end of available SDRAM, > so move the scratch area below OP-TEE and not above. > > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> > --- > arch/arm/include/asm/barebox-arm.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h > index f446044be6..6e6606d005 100644 > --- a/arch/arm/include/asm/barebox-arm.h > +++ b/arch/arm/include/asm/barebox-arm.h > @@ -71,14 +71,14 @@ static inline void arm_fixup_vectors(void) > > void *barebox_arm_boot_dtb(void); > > -#define arm_mem_scratch(endmem) ((endmem) - SZ_32K) > +#define arm_mem_scratch(endmem) ((endmem) - OPTEE_SIZE - SZ_32K) > > static inline const void *arm_mem_scratch_get(void) > { > return (const void *)arm_mem_scratch(arm_mem_endmem_get()); > } > > -#define arm_mem_stack_top(endmem) ((endmem) - SZ_64K - OPTEE_SIZE) > +#define arm_mem_stack_top(endmem) ((endmem) - SZ_64K) I don't understand why you drop OPTEE_SIZE here. Wouldn't the stack now eat into the OP-TEE region? > > static inline unsigned long arm_mem_stack(unsigned long endmem) > { -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |