2 * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
8 #include <asm_macros.S>
9 #include <common/bl_common.h>
11 .globl bl2u_entrypoint
15 /*---------------------------------------------
16 * Store the extents of the tzram available to
17 * BL2U and other platform specific information
18 * for future use. x0 is currently not used.
19 * ---------------------------------------------
24 /* ---------------------------------------------
25 * Set the exception vector to something sane.
26 * ---------------------------------------------
28 adr x0, early_exceptions
32 /* ---------------------------------------------
33 * Enable the SError interrupt now that the
34 * exception vectors have been setup.
35 * ---------------------------------------------
37 msr daifclr, #DAIF_ABT_BIT
39 /* ---------------------------------------------
40 * Enable the instruction cache, stack pointer
41 * and data access alignment checks and disable
43 * ---------------------------------------------
45 mov x1, #(SCTLR_I_BIT | SCTLR_A_BIT | SCTLR_SA_BIT)
48 bic x0, x0, #SCTLR_DSSBS_BIT
52 /* ---------------------------------------------
53 * Invalidate the RW memory used by the BL2U
54 * image. This includes the data and NOBITS
55 * sections. This is done to safeguard against
56 * possible corruption of this memory by dirty
57 * cache lines in a system cache as a result of
58 * use by an earlier boot loader stage.
59 * ---------------------------------------------
66 /* ---------------------------------------------
67 * Zero out NOBITS sections. There are 2 of them:
69 * - the coherent memory section.
70 * ---------------------------------------------
72 ldr x0, =__BSS_START__
76 /* --------------------------------------------
77 * Allocate a stack whose memory will be marked
78 * as Normal-IS-WBWA when the MMU is enabled.
79 * There is no risk of reading stale stack
80 * memory after enabling the MMU as only the
81 * primary cpu is running at the moment.
82 * --------------------------------------------
86 /* ---------------------------------------------
87 * Initialize the stack protector canary before
88 * any C code is called.
89 * ---------------------------------------------
91 #if STACK_PROTECTOR_ENABLED
92 bl update_stack_protector_canary
95 /* ---------------------------------------------
96 * Perform early platform setup & platform
97 * specific early arch. setup e.g. mmu setup
98 * ---------------------------------------------
102 bl bl2u_early_platform_setup
103 bl bl2u_plat_arch_setup
105 /* ---------------------------------------------
106 * Jump to bl2u_main function.
107 * ---------------------------------------------
111 /* ---------------------------------------------
112 * Should never reach this point.
113 * ---------------------------------------------
115 no_ret plat_panic_handler
117 endfunc bl2u_entrypoint