From 5fe51c93f81c373d37674b372469419fca92e073 Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Mon, 4 Jul 2022 11:09:46 +0200 Subject: [PATCH] refactor(imx8mp): introduce BL2_SIZE and BL31_SIZE No functional change. Introduce BLx_SIZE defines and calculate the limits based on the BLx_BASE and the BLx_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. Signed-off-by: Marco Felsch Change-Id: Idae34c1dfcedd35238fe083149080a199d50eed0 --- plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 2 +- plat/imx/imx8m/imx8mp/include/platform_def.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c index b98566ccc..4221633e0 100644 --- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c +++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c @@ -176,7 +176,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/imx8mp/include/platform_def.h b/plat/imx/imx8m/imx8mp/include/platform_def.h index 8807f5d2d..c4c51a687 100644 --- a/plat/imx/imx8m/imx8mp/include/platform_def.h +++ b/plat/imx/imx8m/imx8mp/include/platform_def.h @@ -9,6 +9,7 @@ #include #include #include +#include #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" #define PLATFORM_LINKER_ARCH aarch64 @@ -37,9 +38,9 @@ #if defined(NEED_BL2) #define BL2_BASE U(0x970000) -#define BL2_LIMIT U(0x990000) +#define BL2_SIZE SZ_128K +#define BL2_LIMIT (BL2_BASE + BL2_SIZE) #define BL31_BASE U(0x950000) -#define BL31_LIMIT U(0x970000) #define IMX_FIP_BASE U(0x40310000) #define IMX_FIP_SIZE U(0x000300000) #define IMX_FIP_LIMIT U(FIP_BASE + FIP_SIZE) @@ -50,9 +51,11 @@ #define PLAT_IMX8MP_BOOT_MMC_BASE U(0x30B50000) /* SD */ #else #define BL31_BASE U(0x970000) -#define BL31_LIMIT U(0x990000) #endif +#define BL31_SIZE SZ_128K +#define BL31_LIMIT (BL31_BASE + BL31_SIZE) + #define PLAT_PRI_BITS U(3) #define PLAT_SDEI_CRITICAL_PRI 0x10 #define PLAT_SDEI_NORMAL_PRI 0x20 -- 2.39.5