aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2014-06-02 15:01:00 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2014-06-05 17:39:40 +0100
commit5c21e430b62c71acc9a2b74ccf13cc1ea3af8c3f (patch)
tree4eb1045cb126130c25d217799ffa41d76dc76c6c
parent28d67b29a18d9f5b2f5fbf7e39a125217fa8845e (diff)
downloadarm-trusted-firmware-5c21e430b62c71acc9a2b74ccf13cc1ea3af8c3f.tar.gz
juno: Add a check to verify BL2 to BL31 plat. param
This concerns only debug builds. In BL2, we now pass a special value to BL3-1 through x1. In BL3-1, we check that we receive the correct value. This ensures that any platform set value is correctly passed from BL2 to BL3-1. Change-Id: Icb94d0e99ca445dcbe574a7d5e291659bba2209e
-rw-r--r--plat/juno/bl2_plat_setup.c4
-rw-r--r--plat/juno/bl31_plat_setup.c9
-rw-r--r--plat/juno/juno_def.h3
3 files changed, 14 insertions, 2 deletions
diff --git a/plat/juno/bl2_plat_setup.c b/plat/juno/bl2_plat_setup.c
index 563f05b..5be725a 100644
--- a/plat/juno/bl2_plat_setup.c
+++ b/plat/juno/bl2_plat_setup.c
@@ -142,6 +142,10 @@ bl31_params_t *bl2_plat_get_bl31_params(void)
******************************************************************************/
struct entry_point_info *bl2_plat_get_bl31_ep_info(void)
{
+#if DEBUG
+ bl31_params_mem.bl31_ep_info.args.arg1 = JUNO_BL31_PLAT_PARAM_VAL;
+#endif
+
return &bl31_params_mem.bl31_ep_info;
}
diff --git a/plat/juno/bl31_plat_setup.c b/plat/juno/bl31_plat_setup.c
index cb5fd1e..2eac0fb 100644
--- a/plat/juno/bl31_plat_setup.c
+++ b/plat/juno/bl31_plat_setup.c
@@ -111,12 +111,17 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
/*
* Check params passed from BL2 should not be NULL,
- * We are not checking plat_params_from_bl2 as NULL as we are not
- * using it on Juno
*/
assert(from_bl2 != NULL);
assert(from_bl2->h.type == PARAM_BL31);
assert(from_bl2->h.version >= VERSION_1);
+ /*
+ * In debug builds, we pass a special value in 'plat_params_from_bl2'
+ * to verify platform parameters from BL2 to BL3-1.
+ * In release builds, it's not used.
+ */
+ assert(((unsigned long long)plat_params_from_bl2) ==
+ JUNO_BL31_PLAT_PARAM_VAL);
/*
* Copy BL3-2 and BL3-3 entry point information.
diff --git a/plat/juno/juno_def.h b/plat/juno/juno_def.h
index da852c5..6b3ba57 100644
--- a/plat/juno/juno_def.h
+++ b/plat/juno/juno_def.h
@@ -31,6 +31,9 @@
#ifndef __JUNO_DEF_H__
#define __JUNO_DEF_H__
+/* Special value used to verify platform parameters from BL2 to BL3-1 */
+#define JUNO_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
+
/*******************************************************************************
* Juno memory map related constants
******************************************************************************/