blob: 5a17a0dcabf7cf6ca14545c5da3180b1aff8b274 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Sandrine Bailleux4a247072021-07-01 14:13:09 +02002 * Copyright (c) 2013-2021, 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
Manish V Badarkhe7fb9bcd2020-05-30 17:40:44 +01007#include <assert.h>
8
Alexei Fedorov4a135bc2020-07-13 14:59:02 +01009#include <common/debug.h>
Manish V Badarkhe7fb9bcd2020-05-30 17:40:44 +010010#include <common/desc_image_load.h>
Antonio Nino Diaz09d40e02018-12-14 00:18:21 +000011#include <drivers/arm/sp804_delay_timer.h>
Manish V Badarkhe7fb9bcd2020-05-30 17:40:44 +010012#include <lib/fconf/fconf.h>
13#include <lib/fconf/fconf_dyn_cfg_getter.h>
14
Antonio Nino Diazbd9344f2019-01-25 14:30:04 +000015#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaz09d40e02018-12-14 00:18:21 +000016#include <plat/common/platform.h>
Antonio Nino Diaz234bc7f2019-01-15 14:19:50 +000017#include <platform_def.h>
Antonio Nino Diaz09d40e02018-12-14 00:18:21 +000018
Dan Handley5f0cdb02014-05-14 17:44:19 +010019#include "fvp_private.h"
Achin Gupta4f6ad662013-10-25 09:08:21 +010020
Soby Mathew0c306cc2018-01-10 15:59:31 +000021void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
Achin Gupta4f6ad662013-10-25 09:08:21 +010022{
Soby Mathewcab0b5b2018-01-15 14:45:33 +000023 arm_bl2_early_platform_setup((uintptr_t)arg0, (meminfo_t *)arg1);
Achin Gupta4f6ad662013-10-25 09:08:21 +010024
25 /* Initialize the platform config for future decision making */
Dan Handley17a387a2014-05-15 14:53:30 +010026 fvp_config_setup();
Vikram Kanigiri6871c5d2014-05-16 18:48:12 +010027}
Ryan Harkinb49b3222015-03-17 14:54:01 +000028
29void bl2_platform_setup(void)
30{
31 arm_bl2_platform_setup();
32
Alexei Fedorov1b597c22019-08-16 14:15:59 +010033 /* Initialize System level generic or SP804 timer */
34 fvp_timer_init();
Ryan Harkinb49b3222015-03-17 14:54:01 +000035}
Manish V Badarkhe7fb9bcd2020-05-30 17:40:44 +010036
37/*******************************************************************************
38 * This function returns the list of executable images
39 ******************************************************************************/
40struct bl_params *plat_get_next_bl_params(void)
41{
42 struct bl_params *arm_bl_params;
43
44 arm_bl_params = arm_get_next_bl_params();
45
46#if __aarch64__ && !BL2_AT_EL3
47 const struct dyn_cfg_dtb_info_t *fw_config_info;
48 bl_mem_params_node_t *param_node;
49 uintptr_t fw_config_base = 0U;
50 entry_point_info_t *ep_info;
51
52 /* Get BL31 image node */
53 param_node = get_bl_mem_params_node(BL31_IMAGE_ID);
54 assert(param_node != NULL);
55
56 /* get fw_config load address */
57 fw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, FW_CONFIG_ID);
58 assert(fw_config_info != NULL);
59
60 fw_config_base = fw_config_info->config_addr;
61 assert(fw_config_base != 0U);
62
63 /*
64 * Get the entry point info of BL31 image and override
65 * arg1 of entry point info with fw_config base address
66 */
67 ep_info = &param_node->ep_info;
68 ep_info->args.arg1 = (uint32_t)fw_config_base;
69#endif /* __aarch64__ && !BL2_AT_EL3 */
70
71 return arm_bl_params;
72}