cortex_a5.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <asm_macros.S>
  8. #include <assert_macros.S>
  9. #include <cortex_a5.h>
  10. #include <cpu_macros.S>
  11. .macro assert_cache_enabled
  12. #if ENABLE_ASSERTIONS
  13. ldcopr r0, SCTLR
  14. tst r0, #SCTLR_C_BIT
  15. ASM_ASSERT(eq)
  16. #endif
  17. .endm
  18. func cortex_a5_disable_smp
  19. ldcopr r0, ACTLR
  20. bic r0, #CORTEX_A5_ACTLR_SMP_BIT
  21. stcopr r0, ACTLR
  22. isb
  23. dsb sy
  24. bx lr
  25. endfunc cortex_a5_disable_smp
  26. func cortex_a5_enable_smp
  27. ldcopr r0, ACTLR
  28. orr r0, #CORTEX_A5_ACTLR_SMP_BIT
  29. stcopr r0, ACTLR
  30. isb
  31. bx lr
  32. endfunc cortex_a5_enable_smp
  33. func cortex_a5_reset_func
  34. b cortex_a5_enable_smp
  35. endfunc cortex_a5_reset_func
  36. func cortex_a5_core_pwr_dwn
  37. push {r12, lr}
  38. assert_cache_enabled
  39. /* Flush L1 cache */
  40. mov r0, #DC_OP_CISW
  41. bl dcsw_op_level1
  42. /* Exit cluster coherency */
  43. pop {r12, lr}
  44. b cortex_a5_disable_smp
  45. endfunc cortex_a5_core_pwr_dwn
  46. func cortex_a5_cluster_pwr_dwn
  47. push {r12, lr}
  48. assert_cache_enabled
  49. /* Flush L1 caches */
  50. mov r0, #DC_OP_CISW
  51. bl dcsw_op_level1
  52. bl plat_disable_acp
  53. /* Exit cluster coherency */
  54. pop {r12, lr}
  55. b cortex_a5_disable_smp
  56. endfunc cortex_a5_cluster_pwr_dwn
  57. declare_cpu_ops cortex_a5, CORTEX_A5_MIDR, \
  58. cortex_a5_reset_func, \
  59. cortex_a5_core_pwr_dwn, \
  60. cortex_a5_cluster_pwr_dwn