gic600_multichip.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2019, ARM Limited. All rights reserved.
  3. * Copyright (c) 2023, NVIDIA Corporation. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #ifndef GIC600_MULTICHIP_H
  8. #define GIC600_MULTICHIP_H
  9. #include <stdint.h>
  10. /*
  11. * GIC-600 microarchitecture supports coherent multichip environments containing
  12. * up to 16 chips.
  13. */
  14. #define GIC600_MAX_MULTICHIP 16
  15. typedef struct multichip_spi_ids_desc {
  16. uintptr_t gicd_base;
  17. uint32_t spi_id_min;
  18. uint32_t spi_id_max;
  19. } multichip_spi_ids_desc_t;
  20. /*******************************************************************************
  21. * GIC-600 multichip data structure describes platform specific attributes
  22. * related to GIC-600 multichip. Platform port is expected to define these
  23. * attributes to initialize the multichip related registers and create
  24. * successful connections between the GIC-600s in a multichip system.
  25. *
  26. * The 'rt_owner_base' field contains the base address of the GIC Distributor
  27. * which owns the routing table.
  28. *
  29. * The 'rt_owner' field contains the chip number which owns the routing table.
  30. * Chip number or chip_id starts from 0.
  31. *
  32. * The 'chip_count' field contains the total number of chips in a multichip
  33. * system. This should match the number of entries in 'chip_addrs' and 'spi_ids'
  34. * fields.
  35. *
  36. * The 'chip_addrs' field contains array of chip addresses. These addresses are
  37. * implementation specific values.
  38. *
  39. * The 'multichip_spi_ids_desc_t' field contains array of descriptors used to
  40. * provide minimum and maximum SPI interrupt ids that each chip owns and the
  41. * corresponding chip base address. Note that SPI interrupt ids can range from
  42. * 32 to 960 and it should be group of 32 (i.e., SPI minimum and (SPI maximum +
  43. * 1) should be a multiple of 32). If a chip doesn't own any SPI interrupts a
  44. * value of {0, 0, 0} should be passed.
  45. ******************************************************************************/
  46. struct gic600_multichip_data {
  47. uintptr_t rt_owner_base;
  48. unsigned int rt_owner;
  49. unsigned int chip_count;
  50. uint64_t chip_addrs[GIC600_MAX_MULTICHIP];
  51. multichip_spi_ids_desc_t spi_ids[GIC600_MAX_MULTICHIP];
  52. };
  53. uintptr_t gic600_multichip_gicd_base_for_spi(uint32_t spi_id);
  54. void gic600_multichip_init(struct gic600_multichip_data *multichip_data);
  55. bool gic600_multichip_is_initialized(void);
  56. #endif /* GIC600_MULTICHIP_H */