Skip to content
Snippets Groups Projects
Commit a5aa7ff3 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Hans de Goede
Browse files

ARM: Add secure section for initialized data


The secure monitor may need to store global or static values within the
secure section of memory, such as target PC or CPU power status.

Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent afc1f65f
No related branches found
No related tags found
No related merge requests found
...@@ -120,8 +120,8 @@ endif ...@@ -120,8 +120,8 @@ endif
ifdef CONFIG_ARM64 ifdef CONFIG_ARM64
OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
else else
OBJCOPYFLAGS += -j .text -j .secure_text -j .rodata -j .hash -j .data -j \ OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \
.got -j .got.plt -j .u_boot_list -j .rel.dyn -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn
endif endif
ifdef CONFIG_OF_EMBED ifdef CONFIG_OF_EMBED
......
...@@ -69,12 +69,17 @@ SECTIONS ...@@ -69,12 +69,17 @@ SECTIONS
*(._secure.text) *(._secure.text)
} }
.secure_stack ALIGN(ADDR(.secure_text) + SIZEOF(.secure_text), .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
{
*(._secure.data)
}
.secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data),
CONSTANT(COMMONPAGESIZE)) (NOLOAD) : CONSTANT(COMMONPAGESIZE)) (NOLOAD) :
#ifdef __ARMV7_PSCI_STACK_IN_RAM #ifdef __ARMV7_PSCI_STACK_IN_RAM
AT(ADDR(.secure_stack)) AT(ADDR(.secure_stack))
#else #else
AT(LOADADDR(.secure_text) + SIZEOF(.secure_text)) AT(LOADADDR(.secure_data) + SIZEOF(.secure_data))
#endif #endif
{ {
KEEP(*(.__secure_stack_start)) KEEP(*(.__secure_stack_start))
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <config.h> #include <config.h>
#define __secure __attribute__ ((section ("._secure.text"))) #define __secure __attribute__ ((section ("._secure.text")))
#define __secure_data __attribute__ ((section ("._secure.data")))
#ifdef CONFIG_ARMV7_SECURE_BASE #ifdef CONFIG_ARMV7_SECURE_BASE
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment