Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 5 | */ |
Yatharth Kochar | 71c9a5e | 2015-10-10 19:06:53 +0100 | [diff] [blame] | 6 | |
| 7 | #include <arch_helpers.h> |
| 8 | #include <assert.h> |
Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 9 | #include <bl_common.h> |
| 10 | #include <debug.h> |
Yatharth Kochar | 71c9a5e | 2015-10-10 19:06:53 +0100 | [diff] [blame] | 11 | #include <errno.h> |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame^] | 12 | #include <platform.h> |
Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 13 | #include <platform_def.h> |
| 14 | |
| 15 | /* |
| 16 | * The following platform functions are weakly defined. They |
Yatharth Kochar | 71c9a5e | 2015-10-10 19:06:53 +0100 | [diff] [blame] | 17 | * are default implementations that allow BL1 to compile in |
Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 18 | * absence of real definitions. The Platforms may override |
| 19 | * with more complex definitions. |
| 20 | */ |
| 21 | #pragma weak bl1_plat_get_next_image_id |
| 22 | #pragma weak bl1_plat_set_ep_info |
| 23 | #pragma weak bl1_plat_get_image_desc |
Yatharth Kochar | 71c9a5e | 2015-10-10 19:06:53 +0100 | [diff] [blame] | 24 | #pragma weak bl1_plat_fwu_done |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame^] | 25 | #pragma weak bl1_plat_handle_pre_image_load |
| 26 | #pragma weak bl1_plat_handle_post_image_load |
Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 27 | |
| 28 | |
| 29 | unsigned int bl1_plat_get_next_image_id(void) |
| 30 | { |
| 31 | /* BL2 load will be done by default. */ |
| 32 | return BL2_IMAGE_ID; |
| 33 | } |
| 34 | |
| 35 | void bl1_plat_set_ep_info(unsigned int image_id, |
| 36 | entry_point_info_t *ep_info) |
| 37 | { |
| 38 | |
| 39 | } |
| 40 | |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame^] | 41 | int bl1_plat_handle_pre_image_load(unsigned int image_id) |
| 42 | { |
| 43 | return 0; |
| 44 | } |
| 45 | |
| 46 | int bl1_plat_handle_post_image_load(unsigned int image_id) |
| 47 | { |
| 48 | return 0; |
| 49 | } |
| 50 | |
Yatharth Kochar | a65be2f | 2015-10-09 18:06:13 +0100 | [diff] [blame] | 51 | /* |
| 52 | * Following is the default definition that always |
| 53 | * returns BL2 image details. |
| 54 | */ |
| 55 | image_desc_t *bl1_plat_get_image_desc(unsigned int image_id) |
| 56 | { |
| 57 | static image_desc_t bl2_img_desc = BL2_IMAGE_DESC; |
| 58 | return &bl2_img_desc; |
| 59 | } |
Yatharth Kochar | 71c9a5e | 2015-10-10 19:06:53 +0100 | [diff] [blame] | 60 | |
Dan Handley | 89f8f33 | 2015-12-15 14:28:24 +0000 | [diff] [blame] | 61 | __dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved) |
Yatharth Kochar | 71c9a5e | 2015-10-10 19:06:53 +0100 | [diff] [blame] | 62 | { |
| 63 | while (1) |
| 64 | wfi(); |
| 65 | } |
| 66 | |
| 67 | /* |
| 68 | * The Platforms must override with real definition. |
| 69 | */ |
| 70 | #pragma weak bl1_plat_mem_check |
| 71 | |
| 72 | int bl1_plat_mem_check(uintptr_t mem_base, unsigned int mem_size, |
| 73 | unsigned int flags) |
| 74 | { |
| 75 | assert(0); |
| 76 | return -ENOMEM; |
| 77 | } |