Commit a249a9d9 authored by Manish V Badarkhe's avatar Manish V Badarkhe Committed by Manish V Badarkhe
Browse files

plat/arm: Check the need for firmware update only once



Currently, the need for firmware update is being checked twice
in the code hence modifications are done to do this check only
once and set the global variable.
Then this global variable helps to decide whether to go for
normal boot or firmware update flow.

Change-Id: I8469284555a8039786f34670f9dc4830f87aecc1
Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
parent d958f37d
......@@ -54,6 +54,9 @@
/* Data structure which holds the extents of the trusted SRAM for BL1*/
static meminfo_t bl1_tzram_layout;
/* Boolean variable to hold condition whether firmware update needed or not */
static bool is_fwu_needed;
struct meminfo *bl1_plat_sec_mem_layout(void)
{
return &bl1_tzram_layout;
......@@ -152,8 +155,8 @@ void arm_bl1_platform_setup(void)
plat_arm_io_setup();
/* Check if we need FWU before further processing */
err = plat_arm_bl1_fwu_needed();
if (err) {
is_fwu_needed = plat_arm_bl1_fwu_needed();
if (is_fwu_needed) {
ERROR("Skip platform setup as FWU detected\n");
return;
}
......@@ -247,5 +250,5 @@ bool plat_arm_bl1_fwu_needed(void)
******************************************************************************/
unsigned int bl1_plat_get_next_image_id(void)
{
return plat_arm_bl1_fwu_needed() ? NS_BL1U_IMAGE_ID : BL2_IMAGE_ID;
return is_fwu_needed ? NS_BL1U_IMAGE_ID : BL2_IMAGE_ID;
}
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