summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2016-06-19 04:38:39 (GMT)
committerHans de Goede <hdegoede@redhat.com>2016-07-15 13:54:57 (GMT)
commit3eff681818e2c858175a7cc4e766f75e95827920 (patch)
treee08efb181fef7b2ddcabb53599e9b863d61b56e4 /arch
parent28f90357323bc65e7da01c458222b84dc42988bb (diff)
downloadu-boot-fsl-qoriq-3eff681818e2c858175a7cc4e766f75e95827920.tar.xz
ARM: Add CONFIG_ARMV7_SECURE_MAX_SIZE and check size of secure section
As the PSCI implementation grows, we might exceed the size of the secure memory that holds the firmware. Add a configurable CONFIG_ARMV7_SECURE_MAX_SIZE so platforms can define how much secure memory is available. The linker then checks the size of the whole secure section against this. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/u-boot.lds11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index 002706a..5a65c27 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -86,6 +86,17 @@ SECTIONS
. = ALIGN(CONSTANT(COMMONPAGESIZE));
KEEP(*(.__secure_stack_end))
+
+#ifdef CONFIG_ARMV7_SECURE_MAX_SIZE
+ /*
+ * We are not checking (__secure_end - __secure_start) here,
+ * as these are the load addresses, and do not include the
+ * stack section. Instead, use the end of the stack section
+ * and the start of the text section.
+ */
+ ASSERT((. - ADDR(.secure_text)) <= CONFIG_ARMV7_SECURE_MAX_SIZE,
+ "Error: secure section exceeds secure memory size");
+#endif
}
#ifndef __ARMV7_PSCI_STACK_IN_RAM