platform_helpers.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright (c) 2013-2019, 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 <drivers/console.h>
  9. #include <platform_def.h>
  10. .weak plat_report_exception
  11. .weak plat_reset_handler
  12. .weak plat_disable_acp
  13. .weak bl1_plat_prepare_exit
  14. .weak plat_panic_handler
  15. .weak bl31_plat_enable_mmu
  16. .weak bl32_plat_enable_mmu
  17. .weak plat_handle_uncontainable_ea
  18. .weak plat_handle_double_fault
  19. .weak plat_handle_el3_ea
  20. #define MPIDR_RES_BIT_MASK 0xff000000
  21. /* -----------------------------------------------------
  22. * Placeholder function which should be redefined by
  23. * each platform.
  24. * -----------------------------------------------------
  25. */
  26. func plat_report_exception
  27. ret
  28. endfunc plat_report_exception
  29. /* -----------------------------------------------------
  30. * Placeholder function which should be redefined by
  31. * each platform. This function should preserve x19 - x29.
  32. * -----------------------------------------------------
  33. */
  34. func plat_reset_handler
  35. ret
  36. endfunc plat_reset_handler
  37. /* -----------------------------------------------------
  38. * Placeholder function which should be redefined by
  39. * each platform. This function is allowed to use
  40. * registers x0 - x17.
  41. * -----------------------------------------------------
  42. */
  43. func plat_disable_acp
  44. ret
  45. endfunc plat_disable_acp
  46. /* -----------------------------------------------------
  47. * void bl1_plat_prepare_exit(entry_point_info_t *ep_info);
  48. * Called before exiting BL1. Default: do nothing
  49. * -----------------------------------------------------
  50. */
  51. func bl1_plat_prepare_exit
  52. ret
  53. endfunc bl1_plat_prepare_exit
  54. /* -----------------------------------------------------
  55. * void plat_panic_handler(void) __dead2;
  56. * Endless loop by default.
  57. * -----------------------------------------------------
  58. */
  59. func plat_panic_handler
  60. wfi
  61. b plat_panic_handler
  62. endfunc plat_panic_handler
  63. /* -----------------------------------------------------
  64. * void bl31_plat_enable_mmu(uint32_t flags);
  65. *
  66. * Enable MMU in BL31.
  67. * -----------------------------------------------------
  68. */
  69. func bl31_plat_enable_mmu
  70. b enable_mmu_direct_el3
  71. endfunc bl31_plat_enable_mmu
  72. /* -----------------------------------------------------
  73. * void bl32_plat_enable_mmu(uint32_t flags);
  74. *
  75. * Enable MMU in BL32.
  76. * -----------------------------------------------------
  77. */
  78. func bl32_plat_enable_mmu
  79. b enable_mmu_direct_el1
  80. endfunc bl32_plat_enable_mmu
  81. /* -----------------------------------------------------
  82. * Platform handler for Uncontainable External Abort.
  83. *
  84. * x0: EA reason
  85. * x1: EA syndrome
  86. * -----------------------------------------------------
  87. */
  88. func plat_handle_uncontainable_ea
  89. b report_unhandled_exception
  90. endfunc plat_handle_uncontainable_ea
  91. /* -----------------------------------------------------
  92. * Platform handler for Double Fault.
  93. *
  94. * x0: EA reason
  95. * x1: EA syndrome
  96. * -----------------------------------------------------
  97. */
  98. func plat_handle_double_fault
  99. b report_unhandled_exception
  100. endfunc plat_handle_double_fault
  101. /* -----------------------------------------------------
  102. * Platform handler for EL3 External Abort.
  103. * -----------------------------------------------------
  104. */
  105. func plat_handle_el3_ea
  106. b report_unhandled_exception
  107. endfunc plat_handle_el3_ea