Fix MISRA rule 8.4 in common code
[project/bcm63xx/atf.git] / plat / common / plat_bl_common.c
1 /*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #include <arch_helpers.h>
8 #include <assert.h>
9 #include <bl_common.h>
10 #include <debug.h>
11 #include <errno.h>
12 #include <platform.h>
13
14 /*
15 * The following platform functions are weakly defined. The Platforms
16 * may redefine with strong definition.
17 */
18 #pragma weak bl2_el3_plat_prepare_exit
19 #pragma weak plat_error_handler
20 #pragma weak bl2_plat_preload_setup
21 #pragma weak bl2_plat_handle_pre_image_load
22 #pragma weak bl2_plat_handle_post_image_load
23 #pragma weak plat_try_next_boot_source
24
25 void bl2_el3_plat_prepare_exit(void)
26 {
27 }
28
29 void __dead2 plat_error_handler(int err)
30 {
31 while (1)
32 wfi();
33 }
34
35 void bl2_plat_preload_setup(void)
36 {
37 }
38
39 #if LOAD_IMAGE_V2
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 }
49 #endif
50
51 int plat_try_next_boot_source(void)
52 {
53 return 0;
54 }
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