blob: f7e02e974073400be00647d2cf369ea4fa5b6ea4 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
David Cunadofee86532017-04-13 22:38:29 +01002 * Copyright (c) 2013-2017, 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
35 /* ---------------------------------------------
36 * Architectural init. can be generic e.g.
37 * enabling stack alignment and platform spec-
38 * ific e.g. MMU & page table setup as per the
39 * platform memory map. Perform the latter here
40 * and the former in bl1_main.
Achin Gupta4f6ad662013-10-25 09:08:21 +010041 * ---------------------------------------------
42 */
Vikram Kanigiri96377452014-04-24 11:02:16 +010043 bl bl1_early_platform_setup
44 bl bl1_plat_arch_setup
Achin Gupta4f6ad662013-10-25 09:08:21 +010045
Vikram Kanigiri96377452014-04-24 11:02:16 +010046 /* --------------------------------------------------
47 * Initialize platform and jump to our c-entry point
Yatharth Kochara65be2f2015-10-09 18:06:13 +010048 * for this type of reset.
Vikram Kanigiri96377452014-04-24 11:02:16 +010049 * --------------------------------------------------
50 */
51 bl bl1_main
Yatharth Kochara65be2f2015-10-09 18:06:13 +010052
53 /* --------------------------------------------------
54 * Do the transition to next boot image.
55 * --------------------------------------------------
56 */
57 b el3_exit
Kévin Petita877c252015-03-24 14:03:57 +000058endfunc bl1_entrypoint