qemu_max.S 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2014-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 <cpu_macros.S>
  9. #include <qemu_max.h>
  10. func qemu_max_core_pwr_dwn
  11. /* ---------------------------------------------
  12. * Disable the Data Cache.
  13. * ---------------------------------------------
  14. */
  15. mrs x1, sctlr_el3
  16. bic x1, x1, #SCTLR_C_BIT
  17. msr sctlr_el3, x1
  18. isb
  19. /* ---------------------------------------------
  20. * Flush L1 cache to L2.
  21. * ---------------------------------------------
  22. */
  23. mov x18, lr
  24. mov x0, #DCCISW
  25. bl dcsw_op_level1
  26. mov lr, x18
  27. ret
  28. endfunc qemu_max_core_pwr_dwn
  29. func qemu_max_cluster_pwr_dwn
  30. /* ---------------------------------------------
  31. * Disable the Data Cache.
  32. * ---------------------------------------------
  33. */
  34. mrs x1, sctlr_el3
  35. bic x1, x1, #SCTLR_C_BIT
  36. msr sctlr_el3, x1
  37. isb
  38. /* ---------------------------------------------
  39. * Flush all caches to PoC.
  40. * ---------------------------------------------
  41. */
  42. mov x0, #DCCISW
  43. b dcsw_op_all
  44. endfunc qemu_max_cluster_pwr_dwn
  45. /* ---------------------------------------------
  46. * This function provides cpu 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.qemu_max_regs, "aS"
  55. qemu_max_regs: /* The ascii list of register names to be reported */
  56. .asciz "" /* no registers to report */
  57. func qemu_max_cpu_reg_dump
  58. adr x6, qemu_max_regs
  59. ret
  60. endfunc qemu_max_cpu_reg_dump
  61. /* cpu_ops for QEMU MAX */
  62. declare_cpu_ops qemu_max, QEMU_MAX_MIDR, CPU_NO_RESET_FUNC, \
  63. qemu_max_core_pwr_dwn, \
  64. qemu_max_cluster_pwr_dwn