blob: c539a285837bf1506cbf2cc9cdd3e3e007f488b7 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Vikram Kanigirifbb13012016-02-15 11:54:14 +00002 * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005 */
6
Dan Handley2b6b5742015-03-19 19:17:53 +00007#include <plat_arm.h>
Yatharth Kochar736a3bf2015-10-11 14:14:55 +01008#include <tbbr_img_def.h>
Dan Handleyed6ff952014-05-14 17:44:19 +01009#include "fvp_private.h"
Achin Gupta4f6ad662013-10-25 09:08:21 +010010
Achin Gupta4f6ad662013-10-25 09:08:21 +010011
12/*******************************************************************************
13 * Perform any BL1 specific platform actions.
14 ******************************************************************************/
15void bl1_early_platform_setup(void)
16{
Dan Handley2b6b5742015-03-19 19:17:53 +000017 arm_bl1_early_platform_setup();
Sandrine Bailleuxe3060e22014-06-13 14:48:18 +010018
Harry Liebel30affd52013-10-30 17:41:48 +000019 /* Initialize the platform config for future decision making */
Dan Handleyea451572014-05-15 14:53:30 +010020 fvp_config_setup();
James Morrissey9d72b4e2014-02-10 17:04:32 +000021
Dan Handley2b6b5742015-03-19 19:17:53 +000022 /*
Vikram Kanigirifbb13012016-02-15 11:54:14 +000023 * Initialize Interconnect for this cluster during cold boot.
Dan Handley2b6b5742015-03-19 19:17:53 +000024 * No need for locks as no other CPU is active.
25 */
Vikram Kanigirifbb13012016-02-15 11:54:14 +000026 fvp_interconnect_init();
Dan Handley2b6b5742015-03-19 19:17:53 +000027 /*
Vikram Kanigirifbb13012016-02-15 11:54:14 +000028 * Enable coherency in Interconnect for the primary CPU's cluster.
Dan Handley2b6b5742015-03-19 19:17:53 +000029 */
Vikram Kanigirifbb13012016-02-15 11:54:14 +000030 fvp_interconnect_enable();
Vikram Kanigirida567432014-04-15 18:08:08 +010031}
Yatharth Kochar736a3bf2015-10-11 14:14:55 +010032
33/*******************************************************************************
34 * The following function checks if Firmware update is needed,
35 * by checking if TOC in FIP image is valid or not.
36 ******************************************************************************/
37unsigned int bl1_plat_get_next_image_id(void)
38{
39 if (!arm_io_is_toc_valid())
40 return NS_BL1U_IMAGE_ID;
41
42 return BL2_IMAGE_ID;
43}
44