fix(versal-net): fix BLXX memory limits for user defined values
When compiling with user defined areas of memory the platform code
calculates the size with (base + size - 1). However, the linker
file aligns section on a page boundary. So having the -1 in
the size calculations leads to an error message looking like this:
bl31.elf section `coherent_ram' will not fit in region `RAM'
aarch64-buildroot-linux-uclibc-ld: region `RAM' overflowed by 1 byte
While at it fix all other occurences of predefined values that were
calculated with -1.
Fixes: 1d333e69091f ("feat(versal-net): add support for Xilinx
Versal NET platform")
Change-Id: I4455f63ee3ad52369f517a7d8d3627faf0b28c0f
Signed-off-by: Michal Simek <michal.simek@amd.com>
diff --git a/plat/xilinx/versal_net/include/platform_def.h b/plat/xilinx/versal_net/include/platform_def.h
index b3bc80b..b256b05 100644
--- a/plat/xilinx/versal_net/include/platform_def.h
+++ b/plat/xilinx/versal_net/include/platform_def.h
@@ -38,13 +38,13 @@
*/
#ifndef VERSAL_NET_ATF_MEM_BASE
# define BL31_BASE U(0xBBF00000)
-# define BL31_LIMIT U(0xBBFFFFFF)
+# define BL31_LIMIT U(0xBC000000)
#else
# define BL31_BASE U(VERSAL_NET_ATF_MEM_BASE)
-# define BL31_LIMIT U(VERSAL_NET_ATF_MEM_BASE + VERSAL_NET_ATF_MEM_SIZE - 1)
+# define BL31_LIMIT U(VERSAL_NET_ATF_MEM_BASE + VERSAL_NET_ATF_MEM_SIZE)
# ifdef VERSAL_NET_ATF_MEM_PROGBITS_SIZE
# define BL31_PROGBITS_LIMIT U(VERSAL_NET_ATF_MEM_BASE + \
- VERSAL_NET_ATF_MEM_PROGBITS_SIZE - 1)
+ VERSAL_NET_ATF_MEM_PROGBITS_SIZE)
# endif
#endif
@@ -53,10 +53,10 @@
******************************************************************************/
#ifndef VERSAL_NET_BL32_MEM_BASE
# define BL32_BASE U(0x60000000)
-# define BL32_LIMIT U(0x7FFFFFFF)
+# define BL32_LIMIT U(0x80000000)
#else
# define BL32_BASE U(VERSAL_NET_BL32_MEM_BASE)
-# define BL32_LIMIT U(VERSAL_NET_BL32_MEM_BASE + VERSAL_NET_BL32_MEM_SIZE - 1)
+# define BL32_LIMIT U(VERSAL_NET_BL32_MEM_BASE + VERSAL_NET_BL32_MEM_SIZE)
#endif
/*******************************************************************************
@@ -72,7 +72,7 @@
* TSP specific defines.
******************************************************************************/
#define TSP_SEC_MEM_BASE BL32_BASE
-#define TSP_SEC_MEM_SIZE (BL32_LIMIT - BL32_BASE + 1U)
+#define TSP_SEC_MEM_SIZE (BL32_LIMIT - BL32_BASE)
/* ID of the secure physical generic timer interrupt used by the TSP */
#define TSP_IRQ_SEC_PHY_TIMER ARM_IRQ_SEC_PHY_TIMER