plat_bl_common.c 1.26 KB
Newer Older
1
/*
2
 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3
4
5
6
7
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <arch_helpers.h>
8
9
10
11
#include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <errno.h>
12
#include <platform.h>
13
14

/*
15
16
 * The following platform functions are weakly defined. The Platforms
 * may redefine with strong definition.
17
 */
18
#pragma weak bl2_el3_plat_prepare_exit
19
20
#pragma weak plat_error_handler
#pragma weak bl2_plat_preload_setup
21
22
#pragma weak bl2_plat_handle_pre_image_load
#pragma weak bl2_plat_handle_post_image_load
23
24
#pragma weak plat_try_next_boot_source

25
void bl2_el3_plat_prepare_exit(void)
26
27
28
{
}

29
void __dead2 plat_error_handler(int err)
30
{
31
32
	while (1)
		wfi();
33
34
}

35
36
37
38
void bl2_plat_preload_setup(void)
{
}

39
40
41
42
43
44
45
46
47
48
int bl2_plat_handle_pre_image_load(unsigned int image_id)
{
	return 0;
}

int bl2_plat_handle_post_image_load(unsigned int image_id)
{
	return 0;
}

49
50
51
52
int plat_try_next_boot_source(void)
{
	return 0;
}
53
54
55
56
57
58
59
60
61
62
63
64
65
66

#if !ERROR_DEPRECATED
#pragma weak bl2_early_platform_setup2

/*
 * The following platform API implementation that allow compatibility for
 * the older platform APIs.
 */
void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1,
			u_register_t arg2, u_register_t arg3)
{
	bl2_early_platform_setup((void *)arg1);
}
#endif