blob: b92cf54b0063e95d554984a37e347365a7f5a308 [file] [log] [blame]
Yatharth Kochar7baff112015-10-09 18:06:13 +01001/*
2 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
3 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Yatharth Kochar7baff112015-10-09 18:06:13 +01005 */
Yatharth Kochar48bfb882015-10-10 19:06:53 +01006
7#include <arch_helpers.h>
8#include <assert.h>
Yatharth Kochar7baff112015-10-09 18:06:13 +01009#include <bl_common.h>
10#include <debug.h>
Yatharth Kochar48bfb882015-10-10 19:06:53 +010011#include <errno.h>
Yatharth Kochar7baff112015-10-09 18:06:13 +010012#include <platform_def.h>
13
14/*
15 * The following platform functions are weakly defined. They
Yatharth Kochar48bfb882015-10-10 19:06:53 +010016 * are default implementations that allow BL1 to compile in
Yatharth Kochar7baff112015-10-09 18:06:13 +010017 * absence of real definitions. The Platforms may override
18 * with more complex definitions.
19 */
20#pragma weak bl1_plat_get_next_image_id
21#pragma weak bl1_plat_set_ep_info
22#pragma weak bl1_plat_get_image_desc
Yatharth Kochar48bfb882015-10-10 19:06:53 +010023#pragma weak bl1_plat_fwu_done
Yatharth Kochar7baff112015-10-09 18:06:13 +010024
25
26unsigned int bl1_plat_get_next_image_id(void)
27{
28 /* BL2 load will be done by default. */
29 return BL2_IMAGE_ID;
30}
31
32void bl1_plat_set_ep_info(unsigned int image_id,
33 entry_point_info_t *ep_info)
34{
35
36}
37
38/*
39 * Following is the default definition that always
40 * returns BL2 image details.
41 */
42image_desc_t *bl1_plat_get_image_desc(unsigned int image_id)
43{
44 static image_desc_t bl2_img_desc = BL2_IMAGE_DESC;
45 return &bl2_img_desc;
46}
Yatharth Kochar48bfb882015-10-10 19:06:53 +010047
Dan Handley1f37b942015-12-15 14:28:24 +000048__dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved)
Yatharth Kochar48bfb882015-10-10 19:06:53 +010049{
50 while (1)
51 wfi();
52}
53
54/*
55 * The Platforms must override with real definition.
56 */
57#pragma weak bl1_plat_mem_check
58
59int bl1_plat_mem_check(uintptr_t mem_base, unsigned int mem_size,
60 unsigned int flags)
61{
62 assert(0);
63 return -ENOMEM;
64}