mpipe.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. /*
  2. * Copyright 2012 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. /* Machine-generated file; do not edit. */
  15. #ifndef __ARCH_MPIPE_H__
  16. #define __ARCH_MPIPE_H__
  17. #include <arch/abi.h>
  18. #include <arch/mpipe_def.h>
  19. #ifndef __ASSEMBLER__
  20. /*
  21. * MMIO Ingress DMA Release Region Address.
  22. * This is a description of the physical addresses used to manipulate ingress
  23. * credit counters. Accesses to this address space should use an address of
  24. * this form and a value like that specified in IDMA_RELEASE_REGION_VAL.
  25. */
  26. __extension__
  27. typedef union
  28. {
  29. struct
  30. {
  31. #ifndef __BIG_ENDIAN__
  32. /* Reserved. */
  33. uint_reg_t __reserved_0 : 3;
  34. /* NotifRing to be released */
  35. uint_reg_t ring : 8;
  36. /* Bucket to be released */
  37. uint_reg_t bucket : 13;
  38. /* Enable NotifRing release */
  39. uint_reg_t ring_enable : 1;
  40. /* Enable Bucket release */
  41. uint_reg_t bucket_enable : 1;
  42. /*
  43. * This field of the address selects the region (address space) to be
  44. * accessed. For the iDMA release region, this field must be 4.
  45. */
  46. uint_reg_t region : 3;
  47. /* Reserved. */
  48. uint_reg_t __reserved_1 : 6;
  49. /* This field of the address indexes the 32 entry service domain table. */
  50. uint_reg_t svc_dom : 5;
  51. /* Reserved. */
  52. uint_reg_t __reserved_2 : 24;
  53. #else /* __BIG_ENDIAN__ */
  54. uint_reg_t __reserved_2 : 24;
  55. uint_reg_t svc_dom : 5;
  56. uint_reg_t __reserved_1 : 6;
  57. uint_reg_t region : 3;
  58. uint_reg_t bucket_enable : 1;
  59. uint_reg_t ring_enable : 1;
  60. uint_reg_t bucket : 13;
  61. uint_reg_t ring : 8;
  62. uint_reg_t __reserved_0 : 3;
  63. #endif
  64. };
  65. uint_reg_t word;
  66. } MPIPE_IDMA_RELEASE_REGION_ADDR_t;
  67. /*
  68. * MMIO Ingress DMA Release Region Value - Release NotifRing and/or Bucket.
  69. * Provides release of the associated NotifRing. The address of the MMIO
  70. * operation is described in IDMA_RELEASE_REGION_ADDR.
  71. */
  72. __extension__
  73. typedef union
  74. {
  75. struct
  76. {
  77. #ifndef __BIG_ENDIAN__
  78. /*
  79. * Number of packets being released. The load balancer's count of
  80. * inflight packets will be decremented by this amount for the associated
  81. * Bucket and/or NotifRing
  82. */
  83. uint_reg_t count : 16;
  84. /* Reserved. */
  85. uint_reg_t __reserved : 48;
  86. #else /* __BIG_ENDIAN__ */
  87. uint_reg_t __reserved : 48;
  88. uint_reg_t count : 16;
  89. #endif
  90. };
  91. uint_reg_t word;
  92. } MPIPE_IDMA_RELEASE_REGION_VAL_t;
  93. /*
  94. * MMIO Buffer Stack Manager Region Address.
  95. * This MMIO region is used for posting or fetching buffers to/from the
  96. * buffer stack manager. On an MMIO load, this pops a buffer descriptor from
  97. * the top of stack if one is available. On an MMIO store, this pushes a
  98. * buffer to the stack. The value read or written is described in
  99. * BSM_REGION_VAL.
  100. */
  101. __extension__
  102. typedef union
  103. {
  104. struct
  105. {
  106. #ifndef __BIG_ENDIAN__
  107. /* Reserved. */
  108. uint_reg_t __reserved_0 : 3;
  109. /* BufferStack being accessed. */
  110. uint_reg_t stack : 5;
  111. /* Reserved. */
  112. uint_reg_t __reserved_1 : 18;
  113. /*
  114. * This field of the address selects the region (address space) to be
  115. * accessed. For the buffer stack manager region, this field must be 6.
  116. */
  117. uint_reg_t region : 3;
  118. /* Reserved. */
  119. uint_reg_t __reserved_2 : 6;
  120. /* This field of the address indexes the 32 entry service domain table. */
  121. uint_reg_t svc_dom : 5;
  122. /* Reserved. */
  123. uint_reg_t __reserved_3 : 24;
  124. #else /* __BIG_ENDIAN__ */
  125. uint_reg_t __reserved_3 : 24;
  126. uint_reg_t svc_dom : 5;
  127. uint_reg_t __reserved_2 : 6;
  128. uint_reg_t region : 3;
  129. uint_reg_t __reserved_1 : 18;
  130. uint_reg_t stack : 5;
  131. uint_reg_t __reserved_0 : 3;
  132. #endif
  133. };
  134. uint_reg_t word;
  135. } MPIPE_BSM_REGION_ADDR_t;
  136. /*
  137. * MMIO Buffer Stack Manager Region Value.
  138. * This MMIO region is used for posting or fetching buffers to/from the
  139. * buffer stack manager. On an MMIO load, this pops a buffer descriptor from
  140. * the top of stack if one is available. On an MMIO store, this pushes a
  141. * buffer to the stack. The address of the MMIO operation is described in
  142. * BSM_REGION_ADDR.
  143. */
  144. __extension__
  145. typedef union
  146. {
  147. struct
  148. {
  149. #ifndef __BIG_ENDIAN__
  150. /* Reserved. */
  151. uint_reg_t __reserved_0 : 7;
  152. /*
  153. * Base virtual address of the buffer. Must be sign extended by consumer.
  154. */
  155. int_reg_t va : 35;
  156. /* Reserved. */
  157. uint_reg_t __reserved_1 : 6;
  158. /*
  159. * Index of the buffer stack to which this buffer belongs. Ignored on
  160. * writes since the offset bits specify the stack being accessed.
  161. */
  162. uint_reg_t stack_idx : 5;
  163. /* Reserved. */
  164. uint_reg_t __reserved_2 : 3;
  165. /*
  166. * Instance ID. For devices that support automatic buffer return between
  167. * mPIPE instances, this field indicates the buffer owner. If the INST
  168. * field does not match the mPIPE's instance number when a packet is
  169. * egressed, buffers with HWB set will be returned to the other mPIPE
  170. * instance. Note that not all devices support multi-mPIPE buffer
  171. * return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates
  172. * whether the INST field in the buffer descriptor is populated by iDMA
  173. * hardware. This field is ignored on writes.
  174. */
  175. uint_reg_t inst : 2;
  176. /*
  177. * Reads as one to indicate that this is a hardware managed buffer.
  178. * Ignored on writes since all buffers on a given stack are the same size.
  179. */
  180. uint_reg_t hwb : 1;
  181. /*
  182. * Encoded size of buffer (ignored on writes):
  183. * 0 = 128 bytes
  184. * 1 = 256 bytes
  185. * 2 = 512 bytes
  186. * 3 = 1024 bytes
  187. * 4 = 1664 bytes
  188. * 5 = 4096 bytes
  189. * 6 = 10368 bytes
  190. * 7 = 16384 bytes
  191. */
  192. uint_reg_t size : 3;
  193. /*
  194. * Valid indication for the buffer. Ignored on writes.
  195. * 0 : Valid buffer descriptor popped from stack.
  196. * 3 : Could not pop a buffer from the stack. Either the stack is empty,
  197. * or the hardware's prefetch buffer is empty for this stack.
  198. */
  199. uint_reg_t c : 2;
  200. #else /* __BIG_ENDIAN__ */
  201. uint_reg_t c : 2;
  202. uint_reg_t size : 3;
  203. uint_reg_t hwb : 1;
  204. uint_reg_t inst : 2;
  205. uint_reg_t __reserved_2 : 3;
  206. uint_reg_t stack_idx : 5;
  207. uint_reg_t __reserved_1 : 6;
  208. int_reg_t va : 35;
  209. uint_reg_t __reserved_0 : 7;
  210. #endif
  211. };
  212. uint_reg_t word;
  213. } MPIPE_BSM_REGION_VAL_t;
  214. /*
  215. * MMIO Egress DMA Post Region Address.
  216. * Used to post descriptor locations to the eDMA descriptor engine. The
  217. * value to be written is described in EDMA_POST_REGION_VAL
  218. */
  219. __extension__
  220. typedef union
  221. {
  222. struct
  223. {
  224. #ifndef __BIG_ENDIAN__
  225. /* Reserved. */
  226. uint_reg_t __reserved_0 : 3;
  227. /* eDMA ring being accessed */
  228. uint_reg_t ring : 6;
  229. /* Reserved. */
  230. uint_reg_t __reserved_1 : 17;
  231. /*
  232. * This field of the address selects the region (address space) to be
  233. * accessed. For the egress DMA post region, this field must be 5.
  234. */
  235. uint_reg_t region : 3;
  236. /* Reserved. */
  237. uint_reg_t __reserved_2 : 6;
  238. /* This field of the address indexes the 32 entry service domain table. */
  239. uint_reg_t svc_dom : 5;
  240. /* Reserved. */
  241. uint_reg_t __reserved_3 : 24;
  242. #else /* __BIG_ENDIAN__ */
  243. uint_reg_t __reserved_3 : 24;
  244. uint_reg_t svc_dom : 5;
  245. uint_reg_t __reserved_2 : 6;
  246. uint_reg_t region : 3;
  247. uint_reg_t __reserved_1 : 17;
  248. uint_reg_t ring : 6;
  249. uint_reg_t __reserved_0 : 3;
  250. #endif
  251. };
  252. uint_reg_t word;
  253. } MPIPE_EDMA_POST_REGION_ADDR_t;
  254. /*
  255. * MMIO Egress DMA Post Region Value.
  256. * Used to post descriptor locations to the eDMA descriptor engine. The
  257. * address is described in EDMA_POST_REGION_ADDR.
  258. */
  259. __extension__
  260. typedef union
  261. {
  262. struct
  263. {
  264. #ifndef __BIG_ENDIAN__
  265. /*
  266. * For writes, this specifies the current ring tail pointer prior to any
  267. * post. For example, to post 1 or more descriptors starting at location
  268. * 23, this would contain 23 (not 24). On writes, this index must be
  269. * masked based on the ring size. The new tail pointer after this post
  270. * is COUNT+RING_IDX (masked by the ring size).
  271. *
  272. * For reads, this provides the hardware descriptor fetcher's head
  273. * pointer. The descriptors prior to the head pointer, however, may not
  274. * yet have been processed so this indicator is only used to determine
  275. * how full the ring is and if software may post more descriptors.
  276. */
  277. uint_reg_t ring_idx : 16;
  278. /*
  279. * For writes, this specifies number of contiguous descriptors that are
  280. * being posted. Software may post up to RingSize descriptors with a
  281. * single MMIO store. A zero in this field on a write will "wake up" an
  282. * eDMA ring and cause it fetch descriptors regardless of the hardware's
  283. * current view of the state of the tail pointer.
  284. *
  285. * For reads, this field provides a rolling count of the number of
  286. * descriptors that have been completely processed. This may be used by
  287. * software to determine when buffers associated with a descriptor may be
  288. * returned or reused. When the ring's flush bit is cleared by software
  289. * (after having been set by HW or SW), the COUNT will be cleared.
  290. */
  291. uint_reg_t count : 16;
  292. /*
  293. * For writes, this specifies the generation number of the tail being
  294. * posted. Note that if tail+cnt wraps to the beginning of the ring, the
  295. * eDMA hardware assumes that the descriptors posted at the beginning of
  296. * the ring are also valid so it is okay to post around the wrap point.
  297. *
  298. * For reads, this is the current generation number. Valid descriptors
  299. * will have the inverse of this generation number.
  300. */
  301. uint_reg_t gen : 1;
  302. /* Reserved. */
  303. uint_reg_t __reserved : 31;
  304. #else /* __BIG_ENDIAN__ */
  305. uint_reg_t __reserved : 31;
  306. uint_reg_t gen : 1;
  307. uint_reg_t count : 16;
  308. uint_reg_t ring_idx : 16;
  309. #endif
  310. };
  311. uint_reg_t word;
  312. } MPIPE_EDMA_POST_REGION_VAL_t;
  313. /*
  314. * Load Balancer Bucket Status Data.
  315. * Read/Write data for load balancer Bucket-Status Table. 4160 entries
  316. * indexed by LBL_INIT_CTL.IDX when LBL_INIT_CTL.STRUCT_SEL is BSTS_TBL
  317. */
  318. __extension__
  319. typedef union
  320. {
  321. struct
  322. {
  323. #ifndef __BIG_ENDIAN__
  324. /* NotifRing currently assigned to this bucket. */
  325. uint_reg_t notifring : 8;
  326. /* Current reference count. */
  327. uint_reg_t count : 16;
  328. /* Group associated with this bucket. */
  329. uint_reg_t group : 5;
  330. /* Mode select for this bucket. */
  331. uint_reg_t mode : 3;
  332. /* Reserved. */
  333. uint_reg_t __reserved : 32;
  334. #else /* __BIG_ENDIAN__ */
  335. uint_reg_t __reserved : 32;
  336. uint_reg_t mode : 3;
  337. uint_reg_t group : 5;
  338. uint_reg_t count : 16;
  339. uint_reg_t notifring : 8;
  340. #endif
  341. };
  342. uint_reg_t word;
  343. } MPIPE_LBL_INIT_DAT_BSTS_TBL_t;
  344. #endif /* !defined(__ASSEMBLER__) */
  345. #endif /* !defined(__ARCH_MPIPE_H__) */