fvp_r_misc_helpers.S 731 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <asm_macros.S>
  7. .globl disable_mpu_el2
  8. .globl disable_mpu_icache_el2
  9. /* ---------------------------------------------------------------------------
  10. * Disable the MPU at EL2.
  11. * ---------------------------------------------------------------------------
  12. */
  13. func disable_mpu_el2
  14. mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT)
  15. do_disable_mpu_el2:
  16. mrs x0, sctlr_el2
  17. bic x0, x0, x1
  18. msr sctlr_el2, x0
  19. isb /* ensure MMU is off */
  20. dsb sy
  21. ret
  22. endfunc disable_mpu_el2
  23. func disable_mpu_icache_el2
  24. mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT | SCTLR_I_BIT)
  25. b do_disable_mpu_el2
  26. endfunc disable_mpu_icache_el2