versal_net_ipi.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (c) 2022, Xilinx, Inc. All rights reserved.
  3. * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. /*
  8. * Versal NET IPI agent registers access management
  9. */
  10. #include <lib/utils_def.h>
  11. #include <ipi.h>
  12. #include <plat_ipi.h>
  13. /* versal_net ipi configuration table */
  14. static const struct ipi_config versal_net_ipi_table[IPI_ID_MAX] = {
  15. /* A72 IPI */
  16. [IPI_ID_APU] = {
  17. .ipi_bit_mask = IPI0_TRIG_BIT,
  18. .ipi_reg_base = IPI0_REG_BASE,
  19. .secure_only = 0,
  20. },
  21. /* PMC IPI */
  22. [IPI_ID_PMC] = {
  23. .ipi_bit_mask = PMC_IPI_TRIG_BIT,
  24. .ipi_reg_base = IPI0_REG_BASE,
  25. .secure_only = IPI_SECURE_MASK,
  26. },
  27. /* RPU0 IPI */
  28. [IPI_ID_RPU0] = {
  29. .ipi_bit_mask = IPI1_TRIG_BIT,
  30. .ipi_reg_base = IPI1_REG_BASE,
  31. .secure_only = 0,
  32. },
  33. /* RPU1 IPI */
  34. [IPI_ID_RPU1] = {
  35. .ipi_bit_mask = IPI2_TRIG_BIT,
  36. .ipi_reg_base = IPI2_REG_BASE,
  37. .secure_only = 0,
  38. },
  39. /* IPI3 IPI */
  40. [IPI_ID_3] = {
  41. .ipi_bit_mask = IPI3_TRIG_BIT,
  42. .ipi_reg_base = IPI3_REG_BASE,
  43. .secure_only = 0,
  44. },
  45. /* IPI4 IPI */
  46. [IPI_ID_4] = {
  47. .ipi_bit_mask = IPI4_TRIG_BIT,
  48. .ipi_reg_base = IPI4_REG_BASE,
  49. .secure_only = 0,
  50. },
  51. /* IPI5 IPI */
  52. [IPI_ID_5] = {
  53. .ipi_bit_mask = IPI5_TRIG_BIT,
  54. .ipi_reg_base = IPI5_REG_BASE,
  55. .secure_only = 0,
  56. },
  57. /* PMC_NOBUF IPI */
  58. [IPI_ID_PMC_NOBUF] = {
  59. .ipi_bit_mask = PMC_NOBUF_TRIG_BIT,
  60. .ipi_reg_base = PMC_NOBUF_REG_BASE,
  61. .secure_only = IPI_SECURE_MASK,
  62. },
  63. /* IPI6 IPI */
  64. [IPI_ID_6_NOBUF_95] = {
  65. .ipi_bit_mask = IPI6_NOBUF_95_TRIG_BIT,
  66. .ipi_reg_base = IPI6_NOBUF_95_REG_BASE,
  67. .secure_only = 0,
  68. },
  69. /* IPI1 NO BUF IPI */
  70. [IPI_ID_1_NOBUF] = {
  71. .ipi_bit_mask = IPI1_NOBUF_TRIG_BIT,
  72. .ipi_reg_base = IPI1_NOBUF_REG_BASE,
  73. .secure_only = 0,
  74. },
  75. /* IPI2 NO BUF IPI */
  76. [IPI_ID_2_NOBUF] = {
  77. .ipi_bit_mask = IPI2_NOBUF_TRIG_BIT,
  78. .ipi_reg_base = IPI2_NOBUF_REG_BASE,
  79. .secure_only = 0,
  80. },
  81. /* IPI3 NO BUF IPI */
  82. [IPI_ID_3_NOBUF] = {
  83. .ipi_bit_mask = IPI3_NOBUF_TRIG_BIT,
  84. .ipi_reg_base = IPI3_NOBUF_REG_BASE,
  85. .secure_only = 0,
  86. },
  87. /* IPI4 NO BUF IPI */
  88. [IPI_ID_4_NOBUF] = {
  89. .ipi_bit_mask = IPI4_NOBUF_TRIG_BIT,
  90. .ipi_reg_base = IPI4_NOBUF_REG_BASE,
  91. .secure_only = 0,
  92. },
  93. /* IPI5 NO BUF IPI */
  94. [IPI_ID_5_NOBUF] = {
  95. .ipi_bit_mask = IPI5_NOBUF_TRIG_BIT,
  96. .ipi_reg_base = IPI5_NOBUF_REG_BASE,
  97. .secure_only = 0,
  98. },
  99. /* IPI6 NO BUF IPI */
  100. [IPI_ID_6_NOBUF_101] = {
  101. .ipi_bit_mask = IPI6_NOBUF_101_TRIG_BIT,
  102. .ipi_reg_base = IPI6_NOBUF_101_REG_BASE,
  103. .secure_only = 0,
  104. },
  105. };
  106. /* versal_net_ipi_config_table_init() - Initialize versal_net IPI configuration
  107. * data.
  108. * @ipi_config_table: IPI configuration table.
  109. * @ipi_total: Total number of IPI available.
  110. *
  111. */
  112. void versal_net_ipi_config_table_init(void)
  113. {
  114. ipi_config_table_init(versal_net_ipi_table, ARRAY_SIZE(versal_net_ipi_table));
  115. }