blob: 181c92319be5f7a7e70599e8457f3f0732bc14b1 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Jeenu Viswambharan955242d2017-07-18 15:42:50 +01002 * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005 */
6
Jeenu Viswambharan955242d2017-07-18 15:42:50 +01007#include <arm_config.h>
Dan Handley60eea552015-03-19 19:17:53 +00008#include <plat_arm.h>
Jeenu Viswambharan955242d2017-07-18 15:42:50 +01009#include <smmu_v3.h>
Dan Handley5f0cdb02014-05-14 17:44:19 +010010#include "fvp_private.h"
Achin Gupta4f6ad662013-10-25 09:08:21 +010011
Yatharth Kochara8aa7fe2016-09-13 17:07:57 +010012#if LOAD_IMAGE_V2
13void bl31_early_platform_setup(void *from_bl2,
14 void *plat_params_from_bl2)
15#else
Vikram Kanigiri4112bfa2014-04-15 18:08:08 +010016void bl31_early_platform_setup(bl31_params_t *from_bl2,
Vikram Kanigiri6871c5d2014-05-16 18:48:12 +010017 void *plat_params_from_bl2)
Yatharth Kochara8aa7fe2016-09-13 17:07:57 +010018#endif
Achin Gupta4f6ad662013-10-25 09:08:21 +010019{
Dan Handley60eea552015-03-19 19:17:53 +000020 arm_bl31_early_platform_setup(from_bl2, plat_params_from_bl2);
Vikram Kanigiri770de652014-03-27 14:33:15 +000021
Achin Gupta4f6ad662013-10-25 09:08:21 +010022 /* Initialize the platform config for future decision making */
Dan Handley17a387a2014-05-15 14:53:30 +010023 fvp_config_setup();
Vikram Kanigiridbad1ba2014-04-24 11:02:16 +010024
Vikram Kanigiridbad1ba2014-04-24 11:02:16 +010025 /*
Vikram Kanigiri6355f232016-02-15 11:54:14 +000026 * Initialize the correct interconnect for this cluster during cold
27 * boot. No need for locks as no other CPU is active.
Vikram Kanigiridbad1ba2014-04-24 11:02:16 +010028 */
Vikram Kanigiri6355f232016-02-15 11:54:14 +000029 fvp_interconnect_init();
Sandrine Bailleuxa6695272015-05-14 14:13:05 +010030
Dan Handley60eea552015-03-19 19:17:53 +000031 /*
Vikram Kanigiri6355f232016-02-15 11:54:14 +000032 * Enable coherency in interconnect for the primary CPU's cluster.
Sandrine Bailleuxa6695272015-05-14 14:13:05 +010033 * Earlier bootloader stages might already do this (e.g. Trusted
34 * Firmware's BL1 does it) but we can't assume so. There is no harm in
35 * executing this code twice anyway.
Dan Handley60eea552015-03-19 19:17:53 +000036 * FVP PSCI code will enable coherency for other clusters.
37 */
Vikram Kanigiri6355f232016-02-15 11:54:14 +000038 fvp_interconnect_enable();
Jeenu Viswambharan955242d2017-07-18 15:42:50 +010039
40 /* On FVP RevC, intialize SMMUv3 */
41 if (arm_config.flags & ARM_CONFIG_FVP_HAS_SMMUV3)
42 smmuv3_init(PLAT_FVP_SMMUV3_BASE);
Achin Gupta4f6ad662013-10-25 09:08:21 +010043}