blob: 855add347fd1bc87e3ca1fcfcb45a580f1f8e278 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Antonio Nino Diaze3887a92019-01-30 20:29:50 +00002 * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005 */
6
Sandrine Bailleuxc10bd2c2013-11-12 16:41:16 +00007#include <arch.h>
Sandrine Bailleuxacde8b02015-05-19 11:54:45 +01008#include <el3_common_macros.S>
Achin Gupta4f6ad662013-10-25 09:08:21 +01009
Jeenu Viswambharan2a30a752014-03-11 11:06:45 +000010 .globl bl1_entrypoint
Achin Gupta4f6ad662013-10-25 09:08:21 +010011
12
Achin Gupta4f6ad662013-10-25 09:08:21 +010013 /* -----------------------------------------------------
Jeenu Viswambharan2a30a752014-03-11 11:06:45 +000014 * bl1_entrypoint() is the entry point into the trusted
Achin Gupta4f6ad662013-10-25 09:08:21 +010015 * firmware code when a cpu is released from warm or
16 * cold reset.
17 * -----------------------------------------------------
18 */
19
Andrew Thoelke38bde412014-03-18 13:46:55 +000020func bl1_entrypoint
Sandrine Bailleux449dbd52015-06-02 17:19:43 +010021 /* ---------------------------------------------------------------------
22 * If the reset address is programmable then bl1_entrypoint() is
23 * executed only on the cold boot path. Therefore, we can skip the warm
24 * boot mailbox mechanism.
25 * ---------------------------------------------------------------------
26 */
Sandrine Bailleuxacde8b02015-05-19 11:54:45 +010027 el3_entrypoint_common \
David Cunadofee86532017-04-13 22:38:29 +010028 _init_sctlr=1 \
Sandrine Bailleux449dbd52015-06-02 17:19:43 +010029 _warm_boot_mailbox=!PROGRAMMABLE_RESET_ADDRESS \
Sandrine Bailleuxb21b02f2015-10-30 15:05:17 +000030 _secondary_cold_boot=!COLD_BOOT_SINGLE_CPU \
Sandrine Bailleuxacde8b02015-05-19 11:54:45 +010031 _init_memory=1 \
32 _init_c_runtime=1 \
33 _exception_vectors=bl1_exceptions
Vikram Kanigiri96377452014-04-24 11:02:16 +010034
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000035 /* --------------------------------------------------------------------
36 * Perform BL1 setup
37 * --------------------------------------------------------------------
Achin Gupta4f6ad662013-10-25 09:08:21 +010038 */
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000039 bl bl1_setup
Achin Gupta4f6ad662013-10-25 09:08:21 +010040
Alexei Fedorovf41355c2019-09-13 14:11:59 +010041#if ENABLE_PAUTH
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000042 /* --------------------------------------------------------------------
Alexei Fedorovf41355c2019-09-13 14:11:59 +010043 * Program APIAKey_EL1 and enable pointer authentication.
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000044 * --------------------------------------------------------------------
45 */
Alexei Fedorovf41355c2019-09-13 14:11:59 +010046 bl pauth_init_enable_el3
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000047#endif /* ENABLE_PAUTH */
48
49 /* --------------------------------------------------------------------
Vikram Kanigiri96377452014-04-24 11:02:16 +010050 * Initialize platform and jump to our c-entry point
Yatharth Kochara65be2f2015-10-09 18:06:13 +010051 * for this type of reset.
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000052 * --------------------------------------------------------------------
Vikram Kanigiri96377452014-04-24 11:02:16 +010053 */
54 bl bl1_main
Yatharth Kochara65be2f2015-10-09 18:06:13 +010055
Alexei Fedorovf41355c2019-09-13 14:11:59 +010056#if ENABLE_PAUTH
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000057 /* --------------------------------------------------------------------
Alexei Fedorovf41355c2019-09-13 14:11:59 +010058 * Disable pointer authentication before jumping to next boot image.
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000059 * --------------------------------------------------------------------
60 */
Alexei Fedorovf41355c2019-09-13 14:11:59 +010061 bl pauth_disable_el3
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000062#endif /* ENABLE_PAUTH */
63
Yatharth Kochara65be2f2015-10-09 18:06:13 +010064 /* --------------------------------------------------
65 * Do the transition to next boot image.
66 * --------------------------------------------------
67 */
68 b el3_exit
Kévin Petita877c252015-03-24 14:03:57 +000069endfunc bl1_entrypoint