Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 1 | /* |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch_helpers.h> |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 8 | #include <assert.h> |
| 9 | #include <bl_common.h> |
| 10 | #include <debug.h> |
| 11 | #include <errno.h> |
Soby Mathew | 73308d0 | 2018-01-09 14:36:14 +0000 | [diff] [blame] | 12 | #include <platform.h> |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 13 | |
| 14 | /* |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 15 | * The following platform functions are weakly defined. The Platforms |
| 16 | * may redefine with strong definition. |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 17 | */ |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 18 | #pragma weak bl2_el3_plat_prepare_exit |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 19 | #pragma weak plat_error_handler |
| 20 | #pragma weak bl2_plat_preload_setup |
Masahiro Yamada | 02a0d3d | 2018-02-01 16:45:51 +0900 | [diff] [blame] | 21 | #pragma weak bl2_plat_handle_pre_image_load |
| 22 | #pragma weak bl2_plat_handle_post_image_load |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 23 | #pragma weak plat_try_next_boot_source |
| 24 | |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 25 | void bl2_el3_plat_prepare_exit(void) |
Masahiro Yamada | 43d20b3 | 2018-02-01 16:46:18 +0900 | [diff] [blame] | 26 | { |
Masahiro Yamada | 43d20b3 | 2018-02-01 16:46:18 +0900 | [diff] [blame] | 27 | } |
| 28 | |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 29 | void __dead2 plat_error_handler(int err) |
Masahiro Yamada | 43d20b3 | 2018-02-01 16:46:18 +0900 | [diff] [blame] | 30 | { |
Soby Mathew | 2f38ce3 | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 31 | while (1) |
| 32 | wfi(); |
Masahiro Yamada | 43d20b3 | 2018-02-01 16:46:18 +0900 | [diff] [blame] | 33 | } |
| 34 | |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 35 | void bl2_plat_preload_setup(void) |
| 36 | { |
| 37 | } |
| 38 | |
Roberto Vargas | 0571270 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 39 | #if LOAD_IMAGE_V2 |
Masahiro Yamada | 02a0d3d | 2018-02-01 16:45:51 +0900 | [diff] [blame] | 40 | int bl2_plat_handle_pre_image_load(unsigned int image_id) |
| 41 | { |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | int bl2_plat_handle_post_image_load(unsigned int image_id) |
| 46 | { |
| 47 | return 0; |
| 48 | } |
Roberto Vargas | 0571270 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 49 | #endif |
Masahiro Yamada | 02a0d3d | 2018-02-01 16:45:51 +0900 | [diff] [blame] | 50 | |
Masahiro Yamada | 2a4fe4f | 2018-02-01 18:42:24 +0900 | [diff] [blame] | 51 | int plat_try_next_boot_source(void) |
| 52 | { |
| 53 | return 0; |
| 54 | } |
Soby Mathew | 73308d0 | 2018-01-09 14:36:14 +0000 | [diff] [blame] | 55 | |
| 56 | #if !ERROR_DEPRECATED |
| 57 | #pragma weak bl2_early_platform_setup2 |
| 58 | |
| 59 | /* |
| 60 | * The following platform API implementation that allow compatibility for |
| 61 | * the older platform APIs. |
| 62 | */ |
| 63 | void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, |
| 64 | u_register_t arg2, u_register_t arg3) |
| 65 | { |
| 66 | bl2_early_platform_setup((void *)arg1); |
| 67 | } |
| 68 | #endif |