blob: b471a7e7b5600f1e87dce32426b0c74a486cf0c0 [file] [log] [blame]
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +09001/*
Soby Mathew2f38ce32018-02-08 17:45:12 +00002 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +09003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch_helpers.h>
Soby Mathew2f38ce32018-02-08 17:45:12 +00008#include <assert.h>
9#include <bl_common.h>
10#include <debug.h>
11#include <errno.h>
Soby Mathew73308d02018-01-09 14:36:14 +000012#include <platform.h>
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +090013
14/*
Soby Mathew2f38ce32018-02-08 17:45:12 +000015 * The following platform functions are weakly defined. The Platforms
16 * may redefine with strong definition.
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +090017 */
Soby Mathew2f38ce32018-02-08 17:45:12 +000018#pragma weak bl2_el3_plat_prepare_exit
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +090019#pragma weak plat_error_handler
20#pragma weak bl2_plat_preload_setup
Masahiro Yamada02a0d3d2018-02-01 16:45:51 +090021#pragma weak bl2_plat_handle_pre_image_load
22#pragma weak bl2_plat_handle_post_image_load
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +090023#pragma weak plat_try_next_boot_source
24
Soby Mathew2f38ce32018-02-08 17:45:12 +000025void bl2_el3_plat_prepare_exit(void)
Masahiro Yamada43d20b32018-02-01 16:46:18 +090026{
Masahiro Yamada43d20b32018-02-01 16:46:18 +090027}
28
Soby Mathew2f38ce32018-02-08 17:45:12 +000029void __dead2 plat_error_handler(int err)
Masahiro Yamada43d20b32018-02-01 16:46:18 +090030{
Soby Mathew2f38ce32018-02-08 17:45:12 +000031 while (1)
32 wfi();
Masahiro Yamada43d20b32018-02-01 16:46:18 +090033}
34
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +090035void bl2_plat_preload_setup(void)
36{
37}
38
Roberto Vargas05712702018-02-12 12:36:17 +000039#if LOAD_IMAGE_V2
Masahiro Yamada02a0d3d2018-02-01 16:45:51 +090040int bl2_plat_handle_pre_image_load(unsigned int image_id)
41{
42 return 0;
43}
44
45int bl2_plat_handle_post_image_load(unsigned int image_id)
46{
47 return 0;
48}
Roberto Vargas05712702018-02-12 12:36:17 +000049#endif
Masahiro Yamada02a0d3d2018-02-01 16:45:51 +090050
Masahiro Yamada2a4fe4f2018-02-01 18:42:24 +090051int plat_try_next_boot_source(void)
52{
53 return 0;
54}
Soby Mathew73308d02018-01-09 14:36:14 +000055
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 */
63void 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