Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 1 | /* |
Zelalem Aweke | 688fbf7 | 2021-07-09 11:37:10 -0500 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, Arm Limited and Contributors. All rights reserved. |
Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <common/bl_common.h> |
Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 10 | #include <el3_common_macros.S> |
| 11 | |
Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 12 | .globl bl2_entrypoint |
Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 13 | |
| 14 | |
| 15 | func 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 Gautier | 514e59c | 2020-10-05 11:02:54 +0200 | [diff] [blame] | 28 | _exception_vectors=bl2_vector_table \ |
| 29 | _pie_fixup_size=0 |
Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 30 | |
| 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 Diaz | 4f29fb7 | 2019-01-31 17:40:44 +0000 | [diff] [blame] | 39 | /* --------------------------------------------- |
| 40 | * Perform BL2 setup |
| 41 | * --------------------------------------------- |
| 42 | */ |
| 43 | bl bl2_el3_setup |
Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 44 | |
| 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 | |
| 57 | endfunc bl2_entrypoint |