blob: 00f27184df79f4aae741405930510912a5b849f7 [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 \
Manish Pandeyc8257682019-11-26 11:34:17 +000033 _exception_vectors=bl1_exceptions \
34 _pie_fixup_size=0
Vikram Kanigiri96377452014-04-24 11:02:16 +010035
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000036 /* --------------------------------------------------------------------
37 * Perform BL1 setup
38 * --------------------------------------------------------------------
Achin Gupta4f6ad662013-10-25 09:08:21 +010039 */
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000040 bl bl1_setup
Achin Gupta4f6ad662013-10-25 09:08:21 +010041
Alexei Fedorovf41355c2019-09-13 14:11:59 +010042#if ENABLE_PAUTH
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000043 /* --------------------------------------------------------------------
Alexei Fedorovf41355c2019-09-13 14:11:59 +010044 * Program APIAKey_EL1 and enable pointer authentication.
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000045 * --------------------------------------------------------------------
46 */
Alexei Fedorovf41355c2019-09-13 14:11:59 +010047 bl pauth_init_enable_el3
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000048#endif /* ENABLE_PAUTH */
49
50 /* --------------------------------------------------------------------
Vikram Kanigiri96377452014-04-24 11:02:16 +010051 * Initialize platform and jump to our c-entry point
Yatharth Kochara65be2f2015-10-09 18:06:13 +010052 * for this type of reset.
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000053 * --------------------------------------------------------------------
Vikram Kanigiri96377452014-04-24 11:02:16 +010054 */
55 bl bl1_main
Yatharth Kochara65be2f2015-10-09 18:06:13 +010056
Alexei Fedorovf41355c2019-09-13 14:11:59 +010057#if ENABLE_PAUTH
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000058 /* --------------------------------------------------------------------
Alexei Fedorovf41355c2019-09-13 14:11:59 +010059 * Disable pointer authentication before jumping to next boot image.
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000060 * --------------------------------------------------------------------
61 */
Alexei Fedorovf41355c2019-09-13 14:11:59 +010062 bl pauth_disable_el3
Antonio Nino Diaze3887a92019-01-30 20:29:50 +000063#endif /* ENABLE_PAUTH */
64
Yatharth Kochara65be2f2015-10-09 18:06:13 +010065 /* --------------------------------------------------
66 * Do the transition to next boot image.
67 * --------------------------------------------------
68 */
69 b el3_exit
Kévin Petita877c252015-03-24 14:03:57 +000070endfunc bl1_entrypoint