travis.S 1.8 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 <travis.h>
  10. #include <cpu_macros.S>
  11. #include <plat_macros.S>
  12. /* Hardware handled coherency */
  13. #if HW_ASSISTED_COHERENCY == 0
  14. #error "Travis must be compiled with HW_ASSISTED_COHERENCY enabled"
  15. #endif
  16. /* 64-bit only core */
  17. #if CTX_INCLUDE_AARCH32_REGS == 1
  18. #error "Travis supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
  19. #endif
  20. cpu_reset_func_start travis
  21. /* ----------------------------------------------------
  22. * Disable speculative loads
  23. * ----------------------------------------------------
  24. */
  25. msr SSBS, xzr
  26. cpu_reset_func_end travis
  27. func travis_core_pwr_dwn
  28. #if ENABLE_SME_FOR_NS
  29. /* ---------------------------------------------------
  30. * Disable SME if enabled and supported
  31. * ---------------------------------------------------
  32. */
  33. mrs x0, ID_AA64PFR1_EL1
  34. ubfx x0, x0, #ID_AA64PFR1_EL1_SME_SHIFT, \
  35. #ID_AA64PFR1_EL1_SME_WIDTH
  36. cmp x0, #SME_NOT_IMPLEMENTED
  37. b.eq 1f
  38. msr TRAVIS_SVCRSM, xzr
  39. msr TRAVIS_SVCRZA, xzr
  40. 1:
  41. #endif
  42. /* ---------------------------------------------------
  43. * Enable CPU power down bit in power control register
  44. * ---------------------------------------------------
  45. */
  46. sysreg_bit_set TRAVIS_IMP_CPUPWRCTLR_EL1, \
  47. TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
  48. isb
  49. ret
  50. endfunc travis_core_pwr_dwn
  51. .section .rodata.travis_regs, "aS"
  52. travis_regs: /* The ASCII list of register names to be reported */
  53. .asciz "cpuectlr_el1", ""
  54. func travis_cpu_reg_dump
  55. adr x6, travis_regs
  56. mrs x8, TRAVIS_IMP_CPUECTLR_EL1
  57. ret
  58. endfunc travis_cpu_reg_dump
  59. declare_cpu_ops travis, TRAVIS_MIDR, \
  60. travis_reset_func, \
  61. travis_core_pwr_dwn