cortex_a35.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 <common/bl_common.h>
  9. #include <cortex_a35.h>
  10. #include <cpu_macros.S>
  11. #include <plat_macros.S>
  12. /* ---------------------------------------------
  13. * Disable L1 data cache and unified L2 cache
  14. * ---------------------------------------------
  15. */
  16. func cortex_a35_disable_dcache
  17. sysreg_bit_clear sctlr_el3, SCTLR_C_BIT
  18. isb
  19. ret
  20. endfunc cortex_a35_disable_dcache
  21. /* ---------------------------------------------
  22. * Disable intra-cluster coherency
  23. * ---------------------------------------------
  24. */
  25. func cortex_a35_disable_smp
  26. sysreg_bit_clear CORTEX_A35_CPUECTLR_EL1, CORTEX_A35_CPUECTLR_SMPEN_BIT
  27. isb
  28. dsb sy
  29. ret
  30. endfunc cortex_a35_disable_smp
  31. workaround_reset_start cortex_a35, ERRATUM(855472), ERRATA_A35_855472
  32. sysreg_bit_set CORTEX_A35_CPUACTLR_EL1, CORTEX_A35_CPUACTLR_EL1_ENDCCASCI
  33. workaround_reset_end cortex_a35, ERRATUM(855472)
  34. check_erratum_ls cortex_a35, ERRATUM(855472), CPU_REV(0, 0)
  35. /* -------------------------------------------------
  36. * The CPU Ops reset function for Cortex-A35.
  37. * -------------------------------------------------
  38. */
  39. cpu_reset_func_start cortex_a35
  40. /* ---------------------------------------------
  41. * Enable the SMP bit.
  42. * ---------------------------------------------
  43. */
  44. sysreg_bit_set CORTEX_A35_CPUECTLR_EL1, CORTEX_A35_CPUECTLR_SMPEN_BIT
  45. cpu_reset_func_end cortex_a35
  46. func cortex_a35_core_pwr_dwn
  47. mov x18, x30
  48. /* ---------------------------------------------
  49. * Turn off caches.
  50. * ---------------------------------------------
  51. */
  52. bl cortex_a35_disable_dcache
  53. /* ---------------------------------------------
  54. * Flush L1 caches.
  55. * ---------------------------------------------
  56. */
  57. mov x0, #DCCISW
  58. bl dcsw_op_level1
  59. /* ---------------------------------------------
  60. * Come out of intra cluster coherency
  61. * ---------------------------------------------
  62. */
  63. mov x30, x18
  64. b cortex_a35_disable_smp
  65. endfunc cortex_a35_core_pwr_dwn
  66. func cortex_a35_cluster_pwr_dwn
  67. mov x18, x30
  68. /* ---------------------------------------------
  69. * Turn off caches.
  70. * ---------------------------------------------
  71. */
  72. bl cortex_a35_disable_dcache
  73. /* ---------------------------------------------
  74. * Flush L1 caches.
  75. * ---------------------------------------------
  76. */
  77. mov x0, #DCCISW
  78. bl dcsw_op_level1
  79. /* ---------------------------------------------
  80. * Disable the optional ACP.
  81. * ---------------------------------------------
  82. */
  83. bl plat_disable_acp
  84. /* ---------------------------------------------
  85. * Flush L2 caches.
  86. * ---------------------------------------------
  87. */
  88. mov x0, #DCCISW
  89. bl dcsw_op_level2
  90. /* ---------------------------------------------
  91. * Come out of intra cluster coherency
  92. * ---------------------------------------------
  93. */
  94. mov x30, x18
  95. b cortex_a35_disable_smp
  96. endfunc cortex_a35_cluster_pwr_dwn
  97. /* ---------------------------------------------
  98. * This function provides cortex_a35 specific
  99. * register information for crash reporting.
  100. * It needs to return with x6 pointing to
  101. * a list of register names in ascii and
  102. * x8 - x15 having values of registers to be
  103. * reported.
  104. * ---------------------------------------------
  105. */
  106. .section .rodata.cortex_a35_regs, "aS"
  107. cortex_a35_regs: /* The ascii list of register names to be reported */
  108. .asciz "cpuectlr_el1", ""
  109. func cortex_a35_cpu_reg_dump
  110. adr x6, cortex_a35_regs
  111. mrs x8, CORTEX_A35_CPUECTLR_EL1
  112. ret
  113. endfunc cortex_a35_cpu_reg_dump
  114. declare_cpu_ops cortex_a35, CORTEX_A35_MIDR, \
  115. cortex_a35_reset_func, \
  116. cortex_a35_core_pwr_dwn, \
  117. cortex_a35_cluster_pwr_dwn