Merge pull request #1184 from antonio-nino-diaz-arm/an/bl31-in-dram
authordavidcunado-arm <david.cunado@arm.com>
Sat, 9 Dec 2017 23:10:24 +0000 (23:10 +0000)
committerGitHub <noreply@github.com>
Sat, 9 Dec 2017 23:10:24 +0000 (23:10 +0000)
fvp: Disable SYSTEM_SUSPEND when ARM_BL31_IN_DRAM

plat/arm/board/fvp/fvp_pm.c
plat/arm/board/fvp/include/platform_def.h
services/std_svc/spm/secure_partition_setup.c

index 13bd8f2377ae9242598bef556f1ab8f0fa034df2..72845843d86e827c4fb987c92925aa577e1cae70 100644 (file)
@@ -402,12 +402,20 @@ plat_psci_ops_t plat_arm_psci_pm_ops = {
        .validate_ns_entrypoint = arm_validate_psci_entrypoint,
        .translate_power_state_by_mpidr = fvp_translate_power_state_by_mpidr,
        .get_node_hw_state = fvp_node_hw_state,
+#if !ARM_BL31_IN_DRAM
+       /*
+        * The TrustZone Controller is set up during the warmboot sequence after
+        * resuming the CPU from a SYSTEM_SUSPEND. If BL31 is located in SRAM
+        * this is  not a problem but, if it is in TZC-secured DRAM, it tries to
+        * reconfigure the same memory it is running on, causing an exception.
+        */
        .get_sys_suspend_power_state = fvp_get_sys_suspend_power_state,
-/*
- * mem_protect is not supported in RESET_TO_BL31 and RESET_TO_SP_MIN,
- * as that would require mapping in all of NS DRAM into BL31 or BL32.
- */
+#endif
 #if !RESET_TO_BL31 && !RESET_TO_SP_MIN
+       /*
+        * mem_protect is not supported in RESET_TO_BL31 and RESET_TO_SP_MIN,
+        * as that would require mapping in all of NS DRAM into BL31 or BL32.
+        */
        .mem_protect_chk        = arm_psci_mem_protect_chk,
        .read_mem_protect       = arm_psci_read_mem_protect,
        .write_mem_protect      = arm_nor_psci_write_mem_protect,
index 310db7b62ba9e0e64a9671bb993c010539d9ddf5..7080fc302e6e72997656c7c539c64b1a29eea747 100644 (file)
@@ -8,6 +8,7 @@
 #define __PLATFORM_DEF_H__
 
 #include <arm_def.h>
+#include <arm_spm_def.h>
 #include <board_arm_def.h>
 #include <common_def.h>
 #include <tzc400.h>
index 6f4b0571366f31d337c3a53ca86a535693562547..30a82e1d8d0810b103c1c7e5338379ab5b1d9420 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <arch.h>
 #include <arch_helpers.h>
-#include <arm_spm_def.h>
 #include <assert.h>
 #include <common_def.h>
 #include <context.h>