aem_generic.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <aem_generic.h>
  7. #include <arch.h>
  8. #include <asm_macros.S>
  9. #include <assert_macros.S>
  10. #include <cpu_macros.S>
  11. func aem_generic_core_pwr_dwn
  12. /* Assert if cache is enabled */
  13. #if ENABLE_ASSERTIONS
  14. ldcopr r0, SCTLR
  15. tst r0, #SCTLR_C_BIT
  16. ASM_ASSERT(eq)
  17. #endif
  18. /* ---------------------------------------------
  19. * Flush L1 cache to PoU.
  20. * ---------------------------------------------
  21. */
  22. mov r0, #DC_OP_CISW
  23. b dcsw_op_louis
  24. endfunc aem_generic_core_pwr_dwn
  25. func aem_generic_cluster_pwr_dwn
  26. /* Assert if cache is enabled */
  27. #if ENABLE_ASSERTIONS
  28. ldcopr r0, SCTLR
  29. tst r0, #SCTLR_C_BIT
  30. ASM_ASSERT(eq)
  31. #endif
  32. /* ---------------------------------------------
  33. * Flush L1 and L2 caches to PoC.
  34. * ---------------------------------------------
  35. */
  36. mov r0, #DC_OP_CISW
  37. b dcsw_op_all
  38. endfunc aem_generic_cluster_pwr_dwn
  39. /* cpu_ops for Base AEM FVP */
  40. declare_cpu_ops aem_generic, BASE_AEM_MIDR, CPU_NO_RESET_FUNC, \
  41. aem_generic_core_pwr_dwn, \
  42. aem_generic_cluster_pwr_dwn