neoverse_n3.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2023-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_n3.h>
  10. #include <cpu_macros.S>
  11. #include <plat_macros.S>
  12. /* Hardware handled coherency */
  13. #if HW_ASSISTED_COHERENCY == 0
  14. #error "Neoverse-N3 must be compiled with HW_ASSISTED_COHERENCY enabled"
  15. #endif
  16. /* 64-bit only core */
  17. #if CTX_INCLUDE_AARCH32_REGS == 1
  18. #error "Neoverse-N3 supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
  19. #endif
  20. cpu_reset_func_start neoverse_n3
  21. /* Disable speculative loads */
  22. msr SSBS, xzr
  23. #if NEOVERSE_Nx_EXTERNAL_LLC
  24. /* Some systems may have External LLC, core needs to be made aware */
  25. sysreg_bit_set NEOVERSE_N3_CPUECTLR_EL1, NEOVERSE_N3_CPUECTLR_EL1_EXTLLC_BIT
  26. #endif
  27. cpu_reset_func_end neoverse_n3
  28. /* ----------------------------------------------------
  29. * HW will do the cache maintenance while powering down
  30. * ----------------------------------------------------
  31. */
  32. func neoverse_n3_core_pwr_dwn
  33. /* ---------------------------------------------------
  34. * Enable CPU power down bit in power control register
  35. * ---------------------------------------------------
  36. */
  37. sysreg_bit_set NEOVERSE_N3_CPUPWRCTLR_EL1, NEOVERSE_N3_CPUPWRCTLR_EL1_CORE_PWRDN_BIT
  38. isb
  39. ret
  40. endfunc neoverse_n3_core_pwr_dwn
  41. /* ---------------------------------------------
  42. * This function provides Neoverse-N3 specific
  43. * register information for crash reporting.
  44. * It needs to return with x6 pointing to
  45. * a list of register names in ascii and
  46. * x8 - x15 having values of registers to be
  47. * reported.
  48. * ---------------------------------------------
  49. */
  50. .section .rodata.neoverse_n3_regs, "aS"
  51. neoverse_n3_regs: /* The ascii list of register names to be reported */
  52. .asciz "cpuectlr_el1", ""
  53. func neoverse_n3_cpu_reg_dump
  54. adr x6, neoverse_n3_regs
  55. mrs x8, NEOVERSE_N3_CPUECTLR_EL1
  56. ret
  57. endfunc neoverse_n3_cpu_reg_dump
  58. declare_cpu_ops neoverse_n3, NEOVERSE_N3_MIDR, \
  59. neoverse_n3_reset_func, \
  60. neoverse_n3_core_pwr_dwn