From 8be574bf6608aedc27dc3d36a362b81fc835aa35 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Thu, 17 Sep 2020 11:30:18 +0200 Subject: [PATCH] refactor(stm32mp1): use a macro for header size Use STM32MP_HEADER_RESERVED_SIZE macro instead of a fixed value 0x3000 in linker script. Change-Id: I2702285c15aebaa1304a891c8aaabc949a912ba6 Signed-off-by: Yann Gautier --- plat/st/stm32mp1/stm32mp1.ld.S | 2 +- plat/st/stm32mp1/stm32mp1_def.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plat/st/stm32mp1/stm32mp1.ld.S b/plat/st/stm32mp1/stm32mp1.ld.S index 23716acc6..2254feead 100644 --- a/plat/st/stm32mp1/stm32mp1.ld.S +++ b/plat/st/stm32mp1/stm32mp1.ld.S @@ -16,7 +16,7 @@ OUTPUT_ARCH(PLATFORM_LINKER_ARCH) ENTRY(__BL2_IMAGE_START__) MEMORY { - HEADER (rw) : ORIGIN = 0x00000000, LENGTH = 0x3000 + HEADER (rw) : ORIGIN = 0x00000000, LENGTH = STM32MP_HEADER_RESERVED_SIZE RAM (rwx) : ORIGIN = STM32MP_BINARY_BASE, LENGTH = STM32MP_BINARY_SIZE } diff --git a/plat/st/stm32mp1/stm32mp1_def.h b/plat/st/stm32mp1/stm32mp1_def.h index 291342e13..ab3ef1792 100644 --- a/plat/st/stm32mp1/stm32mp1_def.h +++ b/plat/st/stm32mp1/stm32mp1_def.h @@ -102,6 +102,8 @@ enum ddr_type { #define STM32MP_PARAM_LOAD_SIZE U(0x00002400) /* 9 KB for param */ /* 256 Octets reserved for header */ #define STM32MP_HEADER_SIZE U(0x00000100) +/* round_up(STM32MP_PARAM_LOAD_SIZE + STM32MP_HEADER_SIZE, PAGE_SIZE) */ +#define STM32MP_HEADER_RESERVED_SIZE U(0x3000) #define STM32MP_BINARY_BASE (STM32MP_SEC_SYSRAM_BASE + \ STM32MP_PARAM_LOAD_SIZE + \ -- 2.39.5