From 796a249c2dd12fd3e871f92feefb859d8067ad87 Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Mon, 4 Jul 2022 12:14:54 +0200 Subject: [PATCH] refactor(imx8mn): introduce BL31_SIZE Introduce BL31_SIZE define and calculate the limit based on the BL31_BASE and the BL31_SIZE define. Also make use of SZ_128K to make it easier to read. This is required for later BL31 PIE support since it drops the calculation based on the BL31_LIMIT and BL31_BASE. While on it remove the duplicated include. Signed-off-by: Marco Felsch Change-Id: Ifca40bd5682ef993db986439115abd9e9a66a5b2 --- plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 2 +- plat/imx/imx8m/imx8mn/include/platform_def.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c index 34ee5bcac..da5c9eecf 100644 --- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c +++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c @@ -180,7 +180,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, } #define MAP_BL31_TOTAL \ - MAP_REGION_FLAT(BL31_BASE, BL31_LIMIT - BL31_BASE, MT_MEMORY | MT_RW | MT_SECURE) + MAP_REGION_FLAT(BL31_BASE, BL31_SIZE, MT_MEMORY | MT_RW | MT_SECURE) #define MAP_BL31_RO \ MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - BL_CODE_BASE, MT_MEMORY | MT_RO | MT_SECURE) #define MAP_COHERENT_MEM \ diff --git a/plat/imx/imx8m/imx8mn/include/platform_def.h b/plat/imx/imx8m/imx8mn/include/platform_def.h index dbb44165c..e6c4bafa6 100644 --- a/plat/imx/imx8m/imx8mn/include/platform_def.h +++ b/plat/imx/imx8m/imx8mn/include/platform_def.h @@ -8,8 +8,7 @@ #include #include - -#include +#include #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" #define PLATFORM_LINKER_ARCH aarch64 @@ -42,7 +41,8 @@ #define PLAT_SDEI_SGI_PRIVATE U(9) #define BL31_BASE U(0x960000) -#define BL31_LIMIT U(0x980000) +#define BL31_SIZE SZ_128K +#define BL31_LIMIT (BL31_BASE + BL31_SIZE) /* non-secure uboot base */ #define PLAT_NS_IMAGE_OFFSET U(0x40200000) -- 2.39.5