neoverse_v3.S 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright (c) 2022-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 <neoverse_v3.h>
  10. #include <cpu_macros.S>
  11. #include <plat_macros.S>
  12. #include "wa_cve_2022_23960_bhb_vector.S"
  13. /* Hardware handled coherency */
  14. #if HW_ASSISTED_COHERENCY == 0
  15. #error "Neoverse V3 must be compiled with HW_ASSISTED_COHERENCY enabled"
  16. #endif
  17. /* 64-bit only core */
  18. #if CTX_INCLUDE_AARCH32_REGS == 1
  19. #error "Neoverse V3 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
  20. #endif
  21. #if WORKAROUND_CVE_2022_23960
  22. wa_cve_2022_23960_bhb_vector_table NEOVERSE_V3_BHB_LOOP_COUNT, neoverse_v3
  23. #endif /* WORKAROUND_CVE_2022_23960 */
  24. /* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */
  25. workaround_reset_start neoverse_v3, CVE(2024, 5660), WORKAROUND_CVE_2024_5660
  26. sysreg_bit_set NEOVERSE_V3_CPUECTLR_EL1, BIT(46)
  27. workaround_reset_end neoverse_v3, CVE(2024, 5660)
  28. check_erratum_ls neoverse_v3, CVE(2024, 5660), CPU_REV(0, 1)
  29. workaround_reset_start neoverse_v3, CVE(2022,23960), WORKAROUND_CVE_2022_23960
  30. #if IMAGE_BL31
  31. /*
  32. * The Neoverse V3 generic vectors are overridden to apply errata
  33. * mitigation on exception entry from lower ELs.
  34. */
  35. override_vector_table wa_cve_vbar_neoverse_v3
  36. #endif /* IMAGE_BL31 */
  37. workaround_reset_end neoverse_v3, CVE(2022,23960)
  38. check_erratum_chosen neoverse_v3, CVE(2022, 23960), WORKAROUND_CVE_2022_23960
  39. /* ---------------------------------------------
  40. * HW will do the cache maintenance while powering down
  41. * ---------------------------------------------
  42. */
  43. func neoverse_v3_core_pwr_dwn
  44. /* ---------------------------------------------
  45. * Enable CPU power down bit in power control register
  46. * ---------------------------------------------
  47. */
  48. sysreg_bit_set NEOVERSE_V3_CPUPWRCTLR_EL1, \
  49. NEOVERSE_V3_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
  50. isb
  51. ret
  52. endfunc neoverse_v3_core_pwr_dwn
  53. cpu_reset_func_start neoverse_v3
  54. /* Disable speculative loads */
  55. msr SSBS, xzr
  56. cpu_reset_func_end neoverse_v3
  57. /* ---------------------------------------------
  58. * This function provides Neoverse V3 specific
  59. * register information for crash reporting.
  60. * It needs to return with x6 pointing to
  61. * a list of register names in ascii and
  62. * x8 - x15 having values of registers to be
  63. * reported.
  64. * ---------------------------------------------
  65. */
  66. .section .rodata.neoverse_v3_regs, "aS"
  67. neoverse_v3_regs: /* The ascii list of register names to be reported */
  68. .asciz "cpuectlr_el1", ""
  69. func neoverse_v3_cpu_reg_dump
  70. adr x6, neoverse_v3_regs
  71. mrs x8, NEOVERSE_V3_CPUECTLR_EL1
  72. ret
  73. endfunc neoverse_v3_cpu_reg_dump
  74. declare_cpu_ops neoverse_v3, NEOVERSE_V3_VNAE_MIDR, \
  75. neoverse_v3_reset_func, \
  76. neoverse_v3_core_pwr_dwn
  77. declare_cpu_ops neoverse_v3, NEOVERSE_V3_MIDR, \
  78. neoverse_v3_reset_func, \
  79. neoverse_v3_core_pwr_dwn