plat_nuvoton_gic.c 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2016-2023, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * Copyright (C) 2022-2023 Nuvoton Ltd.
  5. *
  6. * SPDX-License-Identifier: BSD-3-Clause
  7. */
  8. #include <common/interrupt_props.h>
  9. #include <drivers/arm/gicv2.h>
  10. #include <plat/common/platform.h>
  11. #include <platform_def.h>
  12. static const interrupt_prop_t g0_interrupt_props[] = {
  13. INTR_PROP_DESC(FIQ_SMP_CALL_SGI, GIC_HIGHEST_SEC_PRIORITY,
  14. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
  15. };
  16. gicv2_driver_data_t arm_gic_data = {
  17. .gicd_base = BASE_GICD_BASE,
  18. .gicc_base = BASE_GICC_BASE,
  19. .interrupt_props = g0_interrupt_props,
  20. .interrupt_props_num = ARRAY_SIZE(g0_interrupt_props),
  21. };
  22. void plat_gic_driver_init(void)
  23. {
  24. gicv2_driver_init(&arm_gic_data);
  25. }
  26. void plat_gic_init(void)
  27. {
  28. gicv2_distif_init();
  29. gicv2_pcpu_distif_init();
  30. gicv2_cpuif_enable();
  31. }
  32. void plat_gic_cpuif_enable(void)
  33. {
  34. gicv2_cpuif_enable();
  35. }
  36. void plat_gic_cpuif_disable(void)
  37. {
  38. gicv2_cpuif_disable();
  39. }
  40. void plat_gic_pcpu_init(void)
  41. {
  42. gicv2_pcpu_distif_init();
  43. }