nrd_ras.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef NRD_RAS_H
  7. #define NRD_RAS_H
  8. #include <lib/extensions/ras.h>
  9. #include <plat/common/platform.h>
  10. /*
  11. * Interrupt type supported.
  12. * - NRD_RAS_INTR_TYPE_SPI: Denotes a SPI interrupt
  13. * - NRD_RAS_INTR_TYPE_PPI: Denotes a PPI interrupt
  14. */
  15. #define NRD_RAS_INTR_TYPE_SPI 0
  16. #define NRD_RAS_INTR_TYPE_PPI 1
  17. /*
  18. * MM Communicate information structure. Required to generate MM Communicate
  19. * payload to be shared with Standalone MM.
  20. */
  21. typedef struct mm_communicate_header {
  22. struct efi_guid header_guid;
  23. size_t message_len;
  24. uint8_t data[1];
  25. } mm_communicate_header_t;
  26. /* RAS error info data structure. */
  27. struct nrd_ras_ev_map {
  28. int sdei_ev_num; /* SDEI Event number */
  29. int intr; /* Physical intr number */
  30. int intr_type; /* Interrupt Type (SPI or PPI)*/
  31. };
  32. /* RAS config data structure. Must be defined by each platform. */
  33. struct plat_nrd_ras_config {
  34. struct nrd_ras_ev_map *ev_map;
  35. int ev_map_size;
  36. };
  37. /*
  38. * Find event map for a given interrupt number. On success, returns pointer
  39. * to the event map. On error, returns NULL.
  40. */
  41. struct nrd_ras_ev_map *nrd_find_ras_event_map_by_intr(uint32_t intr_num);
  42. /*
  43. * Initialization function for the framework.
  44. *
  45. * Registers RAS config provided by the platform and then configures and
  46. * enables interrupt for each registered error. On success, return 0.
  47. */
  48. int nrd_ras_platform_setup(struct plat_nrd_ras_config *config);
  49. /* Base element RAM RAS interrupt handler function. */
  50. int nrd_ras_sram_intr_handler(const struct err_record_info *err_rec,
  51. int probe_data,
  52. const struct err_handler_data *const data);
  53. /* CPU RAS interrupt handler */
  54. int nrd_ras_cpu_intr_handler(const struct err_record_info *err_rec,
  55. int probe_data,
  56. const struct err_handler_data *const data);
  57. #endif /* NRD_RAS_H */