bl1_arch_setup.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <arch_helpers.h>
  8. #include "../bl1_private.h"
  9. /*******************************************************************************
  10. * Function that does the first bit of architectural setup that affects
  11. * execution in the non-secure address space.
  12. ******************************************************************************/
  13. void bl1_arch_setup(void)
  14. {
  15. /* Set the next EL to be AArch64 */
  16. write_scr_el3(read_scr_el3() | SCR_RW_BIT);
  17. }
  18. /*******************************************************************************
  19. * Set the Secure EL1 required architectural state
  20. ******************************************************************************/
  21. void bl1_arch_next_el_setup(void)
  22. {
  23. u_register_t next_sctlr;
  24. /* Use the same endianness than the current BL */
  25. next_sctlr = (read_sctlr_el3() & SCTLR_EE_BIT);
  26. /* Set SCTLR Secure EL1 */
  27. next_sctlr |= SCTLR_EL1_RES1;
  28. write_sctlr_el1(next_sctlr);
  29. }