csl_srio.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. /**
  2. * @file csl_srio.h
  3. *
  4. * @brief
  5. * This is the header file for the SRIO CSL Functional Layer.
  6. *
  7. * \par
  8. * ============================================================================
  9. * @n (C) Copyright 2008-2011, Texas Instruments, Inc.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. *
  15. * Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. *
  18. * Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in the
  20. * documentation and/or other materials provided with the
  21. * distribution.
  22. *
  23. * Neither the name of Texas Instruments Incorporated nor the names of
  24. * its contributors may be used to endorse or promote products derived
  25. * from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  30. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  31. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  33. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  34. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  35. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  36. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. /** @defgroup CSL_SRIO_API SRIO
  41. *
  42. * @section Introduction
  43. *
  44. * @subsection xxx Overview
  45. * RapidIOTM is a non-proprietary high-bandwidth system level interconnect. It is
  46. * intended to offer giga-byte per second performance levels for chip-to-chip and
  47. * board-to-board communication. Its layered architecture, allows a highly
  48. * scalable interconnect capable of future enhancements.
  49. *
  50. * @subsection References
  51. * -# Rapid IO Module Specification
  52. *
  53. */
  54. #ifndef CSL_SRIO_H
  55. #define CSL_SRIO_H
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. #include <ti/csl/soc.h>
  60. #include <ti/csl/csl.h>
  61. #include <ti/csl/cslr_srio.h>
  62. /**
  63. @defgroup CSL_SRIO_SYMBOL SRIO Symbols Defined
  64. @ingroup CSL_SRIO_API
  65. */
  66. /**
  67. @defgroup CSL_SRIO_DATASTRUCT SRIO Data Structures
  68. @ingroup CSL_SRIO_API
  69. */
  70. /**
  71. @defgroup CSL_SRIO_FUNCTION SRIO Functions
  72. @ingroup CSL_SRIO_API
  73. */
  74. /** @addtogroup CSL_SRIO_DATASTRUCT
  75. @{ */
  76. /** @brief This is the handle to the SRIO instance */
  77. typedef volatile CSL_SrioRegs* CSL_SrioHandle;
  78. /** @brief SRIO Message Description.
  79. *
  80. * This structure is used to define a SRIO message and is used by the
  81. * SRIO module to compare all received RIO packets to determine the
  82. * receive queue where the packet is pushed to.
  83. */
  84. typedef struct SRIO_MESSAGE_s
  85. {
  86. Uint16 srcId;
  87. Uint8 mbx;
  88. Uint8 ltr;
  89. Uint8 mbxMask;
  90. Uint8 ltrMask;
  91. Uint8 segMap;
  92. Uint8 srcProm;
  93. Uint8 tt;
  94. Uint8 dstProm;
  95. Uint16 dstId;
  96. Uint8 flowId;
  97. }SRIO_MESSAGE;
  98. /** @brief SRIO Type 9 Message Description.
  99. *
  100. * This structure is used to define the TYPE9 Message. This is then
  101. * used to MAP Type9 messages to a specific destination queue.
  102. */
  103. typedef struct SRIO_TYPE9_MESSAGE_s
  104. {
  105. Uint16 srcId;
  106. Uint8 cos;
  107. Uint8 cosMask;
  108. Uint8 srcProm;
  109. Uint8 tt;
  110. Uint8 dstProm;
  111. Uint16 dstId;
  112. Uint16 streamId;
  113. Uint16 streamMask;
  114. Uint8 flowId;
  115. }SRIO_TYPE9_MESSAGE;
  116. /** @brief SRIO AMU Window
  117. *
  118. * This structure is used to define the SRIO AMU Window
  119. * properties.
  120. */
  121. typedef struct SRIO_AMU_WINDOW_s
  122. {
  123. Uint8 xambs;
  124. Uint8 paneCount;
  125. Uint16 paneSize;
  126. Uint8 winSize;
  127. Uint32 rapidIOMsb;
  128. Uint32 rapidIOLsb;
  129. }SRIO_AMU_WINDOW;
  130. /** @brief SRIO AMU Pane
  131. *
  132. * This structure is used to define the SRIO AMU Pane
  133. * properties.
  134. */
  135. typedef struct SRIO_AMU_PANE_s
  136. {
  137. Uint8 cmdEnc;
  138. Uint8 portId;
  139. Uint8 idSize;
  140. Uint16 dstID;
  141. }SRIO_AMU_PANE;
  142. /** @brief SRIO LSU Transfer
  143. *
  144. * This structure is used to configure LSU module for Transfer
  145. */
  146. typedef struct SRIO_LSU_TRANSFER_s
  147. {
  148. Uint32 rapidIOMSB;
  149. Uint32 rapidIOLSB;
  150. Uint32 dspAddress;
  151. Uint32 bytecount;
  152. Uint8 doorbellValid;
  153. Uint8 intrRequest;
  154. Uint8 supInt;
  155. Uint8 xambs;
  156. Uint8 priority;
  157. Uint8 outPortID;
  158. Uint8 idSize;
  159. Uint8 srcIDMap;
  160. Uint16 dstID;
  161. Uint8 ttype;
  162. Uint8 ftype;
  163. Uint8 hopCount;
  164. Uint16 doorbellInfo;
  165. }SRIO_LSU_TRANSFER;
  166. /** @brief SRIO Processing Element Features
  167. *
  168. * This structure is used to configure the Tundra
  169. * Processing Element Features.
  170. */
  171. typedef struct SRIO_PE_FEATURES_s
  172. {
  173. Uint8 isBridge;
  174. Uint8 isEndpoint;
  175. Uint8 isProcessor;
  176. Uint8 isSwitch;
  177. Uint8 isMultiport;
  178. Uint8 isFlowArbiterationSupported;
  179. Uint8 isMulticastSupported;
  180. Uint8 isExtendedRouteConfigSupported;
  181. Uint8 isStandardRouteConfigSupported;
  182. Uint8 isFlowControlSupported;
  183. Uint8 isCRFSupported;
  184. Uint8 isCTLSSupported;
  185. Uint8 isExtendedFeaturePtrValid;
  186. Uint8 numAddressBitSupported;
  187. }SRIO_PE_FEATURES;
  188. /** @brief SRIO Operation Capability Register
  189. *
  190. * This structure is used to store the operation capability
  191. * configuration.
  192. */
  193. typedef struct SRIO_OP_CAR_s
  194. {
  195. Uint8 gsmRead;
  196. Uint8 gsmInstrnRead;
  197. Uint8 gsmReadOwn;
  198. Uint8 gsmDataCacheInvalidate;
  199. Uint8 gsmCastout;
  200. Uint8 gsmDataCacheFlush;
  201. Uint8 gsmIORead;
  202. Uint8 gsmInstrnCacheInvalidate;
  203. Uint8 gsmTLBInvalidate;
  204. Uint8 gsmTLBSync;
  205. Uint8 dataStreamingTM;
  206. Uint8 dataStreamingSupport;
  207. Uint8 implnDefined;
  208. Uint8 readSupport;
  209. Uint8 writeSupport;
  210. Uint8 streamWriteSupport;
  211. Uint8 writeResponseSupport;
  212. Uint8 dataMessageSupport;
  213. Uint8 doorbellSupport;
  214. Uint8 atomicCompareSwapSupport;
  215. Uint8 atomicTestSwapSupport;
  216. Uint8 atomicIncSupport;
  217. Uint8 atomicDecSupport;
  218. Uint8 atomicSetSupport;
  219. Uint8 atomicClearSupport;
  220. Uint8 atomicSwapSupport;
  221. Uint8 portWriteOperationSupport;
  222. Uint8 implnDefined2;
  223. }SRIO_OP_CAR;
  224. /** @brief SRIO Error Rate
  225. *
  226. * This structure is used to store the error rate CSR configuration
  227. * which is used to monitor and control the port physical layer
  228. * errors.
  229. */
  230. typedef struct SRIO_ERR_RATE_s
  231. {
  232. Uint8 errRateBias;
  233. Uint8 errRateRecovery;
  234. Uint8 peak;
  235. Uint8 errRateCnt;
  236. }SRIO_ERR_RATE;
  237. /** @brief SRIO Lane Status
  238. *
  239. * This structure is used to store the lane status information.
  240. */
  241. typedef struct SRIO_LANE_STATUS_s
  242. {
  243. Uint8 portNum;
  244. Uint8 laneNum;
  245. Uint8 txType;
  246. Uint8 txMode;
  247. Uint8 rxType;
  248. Uint8 rxInv;
  249. Uint8 rxTrn;
  250. Uint8 rxSync;
  251. Uint8 rxReady;
  252. Uint8 errCnt;
  253. Uint8 chgSync;
  254. Uint8 chgTrn;
  255. Uint8 stat1;
  256. Uint8 stat2_7;
  257. Uint8 idle2;
  258. Uint8 infoOk;
  259. Uint8 chg;
  260. Uint8 implSpecific;
  261. Uint8 lpRxTrn;
  262. Uint8 lpWidth;
  263. Uint8 lpLaneNum;
  264. Uint8 lpTapM1;
  265. Uint8 lpTapP1;
  266. Uint8 lpScrm;
  267. }SRIO_LANE_STATUS;
  268. /** @brief SRIO Lane Status
  269. *
  270. * This structure is used to store the PLM Implementation specific
  271. * control register
  272. */
  273. typedef struct SRIO_PLM_IMPL_CONTROL_s
  274. {
  275. Uint8 payloadCapture;
  276. Uint8 useIdle2;
  277. Uint8 useIdle1;
  278. Uint8 dlbEn;
  279. Uint8 forceReinit;
  280. Uint8 softRstPort;
  281. Uint8 txBypass;
  282. Uint8 lineLoopbackMode;
  283. Uint8 portSelfReset;
  284. Uint8 selfReset;
  285. Uint8 swapTx;
  286. Uint8 swapRx;
  287. Uint8 dltThresh;
  288. }SRIO_PLM_IMPL_CONTROL;
  289. /** @brief SRIO PLM VMin Exponent
  290. *
  291. * This structure is used to store the PLM VMin Exponent configuration
  292. */
  293. typedef struct SRIO_PLM_VMIN_EXPONENT_s
  294. {
  295. Uint8 vminExp;
  296. Uint8 imax;
  297. Uint8 mmax;
  298. }SRIO_PLM_VMIN_EXPONENT;
  299. /** @brief SRIO PLM Polarity Control
  300. *
  301. * This structure is used to store the PLM Polarity Control
  302. */
  303. typedef struct SRIO_PLM_POLARITY_CONTROL_s
  304. {
  305. Uint8 tx3Pol;
  306. Uint8 tx2Pol;
  307. Uint8 tx1Pol;
  308. Uint8 tx0Pol;
  309. Uint8 rx3Pol;
  310. Uint8 rx2Pol;
  311. Uint8 rx1Pol;
  312. Uint8 rx0Pol;
  313. }SRIO_PLM_POLARITY_CONTROL;
  314. /** @brief SRIO PLM Control Symbol Configuration
  315. *
  316. * This structure is used to store the PLM Control Symbol configuration
  317. */
  318. typedef struct SRIO_PLM_CONTROL_SYMBOL_s
  319. {
  320. Uint8 stype0;
  321. Uint8 par0;
  322. Uint8 par1;
  323. Uint8 csEmb;
  324. Uint8 stype1;
  325. Uint8 cmd;
  326. Uint8 stype2;
  327. Uint8 parm;
  328. }SRIO_PLM_CONTROL_SYMBOL;
  329. /** @brief SRIO TLM Control Configuration
  330. *
  331. * This structure is used to store the SRIO TLM Control configuration
  332. */
  333. typedef struct SRIO_TLM_CONTROL_s
  334. {
  335. Uint8 portGroupSelect;
  336. Uint8 voqSelect;
  337. Uint8 tgtIDDis;
  338. Uint8 mtcTgtIDDis;
  339. Uint8 length;
  340. }SRIO_TLM_CONTROL;
  341. /**
  342. @}
  343. */
  344. /* Device specific API which opens the SRIO instance and returns a handle used in all subsequent calls */
  345. extern CSL_SrioHandle CSL_SRIO_Open (Int32 instNum);
  346. #ifdef __cplusplus
  347. }
  348. #endif
  349. #endif /* CSL_SRIO_H */