summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/u-boot.lds
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2014-07-12 14:24:02 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-07-28 17:07:23 +0200
commitbf433afd60ce2ccd1bec3cf14150323be8272ac3 (patch)
tree1dd1eb0cd86852ac01e6ca5b39978a1358c123b5 /arch/arm/cpu/u-boot.lds
parentb726d22da9aed61462e36aa722fa4e6fd0aec9f1 (diff)
downloadblackbird-obmc-uboot-bf433afd60ce2ccd1bec3cf14150323be8272ac3.tar.gz
blackbird-obmc-uboot-bf433afd60ce2ccd1bec3cf14150323be8272ac3.zip
ARM: HYP/non-sec: add separate section for secure code
In anticipation of refactoring the HYP/non-secure code to run from secure RAM, add a new linker section that will contain that code. Nothing is using it just yet. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm/cpu/u-boot.lds')
-rw-r--r--arch/arm/cpu/u-boot.lds30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index a7728e0a2d..7336162d80 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -7,6 +7,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#include <config.h>
+
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
@@ -23,6 +25,34 @@ SECTIONS
*(.text*)
}
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) || defined(CONFIG_ARMV7_PSCI)
+
+#ifndef CONFIG_ARMV7_SECURE_BASE
+#define CONFIG_ARMV7_SECURE_BASE
+#endif
+
+ .__secure_start : {
+ . = ALIGN(0x1000);
+ *(.__secure_start)
+ }
+
+ .secure_text CONFIG_ARMV7_SECURE_BASE :
+ AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
+ {
+ *(._secure.text)
+ }
+
+ . = LOADADDR(.__secure_start) +
+ SIZEOF(.__secure_start) +
+ SIZEOF(.secure_text);
+
+ __secure_end_lma = .;
+ .__secure_end : AT(__secure_end_lma) {
+ *(.__secure_end)
+ LONG(0x1d1071c); /* Must output something to reset LMA */
+ }
+#endif
+
. = ALIGN(4);
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
OpenPOWER on IntegriCloud