blob: 181c92319be5f7a7e70599e8457f3f0732bc14b1 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Jeenu Viswambharan9e78b922017-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-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005 */
6
Jeenu Viswambharan9e78b922017-07-18 15:42:50 +01007#include <arm_config.h>
Dan Handley2b6b5742015-03-19 19:17:53 +00008#include <plat_arm.h>
Jeenu Viswambharan9e78b922017-07-18 15:42:50 +01009#include <smmu_v3.h>
Dan Handleyed6ff952014-05-14 17:44:19 +010010#include "fvp_private.h"
Achin Gupta4f6ad662013-10-25 09:08:21 +010011
Yatharth Kocharf9a0f162016-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 Kanigirida567432014-04-15 18:08:08 +010016void bl31_early_platform_setup(bl31_params_t *from_bl2,
Vikram Kanigirid8c9d262014-05-16 18:48:12 +010017 void *plat_params_from_bl2)
Yatharth Kocharf9a0f162016-09-13 17:07:57 +010018#endif
Achin Gupta4f6ad662013-10-25 09:08:21 +010019{
Dan Handley2b6b5742015-03-19 19:17:53 +000020 arm_bl31_early_platform_setup(from_bl2, plat_params_from_bl2);
Vikram Kanigiri3684abf2014-03-27 14:33:15 +000021
Achin Gupta4f6ad662013-10-25 09:08:21 +010022 /* Initialize the platform config for future decision making */
Dan Handleyea451572014-05-15 14:53:30 +010023 fvp_config_setup();
Vikram Kanigiri96377452014-04-24 11:02:16 +010024
Vikram Kanigiri9d70f0f2014-07-15 16:46:43 +010025 /*
Vikram Kanigirifbb13012016-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 Kanigiri9d70f0f2014-07-15 16:46:43 +010028 */
Vikram Kanigirifbb13012016-02-15 11:54:14 +000029 fvp_interconnect_init();
Sandrine Bailleuxda797f62015-05-14 14:13:05 +010030
Dan Handley2b6b5742015-03-19 19:17:53 +000031 /*
Vikram Kanigirifbb13012016-02-15 11:54:14 +000032 * Enable coherency in interconnect for the primary CPU's cluster.
Sandrine Bailleuxda797f62015-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 Handley2b6b5742015-03-19 19:17:53 +000036 * FVP PSCI code will enable coherency for other clusters.
37 */
Vikram Kanigirifbb13012016-02-15 11:54:14 +000038 fvp_interconnect_enable();
Jeenu Viswambharan9e78b922017-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}