2013-10-25 09:08:21 +01:00
|
|
|
/*
|
2014-01-14 18:17:09 +00:00
|
|
|
* Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
|
2013-10-25 09:08:21 +01:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2013-10-25 09:08:21 +01:00
|
|
|
*/
|
|
|
|
|
2014-04-09 13:14:54 +01:00
|
|
|
#include <arch.h>
|
2013-10-25 09:08:21 +01:00
|
|
|
#include <arch_helpers.h>
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Function that does the first bit of architectural setup that affects
|
|
|
|
* execution in the non-secure address space.
|
|
|
|
******************************************************************************/
|
|
|
|
void bl1_arch_setup(void)
|
|
|
|
{
|
2014-08-04 23:13:10 +01:00
|
|
|
/* Set the next EL to be AArch64 */
|
2016-03-22 08:29:23 +00:00
|
|
|
write_scr_el3(read_scr_el3() | SCR_RW_BIT);
|
2013-10-25 09:08:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Set the Secure EL1 required architectural state
|
|
|
|
******************************************************************************/
|
2014-06-13 17:05:10 +01:00
|
|
|
void bl1_arch_next_el_setup(void)
|
|
|
|
{
|
2014-03-11 17:41:00 +00:00
|
|
|
unsigned long next_sctlr;
|
2013-10-25 09:08:21 +01:00
|
|
|
|
|
|
|
/* Use the same endianness than the current BL */
|
2014-03-11 17:41:00 +00:00
|
|
|
next_sctlr = (read_sctlr_el3() & SCTLR_EE_BIT);
|
2013-10-25 09:08:21 +01:00
|
|
|
|
|
|
|
/* Set SCTLR Secure EL1 */
|
|
|
|
next_sctlr |= SCTLR_EL1_RES1;
|
|
|
|
|
|
|
|
write_sctlr_el1(next_sctlr);
|
|
|
|
}
|