cortex_a76ae.S 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2019-2024, Arm Limited. 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_a76ae.h>
  10. #include <cpu_macros.S>
  11. #include "wa_cve_2022_23960_bhb_vector.S"
  12. /* Hardware handled coherency */
  13. #if HW_ASSISTED_COHERENCY == 0
  14. #error "Cortex-A76AE must be compiled with HW_ASSISTED_COHERENCY enabled"
  15. #endif
  16. /* 64-bit only core */
  17. #if CTX_INCLUDE_AARCH32_REGS == 1
  18. #error "Cortex-A76AE supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
  19. #endif
  20. #if WORKAROUND_CVE_2022_23960
  21. wa_cve_2022_23960_bhb_vector_table CORTEX_A76AE_BHB_LOOP_COUNT, cortex_a76ae
  22. #endif /* WORKAROUND_CVE_2022_23960 */
  23. check_erratum_chosen cortex_a76ae, CVE(2022, 23960), WORKAROUND_CVE_2022_23960
  24. workaround_reset_start cortex_a76ae, CVE(2022, 23960), WORKAROUND_CVE_2022_23960
  25. #if IMAGE_BL31
  26. /*
  27. * The Cortex-A76ae generic vectors are overridden to apply errata
  28. * mitigation on exception entry from lower ELs.
  29. */
  30. override_vector_table wa_cve_vbar_cortex_a76ae
  31. isb
  32. #endif /* IMAGE_BL31 */
  33. workaround_reset_end cortex_a76ae, CVE(2022, 23960)
  34. cpu_reset_func_start cortex_a76ae
  35. cpu_reset_func_end cortex_a76ae
  36. /* ----------------------------------------------------
  37. * HW will do the cache maintenance while powering down
  38. * ----------------------------------------------------
  39. */
  40. func cortex_a76ae_core_pwr_dwn
  41. sysreg_bit_set CORTEX_A76AE_CPUPWRCTLR_EL1, CORTEX_A76AE_CORE_PWRDN_EN_MASK
  42. isb
  43. ret
  44. endfunc cortex_a76ae_core_pwr_dwn
  45. /* ---------------------------------------------
  46. * This function provides cortex_a76ae specific
  47. * register information for crash reporting.
  48. * It needs to return with x6 pointing to
  49. * a list of register names in ascii and
  50. * x8 - x15 having values of registers to be
  51. * reported.
  52. * ---------------------------------------------
  53. */
  54. .section .rodata.cortex_a76ae_regs, "aS"
  55. cortex_a76ae_regs: /* The ASCII list of register names to be reported */
  56. .asciz "cpuectlr_el1", ""
  57. func cortex_a76ae_cpu_reg_dump
  58. adr x6, cortex_a76ae_regs
  59. mrs x8, CORTEX_A76AE_CPUECTLR_EL1
  60. ret
  61. endfunc cortex_a76ae_cpu_reg_dump
  62. declare_cpu_ops cortex_a76ae, CORTEX_A76AE_MIDR, cortex_a76ae_reset_func, \
  63. cortex_a76ae_core_pwr_dwn