xref: /rk3399_ARM-atf/plat/arm/common/arm_image_load.c (revision a8aa7fec1d4a6df8617c0d0463f1e10f1827a609)
1*a8aa7fecSYatharth Kochar /*
2*a8aa7fecSYatharth Kochar  * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3*a8aa7fecSYatharth Kochar  *
4*a8aa7fecSYatharth Kochar  * Redistribution and use in source and binary forms, with or without
5*a8aa7fecSYatharth Kochar  * modification, are permitted provided that the following conditions are met:
6*a8aa7fecSYatharth Kochar  *
7*a8aa7fecSYatharth Kochar  * Redistributions of source code must retain the above copyright notice, this
8*a8aa7fecSYatharth Kochar  * list of conditions and the following disclaimer.
9*a8aa7fecSYatharth Kochar  *
10*a8aa7fecSYatharth Kochar  * Redistributions in binary form must reproduce the above copyright notice,
11*a8aa7fecSYatharth Kochar  * this list of conditions and the following disclaimer in the documentation
12*a8aa7fecSYatharth Kochar  * and/or other materials provided with the distribution.
13*a8aa7fecSYatharth Kochar  *
14*a8aa7fecSYatharth Kochar  * Neither the name of ARM nor the names of its contributors may be used
15*a8aa7fecSYatharth Kochar  * to endorse or promote products derived from this software without specific
16*a8aa7fecSYatharth Kochar  * prior written permission.
17*a8aa7fecSYatharth Kochar  *
18*a8aa7fecSYatharth Kochar  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19*a8aa7fecSYatharth Kochar  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*a8aa7fecSYatharth Kochar  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*a8aa7fecSYatharth Kochar  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22*a8aa7fecSYatharth Kochar  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*a8aa7fecSYatharth Kochar  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*a8aa7fecSYatharth Kochar  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*a8aa7fecSYatharth Kochar  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*a8aa7fecSYatharth Kochar  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*a8aa7fecSYatharth Kochar  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*a8aa7fecSYatharth Kochar  * POSSIBILITY OF SUCH DAMAGE.
29*a8aa7fecSYatharth Kochar  */
30*a8aa7fecSYatharth Kochar 
31*a8aa7fecSYatharth Kochar #include <arm_def.h>
32*a8aa7fecSYatharth Kochar #include <bl_common.h>
33*a8aa7fecSYatharth Kochar #include <desc_image_load.h>
34*a8aa7fecSYatharth Kochar #include <platform.h>
35*a8aa7fecSYatharth Kochar 
36*a8aa7fecSYatharth Kochar 
37*a8aa7fecSYatharth Kochar #pragma weak plat_flush_next_bl_params
38*a8aa7fecSYatharth Kochar #pragma weak plat_get_bl_image_load_info
39*a8aa7fecSYatharth Kochar #pragma weak plat_get_next_bl_params
40*a8aa7fecSYatharth Kochar 
41*a8aa7fecSYatharth Kochar 
42*a8aa7fecSYatharth Kochar /*******************************************************************************
43*a8aa7fecSYatharth Kochar  * This function flushes the data structures so that they are visible
44*a8aa7fecSYatharth Kochar  * in memory for the next BL image.
45*a8aa7fecSYatharth Kochar  ******************************************************************************/
46*a8aa7fecSYatharth Kochar void plat_flush_next_bl_params(void)
47*a8aa7fecSYatharth Kochar {
48*a8aa7fecSYatharth Kochar 	flush_bl_params_desc();
49*a8aa7fecSYatharth Kochar }
50*a8aa7fecSYatharth Kochar 
51*a8aa7fecSYatharth Kochar /*******************************************************************************
52*a8aa7fecSYatharth Kochar  * This function returns the list of loadable images.
53*a8aa7fecSYatharth Kochar  ******************************************************************************/
54*a8aa7fecSYatharth Kochar bl_load_info_t *plat_get_bl_image_load_info(void)
55*a8aa7fecSYatharth Kochar {
56*a8aa7fecSYatharth Kochar 	return get_bl_load_info_from_mem_params_desc();
57*a8aa7fecSYatharth Kochar }
58*a8aa7fecSYatharth Kochar 
59*a8aa7fecSYatharth Kochar /*******************************************************************************
60*a8aa7fecSYatharth Kochar  * This function returns the list of executable images.
61*a8aa7fecSYatharth Kochar  ******************************************************************************/
62*a8aa7fecSYatharth Kochar bl_params_t *plat_get_next_bl_params(void)
63*a8aa7fecSYatharth Kochar {
64*a8aa7fecSYatharth Kochar 	return get_next_bl_params_from_mem_params_desc();
65*a8aa7fecSYatharth Kochar }
66