1 /* 2 * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include "../../../../bl1/bl1_private.h" 8 #include <arch.h> 9 10 #include <fvp_r_arch_helpers.h> 11 12 /******************************************************************************* 13 * Function that does the first bit of architectural setup that affects 14 * execution in the non-secure address space. 15 ******************************************************************************/ bl1_arch_setup(void)16void bl1_arch_setup(void) 17 { 18 /* v8-R64 does not include SCRs. */ 19 } 20 21 /******************************************************************************* 22 * Set the Secure EL1 required architectural state 23 ******************************************************************************/ bl1_arch_next_el_setup(void)24void bl1_arch_next_el_setup(void) 25 { 26 u_register_t next_sctlr; 27 28 /* Use the same endianness than the current BL */ 29 next_sctlr = (read_sctlr_el2() & SCTLR_EE_BIT); 30 31 /* Set SCTLR Secure EL1 */ 32 next_sctlr |= SCTLR_EL1_RES1; 33 34 write_sctlr_el1(next_sctlr); 35 } 36