arm_sdei.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. /* SDEI configuration for ARM platforms */
  7. #include <bl31/ehf.h>
  8. #include <common/debug.h>
  9. #include <services/sdei.h>
  10. #if SDEI_IN_FCONF
  11. #include <plat/arm/common/fconf_sdei_getter.h>
  12. #endif
  13. #include <plat/common/platform.h>
  14. #include <platform_def.h>
  15. #if SDEI_IN_FCONF
  16. /* Private event mappings */
  17. static sdei_ev_map_t arm_sdei_private[PLAT_SDEI_DP_EVENT_MAX_CNT + 1] = { 0 };
  18. /* Shared event mappings */
  19. static sdei_ev_map_t arm_sdei_shared[PLAT_SDEI_DS_EVENT_MAX_CNT] = { 0 };
  20. void plat_sdei_setup(void)
  21. {
  22. uint32_t i;
  23. arm_sdei_private[0] = (sdei_ev_map_t)SDEI_DEFINE_EVENT_0(ARM_SDEI_SGI);
  24. for (i = 0; i < FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_cnt); i++) {
  25. arm_sdei_private[i + 1] = (sdei_ev_map_t)SDEI_PRIVATE_EVENT(
  26. FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_nums[i]),
  27. FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_intrs[i]),
  28. FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_flags[i]));
  29. }
  30. for (i = 0; i < FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_cnt); i++) {
  31. arm_sdei_shared[i] = (sdei_ev_map_t)SDEI_SHARED_EVENT(
  32. FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_nums[i]),
  33. FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_intrs[i]),
  34. FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_flags[i]));
  35. }
  36. INFO("FCONF: SDEI platform setup\n");
  37. }
  38. #else
  39. /* Private event mappings */
  40. static sdei_ev_map_t arm_sdei_private[] = {
  41. PLAT_ARM_PRIVATE_SDEI_EVENTS
  42. };
  43. /* Shared event mappings */
  44. static sdei_ev_map_t arm_sdei_shared[] = {
  45. PLAT_ARM_SHARED_SDEI_EVENTS
  46. };
  47. void plat_sdei_setup(void)
  48. {
  49. INFO("SDEI platform setup\n");
  50. }
  51. #endif /* SDEI_IN_FCONF */
  52. /* Export ARM SDEI events */
  53. REGISTER_SDEI_MAP(arm_sdei_private, arm_sdei_shared);