mhu_v3_x_private.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MHU_V3_X_PRIVATE_H
  7. #define MHU_V3_X_PRIVATE_H
  8. #include <stdint.h>
  9. /* Flag for PDBCW Interrupt Transfer Acknowledgment */
  10. #define MHU_V3_X_PDBCW_INT_X_TFR_ACK 0x1
  11. /* Flag for PDBCW CTRL Postbox combined interrupts enable */
  12. #define MHU_V3_X_PDBCW_CTRL_PBX_COMB_EN 0x1
  13. /* Flag for MDBCW CTRL Mailbox combined interrupts enable */
  14. #define MHU_V3_X_MDBCW_CTRL_MBX_COMB_EN 0x1
  15. /**
  16. * Postbox control page structure
  17. */
  18. struct _mhu_v3_x_pbx_ctrl_reg_t {
  19. /* Offset: 0x000 (R/ ) Postbox Block Identifier */
  20. const volatile uint32_t pbx_blk_id;
  21. /* Offset: 0x004 (R/ ) Reserved */
  22. const volatile uint8_t reserved_0[0x10 - 0x04];
  23. /* Offset: 0x010 (R/ ) Postbox Feature Support 0 */
  24. const volatile uint32_t pbx_feat_spt0;
  25. /* Offset: 0x014 (R/ ) Postbox Feature Support 1 */
  26. const volatile uint32_t pbx_feat_spt1;
  27. /* Offset: 0x018 (R/ ) Reserved */
  28. const volatile uint8_t reserved_1[0x20 - 0x18];
  29. /* Offset: 0x020 (R/ ) Postbox Doorbell Channel Configuration 0 */
  30. const volatile uint32_t pbx_dbch_cfg0;
  31. /* Offset: 0x024 (R/ ) Reserved */
  32. const volatile uint8_t reserved_2[0x30 - 0x24];
  33. /* Offset: 0x030 (R/ ) Postbox FIFO Channel Configuration 0 */
  34. const volatile uint32_t pbx_ffch_cfg0;
  35. /* Offset: 0x034 (R/ ) Reserved */
  36. const volatile uint8_t reserved_3[0x40 - 0x34];
  37. /* Offset: 0x040 (R/ ) Postbox Fast Channel Configuration 0 */
  38. const volatile uint32_t pbx_fch_cfg0;
  39. /* Offset: 0x044 (R/ ) Reserved */
  40. const volatile uint8_t reserved_4[0x100 - 0x44];
  41. /* Offset: 0x100 (R/W) Postbox control */
  42. volatile uint32_t pbx_ctrl;
  43. /* Offset: 0x164 (R/ ) Reserved */
  44. const volatile uint8_t reserved_5[0x400 - 0x104];
  45. /*
  46. * Offset: 0x400 (R/ ) Postbox Doorbell Channel Interrupt Status n,
  47. * where n is 0 - 3.
  48. */
  49. const volatile uint32_t pbx_dbch_int_st[4];
  50. /*
  51. * Offset: 0x410 (R/ ) Postbox FIFO Channel <n> Interrupt Status n,
  52. * where n is 0 - 1.
  53. */
  54. const volatile uint32_t pbx_ffch_int_st[2];
  55. /* Offset: 0x418 (R/ ) Reserved */
  56. const uint8_t reserved_6[0xFC8 - 0x418];
  57. /* Offset: 0xFC8 (R/ ) Postbox Implementer Identification Register */
  58. const volatile uint32_t pbx_iidr;
  59. /* Offset: 0xFCC (R/ ) Postbox Architecture Identification Register */
  60. const volatile uint32_t pbx_aidr;
  61. /*
  62. * Offset: 0xFD0 (R/ ) Postbox Implementation Defined Identification
  63. * Register n, where n is 0 - 11.
  64. */
  65. const volatile uint32_t impl_def_id[12];
  66. };
  67. /**
  68. * Postbox doorbell channel window page structure
  69. */
  70. struct _mhu_v3_x_pdbcw_reg_t {
  71. /* Offset: 0x000 (R/ ) Postbox Doorbell Channel Window Status */
  72. const volatile uint32_t pdbcw_st;
  73. /* Offset: 0x004 (R/ ) Reserved */
  74. const uint8_t reserved_0[0xC - 0x4];
  75. /* Offset: 0x00C ( /W) Postbox Doorbell Channel Window Set */
  76. volatile uint32_t pdbcw_set;
  77. /*
  78. * Offset: 0x010 (R/ ) Postbox Doorbell Channel Window Interrupt Status
  79. */
  80. const volatile uint32_t pdbcw_int_st;
  81. /*
  82. * Offset: 0x014 ( /W) Postbox Doorbell Channel Window Interrupt Clear
  83. */
  84. volatile uint32_t pdbcw_int_clr;
  85. /*
  86. * Offset: 0x018 (R/W) Postbox Doorbell Channel Window Interrupt Enable
  87. */
  88. volatile uint32_t pdbcw_int_en;
  89. /* Offset: 0x01C (R/W) Postbox Doorbell Channel Window Control */
  90. volatile uint32_t pdbcw_ctrl;
  91. };
  92. /**
  93. * Postbox structure
  94. */
  95. struct _mhu_v3_x_pbx {
  96. /* Postbox Control */
  97. struct _mhu_v3_x_pbx_ctrl_reg_t pbx_ctrl_page;
  98. /* Postbox Doorbell Channel Window */
  99. struct _mhu_v3_x_pdbcw_reg_t pdbcw_page;
  100. };
  101. /**
  102. * Mailbox control page structure
  103. */
  104. struct _mhu_v3_x_mbx_ctrl_reg_t {
  105. /* Offset: 0x000 (R/ ) Mailbox Block Identifier */
  106. const volatile uint32_t mbx_blk_id;
  107. /* Offset: 0x004 (R/ ) Reserved */
  108. const volatile uint8_t reserved_0[0x10 - 0x04];
  109. /* Offset: 0x010 (R/ ) Mailbox Feature Support 0 */
  110. const volatile uint32_t mbx_feat_spt0;
  111. /* Offset: 0x014 (R/ ) Mailbox Feature Support 1 */
  112. const volatile uint32_t mbx_feat_spt1;
  113. /* Offset: 0x018 (R/ ) Reserved */
  114. const volatile uint8_t reserved_1[0x20 - 0x18];
  115. /* Offset: 0x020 (R/ ) Mailbox Doorbell Channel Configuration 0 */
  116. const volatile uint32_t mbx_dbch_cfg0;
  117. /* Offset: 0x024 (R/ ) Reserved */
  118. const volatile uint8_t reserved_2[0x30 - 0x24];
  119. /* Offset: 0x030 (R/ ) Mailbox FIFO Channel Configuration 0 */
  120. const volatile uint32_t mbx_ffch_cfg0;
  121. /* Offset: 0x034 (R/ ) Reserved */
  122. const volatile uint8_t reserved_4[0x40 - 0x34];
  123. /* Offset: 0x040 (R/ ) Mailbox Fast Channel Configuration 0 */
  124. const volatile uint32_t mbx_fch_cfg0;
  125. /* Offset: 0x044 (R/ ) Reserved */
  126. const volatile uint8_t reserved_5[0x100 - 0x44];
  127. /* Offset: 0x100 (R/W) Mailbox control */
  128. volatile uint32_t mbx_ctrl;
  129. /* Offset: 0x104 (R/ ) Reserved */
  130. const volatile uint8_t reserved_6[0x140 - 0x104];
  131. /* Offset: 0x140 (R/W) Mailbox Fast Channel control */
  132. volatile uint32_t mbx_fch_ctrl;
  133. /* Offset: 0x144 (R/W) Mailbox Fast Channel Group Interrupt Enable */
  134. volatile uint32_t mbx_fcg_int_en;
  135. /* Offset: 0x148 (R/ ) Reserved */
  136. const volatile uint8_t reserved_7[0x400 - 0x148];
  137. /*
  138. * Offset: 0x400 (R/ ) Mailbox Doorbell Channel Interrupt Status n,
  139. * where n = 0 - 3.
  140. */
  141. const volatile uint32_t mbx_dbch_int_st[4];
  142. /*
  143. * Offset: 0x410 (R/ ) Mailbox FIFO Channel Interrupt Status n, where
  144. * n = 0 - 1.
  145. */
  146. const volatile uint32_t mbx_ffch_int_st[2];
  147. /* Offset: 0x418 (R/ ) Reserved */
  148. const volatile uint8_t reserved_8[0x470 - 0x418];
  149. /* Offset: 0x470 (R/ ) Mailbox Fast Channel Group Interrupt Status */
  150. const volatile uint32_t mbx_fcg_int_st;
  151. /* Offset: 0x474 (R/ ) Reserved */
  152. const volatile uint8_t reserved_9[0x480 - 0x474];
  153. /*
  154. * Offset: 0x480 (R/ ) Mailbox Fast Channel Group <n> Interrupt Status,
  155. * where n = 0 - 31.
  156. */
  157. const volatile uint32_t mbx_fch_grp_int_st[32];
  158. /* Offset: 0x500 (R/ ) Reserved */
  159. const volatile uint8_t reserved_10[0xFC8 - 0x500];
  160. /* Offset: 0xFC8 (R/ ) Mailbox Implementer Identification Register */
  161. const volatile uint32_t mbx_iidr;
  162. /* Offset: 0xFCC (R/ ) Mailbox Architecture Identification Register */
  163. const volatile uint32_t mbx_aidr;
  164. /*
  165. * Offset: 0xFD0 (R/ ) Mailbox Implementation Defined Identification
  166. * Register n, where n is 0 - 11.
  167. */
  168. const volatile uint32_t impl_def_id[12];
  169. };
  170. /**
  171. * Mailbox doorbell channel window page structure
  172. */
  173. struct _mhu_v3_x_mdbcw_reg_t {
  174. /* Offset: 0x000 (R/ ) Mailbox Doorbell Channel Window Status */
  175. const volatile uint32_t mdbcw_st;
  176. /* Offset: 0x004 (R/ ) Mailbox Doorbell Channel Window Status Masked */
  177. const volatile uint32_t mdbcw_st_msk;
  178. /* Offset: 0x008 ( /W) Mailbox Doorbell Channel Window Clear */
  179. volatile uint32_t mdbcw_clr;
  180. /* Offset: 0x00C (R/ ) Reserved */
  181. const volatile uint8_t reserved_0[0x10 - 0x0C];
  182. /* Offset: 0x010 (R/ ) Mailbox Doorbell Channel Window Mask Status */
  183. const volatile uint32_t mdbcw_msk_st;
  184. /* Offset: 0x014 ( /W) Mailbox Doorbell Channel Window Mask Set */
  185. volatile uint32_t mdbcw_msk_set;
  186. /* Offset: 0x018 ( /W) Mailbox Doorbell Channel Window Mask Clear */
  187. volatile uint32_t mdbcw_msk_clr;
  188. /* Offset: 0x01C (R/W) Mailbox Doorbell Channel Window Control */
  189. volatile uint32_t mdbcw_ctrl;
  190. };
  191. /**
  192. * Mailbox structure
  193. */
  194. struct _mhu_v3_x_mbx {
  195. /* Mailbox control */
  196. struct _mhu_v3_x_mbx_ctrl_reg_t mbx_ctrl_page;
  197. /* Mailbox Doorbell Channel Window */
  198. struct _mhu_v3_x_mdbcw_reg_t mdbcw_page;
  199. };
  200. /**
  201. * MHUv3 frame type
  202. */
  203. union _mhu_v3_x_frame_t {
  204. /* Postbox Frame */
  205. struct _mhu_v3_x_pbx pbx_frame;
  206. /* Mailbox Frame */
  207. struct _mhu_v3_x_mbx mbx_frame;
  208. };
  209. #endif /* MHU_V3_X_PRIVATE_H */