summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2018-09-18 15:19:54 +0100
committerGitHub <noreply@github.com>2018-09-18 15:19:54 +0100
commit28441f9420cf8f9ffc91d31184e67f7705dac598 (patch)
treec8fccb49de42acda9726b486b6489195a87f4b34
parente52ed092cde21d13533df32eb68629a980d69b4b (diff)
parent943bb7f8f4691966e0d2663a4ba0ef77af7d313a (diff)
downloadarm-trusted-firmware-28441f9420cf8f9ffc91d31184e67f7705dac598.tar.gz
Merge pull request #1575 from soby-mathew/sm/fix_cryptocell_mem
ARM platforms: Reintroduce coherent memory for BL1 and BL2
-rw-r--r--plat/arm/common/arm_bl1_setup.c12
-rw-r--r--plat/arm/common/arm_bl2_setup.c11
-rw-r--r--plat/arm/common/arm_common.mk8
3 files changed, 25 insertions, 6 deletions
diff --git a/plat/arm/common/arm_bl1_setup.c b/plat/arm/common/arm_bl1_setup.c
index d9104ee30..ea3703bc3 100644
--- a/plat/arm/common/arm_bl1_setup.c
+++ b/plat/arm/common/arm_bl1_setup.c
@@ -111,8 +111,11 @@ void bl1_early_platform_setup(void)
*****************************************************************************/
void arm_bl1_plat_arch_setup(void)
{
-#if USE_COHERENT_MEM
- /* ARM platforms dont use coherent memory in BL1 */
+#if USE_COHERENT_MEM && !ARM_CRYPTOCELL_INTEG
+ /*
+ * Ensure ARM platforms don't use coherent memory in BL1 unless
+ * cryptocell integration is enabled.
+ */
assert((BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE) == 0U);
#endif
@@ -122,7 +125,10 @@ void arm_bl1_plat_arch_setup(void)
#if USE_ROMLIB
ARM_MAP_ROMLIB_CODE,
ARM_MAP_ROMLIB_DATA,
- #endif
+#endif
+#if ARM_CRYPTOCELL_INTEG
+ ARM_MAP_BL_COHERENT_RAM,
+#endif
{0}
};
diff --git a/plat/arm/common/arm_bl2_setup.c b/plat/arm/common/arm_bl2_setup.c
index a8ea075d8..edad80003 100644
--- a/plat/arm/common/arm_bl2_setup.c
+++ b/plat/arm/common/arm_bl2_setup.c
@@ -237,9 +237,11 @@ void bl2_platform_setup(void)
******************************************************************************/
void arm_bl2_plat_arch_setup(void)
{
-
-#if USE_COHERENT_MEM
- /* Ensure ARM platforms dont use coherent memory in BL2 */
+#if USE_COHERENT_MEM && !ARM_CRYPTOCELL_INTEG
+ /*
+ * Ensure ARM platforms don't use coherent memory in BL2 unless
+ * cryptocell integration is enabled.
+ */
assert((BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE) == 0U);
#endif
@@ -250,6 +252,9 @@ void arm_bl2_plat_arch_setup(void)
ARM_MAP_ROMLIB_CODE,
ARM_MAP_ROMLIB_DATA,
#endif
+#if ARM_CRYPTOCELL_INTEG
+ ARM_MAP_BL_COHERENT_RAM,
+#endif
{0}
};
diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk
index d8eda35b6..5c2d1e8fa 100644
--- a/plat/arm/common/arm_common.mk
+++ b/plat/arm/common/arm_common.mk
@@ -138,6 +138,14 @@ ARM_CRYPTOCELL_INTEG := 0
$(eval $(call assert_boolean,ARM_CRYPTOCELL_INTEG))
$(eval $(call add_define,ARM_CRYPTOCELL_INTEG))
+# CryptoCell integration relies on coherent buffers for passing data from
+# the AP CPU to the CryptoCell
+ifeq (${ARM_CRYPTOCELL_INTEG},1)
+ ifeq (${USE_COHERENT_MEM},0)
+ $(error "ARM_CRYPTOCELL_INTEG needs USE_COHERENT_MEM to be set.")
+ endif
+endif
+
PLAT_INCLUDES += -Iinclude/common/tbbr \
-Iinclude/plat/arm/common