summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8/cpu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-12-16 17:46:36 (GMT)
committerTom Rini <trini@konsulko.com>2016-12-16 17:46:36 (GMT)
commitb5178a1f2468d5e9b1066e7d08757c1164727e4c (patch)
tree59ba300f55720cc86874c2ad25646ec09a9f2675 /arch/arm/cpu/armv8/cpu.c
parentbe72591bcd644df7e16afdd12ec258693693422f (diff)
parentc151cb5b516e609a0846bd392d6207a77b66a7ff (diff)
downloadu-boot-b5178a1f2468d5e9b1066e7d08757c1164727e4c.tar.xz
Merge git://git.denx.de/u-boot-fsl-qoriq
Diffstat (limited to 'arch/arm/cpu/armv8/cpu.c')
-rw-r--r--arch/arm/cpu/armv8/cpu.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/cpu.c b/arch/arm/cpu/armv8/cpu.c
index e06c3cc..5dcb5e2 100644
--- a/arch/arm/cpu/armv8/cpu.c
+++ b/arch/arm/cpu/armv8/cpu.c
@@ -14,6 +14,7 @@
#include <common.h>
#include <command.h>
#include <asm/system.h>
+#include <asm/secure.h>
#include <linux/compiler.h>
int cleanup_before_linux(void)
@@ -41,3 +42,24 @@ int cleanup_before_linux(void)
return 0;
}
+
+#ifdef CONFIG_ARMV8_PSCI
+static void relocate_secure_section(void)
+{
+#ifdef CONFIG_ARMV8_SECURE_BASE
+ size_t sz = __secure_end - __secure_start;
+
+ memcpy((void *)CONFIG_ARMV8_SECURE_BASE, __secure_start, sz);
+ flush_dcache_range(CONFIG_ARMV8_SECURE_BASE,
+ CONFIG_ARMV8_SECURE_BASE + sz + 1);
+ invalidate_icache_all();
+#endif
+}
+
+void armv8_setup_psci(void)
+{
+ relocate_secure_section();
+ secure_ram_addr(psci_setup_vectors)();
+ secure_ram_addr(psci_arch_init)();
+}
+#endif