Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 1 | /* |
Yann Gautier | c6f77b0 | 2022-05-06 09:50:43 +0200 | [diff] [blame] | 2 | * Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved. |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Manish V Badarkhe | c8437b3 | 2022-05-17 14:05:06 +0100 | [diff] [blame] | 7 | #include <assert.h> |
| 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <common/desc_image_load.h> |
| 10 | #include <plat/common/platform.h> |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 11 | |
Yann Gautier | c6f77b0 | 2022-05-06 09:50:43 +0200 | [diff] [blame] | 12 | #include <platform_def.h> |
| 13 | |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 14 | /******************************************************************************* |
| 15 | * This function flushes the data structures so that they are visible |
| 16 | * in memory for the next BL image. |
| 17 | ******************************************************************************/ |
| 18 | void plat_flush_next_bl_params(void) |
| 19 | { |
| 20 | flush_bl_params_desc(); |
| 21 | } |
| 22 | |
| 23 | /******************************************************************************* |
| 24 | * This function returns the list of loadable images. |
| 25 | ******************************************************************************/ |
| 26 | bl_load_info_t *plat_get_bl_image_load_info(void) |
| 27 | { |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 28 | #if STM32MP_USE_STM32IMAGE |
Yann Gautier | a55169b | 2020-01-10 18:18:59 +0100 | [diff] [blame] | 29 | bl_mem_params_node_t *bl33 = get_bl_mem_params_node(BL33_IMAGE_ID); |
| 30 | uint32_t ddr_ns_size = stm32mp_get_ddr_ns_size(); |
| 31 | |
Yann Gautier | c6f77b0 | 2022-05-06 09:50:43 +0200 | [diff] [blame] | 32 | assert(bl33 != NULL); |
| 33 | |
Yann Gautier | a55169b | 2020-01-10 18:18:59 +0100 | [diff] [blame] | 34 | /* Max size is non-secure DDR end address minus image_base */ |
| 35 | bl33->image_info.image_max_size = STM32MP_DDR_BASE + ddr_ns_size - |
| 36 | bl33->image_info.image_base; |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 37 | #endif /* STM32MP_USE_STM32IMAGE */ |
Yann Gautier | a55169b | 2020-01-10 18:18:59 +0100 | [diff] [blame] | 38 | |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 39 | return get_bl_load_info_from_mem_params_desc(); |
| 40 | } |
| 41 | |
| 42 | /******************************************************************************* |
| 43 | * This function returns the list of executable images. |
| 44 | ******************************************************************************/ |
| 45 | bl_params_t *plat_get_next_bl_params(void) |
| 46 | { |
Yann Gautier | 0ed7b2a | 2021-05-19 18:48:16 +0200 | [diff] [blame] | 47 | bl_params_t *bl_params = get_next_bl_params_from_mem_params_desc(); |
| 48 | |
| 49 | populate_next_bl_params_config(bl_params); |
| 50 | |
| 51 | return bl_params; |
Yann Gautier | 4b0c72a | 2018-07-16 10:54:09 +0200 | [diff] [blame] | 52 | } |