blob: 40154aad687121fc79fdb7964800f13a31089497 [file] [log] [blame]
Roberto Vargase0e99462017-10-30 14:43:43 +00001/*
Zelalem Aweke688fbf72021-07-09 11:37:10 -05002 * Copyright (c) 2017-2021, Arm Limited and Contributors. All rights reserved.
Roberto Vargase0e99462017-10-30 14:43:43 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <asm_macros.S>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00009#include <common/bl_common.h>
Roberto Vargase0e99462017-10-30 14:43:43 +000010#include <el3_common_macros.S>
11
Roberto Vargase0e99462017-10-30 14:43:43 +000012 .globl bl2_entrypoint
Roberto Vargase0e99462017-10-30 14:43:43 +000013
14
15func bl2_entrypoint
16 /* Save arguments x0-x3 from previous Boot loader */
17 mov r9, r0
18 mov r10, r1
19 mov r11, r2
20 mov r12, r3
21
22 el3_entrypoint_common \
23 _init_sctlr=1 \
24 _warm_boot_mailbox=!PROGRAMMABLE_RESET_ADDRESS \
25 _secondary_cold_boot=!COLD_BOOT_SINGLE_CPU \
26 _init_memory=1 \
27 _init_c_runtime=1 \
Yann Gautier514e59c2020-10-05 11:02:54 +020028 _exception_vectors=bl2_vector_table \
29 _pie_fixup_size=0
Roberto Vargase0e99462017-10-30 14:43:43 +000030
31 /*
32 * Restore parameters of boot rom
33 */
34 mov r0, r9
35 mov r1, r10
36 mov r2, r11
37 mov r3, r12
38
Antonio Nino Diaz4f29fb72019-01-31 17:40:44 +000039 /* ---------------------------------------------
40 * Perform BL2 setup
41 * ---------------------------------------------
42 */
43 bl bl2_el3_setup
Roberto Vargase0e99462017-10-30 14:43:43 +000044
45 /* ---------------------------------------------
46 * Jump to main function.
47 * ---------------------------------------------
48 */
49 bl bl2_main
50
51 /* ---------------------------------------------
52 * Should never reach this point.
53 * ---------------------------------------------
54 */
55 no_ret plat_panic_handler
56
57endfunc bl2_entrypoint