blob: 36a3a1c39f8192f4fe672d8085f6a3d97dbb5ff0 [file] [log] [blame]
Yann Gautier4b0c72a2018-07-16 10:54:09 +02001/*
Yann Gautier0ed7b2a2021-05-19 18:48:16 +02002 * Copyright (c) 2016-2021, ARM Limited and Contributors. All rights reserved.
Yann Gautier4b0c72a2018-07-16 10:54:09 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Yann Gautiera55169b2020-01-10 18:18:59 +01007#include <platform_def.h>
8
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00009#include <common/desc_image_load.h>
10#include <plat/common/platform.h>
Yann Gautier4b0c72a2018-07-16 10:54:09 +020011
12/*******************************************************************************
13 * This function flushes the data structures so that they are visible
14 * in memory for the next BL image.
15 ******************************************************************************/
16void plat_flush_next_bl_params(void)
17{
18 flush_bl_params_desc();
19}
20
21/*******************************************************************************
22 * This function returns the list of loadable images.
23 ******************************************************************************/
24bl_load_info_t *plat_get_bl_image_load_info(void)
25{
Yann Gautier0ed7b2a2021-05-19 18:48:16 +020026#if STM32MP_USE_STM32IMAGE
Yann Gautiera55169b2020-01-10 18:18:59 +010027 bl_mem_params_node_t *bl33 = get_bl_mem_params_node(BL33_IMAGE_ID);
28 uint32_t ddr_ns_size = stm32mp_get_ddr_ns_size();
29
30 /* Max size is non-secure DDR end address minus image_base */
31 bl33->image_info.image_max_size = STM32MP_DDR_BASE + ddr_ns_size -
32 bl33->image_info.image_base;
Yann Gautier0ed7b2a2021-05-19 18:48:16 +020033#endif /* STM32MP_USE_STM32IMAGE */
Yann Gautiera55169b2020-01-10 18:18:59 +010034
Yann Gautier4b0c72a2018-07-16 10:54:09 +020035 return get_bl_load_info_from_mem_params_desc();
36}
37
38/*******************************************************************************
39 * This function returns the list of executable images.
40 ******************************************************************************/
41bl_params_t *plat_get_next_bl_params(void)
42{
Yann Gautier0ed7b2a2021-05-19 18:48:16 +020043 bl_params_t *bl_params = get_next_bl_params_from_mem_params_desc();
44
45 populate_next_bl_params_config(bl_params);
46
47 return bl_params;
Yann Gautier4b0c72a2018-07-16 10:54:09 +020048}