ls_gicv2.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <gicv2.h>
  8. #include <plat_gic.h>
  9. /*
  10. * NXP common helper to initialize the GICv3 only driver.
  11. */
  12. void plat_ls_gic_driver_init(uintptr_t nxp_gicd_addr,
  13. uintptr_t nxp_gicc_addr,
  14. uint8_t plat_core_count,
  15. interrupt_prop_t *ls_interrupt_props,
  16. uint8_t ls_interrupt_prop_count,
  17. uint32_t *target_mask_array)
  18. {
  19. static struct gicv2_driver_data ls_gic_data;
  20. ls_gic_data.gicd_base = nxp_gicd_addr;
  21. ls_gic_data.gicc_base = nxp_gicc_addr;
  22. ls_gic_data.target_masks = target_mask_array;
  23. ls_gic_data.target_masks_num = plat_core_count;
  24. ls_gic_data.interrupt_props = ls_interrupt_props;
  25. ls_gic_data.interrupt_props_num = ls_interrupt_prop_count;
  26. gicv2_driver_init(&ls_gic_data);
  27. }
  28. void plat_ls_gic_init(void)
  29. {
  30. gicv2_distif_init();
  31. gicv2_pcpu_distif_init();
  32. gicv2_cpuif_enable();
  33. }
  34. /******************************************************************************
  35. * ARM common helper to enable the GICv2 CPU interface
  36. *****************************************************************************/
  37. void plat_ls_gic_cpuif_enable(void)
  38. {
  39. gicv2_cpuif_enable();
  40. }
  41. /******************************************************************************
  42. * ARM common helper to disable the GICv2 CPU interface
  43. *****************************************************************************/
  44. void plat_ls_gic_cpuif_disable(void)
  45. {
  46. gicv2_cpuif_disable();
  47. }
  48. /******************************************************************************
  49. * NXP common helper to initialize GICv2 per cpu
  50. *****************************************************************************/
  51. void plat_gic_pcpu_init(void)
  52. {
  53. gicv2_pcpu_distif_init();
  54. gicv2_cpuif_enable();
  55. }
  56. /******************************************************************************
  57. * Stubs for Redistributor power management. Although GICv2 doesn't have
  58. * Redistributor interface, these are provided for the sake of uniform GIC API
  59. *****************************************************************************/
  60. void plat_ls_gic_redistif_on(void)
  61. {
  62. }
  63. void plat_ls_gic_redistif_off(void)
  64. {
  65. }