msm8916_gicv2.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2021, Stephan Gerhold <stephan@gerhold.net>
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/debug.h>
  7. #include <drivers/arm/gicv2.h>
  8. #include <lib/mmio.h>
  9. #include "msm8916_gicv2.h"
  10. #include <msm8916_mmap.h>
  11. #include <platform_def.h>
  12. #define IRQ_SEC_SGI_0 8
  13. #define IRQ_SEC_SGI_1 9
  14. #define IRQ_SEC_SGI_2 10
  15. #define IRQ_SEC_SGI_3 11
  16. #define IRQ_SEC_SGI_4 12
  17. #define IRQ_SEC_SGI_5 13
  18. #define IRQ_SEC_SGI_6 14
  19. #define IRQ_SEC_SGI_7 15
  20. static const interrupt_prop_t msm8916_interrupt_props[] = {
  21. INTR_PROP_DESC(IRQ_SEC_SGI_0, GIC_HIGHEST_SEC_PRIORITY,
  22. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  23. INTR_PROP_DESC(IRQ_SEC_SGI_1, GIC_HIGHEST_SEC_PRIORITY,
  24. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  25. INTR_PROP_DESC(IRQ_SEC_SGI_2, GIC_HIGHEST_SEC_PRIORITY,
  26. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  27. INTR_PROP_DESC(IRQ_SEC_SGI_3, GIC_HIGHEST_SEC_PRIORITY,
  28. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  29. INTR_PROP_DESC(IRQ_SEC_SGI_4, GIC_HIGHEST_SEC_PRIORITY,
  30. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  31. INTR_PROP_DESC(IRQ_SEC_SGI_5, GIC_HIGHEST_SEC_PRIORITY,
  32. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  33. INTR_PROP_DESC(IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY,
  34. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  35. INTR_PROP_DESC(IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY,
  36. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  37. INTR_PROP_DESC(IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY,
  38. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  39. };
  40. static const gicv2_driver_data_t msm8916_gic_data = {
  41. .gicd_base = APCS_QGIC2_GICD,
  42. .gicc_base = APCS_QGIC2_GICC,
  43. .interrupt_props = msm8916_interrupt_props,
  44. .interrupt_props_num = ARRAY_SIZE(msm8916_interrupt_props),
  45. };
  46. void msm8916_gicv2_init(void)
  47. {
  48. gicv2_driver_init(&msm8916_gic_data);
  49. }
  50. void msm8916_gicv2_configure(void)
  51. {
  52. gicv2_distif_init();
  53. gicv2_pcpu_distif_init();
  54. gicv2_cpuif_enable();
  55. }