Commit 5c21e430 authored by Sandrine Bailleux's avatar Sandrine Bailleux
Browse files

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
parent 28d67b29
...@@ -142,6 +142,10 @@ bl31_params_t *bl2_plat_get_bl31_params(void) ...@@ -142,6 +142,10 @@ bl31_params_t *bl2_plat_get_bl31_params(void)
******************************************************************************/ ******************************************************************************/
struct entry_point_info *bl2_plat_get_bl31_ep_info(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; return &bl31_params_mem.bl31_ep_info;
} }
......
...@@ -111,12 +111,17 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2, ...@@ -111,12 +111,17 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
/* /*
* Check params passed from BL2 should not be NULL, * 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 != NULL);
assert(from_bl2->h.type == PARAM_BL31); assert(from_bl2->h.type == PARAM_BL31);
assert(from_bl2->h.version >= VERSION_1); 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. * Copy BL3-2 and BL3-3 entry point information.
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#ifndef __JUNO_DEF_H__ #ifndef __JUNO_DEF_H__
#define __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 * Juno memory map related constants
******************************************************************************/ ******************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment