mpipe.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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 : 5;
  165. /*
  166. * Reads as one to indicate that this is a hardware managed buffer.
  167. * Ignored on writes since all buffers on a given stack are the same size.
  168. */
  169. uint_reg_t hwb : 1;
  170. /*
  171. * Encoded size of buffer (ignored on writes):
  172. * 0 = 128 bytes
  173. * 1 = 256 bytes
  174. * 2 = 512 bytes
  175. * 3 = 1024 bytes
  176. * 4 = 1664 bytes
  177. * 5 = 4096 bytes
  178. * 6 = 10368 bytes
  179. * 7 = 16384 bytes
  180. */
  181. uint_reg_t size : 3;
  182. /*
  183. * Valid indication for the buffer. Ignored on writes.
  184. * 0 : Valid buffer descriptor popped from stack.
  185. * 3 : Could not pop a buffer from the stack. Either the stack is empty,
  186. * or the hardware's prefetch buffer is empty for this stack.
  187. */
  188. uint_reg_t c : 2;
  189. #else /* __BIG_ENDIAN__ */
  190. uint_reg_t c : 2;
  191. uint_reg_t size : 3;
  192. uint_reg_t hwb : 1;
  193. uint_reg_t __reserved_2 : 5;
  194. uint_reg_t stack_idx : 5;
  195. uint_reg_t __reserved_1 : 6;
  196. int_reg_t va : 35;
  197. uint_reg_t __reserved_0 : 7;
  198. #endif
  199. };
  200. uint_reg_t word;
  201. } MPIPE_BSM_REGION_VAL_t;
  202. /*
  203. * MMIO Egress DMA Post Region Address.
  204. * Used to post descriptor locations to the eDMA descriptor engine. The
  205. * value to be written is described in EDMA_POST_REGION_VAL
  206. */
  207. __extension__
  208. typedef union
  209. {
  210. struct
  211. {
  212. #ifndef __BIG_ENDIAN__
  213. /* Reserved. */
  214. uint_reg_t __reserved_0 : 3;
  215. /* eDMA ring being accessed */
  216. uint_reg_t ring : 5;
  217. /* Reserved. */
  218. uint_reg_t __reserved_1 : 18;
  219. /*
  220. * This field of the address selects the region (address space) to be
  221. * accessed. For the egress DMA post region, this field must be 5.
  222. */
  223. uint_reg_t region : 3;
  224. /* Reserved. */
  225. uint_reg_t __reserved_2 : 6;
  226. /* This field of the address indexes the 32 entry service domain table. */
  227. uint_reg_t svc_dom : 5;
  228. /* Reserved. */
  229. uint_reg_t __reserved_3 : 24;
  230. #else /* __BIG_ENDIAN__ */
  231. uint_reg_t __reserved_3 : 24;
  232. uint_reg_t svc_dom : 5;
  233. uint_reg_t __reserved_2 : 6;
  234. uint_reg_t region : 3;
  235. uint_reg_t __reserved_1 : 18;
  236. uint_reg_t ring : 5;
  237. uint_reg_t __reserved_0 : 3;
  238. #endif
  239. };
  240. uint_reg_t word;
  241. } MPIPE_EDMA_POST_REGION_ADDR_t;
  242. /*
  243. * MMIO Egress DMA Post Region Value.
  244. * Used to post descriptor locations to the eDMA descriptor engine. The
  245. * address is described in EDMA_POST_REGION_ADDR.
  246. */
  247. __extension__
  248. typedef union
  249. {
  250. struct
  251. {
  252. #ifndef __BIG_ENDIAN__
  253. /*
  254. * For writes, this specifies the current ring tail pointer prior to any
  255. * post. For example, to post 1 or more descriptors starting at location
  256. * 23, this would contain 23 (not 24). On writes, this index must be
  257. * masked based on the ring size. The new tail pointer after this post
  258. * is COUNT+RING_IDX (masked by the ring size).
  259. *
  260. * For reads, this provides the hardware descriptor fetcher's head
  261. * pointer. The descriptors prior to the head pointer, however, may not
  262. * yet have been processed so this indicator is only used to determine
  263. * how full the ring is and if software may post more descriptors.
  264. */
  265. uint_reg_t ring_idx : 16;
  266. /*
  267. * For writes, this specifies number of contiguous descriptors that are
  268. * being posted. Software may post up to RingSize descriptors with a
  269. * single MMIO store. A zero in this field on a write will "wake up" an
  270. * eDMA ring and cause it fetch descriptors regardless of the hardware's
  271. * current view of the state of the tail pointer.
  272. *
  273. * For reads, this field provides a rolling count of the number of
  274. * descriptors that have been completely processed. This may be used by
  275. * software to determine when buffers associated with a descriptor may be
  276. * returned or reused. When the ring's flush bit is cleared by software
  277. * (after having been set by HW or SW), the COUNT will be cleared.
  278. */
  279. uint_reg_t count : 16;
  280. /*
  281. * For writes, this specifies the generation number of the tail being
  282. * posted. Note that if tail+cnt wraps to the beginning of the ring, the
  283. * eDMA hardware assumes that the descriptors posted at the beginning of
  284. * the ring are also valid so it is okay to post around the wrap point.
  285. *
  286. * For reads, this is the current generation number. Valid descriptors
  287. * will have the inverse of this generation number.
  288. */
  289. uint_reg_t gen : 1;
  290. /* Reserved. */
  291. uint_reg_t __reserved : 31;
  292. #else /* __BIG_ENDIAN__ */
  293. uint_reg_t __reserved : 31;
  294. uint_reg_t gen : 1;
  295. uint_reg_t count : 16;
  296. uint_reg_t ring_idx : 16;
  297. #endif
  298. };
  299. uint_reg_t word;
  300. } MPIPE_EDMA_POST_REGION_VAL_t;
  301. /*
  302. * Load Balancer Bucket Status Data.
  303. * Read/Write data for load balancer Bucket-Status Table. 4160 entries
  304. * indexed by LBL_INIT_CTL.IDX when LBL_INIT_CTL.STRUCT_SEL is BSTS_TBL
  305. */
  306. __extension__
  307. typedef union
  308. {
  309. struct
  310. {
  311. #ifndef __BIG_ENDIAN__
  312. /* NotifRing currently assigned to this bucket. */
  313. uint_reg_t notifring : 8;
  314. /* Current reference count. */
  315. uint_reg_t count : 16;
  316. /* Group associated with this bucket. */
  317. uint_reg_t group : 5;
  318. /* Mode select for this bucket. */
  319. uint_reg_t mode : 3;
  320. /* Reserved. */
  321. uint_reg_t __reserved : 32;
  322. #else /* __BIG_ENDIAN__ */
  323. uint_reg_t __reserved : 32;
  324. uint_reg_t mode : 3;
  325. uint_reg_t group : 5;
  326. uint_reg_t count : 16;
  327. uint_reg_t notifring : 8;
  328. #endif
  329. };
  330. uint_reg_t word;
  331. } MPIPE_LBL_INIT_DAT_BSTS_TBL_t;
  332. #endif /* !defined(__ASSEMBLER__) */
  333. #endif /* !defined(__ARCH_MPIPE_H__) */