]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - psdk_cust/pdk_k2g_1_0_1_2_eng/packages/ti/csl/csl_srioAux.h
PASDK-319:Update PDK eng to 1.0.1.2.
[processor-sdk/performance-audio-sr.git] / psdk_cust / pdk_k2g_1_0_1_2_eng / packages / ti / csl / csl_srioAux.h
1 /**
2  *   @file  csl_srioAux.h
3  *
4  *   @brief   
5  *      This is the SRIO Auxilary Header File which exposes the various
6  *      CSL Functional Layer API's to configure the SRIO Module.
7  *
8  *  \par
9  *  ============================================================================
10  *  @n   (C) Copyright 2008-2011, Texas Instruments, Inc.
11  * 
12  *  Redistribution and use in source and binary forms, with or without 
13  *  modification, are permitted provided that the following conditions 
14  *  are met:
15  *
16  *    Redistributions of source code must retain the above copyright 
17  *    notice, this list of conditions and the following disclaimer.
18  *
19  *    Redistributions in binary form must reproduce the above copyright
20  *    notice, this list of conditions and the following disclaimer in the 
21  *    documentation and/or other materials provided with the   
22  *    distribution.
23  *
24  *    Neither the name of Texas Instruments Incorporated nor the names of
25  *    its contributors may be used to endorse or promote products derived
26  *    from this software without specific prior written permission.
27  *
28  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
29  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
30  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
32  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
33  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
34  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
37  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
38  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40 */
42 #ifndef _CSL_SRIOAUX_H_
43 #define _CSL_SRIOAUX_H_
45 #include <ti/csl/soc.h>
46 #include <ti/csl/csl_srio.h>
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
52 /** @addtogroup CSL_SRIO_FUNCTION
53  @{ */
55 /** ============================================================================
56  *   @n@b CSL_SRIO_GetPID
57  *
58  *   @b Description
59  *   @n This function reads the peripheral ID register which identifies the 
60  *      peripheral number for the peripheral.
61  *
62  *   @b Arguments
63      @verbatim
64           revInfo      Peripheral Revision populated by this API
65           classInfo    Peripheral class populated by this API
66           typeInfo     Peripheral Type populated by this API
67      @endverbatim
68  *
69  *   <b> Return Value </b>
70  *   @n None
71  *
72  *   <b> Pre Condition </b>
73  *   @n  CSL_SRIO_Open() must be called 
74  *
75  *   <b> Post Condition </b>
76  *   @n None
77  *
78  *   @b Reads
79  *   @n SRIO_RIO_PID
80  *
81  *   @b Example
82  *   @verbatim
83         Uint32          pid;
84         CSL_SrioHandle  hSrio;
86         // Open the CSL SRIO Module 0
87         hSrio = CSL_SRIO_Open (0);
89         // Get the SRIO Peripheral Identification.
90         CSL_SRIO_GetPID (hSrio, &pid);
92      @endverbatim
93  * =============================================================================
94  */
95 static inline void CSL_SRIO_GetPID 
96 (
97     CSL_SrioHandle  hSrio,
98     Uint32*         pid
99 )
101     *pid = hSrio->RIO_PID;
104 /** ============================================================================
105  *   @n@b CSL_SRIO_EnablePeripheral
106  *
107  *   @b Description
108  *   @n This function sets the PEREN bit in the Peripheral Control register and
109  *      if not set this will prevent the peripheral from participating in any
110  *      transmit transactions and will disable all incoming requests. This should
111  *      be the last enable bit when bringing the device out of reset.
112  *
113  *   @b Arguments
114      @verbatim
115           hSrio   Handle of the SRIO device
116      @endverbatim
117  *
118  *   <b> Return Value </b>
119  *   @n  None
120  *
121  *   <b> Pre Condition </b>
122  *   @n  CSL_SRIO_Open() must be called 
123  *
124  *   <b> Post Condition </b>
125  *   @n None
126  *
127  *   @b Writes
128  *   @n SRIO_RIO_PCR_PEREN=1
129  *
130  *   @b Example
131  *   @verbatim
132         CSL_SrioHandle  hSrio;
134         // Open the CSL SRIO Module 0
135         hSrio = CSL_SRIO_Open (0);
137         // Enable the SRIO peripheral. 
138         CSL_SRIO_EnablePeripheral (hSrio);
139         ...
140      @endverbatim
141  * =============================================================================
142  */
143 static inline void CSL_SRIO_EnablePeripheral (CSL_SrioHandle hSrio)
145     CSL_FINS(hSrio->RIO_PCR, SRIO_RIO_PCR_PEREN, 1);
148 /** ============================================================================
149  *   @n@b CSL_SRIO_DisablePeripheral
150  *
151  *   @b Description
152  *   @n This function resets the PEREN bit in the Peripheral Control register 
153  *      and disables the SRIO peripheral.
154  *
155  *   @b Arguments
156      @verbatim
157           hSrio   Handle of the SRIO device
158      @endverbatim
159  *
160  *   <b> Return Value </b>
161  *   @n  None
162  *
163  *   <b> Pre Condition </b>
164  *   @n  CSL_SRIO_Open() must be called 
165  *
166  *   <b> Post Condition </b>
167  *   @n None
168  *
169  *   @b Writes
170  *   @n SRIO_RIO_PCR_PEREN=0
171  *
172  *   @b Example
173  *   @verbatim
174         CSL_SrioHandle  hSrio;
176         // Open the CSL SRIO Module 0
177         hSrio = CSL_SRIO_Open (0);
179         // Disable the SRIO peripheral. 
180         CSL_SRIO_DisablePeripheral (hSrio);
181         ...
182      @endverbatim
183  * =============================================================================
184  */
185 static inline void CSL_SRIO_DisablePeripheral (CSL_SrioHandle hSrio)
187     CSL_FINS(hSrio->RIO_PCR, SRIO_RIO_PCR_PEREN, 0);
190 /** ============================================================================
191  *   @n@b CSL_SRIO_SetMAUSwappingMode
192  *
193  *   @b Description
194  *   @n This function sets the Little Endian Swapping Mode for the Memory Access
195  *      Unit.
196  *
197  *   @b Arguments
198      @verbatim
199           hSrio     Handle of the SRIO device
200           mode      Little Endian Swapping Mode for the MAU.
201      @endverbatim
202  *
203  *   <b> Return Value </b>
204  *   @n  None
205  *
206  *   <b> Pre Condition </b>
207  *   @n  CSL_SRIO_Open() must be called 
208  *
209  *   <b> Post Condition </b>
210  *   @n None
211  *
212  *   @b Writes
213  *   @n SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE
214  *
215  *   @b Example
216  *   @verbatim
217         CSL_SrioHandle  hSrio;
219         // Open the CSL SRIO Module 0
220         hSrio = CSL_SRIO_Open (0);
222         // Ensure that the Memory Access Unit operates in mode A
223         CSL_SRIO_SetMAUSwappingMode (hSrio, 0);
224         ...
225      @endverbatim
226  * =============================================================================
227  */
228 static inline void CSL_SRIO_SetMAUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
230     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE, mode);
233 /** ============================================================================
234  *   @n@b CSL_SRIO_GetMAUSwappingMode
235  *
236  *   @b Description
237  *   @n This function gets the Little Endian Swapping Mode for the Memory Access
238  *      Unit.
239  *
240  *   @b Arguments
241      @verbatim
242           hSrio     Handle of the SRIO device
243           mode      Little Endian Swapping Mode for the MAU populated by this API
244      @endverbatim
245  *
246  *   <b> Return Value </b>
247  *   @n  None
248  *
249  *   <b> Pre Condition </b>
250  *   @n  CSL_SRIO_Open() must be called 
251  *
252  *   <b> Post Condition </b>
253  *   @n None
254  *
255  *   @b Reads
256  *   @n SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE
257  *
258  *   @b Example
259  *   @verbatim
260         CSL_SrioHandle  hSrio;
261         Uint8           mode;
263         // Open the CSL SRIO Module 0
264         hSrio = CSL_SRIO_Open (0);
266         // Get the Memory Access Unit Swapping Mode.
267         CSL_SRIO_GetMAUSwappingMode (hSrio, &mode);
268         ...
269      @endverbatim
270  * =============================================================================
271  */
272 static inline void CSL_SRIO_GetMAUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
274     *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE);
277 /** ============================================================================
278  *   @n@b CSL_SRIO_SetLSUSwappingMode
279  *
280  *   @b Description
281  *   @n This function sets the Little Endian Swapping Mode for the Load Store 
282  *      Unit
283  *
284  *   @b Arguments
285      @verbatim
286           hSrio     Handle of the SRIO device
287           mode      Little Endian Swapping Mode for the LSU.
288      @endverbatim
289  *
290  *   <b> Return Value </b>
291  *   @n  None
292  *
293  *   <b> Pre Condition </b>
294  *   @n  CSL_SRIO_Open() must be called 
295  *
296  *   <b> Post Condition </b>
297  *   @n None
298  *
299  *   @b Writes
300  *   @n SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE
301  *
302  *   @b Example
303  *   @verbatim
304         CSL_SrioHandle  hSrio;
306         // Open the CSL SRIO Module 0
307         hSrio = CSL_SRIO_Open (0);
309         // Ensure that the LSU operates in mode A
310         CSL_SRIO_SetLSUSwappingMode (hSrio, 0);
311         ...
312      @endverbatim
313  * =============================================================================
314  */
315 static inline void CSL_SRIO_SetLSUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
317     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE, mode);
320 /** ============================================================================
321  *   @n@b CSL_SRIO_GetLSUSwappingMode
322  *
323  *   @b Description
324  *   @n This function gets the Little Endian Swapping Mode for the Load Store 
325  *      Unit.
326  *
327  *   @b Arguments
328      @verbatim
329           hSrio     Handle of the SRIO device
330           mode      Little Endian Swapping Mode for the LSU populated by this API
331      @endverbatim
332  *
333  *   <b> Return Value </b>
334  *   @n  None
335  *
336  *   <b> Pre Condition </b>
337  *   @n  CSL_SRIO_Open() must be called 
338  *
339  *   <b> Post Condition </b>
340  *   @n None
341  *
342  *   @b Reads
343  *   @n SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE
344  *
345  *   @b Example
346  *   @verbatim
347         CSL_SrioHandle  hSrio;
348         Uint8           mode;
350         // Open the CSL SRIO Module 0
351         hSrio = CSL_SRIO_Open (0);
353         // Get the LSU Swapping Mode.
354         CSL_SRIO_GetLSUSwappingMode (hSrio, &mode);
355         ...
356      @endverbatim
357  * =============================================================================
358  */
359 static inline void CSL_SRIO_GetLSUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
361     *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE);
364 /** ============================================================================
365  *   @n@b CSL_SRIO_EnablePromiscuous
366  *
367  *   @b Description
368  *   @n This function enables the LOG_TGT_ID_DIS bit which ensures that the SRIO
369  *      packets are accepted at the logical layer even if there is no match with 
370  *      the destination identifier.
371  *
372  *   @b Arguments
373      @verbatim
374           hSrio     Handle of the SRIO device
375      @endverbatim
376  *
377  *   <b> Return Value </b>
378  *   @n  None
379  *
380  *   <b> Pre Condition </b>
381  *   @n  CSL_SRIO_Open() must be called 
382  *
383  *   <b> Post Condition </b>
384  *   @n None
385  *
386  *   @b Writes
387  *   @n SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS=1
388  *
389  *   @b Example
390  *   @verbatim
391         CSL_SrioHandle  hSrio;
393         // Open the CSL SRIO Module 0
394         hSrio = CSL_SRIO_Open (0);
396         // Operate the peripheral in PROMISCUOUS mode.
397         CSL_SRIO_EnablePromiscuous (hSrio);
398         ...
399      @endverbatim
400  * =============================================================================
401  */
402 static inline void CSL_SRIO_EnablePromiscuous (CSL_SrioHandle hSrio)
404     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS, 1);
407 /** ============================================================================
408  *   @n@b CSL_SRIO_DisablePromiscuous
409  *
410  *   @b Description
411  *   @n This function disables the LOG_TGT_ID_DIS bit which ensures that the SRIO
412  *      packets are accepted at the logical layer only if there is a match with the
413  *      specific destination identifier.
414  *
415  *   @b Arguments
416      @verbatim
417           hSrio     Handle of the SRIO device
418      @endverbatim
419  *
420  *   <b> Return Value </b>
421  *   @n  None
422  *
423  *   <b> Pre Condition </b>
424  *   @n  CSL_SRIO_Open() must be called 
425  *
426  *   <b> Post Condition </b>
427  *   @n None
428  *
429  *   @b Writes
430  *   @n SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS=0
431  *
432  *   @b Example
433  *   @verbatim
434         CSL_SrioHandle  hSrio;
436         // Open the CSL SRIO Module 0
437         hSrio = CSL_SRIO_Open (0);
439         // Operate the peripheral in non-PROMISC mode.
440         CSL_SRIO_DisablePromiscuous (hSrio);
441         ...
442      @endverbatim
443  * =============================================================================
444  */
445 static inline void CSL_SRIO_DisablePromiscuous (CSL_SrioHandle hSrio)
447     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS, 0);
450 /** ============================================================================
451  *   @n@b CSL_SRIO_IsPromiscuous
452  *
453  *   @b Description
454  *   @n This function returns the status of the peripheral as TRUE if the device
455  *      is operating in PROMISCUOUS mode else FALSE.
456  *
457  *   @b Arguments
458      @verbatim
459           hSrio     Handle of the SRIO device
460      @endverbatim
461  *
462  *   <b> Return Value </b>
463  *   @n  TRUE  - Device is in PROMISCUOUS Mode.
464  *   @n  FALSE - Device is in NON-PROMISCUOUS Mode.
465  *
466  *   <b> Pre Condition </b>
467  *   @n  CSL_SRIO_Open() must be called 
468  *
469  *   <b> Post Condition </b>
470  *   @n None
471  *
472  *   @b Reads
473  *   @n SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS
474  *
475  *   @b Example
476  *   @verbatim
477         CSL_SrioHandle  hSrio;
479         // Open the CSL SRIO Module 0
480         hSrio = CSL_SRIO_Open (0);
482         // Check if we are operating in PROMISCUOUS mode or not?
483         if (CSL_SRIO_IsPromiscuous (hSrio) == TRUE)
484         {
485             // Device is in PROMISCUOUS Mode.
486         }
487         else
488         {
489             // Device is in Non-PROMISCUOUS Mode.
490         }
491         ...
492      @endverbatim
493  * =============================================================================
494  */
495 static inline Bool CSL_SRIO_IsPromiscuous (CSL_SrioHandle hSrio)
497     if (CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS) == 1)
498         return TRUE;
499     return FALSE;
502 /** ============================================================================
503  *   @n@b CSL_SRIO_SetAMUSwappingMode
504  *
505  *   @b Description
506  *   @n This function sets the Little Endian Swapping Mode for the AMU
507  *
508  *   @b Arguments
509      @verbatim
510           hSrio     Handle of the SRIO device
511           mode      Little Endian Swapping Mode for the AMU
512      @endverbatim
513  *
514  *   <b> Return Value </b>
515  *   @n  None
516  *
517  *   <b> Pre Condition </b>
518  *   @n  CSL_SRIO_Open() must be called 
519  *
520  *   <b> Post Condition </b>
521  *   @n None
522  *
523  *   @b Writes
524  *   @n SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE
525  *
526  *   @b Example
527  *   @verbatim
528         CSL_SrioHandle  hSrio;
530         // Open the CSL SRIO Module 0
531         hSrio = CSL_SRIO_Open (0);
533         // Ensure that the AMU operates in mode A
534         CSL_SRIO_SetAMUSwappingMode (hSrio, 0);
535         ...
536      @endverbatim
537  * =============================================================================
538  */
539 static inline void CSL_SRIO_SetAMUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
541     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE, mode);
544 /** ============================================================================
545  *   @n@b CSL_SRIO_GetAMUSwappingMode
546  *
547  *   @b Description
548  *   @n This function gets the Little Endian Swapping Mode for the AMU
549  *
550  *   @b Arguments
551      @verbatim
552           hSrio     Handle of the SRIO device
553           mode      Little Endian Swapping Mode for the AMU populated by this API
554      @endverbatim
555  *
556  *   <b> Return Value </b>
557  *   @n  None
558  *
559  *   <b> Pre Condition </b>
560  *   @n  CSL_SRIO_Open() must be called 
561  *
562  *   <b> Post Condition </b>
563  *   @n None
564  *
565  *   @b Reads
566  *   @n SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE
567  *
568  *   @b Example
569  *   @verbatim
570         CSL_SrioHandle  hSrio;
571         Uint8           mode;
573         // Open the CSL SRIO Module 0
574         hSrio = CSL_SRIO_Open (0);
576         // Get the AMU Swapping Mode.
577         CSL_SRIO_GetAMUSwappingMode (hSrio, &mode);
578         ...
579      @endverbatim
580  * =============================================================================
581  */
582 static inline void CSL_SRIO_GetAMUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
584     *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE);
587 /** ============================================================================
588  *   @n@b CSL_SRIO_SetBootComplete
589  *
590  *   @b Description
591  *   @n This function sets the boot complete flag as specified.
592  *
593  *   @b Arguments
594      @verbatim
595           hSrio             Handle of the SRIO device
596           bootCompleteFlag  Boot Complete Flag to be set in the register.
597      @endverbatim
598  *
599  *   <b> Return Value </b>
600  *   @n None
601  *
602  *   <b> Pre Condition </b>
603  *   @n  CSL_SRIO_Open() must be called 
604  *
605  *   <b> Post Condition </b>
606  *   @n None
607  *
608  *   @b Writes
609  *   @n SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE
610  *
611  *   @b Example
612  *   @verbatim
613         CSL_SrioHandle  hSrio;
615         // Open the CSL SRIO Module 0
616         hSrio = CSL_SRIO_Open (0);
618         // Set the Boot Complete Flag to 1 
619         CSL_SRIO_SetBootComplete (hSrio, 1);
620         ...
621      @endverbatim
622  * =============================================================================
623  */
624 static inline void CSL_SRIO_SetBootComplete (CSL_SrioHandle hSrio, Uint8 bootCompleteFlag)
626     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE, bootCompleteFlag);
629 /** ============================================================================
630  *   @n@b CSL_SRIO_GetBootComplete
631  *
632  *   @b Description
633  *   @n This function gets the boot complete flag.
634  *
635  *   @b Arguments
636      @verbatim
637           hSrio             Handle of the SRIO device
638           bootCompleteFlag  Boot Complete Flag populated by this API.
639      @endverbatim
640  *
641  *   <b> Return Value </b>
642  *   @n None
643  *
644  *   <b> Pre Condition </b>
645  *   @n  CSL_SRIO_Open() must be called 
646  *
647  *   <b> Post Condition </b>
648  *   @n None
649  *
650  *   @b Reads
651  *   @n SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE
652  *
653  *   @b Example
654  *   @verbatim
655         CSL_SrioHandle  hSrio;
656         Uint8           bootCompleteFlag;
658         // Open the CSL SRIO Module 0
659         hSrio = CSL_SRIO_Open (0);
661         // Get the Boot Complete Flag
662         bootCompleteFlag = CSL_SRIO_GetBootComplete (hSrio);
663         ...
664      @endverbatim
665  * =============================================================================
666  */
667 static inline void CSL_SRIO_GetBootComplete (CSL_SrioHandle hSrio, Uint8* bootCompleteFlag)
669     *bootCompleteFlag = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE);
672 /** ============================================================================
673  *   @n@b CSL_SRIO_SetTXURXUSwappingMode
674  *
675  *   @b Description
676  *   @n This function sets the Little Endian Swapping Mode for the TXU and RXU
677  *
678  *   @b Arguments
679      @verbatim
680           hSrio     Handle of the SRIO device
681           mode      Little Endian Swapping Mode for the TXU and RXU.
682      @endverbatim
683  *
684  *   <b> Return Value </b>
685  *   @n  None
686  *
687  *   <b> Pre Condition </b>
688  *   @n  CSL_SRIO_Open() must be called 
689  *
690  *   <b> Post Condition </b>
691  *   @n None
692  *
693  *   @b Writes
694  *   @n SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE
695  *
696  *   @b Example
697  *   @verbatim
698         CSL_SrioHandle  hSrio;
700         // Open the CSL SRIO Module 0
701         hSrio = CSL_SRIO_Open (0);
703         // Ensure that the TXU and RXU operates in mode A
704         CSL_SRIO_SetTXURXUSwappingMode (hSrio, 0);
705         ...
706      @endverbatim
707  * =============================================================================
708  */
709 static inline void CSL_SRIO_SetTXURXUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
711     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE, mode);
714 /** ============================================================================
715  *   @n@b CSL_SRIO_GetTXURXUSwappingMode
716  *
717  *   @b Description
718  *   @n This function gets the Little Endian Swapping Mode for the Memory Access
719  *      Unit.
720  *
721  *   @b Arguments
722      @verbatim
723           hSrio     Handle of the SRIO device
724           mode      Little Endian Swapping Mode for the TXU and RXU populated by this API
725      @endverbatim
726  *
727  *   <b> Return Value </b>
728  *   @n  None
729  *
730  *   <b> Pre Condition </b>
731  *   @n  CSL_SRIO_Open() must be called 
732  *
733  *   <b> Post Condition </b>
734  *   @n None
735  *
736  *   @b Reads
737  *   @n SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE
738  *
739  *   @b Example
740  *   @verbatim
741         CSL_SrioHandle  hSrio;
742         Uint8           mode;
744         // Open the CSL SRIO Module 0
745         hSrio = CSL_SRIO_Open (0);
747         // Get the TXU and RXU Swapping Mode.
748         CSL_SRIO_GetTXURXUSwappingMode (hSrio, &mode);
749         ...
750      @endverbatim
751  * =============================================================================
752  */
753 static inline void CSL_SRIO_GetTXURXUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
755     *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE);
758 /** ============================================================================
759  *   @n@b CSL_SRIO_EnableAutomaticPriorityPromotion
760  *
761  *   @b Description
762  *   @n This function enables the automatic promotion of response priority by 
763  *      RXU and MAU.
764  *
765  *   @b Arguments
766      @verbatim
767           hSrio     Handle of the SRIO device
768      @endverbatim
769  *
770  *   <b> Return Value </b>
771  *   @n  None
772  *
773  *   <b> Pre Condition </b>
774  *   @n  CSL_SRIO_Open() must be called 
775  *
776  *   <b> Post Condition </b>
777  *   @n None
778  *
779  *   @b Writes
780  *   @n SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS=0
781  *
782  *   @b Example
783  *   @verbatim
784         CSL_SrioHandle  hSrio;
786         // Open the CSL SRIO Module 0
787         hSrio = CSL_SRIO_Open (0);
789         // Enable Automatic Priority Promotion.
790         CSL_SRIO_EnableAutomaticPriorityPromotion (hSrio);
791         ...
792      @endverbatim
793  * =============================================================================
794  */
795 static inline void CSL_SRIO_EnableAutomaticPriorityPromotion (CSL_SrioHandle hSrio)
797     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS, 0);
800 /** ============================================================================
801  *   @n@b CSL_SRIO_DisableAutomaticPriorityPromotion
802  *
803  *   @b Description
804  *   @n This function disables the automatic promotion of response priority by 
805  *      RXU and MAU.
806  *
807  *   @b Arguments
808      @verbatim
809           hSrio     Handle of the SRIO device
810      @endverbatim
811  *
812  *   <b> Return Value </b>
813  *   @n  None
814  *
815  *   <b> Pre Condition </b>
816  *   @n  CSL_SRIO_Open() must be called 
817  *
818  *   <b> Post Condition </b>
819  *   @n None
820  *
821  *   @b Writes
822  *   @n SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS=1
823  *
824  *   @b Example
825  *   @verbatim
826         CSL_SrioHandle  hSrio;
828         // Open the CSL SRIO Module 0
829         hSrio = CSL_SRIO_Open (0);
831         // Disable Automatic Priority Promotion.
832         CSL_SRIO_DisableAutomaticPriorityPromotion (hSrio);
833         ...
834      @endverbatim
835  * =============================================================================
836  */
837 static inline void CSL_SRIO_DisableAutomaticPriorityPromotion (CSL_SrioHandle hSrio)
839     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS, 1);
842 /** ============================================================================
843  *   @n@b CSL_SRIO_IsAutomaticPriorityPromotionEnabled
844  *
845  *   @b Description
846  *   @n This function check if the automatic promotion of response priority by 
847  *      RXU and MAU is enabled or not?
848  *
849  *   @b Arguments
850      @verbatim
851           hSrio     Handle of the SRIO device
852      @endverbatim
853  *
854  *   <b> Return Value </b>
855  *   @n  TRUE  - Automatic Priority Promotion is enabled
856  *   @n  FALSE - Automatic Priority Promotion is disabled
857  *
858  *   <b> Pre Condition </b>
859  *   @n  CSL_SRIO_Open() must be called 
860  *
861  *   <b> Post Condition </b>
862  *   @n None
863  *
864  *   @b Reads
865  *   @n SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS
866  *
867  *   @b Example
868  *   @verbatim
869         CSL_SrioHandle  hSrio;
871         // Open the CSL SRIO Module 0
872         hSrio = CSL_SRIO_Open (0);
874         // Check if Automatic Priority Promotion.
875         if (CSL_SRIO_IsAutomaticPriorityPromotionEnabled (hSrio) == TRUE)
876         {
877             // Automatic Priority Promotion is enabled.
878         }
879         else
880         {
881             // Automatic Priority Promotion is disabled.
882         }
883         ...
884      @endverbatim
885  * =============================================================================
886  */
887 static inline Bool CSL_SRIO_IsAutomaticPriorityPromotionEnabled (CSL_SrioHandle hSrio)
889     if (CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS) == 0)
890         return TRUE;
891     return FALSE;
894 /** ============================================================================
895  *   @n@b CSL_SRIO_SetTxCreditThreshold
896  *
897  *   @b Description
898  *   @n This function sets the transmit credit threshold for priority packets
899  *
900  *   @b Arguments
901      @verbatim
902           hSrio     Handle of the SRIO device
903           priority  Priority of the Transmit Buffers
904           credit    Credit Threshold for the priority which is to be configured.
905      @endverbatim
906  *
907  *   <b> Return Value </b>
908  *   @n  None
909  *
910  *   <b> Pre Condition </b>
911  *   @n  CSL_SRIO_Open() must be called 
912  *
913  *   <b> Post Condition </b>
914  *   @n None
915  *
916  *   @b Writes
917  *   @n SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM;SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM;
918  *      SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM
919  *
920  *   @b Example
921  *   @verbatim
922         CSL_SrioHandle  hSrio;
924         // Open the CSL SRIO Module 0
925         hSrio = CSL_SRIO_Open (0);
927         // Set the Transmit Credit Threshold as 8 for priority 2
928         CSL_SRIO_SetTxCreditThreshold (hSrio, 2, 8);
929         ...
930      @endverbatim
931  * =============================================================================
932  */
933 static inline void CSL_SRIO_SetTxCreditThreshold (CSL_SrioHandle hSrio,Uint8 priority,Uint8 credit)
935     if (priority == 2)
936     {
937         CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM, credit);
938     }
939     else if (priority == 1)
940     {
941         CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM, credit);
942     }
943     else if (priority == 0)
944     {
945         CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM, credit);
946     }
949 /** ============================================================================
950  *   @n@b CSL_SRIO_GetTxCreditThreshold
951  *
952  *   @b Description
953  *   @n This function gets the transmit credit threshold for priority packets
954  *
955  *   @b Arguments
956      @verbatim
957           hSrio     Handle of the SRIO device
958           priority  Priority of the Transmit Buffers
959           credit    Credit Threshold for the priority which is populated by this API
960      @endverbatim
961  *
962  *   <b> Return Value </b>
963  *   @n  None
964  *
965  *   <b> Pre Condition </b>
966  *   @n  CSL_SRIO_Open() must be called 
967  *
968  *   <b> Post Condition </b>
969  *   @n None
970  *
971  *   @b Reads
972  *   @n SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM;SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM;
973  *      SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM
974  *
975  *   @b Example
976  *   @verbatim
977         CSL_SrioHandle  hSrio;
978         Uint8           credit;
980         // Open the CSL SRIO Module 0
981         hSrio = CSL_SRIO_Open (0);
983         // Get the Transmit Credit Threshold for priority 2
984         CSL_SRIO_GetTxCreditThreshold (hSrio, 2, &credit);
985         ...
986      @endverbatim
987  * =============================================================================
988  */
989 static inline void CSL_SRIO_GetTxCreditThreshold (CSL_SrioHandle hSrio,Uint8 priority,Uint8* credit)
991     if (priority == 2)
992     {
993         *credit = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM);
994     }
995     else if (priority == 1)
996     {
997         *credit = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM);
998     }
999     else if (priority == 0)
1000     {
1001         *credit = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM);
1002     }
1005 /** ============================================================================
1006  *   @n@b CSL_SRIO_SetTransactionPriority
1007  *
1008  *   @b Description
1009  *   @n This function sets the DSP System transaction priority. 0 implies 
1010  *   Highest Priority while 7 implies lowest.
1011  *
1012  *   @b Arguments
1013      @verbatim
1014           hSrio     Handle of the SRIO device
1015           priority  Priority to be configured.
1016      @endverbatim
1017  *
1018  *   <b> Return Value </b>
1019  *   @n  None
1020  *
1021  *   <b> Pre Condition </b>
1022  *   @n  CSL_SRIO_Open() must be called 
1023  *
1024  *   <b> Post Condition </b>
1025  *   @n None
1026  *
1027  *   @b Writes
1028  *   @n SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI
1029  *
1030  *   @b Example
1031  *   @verbatim
1032         CSL_SrioHandle  hSrio;
1034         // Open the CSL SRIO Module 0
1035         hSrio = CSL_SRIO_Open (0);
1037         // Set the transaction priority to be HIGHEST
1038         CSL_SRIO_SetTransactionPriority (hSrio, 0);
1039         ...
1040      @endverbatim
1041  * =============================================================================
1042  */
1043 static inline void CSL_SRIO_SetTransactionPriority (CSL_SrioHandle hSrio,Uint8 priority)
1045     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI, priority);
1048 /** ============================================================================
1049  *   @n@b CSL_SRIO_GetTransactionPriority
1050  *
1051  *   @b Description
1052  *   @n This function gets the DSP System transaction priority. 
1053  *
1054  *   @b Arguments
1055      @verbatim
1056           hSrio     Handle of the SRIO device
1057           priority  Priority to be configured.
1058      @endverbatim
1059  *
1060  *   <b> Return Value </b>
1061  *   @n  None
1062  *
1063  *   <b> Pre Condition </b>
1064  *   @n  CSL_SRIO_Open() must be called 
1065  *
1066  *   <b> Post Condition </b>
1067  *   @n None
1068  *
1069  *   @b Reads
1070  *   @n SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI
1071  *
1072  *   @b Example
1073  *   @verbatim
1074         CSL_SrioHandle  hSrio;
1075         Uint8           priority;
1077         // Open the CSL SRIO Module 0
1078         hSrio = CSL_SRIO_Open (0);
1080         // Get the transaction priority 
1081         CSL_SRIO_GetTransactionPriority (hSrio, &priority);
1082         ...
1083      @endverbatim
1084  * =============================================================================
1085  */
1086 static inline void CSL_SRIO_GetTransactionPriority (CSL_SrioHandle hSrio,Uint8 *priority)
1088     *priority = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI);
1091 /** ============================================================================
1092  *   @n@b CSL_SRIO_SetPrescalarSelect
1093  *
1094  *   @b Description
1095  *   @n This function sets the prescalar select for SRIO
1096  *
1097  *   @b Arguments
1098      @verbatim
1099           hSrio             Handle of the SRIO device
1100           prescalarSelect   Prescalar Select which is to be configured.
1101      @endverbatim
1102  *
1103  *   <b> Return Value </b>
1104  *   @n None
1105  *
1106  *   <b> Pre Condition </b>
1107  *   @n  CSL_SRIO_Open() must be called 
1108  *
1109  *   <b> Post Condition </b>
1110  *   @n None
1111  *
1112  *   @b Writes
1113  *   @n SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT
1114  *
1115  *   @b Example
1116  *   @verbatim
1117         CSL_SrioHandle  hSrio;
1119         // Open the CSL SRIO Module 0
1120         hSrio = CSL_SRIO_Open (0);
1122         // Set the SRIO Prescalar select to operate in the range of 44.7 to 89.5
1123         CSL_SRIO_SetPrescalarSelect (hSrio, 0);
1124         ...
1125      @endverbatim
1126  * =============================================================================
1127  */
1128 static inline void CSL_SRIO_SetPrescalarSelect (CSL_SrioHandle hSrio, Uint8 prescalarSelect)
1130     CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT, prescalarSelect);
1133 /** ============================================================================
1134  *   @n@b CSL_SRIO_GetPrescalarSelect
1135  *
1136  *   @b Description
1137  *   @n This function gets the prescalar select for SRIO
1138  *
1139  *   @b Arguments
1140      @verbatim
1141           hSrio             Handle of the SRIO device
1142           prescalarSelect   Prescalar Select which is to be retrieved.
1143      @endverbatim
1144  *
1145  *   <b> Return Value </b>
1146  *   @n None
1147  *
1148  *   <b> Pre Condition </b>
1149  *   @n  CSL_SRIO_Open() must be called 
1150  *
1151  *   <b> Post Condition </b>
1152  *   @n None
1153  *
1154  *   @b Reads
1155  *   @n SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT
1156  *
1157  *   @b Example
1158  *   @verbatim
1159         CSL_SrioHandle  hSrio;
1160         Uint8           prescalarSelect;
1162         // Open the CSL SRIO Module 0
1163         hSrio = CSL_SRIO_Open (0);
1165         // Get the SRIO Prescalar select.
1166         CSL_SRIO_GetPrescalarSelect (hSrio, &prescalarSelect);
1167         ...
1168      @endverbatim
1169  * =============================================================================
1170  */
1171 static inline void CSL_SRIO_GetPrescalarSelect (CSL_SrioHandle hSrio, Uint8* prescalarSelect)
1173     *prescalarSelect = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT);
1176 /** ============================================================================
1177  *   @n@b CSL_SRIO_SetResponseCRF
1178  *
1179  *   @b Description
1180  *   @n This function sets the CRF value in the response
1181  *
1182  *   @b Arguments
1183      @verbatim
1184           hSrio             Handle of the SRIO device
1185           value             CRF value to be set in the response.
1186      @endverbatim
1187  *
1188  *   <b> Return Value </b>
1189  *   @n None
1190  *
1191  *   <b> Pre Condition </b>
1192  *   @n  CSL_SRIO_Open() must be called 
1193  *
1194  *   <b> Post Condition </b>
1195  *   @n None
1196  *
1197  *   @b Writes
1198  *   @n SRIO_RIO_PER_SET_CNTL1_CRF
1199  *
1200  *   @b Example
1201  *   @verbatim
1202         CSL_SrioHandle  hSrio;
1204         // Open the CSL SRIO Module 0
1205         hSrio = CSL_SRIO_Open (0);
1207         // Set the Response CRF to be always set to 1
1208         CSL_SRIO_SetResponseCRF (hSrio, 1);
1209         ...
1210      @endverbatim
1211  * =============================================================================
1212  */
1213 static inline void CSL_SRIO_SetResponseCRF (CSL_SrioHandle hSrio, Uint8 value)
1215     CSL_FINS(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_CRF, value);
1218 /** ============================================================================
1219  *   @n@b CSL_SRIO_GetResponseCRF
1220  *
1221  *   @b Description
1222  *   @n This function gets the CRF value in the response
1223  *
1224  *   @b Arguments
1225      @verbatim
1226           hSrio             Handle of the SRIO device
1227           value             CRF value populated by this API
1228      @endverbatim
1229  *
1230  *   <b> Return Value </b>
1231  *   @n None
1232  *
1233  *   <b> Pre Condition </b>
1234  *   @n  CSL_SRIO_Open() must be called 
1235  *
1236  *   <b> Post Condition </b>
1237  *   @n None
1238  *
1239  *   @b Reads
1240  *   @n SRIO_RIO_PER_SET_CNTL1_CRF
1241  *
1242  *   @b Example
1243  *   @verbatim
1244         CSL_SrioHandle  hSrio;
1245         Uint8           crfValue;
1247         // Open the CSL SRIO Module 0
1248         hSrio = CSL_SRIO_Open (0);
1250         // Get the Response CRF 
1251         CSL_SRIO_GetResponseCRF (hSrio, &crfValue);
1252         ...
1253      @endverbatim
1254  * =============================================================================
1255  */
1256 static inline void CSL_SRIO_GetResponseCRF (CSL_SrioHandle hSrio, Uint8* value)
1258     *value = CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_CRF);
1261 /** ============================================================================
1262  *   @n@b CSL_SRIO_SetRXUWatermark
1263  *
1264  *   @b Description
1265  *   @n This function sets the RXU Watermark value.
1266  *
1267  *   @b Arguments
1268      @verbatim
1269           hSrio             Handle of the SRIO device
1270           value             0/1 to disable/enable RXU context assignment based on 
1271                             priority.
1272      @endverbatim
1273  *
1274  *   <b> Return Value </b>
1275  *   @n None
1276  *
1277  *   <b> Pre Condition </b>
1278  *   @n  CSL_SRIO_Open() must be called 
1279  *
1280  *   <b> Post Condition </b>
1281  *   @n None
1282  *
1283  *   @b Writes
1284  *   @n SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK
1285  *
1286  *   @b Example
1287  *   @verbatim
1288         CSL_SrioHandle  hSrio;
1290         // Open the CSL SRIO Module 0
1291         hSrio = CSL_SRIO_Open (0);
1293         // Set the RXU Watermark to to 1
1294         CSL_SRIO_SetRXUWatermark (hSrio, 1);
1295         ...
1296      @endverbatim
1297  * =============================================================================
1298  */
1299 static inline void CSL_SRIO_SetRXUWatermark (CSL_SrioHandle hSrio, Uint8 value)
1301     CSL_FINS(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK, value);
1304 /** ============================================================================
1305  *   @n@b CSL_SRIO_GetRXUWatermark
1306  *
1307  *   @b Description
1308  *   @n This function gets the RXU Watermark setting
1309  *
1310  *   @b Arguments
1311      @verbatim
1312           hSrio             Handle of the SRIO device
1313           value             RXU Watermark setting read 
1314      @endverbatim
1315  *
1316  *   <b> Return Value </b>
1317  *   @n None
1318  *
1319  *   <b> Pre Condition </b>
1320  *   @n  CSL_SRIO_Open() must be called 
1321  *
1322  *   <b> Post Condition </b>
1323  *   @n None
1324  *
1325  *   @b Reads
1326  *   @n SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK
1327  *
1328  *   @b Example
1329  *   @verbatim
1330         CSL_SrioHandle  hSrio;
1331         Uint8           value;
1333         // Open the CSL SRIO Module 0
1334         hSrio = CSL_SRIO_Open (0);
1336         // Get the RXU Watermark
1337         CSL_SRIO_GetRXUWatermark (hSrio, &value);
1338         ...
1339      @endverbatim
1340  * =============================================================================
1341  */
1342 static inline void CSL_SRIO_GetRXUWatermark (CSL_SrioHandle hSrio, Uint8* value)
1344     *value = CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK);
1348 /** ============================================================================
1349  *   @n@b CSL_SRIO_SetSysClkSel
1350  *
1351  *   @b Description
1352  *   @n This function sets the SYS_CLK source
1353  *
1354  *   @b Arguments
1355      @verbatim
1356           hSrio             Handle of the SRIO device
1357           value             SYS_CLK source to configure
1358      @endverbatim
1359  *
1360  *   <b> Return Value </b>
1361  *   @n None
1362  *
1363  *   <b> Pre Condition </b>
1364  *   @n  CSL_SRIO_Open() must be called 
1365  *
1366  *   <b> Post Condition </b>
1367  *   @n None
1368  *
1369  *   @b Writes
1370  *   @n SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL
1371  *
1372  *   @b Example
1373  *   @verbatim
1374         CSL_SrioHandle  hSrio;
1376         // Open the CSL SRIO Module 0
1377         hSrio = CSL_SRIO_Open (0);
1379         // Set the SYS_CLK source to 1
1380         CSL_SRIO_SetSysClkSel (hSrio, 1);
1381         ...
1382      @endverbatim
1383  * =============================================================================
1384  */
1385 static inline void CSL_SRIO_SetSysClkSel (CSL_SrioHandle hSrio, Uint8 value)
1387     CSL_FINS(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL, value);
1390 /** ============================================================================
1391  *   @n@b CSL_SRIO_GetSysClkSel
1392  *
1393  *   @b Description
1394  *   @n This function retrieves the SYS_CLK source for the port.
1395  *
1396  *   @b Arguments
1397      @verbatim
1398           hSrio             Handle of the SRIO device
1399           value             SYS_CLK source read
1400      @endverbatim
1401  *
1402  *   <b> Return Value </b>
1403  *   @n None
1404  *
1405  *   <b> Pre Condition </b>
1406  *   @n  CSL_SRIO_Open() must be called 
1407  *
1408  *   <b> Post Condition </b>
1409  *   @n None
1410  *
1411  *   @b Reads
1412  *   @n SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL
1413  *
1414  *   @b Example
1415  *   @verbatim
1416         CSL_SrioHandle  hSrio;
1417         Uint8           value;
1419         // Open the CSL SRIO Module 0
1420         hSrio = CSL_SRIO_Open (0);
1422         // Get the SYS_CLK source
1423         CSL_SRIO_GetSysClkSel (hSrio, &value);
1424         ...
1425      @endverbatim
1426  * =============================================================================
1427  */
1428 static inline void CSL_SRIO_GetSysClkSel (CSL_SrioHandle hSrio, Uint8* value)
1430     *value = CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL);
1433 /** ============================================================================
1434  *   @n@b CSL_SRIO_SetLoopbackMode
1435  *
1436  *   @b Description
1437  *   @n This function sets the port to operate in loopback mode.
1438  *
1439  *   @b Arguments
1440      @verbatim
1441           hSrio             Handle of the SRIO device
1442           portNum           Port Number for which loopback mode must be enabled
1443      @endverbatim
1444  *
1445  *   <b> Return Value </b>
1446  *   @n  None
1447  *
1448  *   <b> Pre Condition </b>
1449  *   @n  CSL_SRIO_Open() must be called 
1450  *
1451  *   <b> Post Condition </b>
1452  *   @n None
1453  *
1454  *   @b Writes
1455  *   @n SRIO_RIO_PER_SET_CNTL1_LOOPBACK
1456  *
1457  *   @b Example
1458  *   @verbatim
1459         CSL_SrioHandle  hSrio;
1461         // Open the CSL SRIO Module 0
1462         hSrio = CSL_SRIO_Open (0);
1464         // Set the Port 0 to work in loopback mode.
1465         CSL_SRIO_SetLoopbackMode (hSrio, 0);
1466         ...
1467      @endverbatim
1468  * =============================================================================
1469  */
1470 static inline void CSL_SRIO_SetLoopbackMode (CSL_SrioHandle hSrio,Uint8 portNum)
1472     CSL_FINSR (hSrio->RIO_PER_SET_CNTL1, 
1473                CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, 
1474                1);
1477 /** ============================================================================
1478  *   @n@b CSL_SRIO_SetNormalMode
1479  *
1480  *   @b Description
1481  *   @n This function sets the port to operate in Normal mode.
1482  *
1483  *   @b Arguments
1484      @verbatim
1485           hSrio             Handle of the SRIO device
1486           portNum           Port Number for which normal mode must be enabled
1487      @endverbatim
1488  *
1489  *   <b> Return Value </b>
1490  *   @n  None
1491  *
1492  *   <b> Pre Condition </b>
1493  *   @n  CSL_SRIO_Open() must be called 
1494  *
1495  *   <b> Post Condition </b>
1496  *   @n None
1497  *
1498  *   @b Writes
1499  *   @n SRIO_RIO_PER_SET_CNTL1_LOOPBACK
1500  *
1501  *   @b Example
1502  *   @verbatim
1503         CSL_SrioHandle  hSrio;
1505         // Open the CSL SRIO Module 0
1506         hSrio = CSL_SRIO_Open (0);
1508         // Set the port 0 to work in normal mode.
1509         CSL_SRIO_SetNormalMode (hSrio, 0);
1510         ...
1511      @endverbatim
1512  * =============================================================================
1513  */
1514 static inline void CSL_SRIO_SetNormalMode (CSL_SrioHandle hSrio,Uint8 portNum)
1516     CSL_FINSR (hSrio->RIO_PER_SET_CNTL1, 
1517                CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, 
1518                0);
1521 /** ============================================================================
1522  *   @n@b CSL_SRIO_IsLoopbackMode
1523  *
1524  *   @b Description
1525  *   @n This function checks if the port specified is operating in loopback 
1526  *      mode or not?
1527  *
1528  *   @b Arguments
1529      @verbatim
1530           hSrio             Handle of the SRIO device
1531           portNum           Port Number for which mode settings must be retrieved
1532      @endverbatim
1533  *
1534  *   <b> Return Value </b>
1535  *   @n  TRUE   -   Port is operating in loopback mode
1536  *   @n  FALSE  -   Port is operating in Normal Mode.
1537  *
1538  *   <b> Pre Condition </b>
1539  *   @n  CSL_SRIO_Open() must be called 
1540  *
1541  *   <b> Post Condition </b>
1542  *   @n None
1543  *
1544  *   @b Reads
1545  *   @n SRIO_RIO_PER_SET_CNTL1_LOOPBACK
1546  *
1547  *   @b Example
1548  *   @verbatim
1549         CSL_SrioHandle  hSrio;
1551         // Open the CSL SRIO Module 0
1552         hSrio = CSL_SRIO_Open (0);
1554         // Set the port 0 to work in normal mode.
1555         if (CSL_SRIO_IsLoopbackMode(hSrio, 0) == TRUE)
1556         {
1557             // Port 0 is operating in loopback mode.
1558         }
1559         else
1560         {
1561             // Port 0 is operating in normal mode.
1562         }
1563         ...
1564      @endverbatim
1565  * =============================================================================
1566  */
1567 static inline Bool CSL_SRIO_IsLoopbackMode (CSL_SrioHandle hSrio,Uint8 portNum)
1569     if (CSL_FEXTR (hSrio->RIO_PER_SET_CNTL1, 
1570                    CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum) == 1)
1571     {
1572         return TRUE;
1573     }
1574     return FALSE;
1577 /** ============================================================================
1578  *   @n@b CSL_SRIO_EnableCOS
1579  *
1580  *   @b Description
1581  *   @n This function enables Class of Service
1582  *
1583  *   @b Arguments
1584      @verbatim
1585           hSrio             Handle of the SRIO device
1586      @endverbatim
1587  *
1588  *   <b> Return Value </b>
1589  *   @n None
1590  *
1591  *   <b> Pre Condition </b>
1592  *   @n  CSL_SRIO_Open() must be called 
1593  *
1594  *   <b> Post Condition </b>
1595  *   @n None
1596  *
1597  *   @b Writes
1598  *   @n SRIO_RIO_PER_SET_CNTL1_COS_EN=1
1599  *
1600  *   @b Example
1601  *   @verbatim
1602         CSL_SrioHandle  hSrio;
1604         // Open the CSL SRIO Module 0
1605         hSrio = CSL_SRIO_Open (0);
1607         // Enable Class of Service
1608         CSL_SRIO_EnableCOS (hSrio);
1609         ...
1610      @endverbatim
1611  * =============================================================================
1612  */
1613 static inline void CSL_SRIO_EnableCOS (CSL_SrioHandle hSrio)
1615     CSL_FINS (hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_COS_EN, 1);
1618 /** ============================================================================
1619  *   @n@b CSL_SRIO_DisableCOS
1620  *
1621  *   @b Description
1622  *   @n This function disables Class of Service for the device.
1623  *
1624  *   @b Arguments
1625      @verbatim
1626           hSrio             Handle of the SRIO device
1627      @endverbatim
1628  *
1629  *   <b> Return Value </b>
1630  *   @n None
1631  *
1632  *   <b> Pre Condition </b>
1633  *   @n  CSL_SRIO_Open() must be called 
1634  *
1635  *   <b> Post Condition </b>
1636  *   @n None
1637  *
1638  *   @b Writes
1639  *   @n SRIO_RIO_PER_SET_CNTL1_COS_EN=0
1640  *
1641  *   @b Example
1642  *   @verbatim
1643         CSL_SrioHandle  hSrio;
1645         // Open the CSL SRIO Module 0
1646         hSrio = CSL_SRIO_Open (0);
1648         // Disable COS.
1649         CSL_SRIO_DisableCOS (hSrio);
1650         ...
1651      @endverbatim
1652  * =============================================================================
1653  */
1654 static inline void CSL_SRIO_DisableCOS (CSL_SrioHandle hSrio)
1656     CSL_FINS (hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_COS_EN, 0);
1659 /** ============================================================================
1660  *   @n@b CSL_SRIO_IsCOSEnabled
1661  *
1662  *   @b Description
1663  *   @n This function checks if COS has been enabled or not for the device?
1664  *
1665  *   @b Arguments
1666      @verbatim
1667           hSrio             Handle of the SRIO device
1668      @endverbatim
1669  *
1670  *   <b> Return Value </b>
1671  *   @n TRUE  - COS is enabled
1672  *   @n FALSE - COS is disabled.
1673  *
1674  *   <b> Pre Condition </b>
1675  *   @n  CSL_SRIO_Open() must be called 
1676  *
1677  *   <b> Post Condition </b>
1678  *   @n None
1679  *
1680  *   @b Reads
1681  *   @n SRIO_RIO_PER_SET_CNTL1_COS_EN
1682  *
1683  *   @b Example
1684  *   @verbatim
1685         CSL_SrioHandle  hSrio;
1687         // Open the CSL SRIO Module 0
1688         hSrio = CSL_SRIO_Open (0);
1690         // Check if COS is enabled
1691         if (CSL_SRIO_IsCOSEnabled (hSrio) == TRUE)
1692         {
1693             // COS is ENABLED
1694         }
1695         else
1696         {
1697             // COS is DISABLED
1698         }
1699         ...
1700      @endverbatim
1701  * =============================================================================
1702  */
1703 static inline Bool CSL_SRIO_IsCOSEnabled (CSL_SrioHandle hSrio)
1705     if (CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_COS_EN) == 1)
1706         return TRUE;
1707     return FALSE;
1710 /** ============================================================================
1711  *   @n@b CSL_SRIO_GlobalEnable
1712  *
1713  *   @b Description
1714  *   @n This function globally enables the SRIO peripheral and all blocks.
1715  *
1716  *   @b Arguments
1717      @verbatim
1718           hSrio             Handle of the SRIO device
1719      @endverbatim
1720  *
1721  *   <b> Return Value </b>
1722  *   @n None
1723  *
1724  *   <b> Pre Condition </b>
1725  *   @n  CSL_SRIO_Open() must be called 
1726  *
1727  *   <b> Post Condition </b>
1728  *   @n None
1729  *
1730  *   @b Writes
1731  *   @n SRIO_RIO_GBL_EN_EN=1
1732  *
1733  *   @b Example
1734  *   @verbatim
1735         CSL_SrioHandle  hSrio;
1737         // Open the CSL SRIO Module 0
1738         hSrio = CSL_SRIO_Open (0);
1740         // Globally Enable the SRIO peripheral.
1741         CSL_SRIO_GlobalEnable (hSrio);
1742         ...
1743      @endverbatim
1744  * =============================================================================
1745  */
1746 static inline void CSL_SRIO_GlobalEnable (CSL_SrioHandle hSrio)
1748     CSL_FINS (hSrio->RIO_GBL_EN, SRIO_RIO_GBL_EN_EN, 1);
1751 /** ============================================================================
1752  *   @n@b CSL_SRIO_GlobalDisable
1753  *
1754  *   @b Description
1755  *   @n This function globally disables the SRIO peripheral and all blocks.
1756  *
1757  *   @b Arguments
1758      @verbatim
1759           hSrio             Handle of the SRIO device
1760      @endverbatim
1761  *
1762  *   <b> Return Value </b>
1763  *   @n None
1764  *
1765  *   <b> Pre Condition </b>
1766  *   @n  CSL_SRIO_Open() must be called 
1767  *
1768  *   <b> Post Condition </b>
1769  *   @n None
1770  *
1771  *   @b Writes
1772  *   @n SRIO_RIO_GBL_EN_EN=0
1773  *
1774  *   @b Example
1775  *   @verbatim
1776         CSL_SrioHandle  hSrio;
1778         // Open the CSL SRIO Module 0
1779         hSrio = CSL_SRIO_Open (0);
1781         // Globally Disable the SRIO peripheral.
1782         CSL_SRIO_GlobalDisable (hSrio);
1783         ...
1784      @endverbatim
1785  * =============================================================================
1786  */
1787 static inline void CSL_SRIO_GlobalDisable (CSL_SrioHandle hSrio)
1789     CSL_FINS (hSrio->RIO_GBL_EN, SRIO_RIO_GBL_EN_EN, 0);
1792 /** ============================================================================
1793  *   @n@b CSL_SRIO_IsSRIOEnabled
1794  *
1795  *   @b Description
1796  *   @n This function checks if the SRIO peripheral has been globally enabled or
1797  *      not?
1798  *
1799  *   @b Arguments
1800      @verbatim
1801           hSrio             Handle of the SRIO device
1802      @endverbatim
1803  *
1804  *   <b> Return Value </b>
1805  *   @n TRUE  - SRIO Peripheral is enabled
1806  *   @n FALSE - SRIO Peripheral is disabled.
1807  *
1808  *   <b> Pre Condition </b>
1809  *   @n  CSL_SRIO_Open() must be called 
1810  *
1811  *   <b> Post Condition </b>
1812  *   @n None
1813  *
1814  *   @b Reads
1815  *   @n SRIO_RIO_GBL_EN_STAT_GBL_EN_STAT
1816  *
1817  *   @b Example
1818  *   @verbatim
1819         CSL_SrioHandle  hSrio;
1821         // Open the CSL SRIO Module 0
1822         hSrio = CSL_SRIO_Open (0);
1824         // Ensure that the SRIO Peripheral is enabled or disabled.
1825         if (CSL_SRIO_IsSRIOEnabled (hSrio) == TRUE)
1826         {
1827             // SRIO Peripheral is ENABLED
1828         }
1829         else
1830         {
1831             // SRIO Peripheral is DISABLED
1832         }
1833         ...
1834      @endverbatim
1835  * =============================================================================
1836  */
1837 static inline Bool CSL_SRIO_IsSRIOEnabled (CSL_SrioHandle hSrio)
1839     if (CSL_FEXT(hSrio->RIO_GBL_EN_STAT, SRIO_RIO_GBL_EN_STAT_GBL_EN_STAT) == 1)
1840         return TRUE;
1841     return FALSE;
1844 /** ============================================================================
1845  *   @n@b CSL_SRIO_EnableBlock
1846  *
1847  *   @b Description
1848  *   @n This function enables the specific block in the SRIO peripheral.
1849  *
1850  *   @b Arguments
1851      @verbatim
1852           hSrio             Handle of the SRIO device
1853           blockNum          Block Number to be enabled.
1854      @endverbatim
1855  *
1856  *   <b> Return Value </b>
1857  *   @n None
1858  *
1859  *   <b> Pre Condition </b>
1860  *   @n  CSL_SRIO_Open() must be called 
1861  *
1862  *   <b> Post Condition </b>
1863  *   @n None
1864  *
1865  *   @b Writes
1866  *   @n SRIO_RIO_BLK_EN_EN=1
1867  *
1868  *   @b Example
1869  *   @verbatim
1870         CSL_SrioHandle  hSrio;
1872         // Open the CSL SRIO Module 0
1873         hSrio = CSL_SRIO_Open (0);
1875         // Enable the SRIO block for LSU .
1876         CSL_SRIO_GlobalEnable (hSrio, 1);
1877         ...
1878      @endverbatim
1879  * =============================================================================
1880  */
1881 static inline void CSL_SRIO_EnableBlock (CSL_SrioHandle hSrio, Uint16 blockNumber)
1883     CSL_FINS (hSrio->BLOCK_ENABLE_STATUS[blockNumber].RIO_BLK_EN, SRIO_RIO_BLK_EN_EN, 1); 
1886 /** ============================================================================
1887  *   @n@b CSL_SRIO_DisableBlock
1888  *
1889  *   @b Description
1890  *   @n This function disables the specific block in the SRIO peripheral.
1891  *
1892  *   @b Arguments
1893      @verbatim
1894           hSrio             Handle of the SRIO device
1895           blockNum          Block Number to be disabled.
1896      @endverbatim
1897  *
1898  *   <b> Return Value </b>
1899  *   @n None
1900  *
1901  *   <b> Pre Condition </b>
1902  *   @n  CSL_SRIO_Open() must be called 
1903  *
1904  *   <b> Post Condition </b>
1905  *   @n None
1906  *
1907  *   @b Writes
1908  *   @n SRIO_RIO_BLK_EN_EN=0
1909  *
1910  *   @b Example
1911  *   @verbatim
1912         CSL_SrioHandle  hSrio;
1914         // Open the CSL SRIO Module 0
1915         hSrio = CSL_SRIO_Open (0);
1917         // Disable the SRIO Block 1 for LSU.
1918         CSL_SRIO_DisableBlock (hSrio, 1);
1919         ...
1920      @endverbatim
1921  * =============================================================================
1922  */
1923 static inline void CSL_SRIO_DisableBlock (CSL_SrioHandle hSrio, Uint16 blockNumber)
1925     CSL_FINS (hSrio->BLOCK_ENABLE_STATUS[blockNumber].RIO_BLK_EN, SRIO_RIO_BLK_EN_EN, 0); 
1928 /** ============================================================================
1929  *   @n@b CSL_SRIO_IsSRIOBlockEnabled
1930  *
1931  *   @b Description
1932  *   @n This function checks if the SRIO block is enabled or disabled?
1933  *
1934  *   @b Arguments
1935      @verbatim
1936           hSrio             Handle of the SRIO device
1937           blockNumber       SRIO Block Number to be checked.
1938      @endverbatim
1939  *
1940  *   <b> Return Value </b>
1941  *   @n TRUE  - SRIO Block is enabled
1942  *   @n FALSE - SRIO Block is disabled.
1943  *
1944  *   <b> Pre Condition </b>
1945  *   @n  CSL_SRIO_Open() must be called 
1946  *
1947  *   <b> Post Condition </b>
1948  *   @n None
1949  *
1950  *   @b Reads
1951  *   @n SRIO_RIO_BLK_EN_STAT_EN_STATUS
1952  *
1953  *   @b Example
1954  *   @verbatim
1955         CSL_SrioHandle  hSrio;
1957         // Open the CSL SRIO Module 0
1958         hSrio = CSL_SRIO_Open (0);
1960         // Ensure that the SRIO Block 1 for LSU is enabled or not? 
1961         if (CSL_SRIO_IsSRIOBlockEnabled (hSrio, 1) == TRUE)
1962         {
1963             // SRIO Block 1 for LSU is ENABLED
1964         }
1965         else
1966         {
1967             // SRIO Block 1 for LSU is DISABLED
1968         }
1969         ...
1970      @endverbatim
1971  * =============================================================================
1972  */
1973 static inline Bool CSL_SRIO_IsSRIOBlockEnabled (CSL_SrioHandle hSrio, Uint16 blockNumber)
1975     return (Bool)CSL_FEXT(hSrio->BLOCK_ENABLE_STATUS[blockNumber].RIO_BLK_EN_STAT,
1976                           SRIO_RIO_BLK_EN_STAT_EN_STATUS);
1979 /** ============================================================================
1980  *   @n@b CSL_SRIO_SetDeviceID
1981  *
1982  *   @b Description
1983  *   @n This function sets the DEVICE ID Register. There are multiple device
1984  *      ID registers which can exist in the system. The index parameter is used
1985  *      to indicate which register is to be configured.
1986  *
1987  *   @b Arguments
1988      @verbatim
1989           hSrio             Handle of the SRIO device
1990           index             Index of the Device ID register to be configured (0-Based)
1991           NodeId8bit        8 Bit Device Identifier to be configured
1992           NodeId16bit       16 Bit Device Identifier to be configured.
1993      @endverbatim
1994  *
1995  *   <b> Return Value </b>
1996  *   @n None
1997  *
1998  *   <b> Pre Condition </b>
1999  *   @n  CSL_SRIO_Open() must be called 
2000  *
2001  *   <b> Post Condition </b>
2002  *   @n None
2003  *
2004  *   @b Writes
2005  *   @n SRIO_RIO_MULTIID_REG_8B_NODEID,SRIO_RIO_MULTIID_REG_16B_NODEID 
2006  *
2007  *   @b Example
2008  *   @verbatim
2009         CSL_SrioHandle  hSrio;
2011         // Open the CSL SRIO Module 0
2012         hSrio = CSL_SRIO_Open (0);
2014         // Configure the First Device ID register with a 16 bit identifer as 0xDEAD
2015         // and no 8 bit identifier.
2016         CSL_SRIO_SetDeviceID (hSrio, 0, 0x0, 0xDEAD);
2017         ...
2018      @endverbatim
2019  * =============================================================================
2020  */
2021 static inline void CSL_SRIO_SetDeviceID 
2023     CSL_SrioHandle  hSrio, 
2024     Uint8           index,
2025     Uint8           NodeId8bit,
2026     Uint16          NodeId16bit
2029     /* Set the 8bit and 16bit device identifiers. */
2030     hSrio->RIO_MULTIID_REG[index] = 
2031                 CSL_FMK(SRIO_RIO_MULTIID_REG_8B_NODEID,  NodeId8bit) | 
2032                 CSL_FMK(SRIO_RIO_MULTIID_REG_16B_NODEID, NodeId16bit);
2036 /** ============================================================================
2037  *   @n@b CSL_SRIO_GetDeviceID
2038  *
2039  *   @b Description
2040  *   @n This function gets the DEVICE ID Register. There are multiple device
2041  *      ID registers which can exist in the system. The index parameter is used
2042  *      to indicate which register is to be retreived.
2043  *
2044  *   @b Arguments
2045      @verbatim
2046           hSrio             Handle of the SRIO device
2047           index             Index of the Device ID register to be configured (0-Based)
2048           NodeId8bit        8 Bit Device Identifier to be populated by this API
2049           NodeId16bit       16 Bit Device Identifier to be populated by this API
2050      @endverbatim
2051  *
2052  *   <b> Return Value </b>
2053  *   @n None
2054  *
2055  *   <b> Pre Condition </b>
2056  *   @n  CSL_SRIO_Open() must be called 
2057  *
2058  *   <b> Post Condition </b>
2059  *   @n None
2060  *
2061  *   @b Reads
2062  *   @n SRIO_RIO_MULTIID_REG_8B_NODEID,SRIO_RIO_MULTIID_REG_16B_NODEID
2063  *
2064  *   @b Example
2065  *   @verbatim
2066         CSL_SrioHandle  hSrio;
2067         Uint8           NodeId8bit;
2068         Uint16          NodeId16bit;
2070         // Open the CSL SRIO Module 0
2071         hSrio = CSL_SRIO_Open (0);
2073         // Get the Device ID register contents 
2074         CSL_SRIO_GetDeviceID (hSrio, 0, &NodeId8bit, &NodeId16bit);
2075         ...
2076      @endverbatim
2077  * =============================================================================
2078  */
2079 static inline void CSL_SRIO_GetDeviceID 
2081     CSL_SrioHandle  hSrio, 
2082     Uint8           index,
2083     Uint8*          NodeId8bit,
2084     Uint16*         NodeId16bit
2087     Uint32 value;
2089     /* Get the value from the register */
2090     value = hSrio->RIO_MULTIID_REG[index];
2092     /* Populate the 8bit and 16bit device identifiers. */
2093     *NodeId8bit  = CSL_FEXT(value, SRIO_RIO_MULTIID_REG_8B_NODEID);
2094     *NodeId16bit = CSL_FEXT(value, SRIO_RIO_MULTIID_REG_16B_NODEID);
2095     return;
2098 /** ============================================================================
2099  *   @n@b CSL_SRIO_SetPacketForwarding
2100  *
2101  *   @b Description
2102  *   @n The function sets the packet forwarding for the SRIO peripheral. There
2103  *   exist multiple packet forwarding registers and the parameter index is to used
2104  *   to select which register is to be configured.
2105  *
2106  *   @b Arguments
2107      @verbatim
2108           hSrio             Handle of the SRIO device
2109           index             Index of the Packet forwarding register to be configured (0-Based)
2110           low16bitDeviceID  Lower bound 16bit Device Identifier which can use this
2111           up16bitDeviceID   Upper bound 16bit Device Identifier which can use this
2112           low8bitDeviceID   Lower bound 8bit Device Identifier which can use this
2113           up8bitDeviceID    Upper bound 8bit Device Identifier which can use this
2114           outPort           Outgoing SRIO port to be used.
2115      @endverbatim
2116  *
2117  *   <b> Return Value </b>
2118  *   @n None
2119  *
2120  *   <b> Pre Condition </b>
2121  *   @n  CSL_SRIO_Open() must be called 
2122  *
2123  *   <b> Post Condition </b>
2124  *   @n None
2125  *
2126  *   @b Writes
2127  *   @n SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP, SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO,
2128  *      SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO,SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP,
2129  *      SRIO_RIO_PF_8B_CNTL_OUT_PORT
2130  *
2131  *   @b Example
2132  *   @verbatim
2133         CSL_SrioHandle  hSrio;
2135         // Open the CSL SRIO Module 0
2136         hSrio = CSL_SRIO_Open (0);
2138         // Create a packet forwarding entry for device ID 0xBEEF to be forwarded
2139         // to port 1; we dont care about the 8-bit identifiers hence these are 
2140         // set to reset values.
2141         CSL_SRIO_SetPacketForwarding (hSrio, 0, 0xBEEF, 0xBEEF, 0xFF, 0xFF, 1);
2142         ...
2143      @endverbatim
2144  * =============================================================================
2145  */
2146 static inline void CSL_SRIO_SetPacketForwarding 
2148     CSL_SrioHandle  hSrio, 
2149     Uint8           index,
2150     Uint16          low16bitDeviceID,
2151     Uint16          up16bitDeviceID,
2152     Uint8           low8bitDeviceID,
2153     Uint8           up8bitDeviceID,
2154     Uint8           outPort
2157     hSrio->PF_CNTL[index].RIO_PF_16B_CNTL = 
2158             CSL_FMK(SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP, up16bitDeviceID) |
2159             CSL_FMK(SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO, low16bitDeviceID);
2161     hSrio->PF_CNTL[index].RIO_PF_8B_CNTL = 
2162             CSL_FMK(SRIO_RIO_PF_8B_CNTL_OUT_PORT,    outPort)           |
2163             CSL_FMK(SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP, up8bitDeviceID)    |
2164             CSL_FMK(SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO, low8bitDeviceID);
2167 /** ============================================================================
2168  *   @n@b CSL_SRIO_GetPacketForwarding
2169  *
2170  *   @b Description
2171  *   @n The function gets the packet forwarding for the SRIO peripheral. There
2172  *   exist multiple packet forwarding registers and the parameter index is to used
2173  *   to select which register is to be retreived.
2174  *
2175  *   @b Arguments
2176      @verbatim
2177           hSrio             Handle of the SRIO device
2178           index             Index of the Packet forwarding register to be configured (0-Based)
2179           low16bitDeviceID  Lower bound 16bit Device Identifier populated by this API
2180           up16bitDeviceID   Upper bound 16bit Device Identifier populated by this API
2181           low8bitDeviceID   Lower bound 8bit Device Identifier populated by this API
2182           up8bitDeviceID    Upper bound 8bit Device Identifier populated by this API
2183           outPort           Outgoing SRIO port populated by this API
2184      @endverbatim
2185  *
2186  *   <b> Return Value </b>
2187  *   @n None
2188  *
2189  *   <b> Pre Condition </b>
2190  *   @n  CSL_SRIO_Open() must be called 
2191  *
2192  *   <b> Post Condition </b>
2193  *   @n None
2194  *
2195  *   @b Reads
2196  *   @n SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO, SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP, 
2197  *      SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO,SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP,
2198  *      SRIO_RIO_PF_8B_CNTL_OUT_PORT
2199  *
2200  *   @b Example
2201  *   @verbatim
2202         CSL_SrioHandle  hSrio;
2203         Uint16          low16bitDeviceID;
2204         Uint16          up16bitDeviceID;
2205         Uint8           low8bitDeviceID;
2206         Uint8           up8bitDeviceID;
2207         Uint8           outPort;
2209         // Open the CSL SRIO Module 0
2210         hSrio = CSL_SRIO_Open (0);
2212         // Get the packet forwarding entry 0.
2213         CSL_SRIO_GetPacketForwarding (hSrio, 0, &low16bitDeviceID, &up16bitDeviceID, 
2214                                       &low8bitDeviceID, &up8bitDeviceID, &outPort);
2215         ...
2216      @endverbatim
2217  * =============================================================================
2218  */
2219 static inline void CSL_SRIO_GetPacketForwarding 
2221     CSL_SrioHandle  hSrio, 
2222     Uint8           index,
2223     Uint16*         low16bitDeviceID,
2224     Uint16*         up16bitDeviceID,
2225     Uint8*          low8bitDeviceID,
2226     Uint8*          up8bitDeviceID,
2227     Uint8*          outPort
2230     Uint32 value = hSrio->PF_CNTL[index].RIO_PF_16B_CNTL;
2231     *up16bitDeviceID  = CSL_FEXT(value, SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP);
2232     *low16bitDeviceID = CSL_FEXT(value, SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO);
2234     value = hSrio->PF_CNTL[index].RIO_PF_8B_CNTL;
2235     *outPort         = CSL_FEXT(value, SRIO_RIO_PF_8B_CNTL_OUT_PORT);
2236     *up8bitDeviceID  = CSL_FEXT(value, SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP);
2237     *low8bitDeviceID = CSL_FEXT(value, SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO);
2240 /** ============================================================================
2241  *   @n@b CSL_SRIO_GetDoorbellPendingInterrupt
2242  *
2243  *   @b Description
2244  *   @n The function reads the DOORBELL status register to determine if there
2245  *      are any pending door bell interrupts or not?
2246  *
2247  *   @b Arguments
2248      @verbatim
2249           hSrio             Handle of the SRIO device
2250           port              SRIO Port (Zero Based) for which the doorbell status is required.
2251           doorbellStatus    Door Bell Status populated by this API
2252      @endverbatim
2253  *
2254  *   <b> Return Value </b>
2255  *   @n None
2256  *
2257  *   <b> Pre Condition </b>
2258  *   @n  CSL_SRIO_Open() must be called 
2259  *
2260  *   <b> Post Condition </b>
2261  *   @n None
2262  *
2263  *   @b Reads
2264  *   @n SRIO_RIO_DOORBELL_ICSR_RIO_DOORBELL
2265  *
2266  *   @b Example
2267  *   @verbatim
2268         CSL_SrioHandle  hSrio;
2269         Uint16          doorbellStatus;
2271         // Open the CSL SRIO Module 0
2272         hSrio = CSL_SRIO_Open (0);
2274         // Get the status of doorbell interrupts for port 0
2275         CSL_SRIO_GetDoorbellPendingInterrupt (hSrio, 0, &doorbellStatus);
2276         if (doorbellStatus != 0)
2277         {
2278             // Door bell Interrupts were pending and need to be serviced.
2279         }
2280         else
2281         {
2282             // There are no door bell interrupts pending.
2283         }
2284         ...
2285      @endverbatim
2286  * =============================================================================
2287  */
2288 static inline void CSL_SRIO_GetDoorbellPendingInterrupt
2290     CSL_SrioHandle  hSrio, 
2291     Uint8           port,
2292     Uint16*         doorbellStatus
2295     *doorbellStatus = CSL_FEXT(hSrio->DOORBELL_ICSR_ICCR[port].RIO_DOORBELL_ICSR,
2296                                SRIO_RIO_DOORBELL_ICSR_RIO_DOORBELL);
2299 /** ============================================================================
2300  *   @n@b CSL_SRIO_ClearDoorbellPendingInterrupt
2301  *
2302  *   @b Description
2303  *   @n The function clears a specific door bell interrupt in the specified door
2304  *   bell interrupt register.
2305  *
2306  *   @b Arguments
2307      @verbatim
2308           hSrio             Handle of the SRIO device
2309           port              SRIO Port (Zero Based) for which the doorbell status is required.
2310           doorbellInterrupt Door Bell Interrupt to be cleared.
2311      @endverbatim
2312  *
2313  *   <b> Return Value </b>
2314  *   @n None
2315  *
2316  *   <b> Pre Condition </b>
2317  *   @n  CSL_SRIO_Open() must be called 
2318  *
2319  *   <b> Post Condition </b>
2320  *   @n None
2321  *
2322  *   @b Writes
2323  *   @n SRIO_RIO_DOORBELL_ICCR
2324  *
2325  *   @b Affects
2326  *   @n SRIO_RIO_DOORBELL_ICSR_RIO_DOORBELL=0
2327  *
2328  *   @b Example
2329  *   @verbatim
2330         CSL_SrioHandle  hSrio;
2331         Uint16          doorbellStatus;
2333         // Open the CSL SRIO Module 0
2334         hSrio = CSL_SRIO_Open (0);
2336         // Get the status of doorbell interrupts for port 0
2337         CSL_SRIO_GetDoorbellPendingInterrupt (hSrio, 0, &doorbellStatus);
2338         if (doorbellStatus != 0)
2339         {
2340             // Door bell Interrupts were pending and need to be serviced.
2341             ...
2342             // Clear the Door Bell Pending Interrupts.
2343             CSL_SRIO_ClearDoorbellPendingInterrupt (hSrio, 0, doorbellStatus);
2344         }
2345         else
2346         {
2347             // There are no door bell interrupts pending.
2348         }        
2349         ...
2350      @endverbatim
2351  * =============================================================================
2352  */
2353 static inline void CSL_SRIO_ClearDoorbellPendingInterrupt 
2355     CSL_SrioHandle  hSrio, 
2356     Uint8           port,
2357     Uint16          doorbellInterrupt
2360     /* Clear all the specified doorbell interrupts. */ 
2361     hSrio->DOORBELL_ICSR_ICCR[port].RIO_DOORBELL_ICCR = doorbellInterrupt;
2364 /** ============================================================================
2365  *   @n@b CSL_SRIO_GetLSUPendingInterrupt
2366  *
2367  *   @b Description
2368  *   @n The function returns the LSU pending interrupt status.
2369  *
2370  *   @b Arguments
2371      @verbatim
2372           hSrio             Handle of the SRIO device          
2373           lsuStatus1        LSU Pending Status populated by this API
2374           lsuStatus2        LSU Pending Status populated by this API
2375      @endverbatim
2376  *
2377  *   <b> Return Value </b>
2378  *   @n None
2379  *
2380  *   <b> Pre Condition </b>
2381  *   @n  CSL_SRIO_Open() must be called 
2382  *
2383  *   <b> Post Condition </b>
2384  *   @n None
2385  *
2386  *   @b Reads
2387  *   @n SRIO_RIO_LSU_ICSR
2388  *
2389  *   @b Example
2390  *   @verbatim
2391         CSL_SrioHandle  hSrio;
2392         Uint32          lsuStatus1;
2393         Uint32          lsuStatus2;
2395         // Open the CSL SRIO Module 0
2396         hSrio = CSL_SRIO_Open (0);
2398         // Check the LSU Pending Interrupt Status.
2399         CSL_SRIO_GetLSUPendingInterrupt (hSrio, &lsuStatus1, &lsuStatus2);
2400         ...
2401      @endverbatim
2402  * =============================================================================
2403  */
2404 static inline void CSL_SRIO_GetLSUPendingInterrupt
2406     CSL_SrioHandle  hSrio, 
2407     Uint32*         lsuStatus1,
2408     Uint32*         lsuStatus2
2411     *lsuStatus1 = hSrio->LSU_ICSR_ICCR[0].RIO_LSU_ICSR;
2412     *lsuStatus2 = hSrio->LSU_ICSR_ICCR[1].RIO_LSU_ICSR;
2415 /** ============================================================================
2416  *   @n@b CSL_SRIO_ClearLSUPendingInterrupt
2417  *
2418  *   @b Description
2419  *   @n The function clears the LSU pending interrupt 
2420  *
2421  *   @b Arguments
2422      @verbatim
2423           hSrio             Handle of the SRIO device          
2424           lsuInterrupt1     LSU Interrupt to be cleared.
2425           lsuInterrupt2     LSU Interrupt to be cleared.
2426      @endverbatim
2427  *
2428  *   <b> Return Value </b>
2429  *   @n None
2430  *
2431  *   <b> Pre Condition </b>
2432  *   @n  CSL_SRIO_Open() must be called 
2433  *
2434  *   <b> Post Condition </b>
2435  *   @n None
2436  *
2437  *   @b Writes
2438  *   @n SRIO_RIO_LSU_ICCR
2439  *
2440  *   @b Example
2441  *   @verbatim
2442         CSL_SrioHandle  hSrio;
2443         Uint32          lsuStatus1;
2444         Uint32          lsuStatus2;
2446         // Open the CSL SRIO Module 0
2447         hSrio = CSL_SRIO_Open (0);
2449         // Check the LSU Pending Interrupt Status.
2450         CSL_SRIO_GetLSUPendingInterrupt (hSrio, &lsuStatus1, &lsuStatus2);
2451         ...
2452         // Clear the pending interrupts.
2453         CSL_SRIO_ClearLSUPendingInterrupt (hSrio, lsuStatus1, lsuStatus);
2455      @endverbatim
2456  * =============================================================================
2457  */
2458 static inline void CSL_SRIO_ClearLSUPendingInterrupt
2460     CSL_SrioHandle  hSrio, 
2461     Uint32          lsuInterrupt1,
2462     Uint32          lsuInterrupt2
2465     hSrio->LSU_ICSR_ICCR[0].RIO_LSU_ICCR = lsuInterrupt1;
2466     hSrio->LSU_ICSR_ICCR[1].RIO_LSU_ICCR = lsuInterrupt2;
2469 /** ============================================================================
2470  *   @n@b CSL_SRIO_ClearLSU0PendingInterrupt
2471  *
2472  *   @b Description
2473  *   @n The function clears the LSU0 pending interrupt 
2474  *
2475  *   @b Arguments
2476      @verbatim
2477           hSrio             Handle of the SRIO device          
2478           lsuInterrupt      LSU Interrupt to be cleared.
2479      @endverbatim
2480  *
2481  *   <b> Return Value </b>
2482  *   @n None
2483  *
2484  *   <b> Pre Condition </b>
2485  *   @n  CSL_SRIO_Open() must be called 
2486  *
2487  *   <b> Post Condition </b>
2488  *   @n None
2489  *
2490  *   @b Writes
2491  *   @n SRIO_RIO_LSU_ICCR
2492  *
2493  *   @b Example
2494  *   @verbatim
2495         CSL_SrioHandle  hSrio;
2497         // Open the CSL SRIO Module 0
2498         hSrio = CSL_SRIO_Open (0);
2499         ...
2500         // Clear the ICS0 indicating that the SRCID0 Transaction was successfully complete.
2501         CSL_SRIO_ClearLSU0PendingInterrupt (hSrio, 0x1);
2503      @endverbatim
2504  * =============================================================================
2505  */
2506 static inline void CSL_SRIO_ClearLSU0PendingInterrupt
2508     CSL_SrioHandle  hSrio, 
2509     Uint32          lsuInterrupt
2512     hSrio->LSU_ICSR_ICCR[0].RIO_LSU_ICCR = lsuInterrupt;
2515 /** ============================================================================
2516  *   @n@b CSL_SRIO_GetErrorPendingInterrupt
2517  *
2518  *   @b Description
2519  *   @n The function returns the interrupt status of any error interrupts 
2520  *      which are pending.
2521  *
2522  *   @b Arguments
2523      @verbatim
2524           hSrio             Handle of the SRIO device          
2525           errStatus         Error Pending Status populated by this API
2526      @endverbatim
2527  *
2528  *   <b> Return Value </b>
2529  *   @n None
2530  *
2531  *   <b> Pre Condition </b>
2532  *   @n  CSL_SRIO_Open() must be called 
2533  *
2534  *   <b> Post Condition </b>
2535  *   @n None
2536  *
2537  *   @b Reads
2538  *   @n SRIO_RIO_ERR_RST_EVNT_ICSR_MCAST_INT_RECEIVED,
2539  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT_WRITE_IN_RECEIVED,
2540  *      SRIO_RIO_ERR_RST_EVNT_ICSR_LLERR_CAPTURE,
2541  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT0_ERR,
2542  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT1_ERR,
2543  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT2_ERR,
2544  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT3_ERR,
2545  *      SRIO_RIO_ERR_RST_EVNT_ICSR_DEVICE_RST_INT
2546  *
2547  *   @b Example
2548  *   @verbatim
2549         CSL_SrioHandle  hSrio;
2550         Uint32          errStatus;
2552         // Open the CSL SRIO Module 0
2553         hSrio = CSL_SRIO_Open (0);
2555         // Get any pending errors 
2556         CSL_SRIO_GetErrorPendingInterrupt (hSrio, &errStatus);
2557         ...
2558      @endverbatim
2559  * =============================================================================
2560  */
2561 static inline void CSL_SRIO_GetErrorPendingInterrupt
2563     CSL_SrioHandle  hSrio, 
2564     Uint32*         errStatus
2567     /* All the errors are present in the lower order 17 bits. */
2568     *errStatus = CSL_FEXTR(hSrio->RIO_ERR_RST_EVNT_ICSR, 16, 0);
2571 /** ============================================================================
2572  *   @n@b CSL_SRIO_ClearErrorPendingInterrupt
2573  *
2574  *   @b Description
2575  *   @n The function clears the pending error interrupts
2576  *
2577  *   @b Arguments
2578      @verbatim
2579           hSrio             Handle of the SRIO device          
2580           errStatus         Error Status to be cleared.
2581      @endverbatim
2582  *
2583  *   <b> Return Value </b>
2584  *   @n None
2585  *
2586  *   <b> Pre Condition </b>
2587  *   @n  CSL_SRIO_Open() must be called 
2588  *
2589  *   <b> Post Condition </b>
2590  *   @n None
2591  *
2592  *   @b Writes
2593  *   @n SRIO_RIO_ERR_RST_EVNT_ICCR_MCAST_INT_RECEIVED,
2594  *      SRIO_RIO_ERR_RST_EVNT_ICCR_PORT_WRITE_IN_REQUEST_RECEIVED,
2595  *      SRIO_RIO_ERR_RST_EVNT_ICCR_LOGICAL_LAYER_ERROR_MANAGEMENT_EVENT_CAPTURE,
2596  *      SRIO_RIO_ERR_RST_EVNT_ICCR_PORT0_ERROR,
2597  *      SRIO_RIO_ERR_RST_EVNT_ICCR_PORT1_ERROR,
2598  *      SRIO_RIO_ERR_RST_EVNT_ICCR_PORT2_ERROR,
2599  *      SRIO_RIO_ERR_RST_EVNT_ICCR_PORT3_ERROR,
2600  *      SRIO_RIO_ERR_RST_EVNT_ICCR_DEVICE_RST_INT
2601  *
2602  *   @b Affects
2603  *   @n SRIO_RIO_ERR_RST_EVNT_ICSR_MCAST_INT_RECEIVED=0,
2604  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT_WRITE_IN_RECEIVED=0,
2605  *      SRIO_RIO_ERR_RST_EVNT_ICSR_LLERR_CAPTURE=0,
2606  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT0_ERR=0,
2607  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT1_ERR=0,
2608  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT2_ERR=0,
2609  *      SRIO_RIO_ERR_RST_EVNT_ICSR_PORT3_ERR=0,
2610  *      SRIO_RIO_ERR_RST_EVNT_ICSR_DEVICE_RST_INT=0
2611  *
2612  *   @b Example
2613  *   @verbatim
2614         CSL_SrioHandle  hSrio;
2615         Uint32          errStatus;
2617         // Open the CSL SRIO Module 0
2618         hSrio = CSL_SRIO_Open (0);
2620         // Get any pending error status.
2621         CSL_SRIO_GetErrorPendingInterrupt (hSrio,&errStatus);
2622         if (errStatus != 0)
2623         {
2624             // Pending error interrupts detected.
2625             ...
2626             // Clear the pending interrupts.
2627             CSL_SRIO_ClearErrorPendingInterrupt (hSrio, errStatus);
2628         }
2629         else
2630         {
2631             // No pending error status
2632         }
2633         ...
2634      @endverbatim
2635  * =============================================================================
2636  */
2637 static inline void CSL_SRIO_ClearErrorPendingInterrupt
2639     CSL_SrioHandle  hSrio, 
2640     Uint32          errStatus
2643     CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICCR, 16, 0, errStatus);
2646 /** ============================================================================
2647  *   @n@b CSL_SRIO_GetAMUPendingInterrupt
2648  *
2649  *   @b Description
2650  *   @n The function returns the interrupt status of any AMU interrupts.
2651  *
2652  *   @b Arguments
2653      @verbatim
2654           hSrio             Handle of the SRIO device          
2655           amuIntrStatus     AMU Interrupt Pending Status populated by this API
2656      @endverbatim
2657  *
2658  *   <b> Return Value </b>
2659  *   @n None
2660  *
2661  *   <b> Pre Condition </b>
2662  *   @n  CSL_SRIO_Open() must be called 
2663  *
2664  *   <b> Post Condition </b>
2665  *   @n None
2666  *
2667  *   @b Reads
2668  *   @n SRIO_RIO_AMU_ICSR_CPRIVID
2669  *
2670  *   @b Example
2671  *   @verbatim
2672         CSL_SrioHandle  hSrio;
2673         Uint16          amuIntrStatus;
2675         // Open the CSL SRIO Module 0
2676         hSrio = CSL_SRIO_Open (0);
2678         // Get the pending AMU interrupt status
2679         CSL_SRIO_GetAMUPendingInterrupt (hSrio, &amuIntrStatus);
2680         ...
2681      @endverbatim
2682  * =============================================================================
2683  */
2684 static inline void CSL_SRIO_GetAMUPendingInterrupt
2686     CSL_SrioHandle  hSrio, 
2687     Uint16*         amuIntrStatus
2690     *amuIntrStatus = CSL_FEXT(hSrio->RIO_AMU_ICSR, SRIO_RIO_AMU_ICSR_CPRIVID);
2693 /** ============================================================================
2694  *   @n@b CSL_SRIO_ClearAMUPendingInterrupt
2695  *
2696  *   @b Description
2697  *   @n The function clears the AMU pending interrupts.
2698  *
2699  *   @b Arguments
2700      @verbatim
2701           hSrio             Handle of the SRIO device          
2702           amuIntrStatus     AMU pending interrupt status to be cleared.
2703      @endverbatim
2704  *
2705  *   <b> Return Value </b>
2706  *   @n None
2707  *
2708  *   <b> Pre Condition </b>
2709  *   @n  CSL_SRIO_Open() must be called 
2710  *
2711  *   <b> Post Condition </b>
2712  *   @n None
2713  *
2714  *   @b Writes
2715  *   @n SRIO_RIO_AMU_ICCR_CPRIVID
2716  *
2717  *   @b Affects
2718  *   @n SRIO_RIO_AMU_ICSR_CPRIVID=0
2719  *
2720  *   @b Example
2721  *   @verbatim
2722         CSL_SrioHandle  hSrio;
2723         Uint16          amuIntrStatus;
2725         // Open the CSL SRIO Module 0
2726         hSrio = CSL_SRIO_Open (0);
2728         // Get the pending AMU interrupt status
2729         CSL_SRIO_GetAMUPendingInterrupt (hSrio, &amuIntrStatus);
2730         if (amuIntrStatus != 0)
2731         {
2732             // Pending AMU interrupts detected.
2733             ...
2734             // Clear the pending interrupts.
2735             CSL_SRIO_ClearAMUPendingInterrupt (hSrio, amuIntrStatus);
2736         }
2737         else
2738         {
2739             // No AMU interrupts were pending.
2740         }
2741         ...
2742      @endverbatim
2743  * =============================================================================
2744  */
2745 static inline void CSL_SRIO_ClearAMUPendingInterrupt
2747     CSL_SrioHandle  hSrio, 
2748     Uint16          amuIntrStatus
2751     CSL_FINS(hSrio->RIO_AMU_ICCR, SRIO_RIO_AMU_ICCR_CPRIVID, amuIntrStatus);
2754 /** ============================================================================
2755  *   @n@b CSL_SRIO_RouteDoorbellInterrupts
2756  *
2757  *   @b Description
2758  *   @n The function routes the doorbell interrupts for the specified doorbell
2759  *      register to a specific destination.
2760  *
2761  *   @b Arguments
2762      @verbatim
2763           hSrio             Handle of the SRIO device
2764           regNum            Doorbell Register Number
2765           doorBellBit       Doorbell bit which is to be routed
2766           destination       Destination to which the interrupt bit is routed.
2767      @endverbatim
2768  *
2769  *   <b> Return Value </b>
2770  *   @n None
2771  *
2772  *   <b> Pre Condition </b>
2773  *   @n  CSL_SRIO_Open() must be called 
2774  *
2775  *   <b> Post Condition </b>
2776  *   @n None
2777  *
2778  *   @b Writes
2779  *   @n SRIO_RIO_DOORBELL_ICRR1_ICR0,SRIO_RIO_DOORBELL_ICRR1_ICR1,
2780  *      SRIO_RIO_DOORBELL_ICRR1_ICR2,SRIO_RIO_DOORBELL_ICRR1_ICR3,
2781  *      SRIO_RIO_DOORBELL_ICRR1_ICR4,SRIO_RIO_DOORBELL_ICRR1_ICR5,
2782  *      SRIO_RIO_DOORBELL_ICRR1_ICR6,SRIO_RIO_DOORBELL_ICRR1_ICR7;
2783  *   @n SRIO_RIO_DOORBELL_ICRR2_ICR8,SRIO_RIO_DOORBELL_ICRR2_ICR9,
2784  *      SRIO_RIO_DOORBELL_ICRR2_ICR10,SRIO_RIO_DOORBELL_ICRR2_ICR11,
2785  *      SRIO_RIO_DOORBELL_ICRR2_ICR12,SRIO_RIO_DOORBELL_ICRR2_ICR13,
2786  *      SRIO_RIO_DOORBELL_ICRR2_ICR14,SRIO_RIO_DOORBELL_ICRR2_ICR15
2787  *
2788  *   @b Example
2789  *   @verbatim
2790         CSL_SrioHandle  hSrio;
2792         // Open the CSL SRIO Module 0
2793         hSrio = CSL_SRIO_Open (0);
2795         // Route the Doorbell bits 1 for Doorbell 2 to destination 2
2796         CSL_SRIO_RouteDoorbellInterrupts (hSrio, 2, 1, 2);
2797         ...
2798      @endverbatim
2799  * =============================================================================
2800  */
2801 static inline void CSL_SRIO_RouteDoorbellInterrupts
2803     CSL_SrioHandle  hSrio, 
2804     Uint8           regNum,
2805     Uint8           doorBellBit,
2806     Uint8           destination
2809     if (doorBellBit < 8)
2810     {
2811         /* This handles interrupts requests between 0 and 7 */
2812         CSL_FINSR (hSrio->DOORBELL_ICRR[regNum].RIO_DOORBELL_ICRR1, 
2813                    ((doorBellBit << 2) + 3), (doorBellBit << 2), destination);
2814     }
2815     else
2816     {
2817         /* This handles interrupts requests between 8 and 15 */
2818         doorBellBit = doorBellBit - 8;
2819         CSL_FINSR (hSrio->DOORBELL_ICRR[regNum].RIO_DOORBELL_ICRR2, 
2820                    ((doorBellBit << 2) + 3), (doorBellBit << 2), destination);
2821     }
2824 /** ============================================================================
2825  *   @n@b CSL_SRIO_RouteLSUInterrupts
2826  *
2827  *   @b Description
2828  *   @n The function routes the LSU interrupts to a specific destination.
2829  *
2830  *   @b Arguments
2831      @verbatim
2832           hSrio             Handle of the SRIO device
2833           lsuIntrReq        LSU Interrupt request which is to be routed
2834           destination       Destination to which the interrupt bit is routed.
2835      @endverbatim
2836  *
2837  *   <b> Return Value </b>
2838  *   @n None
2839  *
2840  *   <b> Pre Condition </b>
2841  *   @n  CSL_SRIO_Open() must be called 
2842  *
2843  *   <b> Post Condition </b>
2844  *   @n None
2845  *
2846  *   @b Writes
2847  *   @n SRIO_LSU_ICRR
2848  *
2849  *   @b Example
2850  *   @verbatim
2851         CSL_SrioHandle  hSrio;
2853         // Open the CSL SRIO Module 0
2854         hSrio = CSL_SRIO_Open (0);
2856         // Route the LSU Interrupts 1 to destination 6
2857         CSL_SRIO_RouteLSUInterrupts (hSrio, 1, 6);
2858         ...
2859      @endverbatim
2860  * =============================================================================
2861  */
2862 static inline void CSL_SRIO_RouteLSUInterrupts
2864     CSL_SrioHandle  hSrio, 
2865     Uint8           lsuIntrReq,
2866     Uint8           destination
2869     if (lsuIntrReq < 8)
2870     {
2871         /* This handles interrupts requests between 0 and 7 */
2872         CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[0], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
2873     }
2874     else if (lsuIntrReq < 16)
2875     {
2876         /* This handles interrupts requests between 8 and 15 */
2877         lsuIntrReq = lsuIntrReq - 8;
2878         CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[1], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
2879     }
2880     else if (lsuIntrReq < 24)
2881     {
2882         /* This handles interrupts requests between 16 and 23 */
2883         lsuIntrReq = lsuIntrReq - 16;
2884         CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[2], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
2885     }
2886     else
2887     {
2888         /* This handles interrupts requests between 24 and 31 */
2889         lsuIntrReq = lsuIntrReq - 24;
2890         CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[3], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
2891     }
2894 /** ============================================================================
2895  *   @n@b CSL_SRIO_RouteErrorInterrupts
2896  *
2897  *   @b Description
2898  *   @n The function routes the error interrupts to a specific destination.
2899  *
2900  *   @b Arguments
2901      @verbatim
2902           hSrio             Handle of the SRIO device
2903           errIntrReq        Error Interrupt request which is to be routed
2904           destination       Destination to which the interrupt bit is routed.
2905      @endverbatim
2906  *
2907  *   <b> Return Value </b>
2908  *   @n None
2909  *
2910  *   <b> Pre Condition </b>
2911  *   @n  CSL_SRIO_Open() must be called 
2912  *
2913  *   <b> Post Condition </b>
2914  *   @n None
2915  *
2916  *   @b Writes
2917  *   @n SRIO_RIO_ERR_RST_EVNT_ICRR_ICR0;SRIO_RIO_ERR_RST_EVNT_ICRR_ICR1;
2918  *      SRIO_RIO_ERR_RST_EVNT_ICRR_ICR2;
2919  *   @n SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR8;SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR9;
2920  *      SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR10;SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR11;
2921  *   @n SRIO_RIO_ERR_RST_EVNT_ICRR3_ICR16
2922  *
2923  *
2924  *   @b Example
2925  *   @verbatim
2926         CSL_SrioHandle  hSrio;
2928         // Open the CSL SRIO Module 0
2929         hSrio = CSL_SRIO_Open (0);
2931         // Route the Error Interrupts 1 to destination 6
2932         CSL_SRIO_RouteErrorInterrupts (hSrio, 1, 6);
2933         ...
2934      @endverbatim
2935  * =============================================================================
2936  */
2937 static inline void CSL_SRIO_RouteErrorInterrupts
2939     CSL_SrioHandle  hSrio, 
2940     Uint8           errIntrReq,
2941     Uint8           destination
2944     if (errIntrReq < 3)
2945     {
2946         /* This handles interrupts requests between 0 and 2 */
2947         CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICRR, ((errIntrReq << 2) + 3), (errIntrReq << 2), destination);
2948     }
2949     else if (errIntrReq < 12)
2950     {
2951         /* This handles interrupts requests between 8 and 15; note that 3 to 7 are not used. */
2952         errIntrReq = errIntrReq - 8;
2953         CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICRR2, ((errIntrReq << 2) + 3), (errIntrReq << 2), destination);
2954     }
2955     else
2956     {
2957         /* This handles interrupts request 16; all else is reserved.*/
2958         errIntrReq = errIntrReq - 16;
2959         CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICRR3, ((errIntrReq << 2) + 3), (errIntrReq << 2), destination);
2960     }
2963 /** ============================================================================
2964  *   @n@b CSL_SRIO_RouteAMUInterrupts
2965  *
2966  *   @b Description
2967  *   @n The function routes the AMU interrupts to a specific destination.
2968  *
2969  *   @b Arguments
2970      @verbatim
2971           hSrio             Handle of the SRIO device
2972           amuIntr           AMU Interrupt request which is to be routed
2973           destination       Destination to which the interrupt bit is routed.
2974      @endverbatim
2975  *
2976  *   <b> Return Value </b>
2977  *   @n None
2978  *
2979  *   <b> Pre Condition </b>
2980  *   @n  CSL_SRIO_Open() must be called 
2981  *
2982  *   <b> Post Condition </b>
2983  *   @n None
2984  *
2985  *   @b Writes
2986  *   @n SRIO_RIO_AMU_ICRR1_ICR0;SRIO_RIO_AMU_ICRR1_ICR1;SRIO_RIO_AMU_ICRR1_ICR2;
2987  *      SRIO_RIO_AMU_ICRR1_ICR3;SRIO_RIO_AMU_ICRR1_ICR4;SRIO_RIO_AMU_ICRR1_ICR5;
2988  *      SRIO_RIO_AMU_ICRR1_ICR6;SRIO_RIO_AMU_ICRR1_ICR7;
2989  *      SRIO_RIO_AMU_ICRR2_ICR8;SRIO_RIO_AMU_ICRR2_ICR9;SRIO_RIO_AMU_ICRR2_ICR10;
2990  *      SRIO_RIO_AMU_ICRR2_ICR11;SRIO_RIO_AMU_ICRR2_ICR12;SRIO_RIO_AMU_ICRR2_ICR13;
2991  *      SRIO_RIO_AMU_ICRR2_ICR14;SRIO_RIO_AMU_ICRR2_ICR15
2992  *
2993  *   @b Example
2994  *   @verbatim
2995         CSL_SrioHandle  hSrio;
2997         // Open the CSL SRIO Module 0
2998         hSrio = CSL_SRIO_Open (0);
3000         // Route the AMU Interrupts 1 to destination 6
3001         CSL_SRIO_RouteAMUInterrupts (hSrio, 1, 6);
3002         ...
3003      @endverbatim
3004  * =============================================================================
3005  */
3006 static inline void CSL_SRIO_RouteAMUInterrupts
3008     CSL_SrioHandle  hSrio, 
3009     Uint8           amuIntr,
3010     Uint8           destination
3013     if (amuIntr < 8)
3014     {
3015         /* This handles AMU interrupts requests between 0 and 7 */
3016         CSL_FINSR(hSrio->RIO_AMU_ICRR1, ((amuIntr << 2) + 3), (amuIntr << 2), destination);
3017     }
3018     else
3019     {
3020         /* This handles AMU interrupts requests between 8 and 15.*/
3021         amuIntr = amuIntr - 8;
3022         CSL_FINSR(hSrio->RIO_AMU_ICRR2, ((amuIntr << 2) + 3), (amuIntr << 2), destination);
3023     }
3026 /** ============================================================================
3027  *   @n@b CSL_SRIO_GetDoorbellRoute
3028  *
3029  *   @b Description
3030  *   @n The function gets the doorbell routing information.
3031  *
3032  *   @b Arguments
3033      @verbatim
3034           hSrio             Handle of the SRIO device
3035           route             Routing Information populated by this API
3036      @endverbatim
3037  *
3038  *   <b> Return Value </b>
3039  *   @n None
3040  *
3041  *   <b> Pre Condition </b>
3042  *   @n  CSL_SRIO_Open() must be called 
3043  *
3044  *   <b> Post Condition </b>
3045  *   @n None
3046  *
3047  *   @b Reads
3048  *   @n SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE
3049  *
3050  *   @b Example
3051  *   @verbatim
3052         CSL_SrioHandle  hSrio;
3053         Uint8           routeInfo;
3055         // Open the CSL SRIO Module 0
3056         hSrio = CSL_SRIO_Open (0);
3058         // Get the Doorbell routing information
3059         CSL_SRIO_GetDoorbellRoute (hSrio, &routeInfo);
3060         ...
3061      @endverbatim
3062  * =============================================================================
3063  */
3064 static inline void CSL_SRIO_GetDoorbellRoute
3066     CSL_SrioHandle  hSrio, 
3067     Uint8*          routeInfo
3070     *routeInfo = CSL_FEXT(hSrio->RIO_INTERRUPT_CTL, SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE);
3073 /** ============================================================================
3074  *   @n@b CSL_SRIO_SetDoorbellRoute
3075  *
3076  *   @b Description
3077  *   @n The function sets the doorbell routing information.
3078  *
3079  *   @b Arguments
3080      @verbatim
3081           hSrio             Handle of the SRIO device
3082           route             Routing Information to be configured
3083      @endverbatim
3084  *
3085  *   <b> Return Value </b>
3086  *   @n None
3087  *
3088  *   <b> Pre Condition </b>
3089  *   @n  CSL_SRIO_Open() must be called 
3090  *
3091  *   <b> Post Condition </b>
3092  *   @n None
3093  *
3094  *   @b Reads
3095  *   @n SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE
3096  *
3097  *   @b Example
3098  *   @verbatim
3099         CSL_SrioHandle  hSrio;
3100         Uint8           routeInfo;
3102         // Open the CSL SRIO Module 0
3103         hSrio = CSL_SRIO_Open (0);
3105         // Set the Doorbell routing information to use dedicated interrupts.
3106         CSL_SRIO_SetDoorbellRoute (hSrio, 0);
3107         ...
3108      @endverbatim
3109  * =============================================================================
3110  */
3111 static inline void CSL_SRIO_SetDoorbellRoute
3113     CSL_SrioHandle  hSrio, 
3114     Uint8           routeInfo
3117     hSrio->RIO_INTERRUPT_CTL = CSL_FMK(SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE, routeInfo);
3120 /** ============================================================================
3121  *   @n@b CSL_SRIO_GetInterruptStatusDecode
3122  *
3123  *   @b Description
3124  *   @n The function gets the interrupt status for a specified interrupt 
3125  *      destination
3126  *
3127  *   @b Arguments
3128      @verbatim
3129           hSrio             Handle of the SRIO device
3130           intrDst           Interrupt Destination for which the status is required.
3131           status            Decode Status populated by this API
3132      @endverbatim
3133  *
3134  *   <b> Return Value </b>
3135  *   @n None
3136  *
3137  *   <b> Pre Condition </b>
3138  *   @n  CSL_SRIO_Open() must be called 
3139  *
3140  *   <b> Post Condition </b>
3141  *   @n None
3142  *
3143  *   @b Reads
3144  *   @n SRIO_RIO_INTDST_DECODE
3145  *
3146  *   @b Example
3147  *   @verbatim
3148         CSL_SrioHandle  hSrio;
3149         Uint32          status;
3151         // Open the CSL SRIO Module 0
3152         hSrio = CSL_SRIO_Open (0);
3154         // Get the Interrupt Status for destination 0
3155         CSL_SRIO_GetInterruptStatusDecode (hSrio, 0, &status);
3156         ...
3157      @endverbatim
3158  * =============================================================================
3159  */
3160 static inline void CSL_SRIO_GetInterruptStatusDecode
3162     CSL_SrioHandle  hSrio, 
3163     Uint8           intrDst,
3164     Uint32*         status
3167     *status = hSrio->RIO_INTDST_DECODE[intrDst];
3170 /** ============================================================================
3171  *   @n@b CSL_SRIO_EnableInterruptPacing
3172  *
3173  *   @b Description
3174  *   @n The function enables interrupt pacing for the specific destination.
3175  *
3176  *   @b Arguments
3177      @verbatim
3178           hSrio             Handle of the SRIO device
3179           destination       Destination Address for which interrupt pacing is enabled.
3180      @endverbatim
3181  *
3182  *   <b> Return Value </b>
3183  *   @n None
3184  *
3185  *   <b> Pre Condition </b>
3186  *   @n  CSL_SRIO_Open() must be called 
3187  *
3188  *   <b> Post Condition </b>
3189  *   @n None
3190  *
3191  *   @b Writes
3192  *   @n SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;
3193  *   SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_IO_INTDST_RATE_DIS_RATEN_DIS=0;
3194  *   SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;
3195  *   SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;
3196  *
3197  *   @b Example
3198  *   @verbatim
3199         CSL_SrioHandle  hSrio;
3200         Uint32          rate;
3202         // Open the CSL SRIO Module 0
3203         hSrio = CSL_SRIO_Open (0);
3205         // Enable Interrupt Pacing for Destination 4.
3206         CSL_SRIO_EnableInterruptPacing (hSrio, 4);
3207         ...
3208      @endverbatim
3209  * =============================================================================
3210  */
3211 static inline void CSL_SRIO_EnableInterruptPacing
3213     CSL_SrioHandle  hSrio, 
3214     Uint8           destination
3217     CSL_FINSR(hSrio->RIO_INTDST_RATE_DIS, destination, destination, 0);
3220 /** ============================================================================
3221  *   @n@b CSL_SRIO_DisableInterruptPacing
3222  *
3223  *   @b Description
3224  *   @n The function disables interrupt pacing for the specific destination.
3225  *
3226  *   @b Arguments
3227      @verbatim
3228           hSrio             Handle of the SRIO device
3229           destination       Destination Address for which interrupt pacing is disabled.
3230      @endverbatim
3231  *
3232  *   <b> Return Value </b>
3233  *   @n None
3234  *
3235  *   <b> Pre Condition </b>
3236  *   @n  CSL_SRIO_Open() must be called 
3237  *
3238  *   <b> Post Condition </b>
3239  *   @n None
3240  *
3241  *   @b Writes
3242  *   @n SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;
3243  *   SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;
3244  *   SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;
3245  *   SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1
3246  *   @b Example
3247  *   @verbatim
3248         CSL_SrioHandle  hSrio;
3249         Uint32          rate;
3251         // Open the CSL SRIO Module 0
3252         hSrio = CSL_SRIO_Open (0);
3254         // Disable Interrupt Pacing for Destination 5.
3255         CSL_SRIO_DisableInterruptPacing (hSrio, 5);
3256         ...
3257      @endverbatim
3258  * =============================================================================
3259  */
3260 static inline void CSL_SRIO_DisableInterruptPacing
3262     CSL_SrioHandle  hSrio, 
3263     Uint8           destination
3266     CSL_FINSR(hSrio->RIO_INTDST_RATE_DIS, destination, destination, 1);
3269 /** ============================================================================
3270  *   @n@b CSL_SRIO_SetInterruptRate
3271  *
3272  *   @b Description
3273  *   @n The function sets the rate for each interrupt destination.
3274  *
3275  *   @b Arguments
3276      @verbatim
3277           hSrio             Handle of the SRIO device
3278           destination       Destination Address for which the status is read.
3279           rate              Interrupt Rate to be configured.
3280      @endverbatim
3281  *
3282  *   <b> Return Value </b>
3283  *   @n None
3284  *
3285  *   <b> Pre Condition </b>
3286  *   @n  CSL_SRIO_Open() must be called 
3287  *
3288  *   <b> Post Condition </b>
3289  *   @n None
3290  *
3291  *   @b Writes
3292  *   @n SRIO_RIO_INTDST_RATE_CNT_COUNT_DOWN_VALUE
3293  *
3294  *   @b Example
3295  *   @verbatim
3296         CSL_SrioHandle  hSrio;
3298         // Open the CSL SRIO Module 0
3299         hSrio = CSL_SRIO_Open (0);
3301         // Enable Interrupt Pacing for Destination 2.
3302         CSL_SRIO_EnableInterruptPacing (hSrio, 2);
3303         
3304         // Set the slowest Interrupt Rate for destination 2.
3305         CSL_SRIO_SetInterruptRate (hSrio, 2, 0xFFFFFFFF);
3306         ...
3307      @endverbatim
3308  * =============================================================================
3309  */
3310 static inline void CSL_SRIO_SetInterruptPacing
3312     CSL_SrioHandle  hSrio, 
3313     Uint8           destination,
3314     Uint32          rate
3317     hSrio->RIO_INTDST_RATE_CNT[destination] = rate; 
3320 /** ============================================================================
3321  *   @n@b CSL_SRIO_GetInterruptPacing
3322  *
3323  *   @b Description
3324  *   @n The function gets the rate for each interrupt destination.
3325  *
3326  *   @b Arguments
3327      @verbatim
3328           hSrio             Handle of the SRIO device
3329           destination       Destination Address for which the status is read.
3330           rate              Interrupt Rate to be configured.
3331      @endverbatim
3332  *
3333  *   <b> Return Value </b>
3334  *   @n None
3335  *
3336  *   <b> Pre Condition </b>
3337  *   @n  CSL_SRIO_Open() must be called 
3338  *
3339  *   <b> Post Condition </b>
3340  *   @n None
3341  *
3342  *   @b Reads
3343  *   @n SRIO_RIO_INTDST_RATE_CNT_COUNT_DOWN_VALUE
3344  *
3345  *   @b Example
3346  *   @verbatim
3347         CSL_SrioHandle  hSrio;
3348         Uint32          rate;
3350         // Open the CSL SRIO Module 0
3351         hSrio = CSL_SRIO_Open (0);
3353         // Enable Interrupt Pacing for Destination 4.
3354         CSL_SRIO_EnableInterruptPacing (hSrio, 4);
3355         ...
3356         // Get the Interrupt rate for destination 4
3357         CSL_SRIO_GetInterruptRate (hSrio, 4, &rate);
3358         ...
3359      @endverbatim
3360  * =============================================================================
3361  */
3362 static inline void CSL_SRIO_GetInterruptRate
3364     CSL_SrioHandle  hSrio, 
3365     Uint8           destination,
3366     Uint32*         rate
3369     *rate = hSrio->RIO_INTDST_RATE_CNT[destination];
3372 /** ============================================================================
3373  *   @n@b CSL_SRIO_SetType11PSInfo
3374  *
3375  *   @b Description
3376  *   @n The function creates the type11 protocol specific information.
3377  *
3378  *   @b Arguments
3379      @verbatim
3380         psInfo      - 8 bytes of PS information populated by this API
3381         dstID       - Destination Identifier.
3382         srcId       - Source Identifier.
3383         mbox        - Mail Box
3384         ltr         - Letter 
3385         tt          - Identifies if 8 bit or 16 bit identifiers are to be used.
3386         ssize       - Standard Message Payload Size
3387         retryCount  - Total Number of retries allowed for this message.
3388      @endverbatim
3389  *
3390  *   <b> Return Value </b>
3391  *   @n None
3392  *
3393  *   <b> Pre Condition </b>
3394  *   @n None
3395  *
3396  *   <b> Post Condition </b>
3397  *   @n None
3398  *
3399  *   @b Example
3400  *   @verbatim
3401         CSL_SrioHandle  hSrio;
3402         Uint32          psInfo[2];
3404         // Open the CSL SRIO Module 0
3405         hSrio = CSL_SRIO_Open (0);
3406        
3407         // Create the Protocol Specific Information.
3408         CSL_SRIO_SetType11PSInfo(psInfo, 0xDEAD, 0xBEED, 0x1, 0x2, 0x1, 0xe, 0x0);
3410         // Set the PS Information into the Buffer Descriptor.
3411         ...
3412      @endverbatim
3413  * =============================================================================
3414  */
3415 static inline void CSL_SRIO_SetType11PSInfo
3417     Uint32  psInfo[2],
3418     Uint16  dstId,
3419     Uint16  srcId,
3420     Uint8   mbox,
3421     Uint8   letter,
3422     Uint8   tt,
3423     Uint8   ssize,
3424     Uint8   retryCount
3427     psInfo[0] = CSL_FMKR(31, 16, srcId) |
3428                 CSL_FMKR(15, 0,  dstId);
3430     psInfo[1] = CSL_FMKR(5,  0,  mbox)      |
3431                 CSL_FMKR(8,  6,  letter)    |
3432                 CSL_FMKR(10, 9,  tt)        |
3433                 CSL_FMKR(20, 17, ssize)     |
3434                 CSL_FMKR(26, 21, retryCount);
3437 /** ============================================================================
3438  *   @n@b CSL_SRIO_ExtractType11PSInfo
3439  *
3440  *   @b Description
3441  *   @n The function extracts the type11 fields from the Protocol Specific 
3442  *      information.
3443  *
3444  *   @b Arguments
3445      @verbatim
3446         psInfo      - 8 bytes of PS information from the descriptor
3447         dstID       - Destination Identifier populated by the API
3448         srcId       - Source Identifier populated by the API
3449         mbox        - Mail Box populated by the API
3450         ltr         - Letter populated by the API
3451         tt          - Identifies if 8 bit or 16 bit identifiers are being used.
3452         pri         - Message Priority populated by the API
3453         cc          - Completion Code populated by the API
3454      @endverbatim
3455  *
3456  *   <b> Return Value </b>
3457  *   @n None
3458  *
3459  *   <b> Pre Condition </b>
3460  *   @n None
3461  *
3462  *   <b> Post Condition </b>
3463  *   @n None
3464  *
3465  *   @b Example
3466  *   @verbatim
3467         CSL_SrioHandle  hSrio;
3468         Uint32          psInfo[2];
3469         Uint16          dstId;
3470         Uint16          srcId;
3471         Uint8           mbox;
3472         Uint8           letter;
3473         Uint8           tt;
3474         Uint8           pri;
3475         Uint8           cc;
3477         // Open the CSL SRIO Module 0
3478         hSrio = CSL_SRIO_Open (0);
3480         // Get the PS Information from the buffer descriptor.
3481         ...
3483         // Populate the Type11 fields from the PS Information.
3484         CSL_SRIO_ExtractType11PSInfo(psInfo, &dstId, &srcId, &mbox, &letter, &tt, &pri, &cc);
3485         ...
3486      @endverbatim
3487  * =============================================================================
3488  */
3489 static inline void CSL_SRIO_ExtractType11PSInfo
3491     Uint32  psInfo[2],
3492     Uint16* dstId,
3493     Uint16* srcId,
3494     Uint8*  mbox,
3495     Uint8*  letter,
3496     Uint8*  tt,
3497     Uint8*  pri,
3498     Uint8*  cc
3501     *srcId    = CSL_FEXTR(psInfo[0], 31, 16);
3502     *dstId    = CSL_FEXTR(psInfo[0], 15, 0);
3503     *mbox     = CSL_FEXTR(psInfo[1], 5,  0);
3504     *letter   = CSL_FEXTR(psInfo[1], 8,  6);
3505     *tt       = CSL_FEXTR(psInfo[1], 10, 9);
3506     *pri      = CSL_FEXTR(psInfo[1], 14, 11);
3507     *cc       = CSL_FEXTR(psInfo[1], 16, 15);
3510 /** ============================================================================
3511  *   @n@b CSL_SRIO_MapMessageToQueue
3512  *
3513  *   @b Description
3514  *   @n The function maps a specific RIO message to the specific queue
3515  *
3516  *   @b Arguments
3517      @verbatim
3518           hSrio             Handle of the SRIO device
3519           index             Index of the MAP register 
3520           message           Message Information which is compared with incoming
3521                             packet.
3522           queueId           Destination Queue to which the message is sent
3523      @endverbatim
3524  *
3525  *   <b> Return Value </b>
3526  *   @n None
3527  *
3528  *   <b> Pre Condition </b>
3529  *   @n  CSL_SRIO_Open() must be called 
3530  *
3531  *   <b> Post Condition </b>
3532  *   @n None
3533  *
3534  *   @b Writes
3535  *   @n SRIO_RIO_RXU_MAP_L_SRCID,SRIO_RIO_RXU_MAP_L_MBX,SRIO_RIO_RXU_MAP_L_LTR
3536  *      SRIO_RIO_RXU_MAP_L_MBX_MASK,SRIO_RIO_RXU_MAP_L_LTR_MASK,
3537  *   @n SRIO_RIO_RXU_MAP_H_SEG_MAP,SRIO_RIO_RXU_MAP_H_SRC_PROM,SRIO_RIO_RXU_MAP_H_TT,
3538  *      SRIO_RIO_RXU_MAP_H_DEST_PROM,SRIO_RIO_RXU_MAP_H_DEST_ID,
3539  *   @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
3540  *
3541  *   @b Example
3542  *   @verbatim
3543         CSL_SrioHandle  hSrio;
3544         SRIO_MESSAGE    message;
3546         // Open the CSL SRIO Module 0
3547         hSrio = CSL_SRIO_Open (0);
3548         
3549         message.srcID   = 0xBEEF;
3550         message.mbx     = 0;
3551         message.ltr     = 0;
3552         message.mbxMask = 0;
3553         message.ltrMask = 0;
3554         message.segMap  = 0;     // Single Segment 
3555         message.srcProm = 1;     // Full Access to the Queue for any Source ID
3556         message.tt      = 1;     // Match 16bits for Source ID.
3557         message.dstProm = 0;     // Access to the Queue for the specified Destination ID
3558         message.dstId   = 0xDEAD;// The destination ID which indicates us.
3559         message.flowId  = 0x0;
3560                
3561         // Map the above message to Queue 4. This is the first mapping which is being done
3562         CSL_SRIO_MapMessageToQueue (hSrio, 0, &message, 4);
3563         ...
3564      @endverbatim
3565  * =============================================================================
3566  */
3567 static inline void CSL_SRIO_MapMessageToQueue
3569     CSL_SrioHandle  hSrio, 
3570     Uint8           index,
3571     SRIO_MESSAGE*   ptrMessage,
3572     Uint16          queueId
3575     /* Initialize the RXU MAPL register. */
3576     hSrio->RXU_MAP[index].RIO_RXU_MAP_L = 
3577             CSL_FMK(SRIO_RIO_RXU_MAP_L_SRCID, ptrMessage->srcId)            |
3578             CSL_FMK(SRIO_RIO_RXU_MAP_L_MBX,   ptrMessage->mbx)              |
3579             CSL_FMK(SRIO_RIO_RXU_MAP_L_LTR,   ptrMessage->ltr)              |
3580             CSL_FMK(SRIO_RIO_RXU_MAP_L_MBX_MASK, ptrMessage->mbxMask)       |
3581             CSL_FMK(SRIO_RIO_RXU_MAP_L_LTR_MASK, ptrMessage->ltrMask);
3583     /* Initialize the RXU MAPH register. */
3584     hSrio->RXU_MAP[index].RIO_RXU_MAP_H =  
3585             CSL_FMK(SRIO_RIO_RXU_MAP_H_SEG_MAP, ptrMessage->segMap)  |
3586             CSL_FMK(SRIO_RIO_RXU_MAP_H_SRC_PROM, ptrMessage->srcProm)       |
3587             CSL_FMK(SRIO_RIO_RXU_MAP_H_TT, ptrMessage->tt)                  |
3588             CSL_FMK(SRIO_RIO_RXU_MAP_H_DEST_PROM, ptrMessage->dstProm)      |
3589             CSL_FMK(SRIO_RIO_RXU_MAP_H_DEST_ID, ptrMessage->dstId);
3591     /* Initialize the RXU QID register. */
3592     hSrio->RXU_MAP[index].RIO_RXU_MAP_QID = 
3593             CSL_FMK(SRIO_RIO_RXU_MAP_QID_DEST_QID, queueId)                 |
3594             CSL_FMK(SRIO_RIO_RXU_MAP_QID_FLOWID, ptrMessage->flowId);
3597 /** ============================================================================
3598  *   @n@b CSL_SRIO_GetMessageToQueueMapping
3599  *
3600  *   @b Description
3601  *   @n The function gets information about the SRIO Message and Queue to which
3602  *      it is mapped by reading the specified MAP 'index' register.
3603  *
3604  *   @b Arguments
3605      @verbatim
3606           hSrio             Handle of the SRIO device
3607           index             Index of the MAP register 
3608           message           Message Information populated by this API
3609           queueId           Destination Queue to which the message is mapped 
3610                             populated by this API
3611      @endverbatim
3612  *
3613  *   <b> Return Value </b>
3614  *   @n None
3615  *
3616  *   <b> Pre Condition </b>
3617  *   @n  CSL_SRIO_Open() must be called 
3618  *
3619  *   <b> Post Condition </b>
3620  *   @n None
3621  *
3622  *   @b Reads
3623  *   @n SRIO_RIO_RXU_MAP_L_SRCID,SRIO_RIO_RXU_MAP_L_MBX,SRIO_RIO_RXU_MAP_L_LTR
3624  *      SRIO_RIO_RXU_MAP_L_MBX_MASK,SRIO_RIO_RXU_MAP_L_LTR_MASK,
3625  *   @n SRIO_RIO_RXU_MAP_H_SEG_MAP,SRIO_RIO_RXU_MAP_H_SRC_PROM,SRIO_RIO_RXU_MAP_H_TT,
3626  *      SRIO_RIO_RXU_MAP_H_DEST_PROM,SRIO_RIO_RXU_MAP_H_DEST_ID,
3627  *   @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
3628  *
3629  *   @b Example
3630  *   @verbatim
3631         CSL_SrioHandle  hSrio;
3632         SRIO_MESSAGE    message;
3633         Uint16          queueId;
3635         // Open the CSL SRIO Module 0
3636         hSrio = CSL_SRIO_Open (0);
3638         // Get the mapping information for the 'first' mapping.
3639         CSL_SRIO_GetMessageToQueueMapping (hSrio, 0, &message, &queueId);
3640         ...
3641      @endverbatim
3642  * =============================================================================
3643  */
3644 static inline void CSL_SRIO_GetMessageToQueueMapping
3646     CSL_SrioHandle  hSrio, 
3647     Uint8           index,
3648     SRIO_MESSAGE*   ptrMessage,
3649     Uint16*         queueId
3652     Uint32  value;
3654     /* Get the RXU MAPL register. */
3655     value = hSrio->RXU_MAP[index].RIO_RXU_MAP_L;
3656     ptrMessage->srcId   = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_SRCID);
3657     ptrMessage->mbx     = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_MBX);
3658     ptrMessage->ltr     = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_LTR);
3659     ptrMessage->mbxMask = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_MBX_MASK);
3660     ptrMessage->ltrMask = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_LTR_MASK);
3662     /* Get the RXU MAPH register. */
3663     value = hSrio->RXU_MAP[index].RIO_RXU_MAP_H;
3664     ptrMessage->segMap  = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_SEG_MAP);
3665     ptrMessage->srcProm = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_SRC_PROM);
3666     ptrMessage->tt      = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_TT);
3667     ptrMessage->dstProm = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_DEST_PROM);
3668     ptrMessage->dstId   = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_DEST_ID);
3670     /* Get the RXU QID register. */
3671     value = hSrio->RXU_MAP[index].RIO_RXU_MAP_QID;
3672     *queueId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_DEST_QID);
3673     ptrMessage->flowId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_FLOWID);
3676 /** ============================================================================
3677  *   @n@b CSL_SRIO_SetType9PSInfo
3678  *
3679  *   @b Description
3680  *   @n The function creates the type9 protocol specific information.
3681  *
3682  *   @b Arguments
3683      @verbatim
3684         psInfo      - 8 bytes of PS information populated by this API
3685         dstID       - Destination Identifier.
3686         srcId       - Source Identifier.
3687         cos         - Class of Service 
3688         cosMask     - Class of Service Mask
3689         tt          - Identifies if 8 bit or 16 bit identifiers are to be used.
3690         streamId    - Stream ID for the transaction
3691      @endverbatim
3692  *
3693  *   <b> Return Value </b>
3694  *   @n None
3695  *
3696  *   <b> Pre Condition </b>
3697  *   @n None
3698  *
3699  *   <b> Post Condition </b>
3700  *   @n None
3701  *
3702  *   @b Example
3703  *   @verbatim
3704         CSL_SrioHandle  hSrio;
3705         Uint32          psInfo[2];
3707         // Open the CSL SRIO Module 0
3708         hSrio = CSL_SRIO_Open (0);
3709        
3710         // Create the Protocol Specific Information.
3711         CSL_SRIO_SetType9PSInfo(psInfo, 0xDEAD, 0xBEED, 0x4, 0x1, 0x1, 0xABCD);
3713         // Set the PS Information into the Buffer Descriptor.
3714         ...
3715      @endverbatim
3716  * =============================================================================
3717  */
3718 static inline void CSL_SRIO_SetType9PSInfo
3720     Uint32  psInfo[2],
3721     Uint16  dstId,
3722     Uint16  srcId,
3723     Uint8   cos,
3724     Uint8   cosMask,
3725     Uint8   tt,
3726     Uint16  streamId
3729     psInfo[0] = CSL_FMKR(31, 16, srcId)     |
3730                 CSL_FMKR(15, 0,  dstId);
3732     psInfo[1] = CSL_FMKR(7,  0,  cos)       |
3733                 CSL_FMKR(8,  8,  cosMask)   |
3734                 CSL_FMKR(10, 9,  tt)        |
3735                 CSL_FMKR(31, 16, streamId);
3738 /** ============================================================================
3739  *   @n@b CSL_SRIO_ExtractType9PSInfo
3740  *
3741  *   @b Description
3742  *   @n The function extracts the type9 protocol specific information.
3743  *
3744  *   @b Arguments
3745      @verbatim
3746         psInfo      - 8 bytes of PS information
3747         dstID       - Destination Identifier populated by this API
3748         srcId       - Source Identifier populated by this API
3749         cos         - Class of Service populated by this API
3750         cc          - Completion Code populated by this API
3751         tt          - Identifies if 8 bit or 16 bit identifiers are to be used.
3752         pri         - Message Priority populated by this API
3753         streamId    - Stream Id populated by this API
3754      @endverbatim
3755  *
3756  *   <b> Return Value </b>
3757  *   @n None
3758  *
3759  *   <b> Pre Condition </b>
3760  *   @n None
3761  *
3762  *   <b> Post Condition </b>
3763  *   @n None
3764  *
3765  *   @b Example
3766  *   @verbatim
3767         CSL_SrioHandle  hSrio;
3768         Uint32          psInfo[2];
3769         Uint16          dstId;
3770         Uint16          srcId;
3771         Uint8           cos;
3772         Uint8           cc;
3773         Uint8           tt;
3774         Uint8           pri;
3775         Uint16          streamId;
3777         // Open the CSL SRIO Module 0
3778         hSrio = CSL_SRIO_Open (0);
3780         // Get the PS Information into the Buffer Descriptor.
3781         ...
3783         // Extract the Type9 fields from the PS Information.
3784         CSL_SRIO_ExtractType9PSInfo(psInfo, &dstId, &srcId, &cos, &cc, &tt, &pri, &streamId);
3785         ...
3786      @endverbatim
3787  * =============================================================================
3788  */
3789 static inline void CSL_SRIO_ExtractType9PSInfo
3791     Uint32  psInfo[2],
3792     Uint16* dstId,
3793     Uint16* srcId,
3794     Uint8*  cos,
3795     Uint8*  cc,
3796     Uint8*  tt,
3797     Uint8*  pri,
3798     Uint16* streamId
3801     *srcId    = CSL_FEXTR(psInfo[0], 31, 16);
3802     *dstId    = CSL_FEXTR(psInfo[0], 15, 0);
3803     *cos      = CSL_FEXTR(psInfo[1], 7,  0);
3804     *cc       = CSL_FEXTR(psInfo[1], 9,  8);
3805     *tt       = CSL_FEXTR(psInfo[1], 10, 10);
3806     *pri      = CSL_FEXTR(psInfo[1], 14, 11);
3807     *streamId = CSL_FEXTR(psInfo[1], 31, 16);
3810 /** ============================================================================
3811  *   @n@b CSL_SRIO_MapType9MessageToQueue
3812  *
3813  *   @b Description
3814  *   @n The function maps the specific TYPE9 message to the queue
3815  *
3816  *   @b Arguments
3817      @verbatim
3818           hSrio             Handle of the SRIO device
3819           index             Index of the MAP register 
3820           message           Type9-Message Information 
3821           queueId           Destination Queue 
3822      @endverbatim
3823  *
3824  *   <b> Return Value </b>
3825  *   @n None
3826  *
3827  *   <b> Pre Condition </b>
3828  *   @n  CSL_SRIO_Open() must be called 
3829  *
3830  *   <b> Post Condition </b>
3831  *   @n None
3832  *
3833  *   @b Writes
3834  *   @n SRIO_RIO_RXU_TYPE9_MAP0_SRCID,SRIO_RIO_RXU_TYPE9_MAP0_COS,
3835  *      SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK,
3836  *   @n SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM,SRIO_RIO_RXU_TYPE9_MAP1_TT,
3837  *      SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM,SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID,
3838  *   @n SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID,SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK,
3839  *   @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
3840  *
3841  *   @b Example
3842  *   @verbatim
3843         CSL_SrioHandle      hSrio;
3844         SRIO_TYPE9_MESSAGE  message;
3846         // Open the CSL SRIO Module 0
3847         hSrio = CSL_SRIO_Open (0);
3849         message.srcId      = 0xBEEF;
3850         message.cos        = 0;
3851         message.cosMask    = 0;
3852         message.srcProm    = 0;
3853         message.tt         = 1; // Match 16bits for Source ID.
3854         message.dstProm    = 0;
3855         message.dstId      = 0xDEAD;
3856         message.streamId   = 0;
3857         message.streamMask = 0;
3858         message.flowId     = 0;
3859                
3860         // Map the above message to Queue 5. This is the first mapping which is being done
3861         CSL_SRIO_MapType9MessageToQueue (hSrio, 0, &message, 5);
3862         ...
3863      @endverbatim
3864  * =============================================================================
3865  */
3866 static inline void CSL_SRIO_MapType9MessageToQueue
3868     CSL_SrioHandle        hSrio, 
3869     Uint8                 index,
3870     SRIO_TYPE9_MESSAGE*   ptrMessage,
3871     Uint16                queueId
3874     /* Initialize the RXU TYPE9 MAP0 register. */
3875     hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP0 = 
3876                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP0_SRCID,    ptrMessage->srcId)     |
3877                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP0_COS,      ptrMessage->cos)       |
3878                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK, ptrMessage->cosMask);
3880     /* Initialize the RXU TYPE9 MAP1 register. */
3881     hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP1 = 
3882                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM, ptrMessage->srcProm)   |
3883                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_TT,       ptrMessage->tt)        |
3884                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM,ptrMessage->dstProm)   |
3885                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID,  ptrMessage->dstId);
3887     /* Initialize the RXU TYPE9 MAP2 register. */
3888     hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP2 =
3889                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID,  ptrMessage->streamId)  |
3890                 CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK,ptrMessage->streamMask);
3892     /* Initialize the RXU QID register: The specification states that this is shared between Type9 and Type11 */
3893     hSrio->RXU_MAP[index].RIO_RXU_MAP_QID = 
3894             CSL_FMK(SRIO_RIO_RXU_MAP_QID_DEST_QID, queueId)                      |
3895             CSL_FMK(SRIO_RIO_RXU_MAP_QID_FLOWID, ptrMessage->flowId);
3898 /** ============================================================================
3899  *   @n@b CSL_SRIO_GetType9MessageToQueueMapping
3900  *
3901  *   @b Description
3902  *   @n The function gets information about the SRIO TYPE9 Message and Queue 
3903  *      to which it is mapped by reading the specified MAP 'index' register.
3904  *
3905  *   @b Arguments
3906      @verbatim
3907           hSrio             Handle of the SRIO device
3908           index             Index of the MAP register 
3909           message           Type9-Message Information populated by this API 
3910           queueId           Destination Queue populated by this API
3911      @endverbatim
3912  *
3913  *   <b> Return Value </b>
3914  *   @n None
3915  *
3916  *   <b> Pre Condition </b>
3917  *   @n  CSL_SRIO_Open() must be called 
3918  *
3919  *   <b> Post Condition </b>
3920  *   @n None
3921  *
3922  *   @b Reads
3923  *   @n SRIO_RIO_RXU_TYPE9_MAP0_SRCID,SRIO_RIO_RXU_TYPE9_MAP0_COS,
3924  *      SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK,
3925  *   @n SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM,SRIO_RIO_RXU_TYPE9_MAP1_TT,
3926  *      SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM,SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID,
3927  *   @n SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID,SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK,
3928  *   @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID   
3929  *
3930  *   @b Example
3931  *   @verbatim
3932         CSL_SrioHandle      hSrio;
3933         SRIO_TYPE9_MESSAGE  message;
3934         Uint16              queueId;
3936         // Open the CSL SRIO Module 0
3937         hSrio = CSL_SRIO_Open (0);
3938         ...
3939         // Get the first mapping information.
3940         CSL_SRIO_GetType9MessageToQueueMapping (hSrio, 0, &message, &queueId);
3941         ...
3942      @endverbatim
3943  * =============================================================================
3944  */
3945 static inline void CSL_SRIO_GetType9MessageToQueueMapping
3947     CSL_SrioHandle        hSrio, 
3948     Uint8                 index,
3949     SRIO_TYPE9_MESSAGE*   ptrMessage,
3950     Uint16*               queueId
3953     Uint32  value;
3955     /* Get the RXU TYPE9 MAP0 register. */
3956     value = hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP0;
3957     ptrMessage->srcId   = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP0_SRCID);
3958     ptrMessage->cos     = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP0_COS);
3959     ptrMessage->cosMask = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK);
3961     /* Get the RXU TYPE9 MAP1 register. */
3962     value = hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP1;
3963     ptrMessage->srcProm = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM);
3964     ptrMessage->tt      = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_TT);
3965     ptrMessage->dstProm = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM);
3966     ptrMessage->dstId   = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID);
3968     /* Get the RXU TYPE9 MAP2 register. */
3969     value = hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP2;
3970     ptrMessage->streamId   = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID);
3971     ptrMessage->streamMask = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK);
3973     /* Get the RXU QID register: This is shared between the Type9 and Type11 */
3974     value = hSrio->RXU_MAP[index].RIO_RXU_MAP_QID;
3975     *queueId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_DEST_QID);
3976     ptrMessage->flowId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_FLOWID);
3979 /** ============================================================================
3980  *   @n@b CSL_SRIO_MapAMUPrivIdToSourceId
3981  *
3982  *   @b Description
3983  *   @n The function maps the AMU Priv ID to a specific Source ID.
3984  *
3985  *   @b Arguments
3986      @verbatim
3987           hSrio             Handle of the SRIO device
3988           privId            AMU Priv ID which is being mapped
3989           srcId             Source ID to which the priv ID is being mapped to.
3990      @endverbatim
3991  *
3992  *   <b> Return Value </b>
3993  *   @n None
3994  *
3995  *   <b> Pre Condition </b>
3996  *   @n  CSL_SRIO_Open() must be called 
3997  *
3998  *   <b> Post Condition </b>
3999  *   @n None
4000  *
4001  *   @b Writes
4002  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID0_8;SRIO_RIO_AMU_SRCID_MAP_CPRIVID1_9; 
4003  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID2_10;SRIO_RIO_AMU_SRCID_MAP_CPRIVID3_11;
4004  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID4_12;SRIO_RIO_AMU_SRCID_MAP_CPRIVID5_13;
4005  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID6_14;SRIO_RIO_AMU_SRCID_MAP_CPRIVID7_15;
4006  *
4007  *   @b Example
4008  *   @verbatim
4009         CSL_SrioHandle      hSrio;
4011         // Open the CSL SRIO Module 0
4012         hSrio = CSL_SRIO_Open (0);
4013         ...
4014         // Map the PRIV-ID 1 to Source ID 3
4015         CSL_SRIO_MapAMUPrivIdToSourceId (hSrio, 1, 5);
4016         ...
4017      @endverbatim
4018  * =============================================================================
4019  */
4020 static inline void CSL_SRIO_MapAMUPrivIdToSourceId
4022     CSL_SrioHandle  hSrio, 
4023     Uint8           privId,
4024     Uint8           srcId
4026 {        
4027     if (privId < 8)
4028     {
4029         CSL_FINSR (hSrio->RIO_AMU_SRCID_MAP[0], (privId << 2) + 3, (privId << 2), srcId);
4030     }
4031     else
4032     {
4033         privId = privId - 8;
4034         CSL_FINSR (hSrio->RIO_AMU_SRCID_MAP[1], (privId << 2) + 3, (privId << 2), srcId);
4035     }
4038 /** ============================================================================
4039  *   @n@b CSL_SRIO_GetAMUPrivIdToSourceIdMapping
4040  *
4041  *   @b Description
4042  *   @n The function gets the mapping of a specific AMU privID to source Id
4043  *
4044  *   @b Arguments
4045      @verbatim
4046           hSrio             Handle of the SRIO device
4047           privId            AMU Priv ID for which the mapping is required.
4048           srcId             Source ID to which the priv ID has been mapped to
4049                             populated by this API
4050      @endverbatim
4051  *
4052  *   <b> Return Value </b>
4053  *   @n None
4054  *
4055  *   <b> Pre Condition </b>
4056  *   @n  CSL_SRIO_Open() must be called 
4057  *
4058  *   <b> Post Condition </b>
4059  *   @n None
4060  *
4061  *   @b Reads
4062  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID0_8;SRIO_RIO_AMU_SRCID_MAP_CPRIVID1_9; 
4063  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID2_10;SRIO_RIO_AMU_SRCID_MAP_CPRIVID3_11;
4064  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID4_12;SRIO_RIO_AMU_SRCID_MAP_CPRIVID5_13;
4065  *   @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID6_14;SRIO_RIO_AMU_SRCID_MAP_CPRIVID7_15;
4066  *
4067  *   @b Example
4068  *   @verbatim
4069         CSL_SrioHandle      hSrio;
4070         Uint8               srcId;
4072         // Open the CSL SRIO Module 0
4073         hSrio = CSL_SRIO_Open (0);
4074         ...
4075         // Get the mapping for Priv ID 1
4076         CSL_SRIO_GetAMUPrivIdToSourceIdMapping (hSrio, 1, &srcId);
4077         ...
4078      @endverbatim
4079  * =============================================================================
4080  */
4081 static inline void CSL_SRIO_GetAMUPrivIdToSourceIdMapping
4083     CSL_SrioHandle  hSrio, 
4084     Uint8           privId,
4085     Uint8*          srcId
4088     if (privId < 8)
4089     {
4090         *srcId = CSL_FEXTR (hSrio->RIO_AMU_SRCID_MAP[0], (privId << 2) + 3, (privId << 2));
4091     }
4092     else
4093     {
4094         privId = privId - 8;
4095         *srcId = CSL_FEXTR (hSrio->RIO_AMU_SRCID_MAP[1], (privId << 2) + 3, (privId << 2));
4096     }
4099 /** ============================================================================
4100  *   @n@b CSL_SRIO_MapVBUSPriorityToRIO
4101  *
4102  *   @b Description
4103  *   @n The function maps the VBUS Priority to RIO Priority.
4104  *
4105  *   @b Arguments
4106      @verbatim
4107           hSrio             Handle of the SRIO device
4108           vbusPriority      VBUS Priority which is to be mapped
4109           priority          RIO Priority to be mapped to.
4110      @endverbatim
4111  *
4112  *   <b> Return Value </b>
4113  *   @n None
4114  *
4115  *   <b> Pre Condition </b>
4116  *   @n  CSL_SRIO_Open() must be called 
4117  *
4118  *   <b> Post Condition </b>
4119  *   @n None
4120  *
4121  *   @b Writes
4122  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI0;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI1;
4123  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI2;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI3;
4124  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI4;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI5;
4125  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI6;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI7
4126  *
4127  *   @b Example
4128  *   @verbatim
4129         CSL_SrioHandle      hSrio;
4131         // Open the CSL SRIO Module 0
4132         hSrio = CSL_SRIO_Open (0);
4133         ...
4134         // Map the VBUS Priority 0 to CRITICAL Flow High Priority i.e. 7
4135         CSL_SRIO_MapVBUSPriorityToRIO (hSrio, 0, 7);
4136         ...
4137      @endverbatim
4138  * =============================================================================
4139  */
4140 static inline void CSL_SRIO_MapVBUSPriorityToRIO
4142     CSL_SrioHandle  hSrio, 
4143     Uint8           vbusPriority,
4144     Uint8           priority
4147     CSL_FINSR (hSrio->RIO_AMU_PRIORITY_MAP, (vbusPriority << 2) + 3, (vbusPriority << 2), priority);
4150 /** ============================================================================
4151  *   @n@b CSL_SRIO_GetVBUSPriorityToRIOMapping
4152  *
4153  *   @b Description
4154  *   @n The function gets the mapping between the VBUS Priority to RIO Priority.
4155  *
4156  *   @b Arguments
4157      @verbatim
4158           hSrio             Handle of the SRIO device
4159           vbusPriority      VBUS Priority for which the mapping is required.
4160           priority          Priority level populated by this API
4161      @endverbatim
4162  *
4163  *   <b> Return Value </b>
4164  *   @n None
4165  *
4166  *   <b> Pre Condition </b>
4167  *   @n  CSL_SRIO_Open() must be called 
4168  *
4169  *   <b> Post Condition </b>
4170  *   @n None
4171  *
4172  *   @b Reads
4173  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI0;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI1;
4174  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI2;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI3;
4175  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI4;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI5;
4176  *   @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI6;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI7
4177  *
4178  *   @b Example
4179  *   @verbatim
4180         CSL_SrioHandle      hSrio;
4181         Uint8               priority;
4183         // Open the CSL SRIO Module 0
4184         hSrio = CSL_SRIO_Open (0);
4185         ...
4186         // Get the RIO Priority Level for VBUS Priority 0
4187         CSL_SRIO_GetVBUSPriorityToRIOMapping (hSrio, 0, &priority);
4188         ...
4189      @endverbatim
4190  * =============================================================================
4191  */
4192 static inline void CSL_SRIO_GetVBUSPriorityToRIOMapping
4194     CSL_SrioHandle  hSrio,
4195     Uint8           vbusPriority,
4196     Uint8*          priority
4199     *priority = CSL_FEXTR (hSrio->RIO_AMU_PRIORITY_MAP, (vbusPriority << 2) + 3, (vbusPriority << 2));
4202 /** ============================================================================
4203  *   @n@b CSL_SRIO_GetAMUErrorCaptureInfo
4204  *
4205  *   @b Description
4206  *   @n The function is used to get access to the AMU Error capture information.
4207  *
4208  *   @b Arguments
4209      @verbatim
4210           hSrio             Handle of the SRIO device
4211           transAddress      Transaction Address which caused the error.
4212           privId            Priv ID which caused the error
4213           mstID             Master ID which caused the error.
4214           doorbellInfo      Doorbell Info
4215      @endverbatim
4216  *
4217  *   <b> Return Value </b>
4218  *   @n None
4219  *
4220  *   <b> Pre Condition </b>
4221  *   @n  CSL_SRIO_Open() must be called 
4222  *
4223  *   <b> Post Condition </b>
4224  *   @n None
4225  *
4226  *   @b Reads
4227  *   @n SRIO_RIO_AMU_CAPT0_MAP,SRIO_RIO_AMU_CAPT1_MAP_CPRIVID,
4228  *      SRIO_RIO_AMU_CAPT1_MAP_CMSTID,SRIO_RIO_AMU_CAPT1_MAP_DOORBELL_INFO
4229  *
4230  *   @b Example
4231  *   @verbatim
4232         CSL_SrioHandle      hSrio;
4233         Uint32              transAddress;
4234         Uint8               privId;
4235         Uint8               mstID;
4236         Uint16              doorbellInfo;
4238         // Open the CSL SRIO Module 0
4239         hSrio = CSL_SRIO_Open (0);
4240         ...
4241         // Get the AMU Error Capture Information
4242         CSL_SRIO_GetAMUErrorCaptureInfo (hSrio, &transAddress, &privId, &mstID, &doorbellInfo);
4243         ...
4244      @endverbatim
4245  * =============================================================================
4246  */
4247 static inline void CSL_SRIO_GetAMUErrorCaptureInfo
4249     CSL_SrioHandle  hSrio,
4250     Uint32*         transAddress,
4251     Uint8*          privId,
4252     Uint8*          mstID,
4253     Uint16*         doorbellInfo
4256     *transAddress = hSrio->RIO_AMU_CAPT0_MAP;
4257     *privId = CSL_FEXT (hSrio->RIO_AMU_CAPT1_MAP, SRIO_RIO_AMU_CAPT1_MAP_CPRIVID);
4258     *mstID = CSL_FEXT (hSrio->RIO_AMU_CAPT1_MAP, SRIO_RIO_AMU_CAPT1_MAP_CMSTID);
4259     *doorbellInfo = CSL_FEXT (hSrio->RIO_AMU_CAPT1_MAP, SRIO_RIO_AMU_CAPT1_MAP_DOORBELL_INFO);
4262 /** ============================================================================
4263  *   @n@b CSL_SRIO_SetAMUWindow
4264  *
4265  *   @b Description
4266  *   @n The function configures the specific AMU Window register
4267  *
4268  *   @b Arguments
4269      @verbatim
4270           hSrio             Handle of the SRIO device
4271           index             AMU Window to be configured
4272           amuWindow         AMU Window Properties to be configured.
4273      @endverbatim
4274  *
4275  *   <b> Return Value </b>
4276  *   @n None
4277  *
4278  *   <b> Pre Condition </b>
4279  *   @n  CSL_SRIO_Open() must be called 
4280  *
4281  *   <b> Post Condition </b>
4282  *   @n None
4283  *
4284  *   @b Writes
4285  *   @n SRIO_RIO_AMU_WINDOW_REG0_XAMBS,SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT,
4286  *      SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE,SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE,
4287  *      SRIO_RIO_AMU_WINDOW_REG1,SRIO_RIO_AMU_WINDOW_REG2
4288  *
4289  *   @b Example
4290  *   @verbatim
4291         CSL_SrioHandle      hSrio;
4292         SRIO_AMU_WINDOW     amuWindow;
4294         // Open the CSL SRIO Module 0
4295         hSrio = CSL_SRIO_Open (0);
4296         ...
4297         // Configure the AMU Window Properties for AMU Window 1
4298         CSL_SRIO_SetAMUWindow (hSrio, 1, &amuWindow);
4299         ...
4300      @endverbatim
4301  * =============================================================================
4302  */
4303 static inline void CSL_SRIO_SetAMUWindow
4305     CSL_SrioHandle      hSrio, 
4306     Uint8               index,
4307     SRIO_AMU_WINDOW*    amuWindow
4310     /* Configure the Window0 Register. */
4311     hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG0 = 
4312                 CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_XAMBS,      amuWindow->xambs)     |
4313                 CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT, amuWindow->paneCount) |
4314                 CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE,  amuWindow->paneSize)  |
4315                 CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE,amuWindow->winSize);
4317     /* Configure the WINDOW1 and WINDOW2 registers. */
4318     hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG1 = amuWindow->rapidIOMsb;
4319     hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG2 = amuWindow->rapidIOLsb;
4322 /** ============================================================================
4323  *   @n@b CSL_SRIO_GetAMUWindow
4324  *
4325  *   @b Description
4326  *   @n The function gets the specific AMU Window register
4327  *
4328  *   @b Arguments
4329      @verbatim
4330           hSrio             Handle of the SRIO device
4331           index             AMU Window Index 
4332           amuWindow         AMU Window Properties populated by this API
4333      @endverbatim
4334  *
4335  *   <b> Return Value </b>
4336  *   @n None
4337  *
4338  *   <b> Pre Condition </b>
4339  *   @n  CSL_SRIO_Open() must be called 
4340  *
4341  *   <b> Post Condition </b>
4342  *   @n None
4343  *
4344  *   @b Reads
4345  *   @n SRIO_RIO_AMU_WINDOW_REG0_XAMBS,SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT,
4346  *      SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE,SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE,
4347  *      SRIO_RIO_AMU_WINDOW_REG1,SRIO_RIO_AMU_WINDOW_REG2
4348  *
4349  *   @b Example
4350  *   @verbatim
4351         CSL_SrioHandle      hSrio;
4352         SRIO_AMU_WINDOW     amuWindow;
4354         // Open the CSL SRIO Module 0
4355         hSrio = CSL_SRIO_Open (0);
4356         ...
4357         // Get the AMU Window Properties for AMU Window 1
4358         CSL_SRIO_GetAMUWindow (hSrio, 1, &amuWindow);
4359         ...
4360      @endverbatim
4361  * =============================================================================
4362  */
4363 static inline void CSL_SRIO_GetAMUWindow
4365     CSL_SrioHandle      hSrio, 
4366     Uint8               index,
4367     SRIO_AMU_WINDOW*    amuWindow
4370     Uint32 value = hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG0;
4372     /* Get the Window0 Register. */
4373     amuWindow->xambs     = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_XAMBS);
4374     amuWindow->paneCount = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT);
4375     amuWindow->paneSize  = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE);
4376     amuWindow->winSize   = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE);
4378     /* Get the WINDOW1 and WINDOW2 registers. */
4379     amuWindow->rapidIOMsb = hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG1;
4380     amuWindow->rapidIOLsb = hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG2;
4383 /** ============================================================================
4384  *   @n@b CSL_SRIO_SetAMUPane
4385  *
4386  *   @b Description
4387  *   @n The function configures the specific AMU Pane
4388  *
4389  *   @b Arguments
4390      @verbatim
4391           hSrio             Handle of the SRIO device
4392           index             AMU Pane to be configured
4393           amuPane           AMU Pane Properties to be configured.
4394      @endverbatim
4395  *
4396  *   <b> Return Value </b>
4397  *   @n None
4398  *
4399  *   <b> Pre Condition </b>
4400  *   @n  CSL_SRIO_Open() must be called 
4401  *
4402  *   <b> Post Condition </b>
4403  *   @n None
4404  *
4405  *   @b Writes
4406  *   @n SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC,SRIO_RIO_AMU_WINDOW_PANE_PORT_ID,
4407  *      SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE,SRIO_RIO_AMU_WINDOW_PANE_DESTID
4408  *
4409  *   @b Example
4410  *   @verbatim
4411         CSL_SrioHandle      hSrio;
4412         SRIO_AMU_PANE       amuPane;
4414         // Open the CSL SRIO Module 0
4415         hSrio = CSL_SRIO_Open (0);
4416         ...
4417         // Configure the AMU Pane Properties for AMU Pane 1
4418         CSL_SRIO_SetAMUPane (hSrio, 1, &amuPane);
4419         ...
4420      @endverbatim
4421  * =============================================================================
4422  */
4423 static inline void CSL_SRIO_SetAMUPane
4425     CSL_SrioHandle      hSrio, 
4426     Uint8               index,
4427     SRIO_AMU_PANE*      amuPane
4430     /* Configure the Pane Register. */
4431     hSrio->RIO_AMU_WINDOW_PANE[index] = 
4432             CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC,amuPane->cmdEnc)    |
4433             CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_PORT_ID,amuPane->portId)    |
4434             CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE,amuPane->idSize)    |
4435             CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_DESTID, amuPane->dstID);
4438 /** ============================================================================
4439  *   @n@b CSL_SRIO_GetAMUPane
4440  *
4441  *   @b Description
4442  *   @n The function gets the specific AMU Pane properties
4443  *
4444  *   @b Arguments
4445      @verbatim
4446           hSrio             Handle of the SRIO device
4447           index             AMU Pane Index
4448           amuPane           AMU Pane Properties populated by this API
4449      @endverbatim
4450  *
4451  *   <b> Return Value </b>
4452  *   @n None
4453  *
4454  *   <b> Pre Condition </b>
4455  *   @n  CSL_SRIO_Open() must be called 
4456  *
4457  *   <b> Post Condition </b>
4458  *   @n None
4459  *
4460  *   @b Reads
4461  *   @n SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC,SRIO_RIO_AMU_WINDOW_PANE_PORT_ID,
4462  *      SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE,SRIO_RIO_AMU_WINDOW_PANE_DESTID
4463  *
4464  *   @b Example
4465  *   @verbatim
4466         CSL_SrioHandle      hSrio;
4467         SRIO_AMU_PANE       amuPane;
4469         // Open the CSL SRIO Module 0
4470         hSrio = CSL_SRIO_Open (0);
4471         ...
4472         // Get the AMU Pane Properties for AMU Pane 2
4473         CSL_SRIO_GetAMUPane (hSrio, 2, &amuPane);
4474         ...
4475      @endverbatim
4476  * =============================================================================
4477  */
4478 static inline void CSL_SRIO_GetAMUPane
4480     CSL_SrioHandle      hSrio, 
4481     Uint8               index,
4482     SRIO_AMU_PANE*      amuPane
4485     Uint32 value = hSrio->RIO_AMU_WINDOW_PANE[index];
4487     /* Get the Pane properties. */
4488     amuPane->cmdEnc = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC);
4489     amuPane->portId = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_PORT_ID);
4490     amuPane->idSize = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE);
4491     amuPane->dstID  = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_DESTID);
4494 /** ============================================================================
4495  *   @n@b CSL_SRIO_SetAMUFlowMask
4496  *
4497  *   @b Description
4498  *   @n The function configures the AMU Flow Mask
4499  *
4500  *   @b Arguments
4501      @verbatim
4502           hSrio             Handle of the SRIO device
4503           flowMask          Flow Mask to be configured.
4504      @endverbatim
4505  *
4506  *   <b> Return Value </b>
4507  *   @n None
4508  *
4509  *   <b> Pre Condition </b>
4510  *   @n  CSL_SRIO_Open() must be called 
4511  *
4512  *   <b> Post Condition </b>
4513  *   @n None
4514  *
4515  *   @b Writes
4516  *   @n SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK
4517  *
4518  *   @b Example
4519  *   @verbatim
4520         CSL_SrioHandle      hSrio;
4522         // Open the CSL SRIO Module 0
4523         hSrio = CSL_SRIO_Open (0);
4524         ...
4525         // Configure the AMU Flow Mask
4526         CSL_SRIO_SetAMUFlowMask (hSrio, 0x0);
4527         ...
4528      @endverbatim
4529  * =============================================================================
4530  */
4531 static inline void CSL_SRIO_SetAMUFlowMask
4533     CSL_SrioHandle      hSrio, 
4534     Uint16              flowMask
4537     hSrio->RIO_AMU_FLOW_MASKS0 = CSL_FMK(SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK, flowMask);
4540 /** ============================================================================
4541  *   @n@b CSL_SRIO_GetAMUFlowMask
4542  *
4543  *   @b Description
4544  *   @n The function gets the AMU Flow Mask
4545  *
4546  *   @b Arguments
4547      @verbatim
4548           hSrio             Handle of the SRIO device
4549           flowMask          Flow Mask to be populated by this API.
4550      @endverbatim
4551  *
4552  *   <b> Return Value </b>
4553  *   @n None
4554  *
4555  *   <b> Pre Condition </b>
4556  *   @n  CSL_SRIO_Open() must be called 
4557  *
4558  *   <b> Post Condition </b>
4559  *   @n None
4560  *
4561  *   @b Reads
4562  *   @n SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK
4563  *
4564  *   @b Example
4565  *   @verbatim
4566         CSL_SrioHandle      hSrio;
4567         Uint32              flowMask;
4569         // Open the CSL SRIO Module 0
4570         hSrio = CSL_SRIO_Open (0);
4571         ...
4572         // Get the AMU Flow Mask
4573         CSL_SRIO_GetAMUFlowMask (hSrio, &flowMask);
4574         ...
4575      @endverbatim
4576  * =============================================================================
4577  */
4578 static inline void CSL_SRIO_GetAMUFlowMask
4580     CSL_SrioHandle      hSrio, 
4581     Uint16*             flowMask
4584     *flowMask = CSL_FEXT(hSrio->RIO_AMU_FLOW_MASKS0, SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK);
4587 /** ============================================================================
4588  *   @n@b CSL_SRIO_SetLSUTransfer
4589  *
4590  *   @b Description
4591  *   @n The function sets the specified LSU for a DIO Transfer.
4592  *
4593  *   @b Arguments
4594      @verbatim
4595           hSrio             Handle of the SRIO device
4596           lsu               LSU Number which is to be used for the transfer.
4597           lsuTransfer       LSU Transfer Information 
4598      @endverbatim
4599  *
4600  *   <b> Return Value </b>
4601  *   @n None
4602  *
4603  *   <b> Pre Condition </b>
4604  *   @n  CSL_SRIO_Open() must be called 
4605  *
4606  *   <b> Post Condition </b>
4607  *   @n None
4608  *
4609  *   @b Writes
4610  *   @n SRIO_RIO_LSU_REG0_RIO_ADDRESS_MSB,
4611  *   @n SRIO_RIO_LSU_REG1_RIO_ADDRESS_LSB,
4612  *   @n SRIO_RIO_LSU_REG2_DSP_ADDRESS,
4613  *   @n SRIO_RIO_LSU_REG3_BYTE_COUNT,SRIO_RIO_LSU_REG3_DRBLL_VALUE,
4614  *   @n SRIO_RIO_LSU_REG4_INT_REQ,SRIO_RIO_LSU_REG4_SUP_GINT,SRIO_RIO_LSU_REG4_XAMBS,
4615  *   @n SRIO_RIO_LSU_REG4_PRIORITY,SRIO_RIO_LSU_REG4_OUTPORTID,SRIO_RIO_LSU_REG4_ID_SIZE,
4616  *   @n SRIO_RIO_LSU_REG4_SRCID_MAP,SRIO_RIO_LSU_REG4_DESTID,
4617  *   @n SRIO_RIO_LSU_REG5_TTYPE,SRIO_RIO_LSU_REG5_FTYPE,SRIO_RIO_LSU_REG5_HOP_COUNT,
4618  *      SRIO_RIO_LSU_REG5_DRBLL_INFO
4619  *
4620  *   @b Example
4621  *   @verbatim
4622         CSL_SrioHandle     hSrio;
4623         SRIO_LSU_TRANSFER  lsuTransfer;
4625         // Open the CSL SRIO Module 0
4626         hSrio = CSL_SRIO_Open (0);
4627         ...
4628         // Populate the Transfer Information. 
4629         lsuTransfer.rapidIOMSB    = 0x0;
4630         lsuTransfer.rapidIOLSB    = (Uint32)&tx_buffer[0];
4631         lsuTransfer.dspAddress    = (Uint32)&rx_buffer[0];
4632         lsuTransfer.bytecount     = 256;
4633         lsuTransfer.doorbellValid = 0;
4634         lsuTransfer.intrRequest   = 1;
4635         lsuTransfer.supInt        = 0;
4636         lsuTransfer.xambs         = 0;
4637         lsuTransfer.priority      = 2;
4638         lsuTransfer.outPortID     = 1;
4639         lsuTransfer.idSize        = 1;
4640         lsuTransfer.srcIDMap      = 0;
4641         lsuTransfer.dstID         = 0xDEAD;
4642         lsuTransfer.ttype         = 4;
4643         lsuTransfer.ftype         = 5;
4644         lsuTransfer.hopCount      = 0;
4645         lsuTransfer.doorbellInfo  = 0;
4647         // Send the transfer on LSU 1 
4648         CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
4649         ...
4650      @endverbatim
4651  * =============================================================================
4652  */
4653 static inline void CSL_SRIO_SetLSUTransfer
4655     CSL_SrioHandle      hSrio, 
4656     Uint8               lsu,
4657     SRIO_LSU_TRANSFER*  lsuTransfer
4660     /* Configure the Source and Destination Address. */
4661     hSrio->LSU_CMD[lsu].RIO_LSU_REG0 = lsuTransfer->rapidIOMSB;
4662     hSrio->LSU_CMD[lsu].RIO_LSU_REG1 = lsuTransfer->rapidIOLSB;
4663     hSrio->LSU_CMD[lsu].RIO_LSU_REG2 = lsuTransfer->dspAddress;
4665     /* Configure the number of bytes which need to be transferred. */
4666     hSrio->LSU_CMD[lsu].RIO_LSU_REG3 = 
4667                 CSL_FMK (SRIO_RIO_LSU_REG3_BYTE_COUNT, lsuTransfer->bytecount)      |
4668                 CSL_FMK (SRIO_RIO_LSU_REG3_DRBLL_VALUE,lsuTransfer->doorbellValid);
4670     /* Configure outgoing port ID, Priority and other RIO parameters. */
4671     hSrio->LSU_CMD[lsu].RIO_LSU_REG4 = 
4672             CSL_FMK(SRIO_RIO_LSU_REG4_INT_REQ,   lsuTransfer->intrRequest)  |
4673             CSL_FMK(SRIO_RIO_LSU_REG4_SRCID_MAP, lsuTransfer->srcIDMap)     |
4674             CSL_FMK(SRIO_RIO_LSU_REG4_SUP_GINT,  lsuTransfer->supInt)       |
4675             CSL_FMK(SRIO_RIO_LSU_REG4_DESTID,    lsuTransfer->dstID)        |
4676             CSL_FMK(SRIO_RIO_LSU_REG4_ID_SIZE,   lsuTransfer->idSize)       |
4677             CSL_FMK(SRIO_RIO_LSU_REG4_XAMBS,     lsuTransfer->xambs)        |
4678             CSL_FMK(SRIO_RIO_LSU_REG4_PRIORITY,  lsuTransfer->priority)     |
4679             CSL_FMK(SRIO_RIO_LSU_REG4_OUTPORTID, lsuTransfer->outPortID);
4681     /* Configure the type of request, doorbell information etc. */
4682     hSrio->LSU_CMD[lsu].RIO_LSU_REG5 = 
4683             CSL_FMK(SRIO_RIO_LSU_REG5_TTYPE,      lsuTransfer->ttype)       |
4684                     CSL_FMK(SRIO_RIO_LSU_REG5_FTYPE,      lsuTransfer->ftype)       |
4685             CSL_FMK(SRIO_RIO_LSU_REG5_HOP_COUNT,  lsuTransfer->hopCount)    |
4686             CSL_FMK(SRIO_RIO_LSU_REG5_DRBLL_INFO, lsuTransfer->doorbellInfo);
4689 /** ============================================================================
4690  *   @n@b CSL_SRIO_SetLSUReg0
4691  *
4692  *   @b Description
4693  *   @n The function configures the REG0 of the specified LSU
4694  *
4695  *   @b Arguments
4696      @verbatim
4697           hSrio             Handle of the SRIO device
4698           lsu               LSU Number
4699           rapidIOMSB        Address to be configured in the REG0
4700      @endverbatim
4701  *
4702  *   <b> Return Value </b>
4703  *   @n None
4704  *
4705  *   <b> Pre Condition </b>
4706  *   @n  CSL_SRIO_Open() must be called 
4707  *
4708  *   <b> Post Condition </b>
4709  *   @n None
4710  *
4711  *   @b Writes
4712  *   @n SRIO_RIO_LSU_REG0_RIO_ADDRESS_MSB
4713  *
4714  *   @b Example
4715  *   @verbatim
4716         CSL_SrioHandle     hSrio;
4718         // Open the CSL SRIO Module 0
4719         hSrio = CSL_SRIO_Open (0);
4720         ...
4721         // Configure REG0 of LSU 0
4722         CSL_SRIO_SetLSUReg0(hSrio, 0, 0x0);
4723         ...
4724      @endverbatim
4725  * =============================================================================
4726  */
4727 static inline void CSL_SRIO_SetLSUReg0
4729     CSL_SrioHandle      hSrio, 
4730     Uint8               lsu,
4731     Uint32              rapidIOMSB
4734     hSrio->LSU_CMD[lsu].RIO_LSU_REG0 = rapidIOMSB;
4737 /** ============================================================================
4738  *   @n@b CSL_SRIO_SetLSUReg1
4739  *
4740  *   @b Description
4741  *   @n The function configures the REG1 of the specified LSU
4742  *
4743  *   @b Arguments
4744      @verbatim
4745           hSrio             Handle of the SRIO device
4746           lsu               LSU Number
4747           rapidIOLSB        Address to be configured in the REG1
4748      @endverbatim
4749  *
4750  *   <b> Return Value </b>
4751  *   @n None
4752  *
4753  *   <b> Pre Condition </b>
4754  *   @n  CSL_SRIO_Open() must be called 
4755  *
4756  *   <b> Post Condition </b>
4757  *   @n None
4758  *
4759  *   @b Writes
4760  *   @n SRIO_RIO_LSU_REG1_RIO_ADDRESS_LSB
4761  *
4762  *   @b Example
4763  *   @verbatim
4764         CSL_SrioHandle     hSrio;
4766         // Open the CSL SRIO Module 0
4767         hSrio = CSL_SRIO_Open (0);
4768         ...
4769         // Configure REG1 of LSU 0
4770         CSL_SRIO_SetLSUReg1(hSrio, 0, 0x0);
4771         ...
4772      @endverbatim
4773  * =============================================================================
4774  */
4775 static inline void CSL_SRIO_SetLSUReg1
4777     CSL_SrioHandle      hSrio, 
4778     Uint8               lsu,
4779     Uint32              rapidIOLSB
4782     hSrio->LSU_CMD[lsu].RIO_LSU_REG1 = rapidIOLSB;
4785 /** ============================================================================
4786  *   @n@b CSL_SRIO_SetLSUReg2
4787  *
4788  *   @b Description
4789  *   @n The function configures the REG2 of the specified LSU
4790  *
4791  *   @b Arguments
4792      @verbatim
4793           hSrio             Handle of the SRIO device
4794           lsu               LSU Number
4795           dspAddress        Address to be configured in the REG2
4796      @endverbatim
4797  *
4798  *   <b> Return Value </b>
4799  *   @n None
4800  *
4801  *   <b> Pre Condition </b>
4802  *   @n  CSL_SRIO_Open() must be called 
4803  *
4804  *   <b> Post Condition </b>
4805  *   @n None
4806  *
4807  *   @b Writes
4808  *   @n SRIO_RIO_LSU_REG2_DSP_ADDRESS
4809  *
4810  *   @b Example
4811  *   @verbatim
4812         CSL_SrioHandle     hSrio;       
4814         // Open the CSL SRIO Module 0
4815         hSrio = CSL_SRIO_Open (0);
4816         ...
4817         // Configure REG2 of LSU 0
4818         CSL_SRIO_SetLSUReg2(hSrio, 0, &myBuffer);
4819         ...
4820      @endverbatim
4821  * =============================================================================
4822  */
4823 static inline void CSL_SRIO_SetLSUReg2
4825     CSL_SrioHandle      hSrio, 
4826     Uint8               lsu,
4827     Uint32              dspAddress
4830     hSrio->LSU_CMD[lsu].RIO_LSU_REG2 = dspAddress;
4833 /** ============================================================================
4834  *   @n@b CSL_SRIO_SetLSUReg3
4835  *
4836  *   @b Description
4837  *   @n The function configures the REG3 of the specified LSU
4838  *
4839  *   @b Arguments
4840      @verbatim
4841           hSrio             Handle of the SRIO device
4842           lsu               LSU Number
4843           byteCount         Byte Count
4844           doorbellValid     Doorbell valid flag 
4845      @endverbatim
4846  *
4847  *   <b> Return Value </b>
4848  *   @n None
4849  *
4850  *   <b> Pre Condition </b>
4851  *   @n  CSL_SRIO_Open() must be called 
4852  *
4853  *   <b> Post Condition </b>
4854  *   @n None
4855  *
4856  *   @b Writes
4857  *   @n SRIO_RIO_LSU_REG3_BYTE_COUNT,SRIO_RIO_LSU_REG3_DRBLL_VALUE
4858  *
4859  *   @b Example
4860  *   @verbatim
4861         CSL_SrioHandle     hSrio;       
4863         // Open the CSL SRIO Module 0
4864         hSrio = CSL_SRIO_Open (0);
4865         ...
4866         // Configure REG3 of LSU 0
4867         CSL_SRIO_SetLSUReg3(hSrio, 0, 100, 1);
4868         ...
4869      @endverbatim
4870  * =============================================================================
4871  */
4872 static inline void CSL_SRIO_SetLSUReg3
4874     CSL_SrioHandle      hSrio, 
4875     Uint8               lsu,
4876     Uint32              byteCount,
4877     Uint8               doorbellValid
4880     hSrio->LSU_CMD[lsu].RIO_LSU_REG3 = 
4881                 CSL_FMK (SRIO_RIO_LSU_REG3_BYTE_COUNT, byteCount)      |
4882                 CSL_FMK (SRIO_RIO_LSU_REG3_DRBLL_VALUE,doorbellValid);
4885 /** ============================================================================
4886  *   @n@b CSL_SRIO_SetLSUReg4
4887  *
4888  *   @b Description
4889  *   @n The function configures the REG4 of the specified LSU
4890  *
4891  *   @b Arguments
4892      @verbatim
4893           hSrio             Handle of the SRIO device
4894           lsu               LSU Number
4895           byteCount         Byte Count
4896           doorbellValid     Doorbell valid flag 
4897      @endverbatim
4898  *
4899  *   <b> Return Value </b>
4900  *   @n None
4901  *
4902  *   <b> Pre Condition </b>
4903  *   @n  CSL_SRIO_Open() must be called 
4904  *
4905  *   <b> Post Condition </b>
4906  *   @n None
4907  *
4908  *   @b Writes
4909  *   @n SRIO_RIO_LSU_REG4_DESTID, SRIO_RIO_LSU_REG4_SRCID_MAP, SRIO_RIO_LSU_REG4_ID_SIZE,
4910  *   @n SRIO_RIO_LSU_REG4_OUTPORTID, SRIO_RIO_LSU_REG4_PRIORITY, SRIO_RIO_LSU_REG4_XAMBS,
4911  *   @n SRIO_RIO_LSU_REG4_SUP_GINT, SRIO_RIO_LSU_REG4_INT_REQ
4912  *
4913  *   @b Example
4914  *   @verbatim
4915         CSL_SrioHandle     hSrio;       
4917         // Open the CSL SRIO Module 0
4918         hSrio = CSL_SRIO_Open (0);
4919         ...
4920         // Configure REG4 of LSU 0
4921         CSL_SRIO_SetLSUReg4(hSrio, 0, 0xBEEF, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0);
4922         ...
4923      @endverbatim
4924  * =============================================================================
4925  */
4926 static inline void CSL_SRIO_SetLSUReg4
4928     CSL_SrioHandle      hSrio, 
4929     Uint8               lsu,
4930     Uint16              dstId,
4931     Uint8               srcIdMap,
4932     Uint8               idSize,
4933     Uint8               outPortId,
4934     Uint8               priority,
4935     Uint8               xambs,
4936     Uint8               supGoodInt,
4937     Uint8               intRequest
4940     hSrio->LSU_CMD[lsu].RIO_LSU_REG4 = 
4941             CSL_FMK(SRIO_RIO_LSU_REG4_INT_REQ,   intRequest)    |
4942             CSL_FMK(SRIO_RIO_LSU_REG4_SRCID_MAP, srcIdMap)      |
4943             CSL_FMK(SRIO_RIO_LSU_REG4_SUP_GINT,  supGoodInt)    |
4944             CSL_FMK(SRIO_RIO_LSU_REG4_DESTID,    dstId)         |
4945             CSL_FMK(SRIO_RIO_LSU_REG4_ID_SIZE,   idSize)        |
4946             CSL_FMK(SRIO_RIO_LSU_REG4_XAMBS,     xambs)         |
4947             CSL_FMK(SRIO_RIO_LSU_REG4_PRIORITY,  priority)      |
4948             CSL_FMK(SRIO_RIO_LSU_REG4_OUTPORTID, outPortId);
4951 /** ============================================================================
4952  *   @n@b CSL_SRIO_SetLSUReg5
4953  *
4954  *   @b Description
4955  *   @n The function configures the REG5 of the specified LSU
4956  *
4957  *   @b Arguments
4958      @verbatim
4959           hSrio             Handle of the SRIO device
4960           lsu               LSU Number
4961           ttype             TTYPE value
4962           ftype             FTYPE value
4963           hopCount          Hop Count
4964           doorBellInfo      Doorbell Information
4965      @endverbatim
4966  *
4967  *   <b> Return Value </b>
4968  *   @n None
4969  *
4970  *   <b> Pre Condition </b>
4971  *   @n  CSL_SRIO_Open() must be called 
4972  *
4973  *   <b> Post Condition </b>
4974  *   @n None
4975  *
4976  *   @b Writes
4977  *   @n SRIO_RIO_LSU_REG5_TTYPE,     SRIO_RIO_LSU_REG5_FTYPE,
4978  *   @n SRIO_RIO_LSU_REG5_HOP_COUNT, SRIO_RIO_LSU_REG5_DRBLL_INFO
4979  *
4980  *   @b Example
4981  *   @verbatim
4982         CSL_SrioHandle     hSrio;       
4984         // Open the CSL SRIO Module 0
4985         hSrio = CSL_SRIO_Open (0);
4986         ...
4987         // Configure REG5 of LSU 0
4988         CSL_SRIO_SetLSUReg5(hSrio, 0, 4, 5, 1, 0);
4989         ...
4990      @endverbatim
4991  * =============================================================================
4992  */
4993 static inline void CSL_SRIO_SetLSUReg5
4995     CSL_SrioHandle      hSrio, 
4996     Uint8               lsu,
4997     Uint8               ttype,
4998     Uint8               ftype,
4999     Uint8               hopCount,
5000     Uint16              doorbellInfo
5003     hSrio->LSU_CMD[lsu].RIO_LSU_REG5 = 
5004             CSL_FMK(SRIO_RIO_LSU_REG5_TTYPE,      ttype)       |
5005                     CSL_FMK(SRIO_RIO_LSU_REG5_FTYPE,      ftype)       |
5006             CSL_FMK(SRIO_RIO_LSU_REG5_HOP_COUNT,  hopCount)    |
5007             CSL_FMK(SRIO_RIO_LSU_REG5_DRBLL_INFO, doorbellInfo);
5010 /** ============================================================================
5011  *   @n@b CSL_SRIO_IsLSUFull
5012  *
5013  *   @b Description
5014  *   @n The function checks if the specific LSU is BUSY or not?
5015  *
5016  *   @b Arguments
5017      @verbatim
5018           hSrio             Handle of the SRIO device
5019           lsu               LSU Number which is to checked
5020      @endverbatim
5021  *
5022  *   <b> Return Value </b>
5023  *   @n TRUE  - All the LSU Shadow Registers are being used
5024  *   @n FALSE - There is space in the LSU Shadow Registers
5025  *
5026  *   <b> Pre Condition </b>
5027  *   @n  CSL_SRIO_Open() must be called 
5028  *
5029  *   <b> Post Condition </b>
5030  *   @n None
5031  *
5032  *   @b Reads
5033  *   @n SRIO_RIO_LSU_REG6_FULL
5034  *
5035  *   @b Example
5036  *   @verbatim
5037         CSL_SrioHandle     hSrio;
5038         SRIO_LSU_TRANSFER  lsuTransfer;
5040         // Open the CSL SRIO Module 0
5041         hSrio = CSL_SRIO_Open (0);
5042         ...
5044         // Wait around till there is space to write 
5045         while (1)
5046         {
5047             if (CSL_SRIO_IsLSUFull (hSrio, 1) == FALSE)
5048                 break;
5049         }
5050         
5051         // Populate the Transfer Information. 
5052         lsuTransfer.rapidIOMSB    = 0x0;
5053         lsuTransfer.rapidIOLSB    = (Uint32)&tx_buffer[0];
5054         lsuTransfer.dspAddress    = (Uint32)&rx_buffer[0];
5055         lsuTransfer.bytecount     = 256;
5056         lsuTransfer.doorbellValid = 0;
5057         lsuTransfer.intrRequest   = 1;
5058         lsuTransfer.supInt        = 0;
5059         lsuTransfer.xambs         = 0;
5060         lsuTransfer.priority      = 2;
5061         lsuTransfer.outPortID     = 1;
5062         lsuTransfer.idSize        = 1;
5063         lsuTransfer.srcIDMap      = 0;
5064         lsuTransfer.dstID         = 0xDEAD;
5065         lsuTransfer.ttype         = 4;
5066         lsuTransfer.ftype         = 5;
5067         lsuTransfer.hopCount      = 0;
5068         lsuTransfer.doorbellInfo  = 0;
5070         // Send the transfer on LSU 1 
5071         CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
5073      @endverbatim
5074  * =============================================================================
5075  */
5076 static inline Bool CSL_SRIO_IsLSUFull
5078     CSL_SrioHandle  hSrio, 
5079     Uint8           lsu
5082     if (CSL_FEXT(hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_FULL) == 1)
5083         return TRUE;
5084     return FALSE;
5087 /** ============================================================================
5088  *   @n@b CSL_SRIO_IsLSUBusy
5089  *
5090  *   @b Description
5091  *   @n The function checks if the specific LSU is BUSY or not?
5092  *
5093  *   @b Arguments
5094      @verbatim
5095           hSrio             Handle of the SRIO device
5096           lsu               LSU Number which is to checked
5097      @endverbatim
5098  *
5099  *   <b> Return Value </b>
5100  *   @n TRUE  - LSU is Busy
5101  *   @n FALSE - LSU is Free
5102  *
5103  *   <b> Pre Condition </b>
5104  *   @n  CSL_SRIO_Open() must be called 
5105  *
5106  *   <b> Post Condition </b>
5107  *   @n None
5108  *
5109  *   @b Reads
5110  *   @n SRIO_RIO_LSU_REG6_BUSY
5111  *
5112  *   @b Example
5113  *   @verbatim
5114         CSL_SrioHandle     hSrio;
5115         SRIO_LSU_TRANSFER  lsuTransfer;
5117         // Open the CSL SRIO Module 0
5118         hSrio = CSL_SRIO_Open (0);
5119         ...
5120         // Populate the Transfer Information. 
5121         lsuTransfer.rapidIOMSB    = 0x0;
5122         lsuTransfer.rapidIOLSB    = (Uint32)&tx_buffer[0];
5123         lsuTransfer.dspAddress    = (Uint32)&rx_buffer[0];
5124         lsuTransfer.bytecount     = 256;
5125         lsuTransfer.doorbellValid = 0;
5126         lsuTransfer.intrRequest   = 1;
5127         lsuTransfer.supInt        = 0;
5128         lsuTransfer.xambs         = 0;
5129         lsuTransfer.priority      = 2;
5130         lsuTransfer.outPortID     = 1;
5131         lsuTransfer.idSize        = 1;
5132         lsuTransfer.srcIDMap      = 0;
5133         lsuTransfer.dstID         = 0xDEAD;
5134         lsuTransfer.ttype         = 4;
5135         lsuTransfer.ftype         = 5;
5136         lsuTransfer.hopCount      = 0;
5137         lsuTransfer.doorbellInfo  = 0;
5139         // Send the transfer on LSU 1 
5140         CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
5142         // Wait around till the transfer is completed.
5143         while (1)
5144         {
5145             if (CSL_SRIO_IsLSUBusy (hSrio, 1) == FALSE)
5146                 break;
5147         }
5149         // Control comes here indicating that the transfer was completed.
5150         ...
5151      @endverbatim
5152  * =============================================================================
5153  */
5154 static inline Bool CSL_SRIO_IsLSUBusy
5156     CSL_SrioHandle  hSrio, 
5157     Uint8           lsu
5160     if (CSL_FEXT(hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_BUSY) == 1)
5161         return TRUE;
5162     return FALSE;
5165 /** ============================================================================
5166  *   @n@b CSL_SRIO_GetLSUContextTransaction
5167  *
5168  *   @b Description
5169  *   @n The function gets the LSU Context bit which can be used by the 
5170  *      transaction to identify if the context of the completion code is with 
5171  *      respect to the current transaction or not
5172  *
5173  *   @b Arguments
5174      @verbatim
5175           hSrio             Handle of the SRIO device
5176           lsu               LSU Index
5177           context           Context Information populated by this API 
5178           transID           Transaction ID populated by this API
5179      @endverbatim
5180  *
5181  *   <b> Return Value </b>
5182  *   @n None
5183  *
5184  *   <b> Pre Condition </b>
5185  *   @n  CSL_SRIO_Open() must be called 
5186  *
5187  *   <b> Post Condition </b>
5188  *   @n None
5189  *
5190  *   @b Reads
5191  *   @n SRIO_RIO_LSU_REG6_LCB,SRIO_RIO_LSU_REG6_LTID
5192  *
5193  *   @b Example
5194  *   @verbatim
5195         CSL_SrioHandle     hSrio;
5196         Uint8              context;
5197         Uint8              transID;
5199         // Open the CSL SRIO Module 0
5200         hSrio = CSL_SRIO_Open (0);
5201         ...
5202         // Get the LSU Context and Transaction Information.
5203         CSL_SRIO_GetLSUContextTransaction (hSrio, &context, &transID);
5204         ...
5205      @endverbatim
5206  * =============================================================================
5207  */
5208 static inline void CSL_SRIO_GetLSUContextTransaction
5210     CSL_SrioHandle  hSrio, 
5211     Uint8           lsu,
5212     Uint8*          context,
5213     Uint8*          transID
5216     Uint32 value = hSrio->LSU_CMD[lsu].RIO_LSU_REG6;
5218     /* Populate the context and transaction identifier. */
5219     *context = CSL_FEXT (value, SRIO_RIO_LSU_REG6_LCB);
5220     *transID = CSL_FEXT (value, SRIO_RIO_LSU_REG6_LTID);
5223 /** ============================================================================
5224  *   @n@b CSL_SRIO_CancelLSUTransaction
5225  *
5226  *   @b Description
5227  *   @n The function is used to cancel an LSU Transaction previously submitted. 
5228  *
5229  *   @b Arguments
5230      @verbatim
5231           hSrio             Handle of the SRIO device
5232           lsu               LSU Index
5233           privID            Priv ID of the original transaction submitter.
5234      @endverbatim
5235  *
5236  *   <b> Return Value </b>
5237  *   @n None
5238  *
5239  *   <b> Pre Condition </b>
5240  *   @n  CSL_SRIO_Open() must be called 
5241  *
5242  *   <b> Post Condition </b>
5243  *   @n None
5244  *
5245  *   @b Writes
5246  *   @n SRIO_RIO_LSU_REG6_CBUSY = 1,
5247  *   @n SRIO_RIO_LSU_REG6_PRIVID
5248  *
5249  *   @b Example
5250  *   @verbatim
5251         CSL_SrioHandle     hSrio;
5253         // Open the CSL SRIO Module 0
5254         hSrio = CSL_SRIO_Open (0);
5255         ...
5256         // Cancel the LSU Transaction for LSU 0 for PRIV-ID 1
5257         CSL_SRIO_CancelLSUTransaction (hSrio, 0, 1);
5258         ...
5259      @endverbatim
5260  * =============================================================================
5261  */
5262 static inline void CSL_SRIO_CancelLSUTransaction
5264     CSL_SrioHandle  hSrio, 
5265     Uint8           lsu,
5266     Uint8           privID
5269     hSrio->LSU_CMD[lsu].RIO_LSU_REG6 = 
5270             CSL_FMK(SRIO_RIO_LSU_REG6_CBUSY,  1)       |
5271             CSL_FMK(SRIO_RIO_LSU_REG6_PRIVID, privID);
5274 /** ============================================================================
5275  *   @n@b CSL_SRIO_RestartLSUTransaction
5276  *
5277  *   @b Description
5278  *   @n The function is used to restart an LSU Transaction which had been halted
5279  *      due to an error condition.
5280  *
5281  *   @b Arguments
5282      @verbatim
5283           hSrio             Handle of the SRIO device
5284           lsu               LSU Index which needs to be restarted
5285      @endverbatim
5286  *
5287  *   <b> Return Value </b>
5288  *   @n None
5289  *
5290  *   <b> Pre Condition </b>
5291  *   @n  CSL_SRIO_Open() must be called 
5292  *
5293  *   <b> Post Condition </b>
5294  *   @n None
5295  *
5296  *   @b Writes
5297  *   @n SRIO_RIO_LSU_REG6_RESTART=1
5298  *
5299  *   @b Example
5300  *   @verbatim
5301         CSL_SrioHandle     hSrio;
5303         // Open the CSL SRIO Module 0
5304         hSrio = CSL_SRIO_Open (0);
5305         ...
5306         // Restart the LSU transaction 1
5307         CSL_SRIO_RestartLSUTransaction (hSrio, 1);
5308         ...
5309      @endverbatim
5310  * =============================================================================
5311  */
5312 static inline void CSL_SRIO_RestartLSUTransaction
5314     CSL_SrioHandle  hSrio, 
5315     Uint8           lsu
5318     hSrio->LSU_CMD[lsu].RIO_LSU_REG6 = CSL_FMK (SRIO_RIO_LSU_REG6_RESTART, 1);
5321 /** ============================================================================
5322  *   @n@b CSL_SRIO_FlushLSUTransaction
5323  *
5324  *   @b Description
5325  *   @n The function is used to flush an LSU Transaction previously submitted 
5326  *      and which matches the SRCID specified here.
5327  *
5328  *   @b Arguments
5329      @verbatim
5330           hSrio             Handle of the SRIO device
5331           lsu               LSU Index which needs to be flushed
5332           srcIDMap          Source ID 
5333      @endverbatim
5334  *
5335  *   <b> Return Value </b>
5336  *   @n None
5337  *
5338  *   <b> Pre Condition </b>
5339  *   @n  CSL_SRIO_Open() must be called 
5340  *
5341  *   <b> Post Condition </b>
5342  *   @n None
5343  *
5344  *   @b Writes
5345  *   @n SRIO_RIO_LSU_REG6_SCRID_MAP, SRIO_RIO_LSU_REG6_FLUSH=1
5346  *
5347  *   @b Example
5348  *   @verbatim
5349         CSL_SrioHandle     hSrio;
5351         // Open the CSL SRIO Module 0
5352         hSrio = CSL_SRIO_Open (0);
5353         ...
5354         // Flush the LSU transaction on LSU 1 with SRC ID 0x0 
5355         CSL_SRIO_FlushLSUTransaction (hSrio, 1, 0x0);
5356         ...
5357      @endverbatim
5358  * =============================================================================
5359  */
5360 static inline void CSL_SRIO_FlushLSUTransaction
5362     CSL_SrioHandle  hSrio, 
5363     Uint8           lsu,
5364     Uint8           srcIDMap
5367     CSL_FINS (hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_SCRID_MAP, srcIDMap);
5368     CSL_FINS (hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_FLUSH, 1);
5371 /** ============================================================================
5372  *   @n@b CSL_SRIO_SetLSUShadowRegs
5373  *
5374  *   @b Description
5375  *   @n The function is used to configure the number of LSU Shadow Registers.
5376  *
5377  *   @b Arguments
5378      @verbatim
5379           hSrio             Handle of the SRIO device
5380           shadowGrp0        Number of Shadow Registers associated with LSU0-3
5381           shadowGrp1        Number of Shadow Registers associated with LSU4-7
5382      @endverbatim
5383  *
5384  *   <b> Return Value </b>
5385  *   @n None
5386  *
5387  *   <b> Pre Condition </b>
5388  *   @n  CSL_SRIO_Open() must be called 
5389  *
5390  *   <b> Post Condition </b>
5391  *   @n None
5392  *
5393  *   @b Writes
5394  *   @n SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP0, SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP1
5395  *
5396  *   @b Example
5397  *   @verbatim
5398         CSL_SrioHandle     hSrio;
5399  
5400         // Open the CSL SRIO Module 0
5401         hSrio = CSL_SRIO_Open (0);
5402         ...
5403         // Set the LSU Shadow Regs as 4 for LSU 0-3 and 4 for LSU 4-7
5404         CSL_SRIO_SetLSUShadowRegs (hSrio, 0x0, 0x0);
5405         ...
5406      @endverbatim
5407  * =============================================================================
5408  */
5409 static inline void CSL_SRIO_SetLSUShadowRegs
5411     CSL_SrioHandle  hSrio,
5412     Uint32          shadowGrp0,
5413     Uint32          shadowGrp1
5416     hSrio->RIO_LSU_SETUP_REG0 = CSL_FMK(SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP0, shadowGrp0) |
5417                                 CSL_FMK(SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP1, shadowGrp1);
5420 /** ============================================================================
5421  *   @n@b CSL_SRIO_GetLSUShadowRegs
5422  *
5423  *   @b Description
5424  *   @n The function is used to get the number of shadow registers associated
5425  *      with each LSU.
5426  *
5427  *   @b Arguments
5428      @verbatim
5429           hSrio             Handle of the SRIO device
5430           lsu               LSU Index for which the count is required
5431           count             Number of Shadow Registers associated with the specified LSU
5432                             populated by this API
5433      @endverbatim
5434  *
5435  *   <b> Return Value </b>
5436  *   @n None
5437  *
5438  *   <b> Pre Condition </b>
5439  *   @n  CSL_SRIO_Open() must be called 
5440  *
5441  *   <b> Post Condition </b>
5442  *   @n None
5443  *
5444  *   @b Reads
5445  *   @n SRIO_RIO_LSU_SETUP_REG0_LSU0_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU1_CNT;
5446  *      SRIO_RIO_LSU_SETUP_REG0_LSU2_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU3_CNT;
5447  *      SRIO_RIO_LSU_SETUP_REG0_LSU4_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU5_CNT;
5448  *      SRIO_RIO_LSU_SETUP_REG0_LSU6_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU7_CNT
5449  *
5450  *   @b Example
5451  *   @verbatim
5452         CSL_SrioHandle     hSrio;
5453         Uint8              count;
5454  
5455         // Open the CSL SRIO Module 0
5456         hSrio = CSL_SRIO_Open (0);
5457         ...
5458         // Get the number of shadow register for LSU 1 
5459         CSL_SRIO_GetLSUShadowRegs (hSrio, 1, &count);
5460         ...
5461      @endverbatim
5462  * =============================================================================
5463  */
5464 static inline void CSL_SRIO_GetLSUShadowRegs
5466     CSL_SrioHandle  hSrio,
5467     Uint8           index,
5468     Uint8*          count
5471     if (index == 0)
5472        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU0_CNT);
5473     else if (index == 1)
5474        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU1_CNT);
5475     else if (index == 2)
5476        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU2_CNT);
5477     else if (index == 3)
5478        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU3_CNT);
5479     else if (index == 4)
5480        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU4_CNT);
5481     else if (index == 5)
5482        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU5_CNT);
5483     else if (index == 6)
5484        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU6_CNT);
5485     else if (index == 7)
5486        *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU7_CNT);
5489 /** ============================================================================
5490  *   @n@b CSL_SRIO_EnableSrcIDInterrupts
5491  *
5492  *   @b Description
5493  *   @n The function is used to enable the LSU interrupts to based on the SRCID
5494  *      and not on the LSU specific interrupt bit.
5495  *
5496  *   @b Arguments
5497      @verbatim
5498           hSrio             Handle of the SRIO device
5499           index             LSU Index to be configured.
5500      @endverbatim
5501  *
5502  *   <b> Return Value </b>
5503  *   @n None
5504  *
5505  *   <b> Pre Condition </b>
5506  *   @n  CSL_SRIO_Open() must be called 
5507  *
5508  *   <b> Post Condition </b>
5509  *   @n None
5510  *
5511  *   @b Writes
5512  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;
5513  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;
5514  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=06;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;
5515  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0
5516  *
5517  *   @b Example
5518  *   @verbatim
5519         CSL_SrioHandle     hSrio;
5520  
5521         // Open the CSL SRIO Module 0
5522         hSrio = CSL_SRIO_Open (0);
5523         ...
5524         // Enable Source ID interrupts for LSU 1
5525         CSL_SRIO_EnableSrcIDInterrupts (hSrio, 1);
5526         ...
5527      @endverbatim
5528  * =============================================================================
5529  */
5530 static inline void CSL_SRIO_EnableSrcIDInterrupts
5532     CSL_SrioHandle  hSrio,
5533     Uint8           index
5536     if (index == 0)
5537        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 0, 0, 0);
5538     else if (index == 1)
5539        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 1, 1, 0);
5540     else if (index == 2)
5541        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 2, 2, 0);
5542     else if (index == 3)
5543        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 3, 3, 0);
5544     else if (index == 4)
5545        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 4, 4, 0);
5546     else if (index == 5)
5547        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 5, 5, 0);
5548     else if (index == 6)
5549        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 6, 6, 0);
5550     else if (index == 7)
5551        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 7, 7, 0);
5554 /** ============================================================================
5555  *   @n@b CSL_SRIO_DisableSrcIDInterrupts
5556  *
5557  *   @b Description
5558  *   @n The function is used to enable the LSU interrupts to based on the LSU 
5559  *      specific interrupt bit and not on the SRCID.
5560  *
5561  *   @b Arguments
5562      @verbatim
5563           hSrio             Handle of the SRIO device
5564           index             LSU Index to be configured.
5565      @endverbatim
5566  *
5567  *   <b> Return Value </b>
5568  *   @n None
5569  *
5570  *   <b> Pre Condition </b>
5571  *   @n  CSL_SRIO_Open() must be called 
5572  *
5573  *   <b> Post Condition </b>
5574  *   @n None
5575  *
5576  *   @b Writes
5577  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=1;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=2;
5578  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=4;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=8;
5579  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=16;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=32;
5580  *   @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=64
5581  *
5582  *   @b Example
5583  *   @verbatim
5584         CSL_SrioHandle     hSrio;
5585  
5586         // Open the CSL SRIO Module 0
5587         hSrio = CSL_SRIO_Open (0);
5588         ...
5589         // Disable SRC ID interrupts for LSU 2
5590         CSL_SRIO_DisableSrcIDInterrupts (hSrio, 2);
5591         ...
5592      @endverbatim
5593  * =============================================================================
5594  */
5595 static inline void CSL_SRIO_DisableSrcIDInterrupts
5597     CSL_SrioHandle  hSrio,
5598     Uint8           index
5601     if (index == 0)
5602        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 0, 0, 1);
5603     else if (index == 1)
5604        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 1, 1, 1);
5605     else if (index == 2)
5606        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 2, 2, 1);
5607     else if (index == 3)
5608        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 3, 3, 1);
5609     else if (index == 4)
5610        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 4, 4, 1);
5611     else if (index == 5)
5612        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 5, 5, 1);
5613     else if (index == 6)
5614        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 6, 6, 1);
5615     else if (index == 7)
5616        CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 7, 7, 1);
5619 /** ============================================================================
5620  *   @n@b CSL_SRIO_SetTimeoutCnt
5621  *
5622  *   @b Description
5623  *   @n The function is used to set the number of timecode changes after an error
5624  *      condition before the current LSU transaction is discarded and a new 
5625  *      transaction is loaded from the shadow register.
5626  *
5627  *   @b Arguments
5628      @verbatim
5629           hSrio             Handle of the SRIO device
5630           timeoutCnt        Time out count to be configured.
5631      @endverbatim
5632  *
5633  *   <b> Return Value </b>
5634  *   @n None
5635  *
5636  *   <b> Pre Condition </b>
5637  *   @n  CSL_SRIO_Open() must be called 
5638  *
5639  *   <b> Post Condition </b>
5640  *   @n None
5641  *
5642  *   @b Writes
5643  *   @n SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT
5644  *
5645  *   @b Example
5646  *   @verbatim
5647         CSL_SrioHandle     hSrio;
5648  
5649         // Open the CSL SRIO Module 0
5650         hSrio = CSL_SRIO_Open (0);
5651         ...
5652         // Set the Timeout Count to be 1
5653         CSL_SRIO_SetTimeoutCnt (hSrio, 2);
5654         ...
5655      @endverbatim
5656  * =============================================================================
5657  */
5658 static inline void CSL_SRIO_SetTimeoutCnt
5660     CSL_SrioHandle  hSrio,
5661     Uint8           timeoutCnt
5664     CSL_FINS (hSrio->RIO_LSU_SETUP_REG1, SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT, timeoutCnt);
5667 /** ============================================================================
5668  *   @n@b CSL_SRIO_GetTimeoutCnt
5669  *
5670  *   @b Description
5671  *   @n The function is used to get the number of timecode changes after an error
5672  *      condition before the current LSU transaction is discarded and a new 
5673  *      transaction is loaded from the shadow register.
5674  *
5675  *   @b Arguments
5676      @verbatim
5677           hSrio             Handle of the SRIO device
5678           timeoutCnt        Time out count to be populated by this API.
5679      @endverbatim
5680  *
5681  *   <b> Return Value </b>
5682  *   @n None
5683  *
5684  *   <b> Pre Condition </b>
5685  *   @n  CSL_SRIO_Open() must be called 
5686  *
5687  *   <b> Post Condition </b>
5688  *   @n None
5689  *
5690  *   @b Reads
5691  *   @n SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT
5692  *
5693  *   @b Example
5694  *   @verbatim
5695         CSL_SrioHandle     hSrio;
5696         Uint8              timeoutCnt;
5697  
5698         // Open the CSL SRIO Module 0
5699         hSrio = CSL_SRIO_Open (0);
5700         ...
5701         // Get the Timeout Count
5702         CSL_SRIO_GetTimeoutCnt (hSrio, &timeoutCnt);
5703         ...
5704      @endverbatim
5705  * =============================================================================
5706  */
5707 static inline void CSL_SRIO_GetTimeoutCnt
5709     CSL_SrioHandle  hSrio,
5710     Uint8*          timeoutCnt
5713     *timeoutCnt = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG1, SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT);
5716 /** ============================================================================
5717  *   @n@b CSL_SRIO_GetLSUCompletionCode
5718  *
5719  *   @b Description
5720  *   @n The function gets the completion code for a previous executed transfer.
5721  *
5722  *   @b Arguments
5723      @verbatim
5724           hSrio             Handle of the SRIO device
5725           lsu               LSU Number which is to checked
5726           transId           Transaction ID for which the completion code is
5727                             required.
5728           compCode          Completion Code populated by this API
5729           contextBit        Context Bit populated by this API
5730      @endverbatim
5731  *
5732  *   <b> Return Value </b>
5733  *   @n None
5734  *
5735  *   <b> Pre Condition </b>
5736  *   @n None
5737  *
5738  *   <b> Post Condition </b>
5739  *   @n None
5740  *
5741  *   @b Reads
5742  *   @n  SRIO_LSU_STAT_REG
5743  
5744  *   @b Example
5745  *   @verbatim
5746         CSL_SrioHandle     hSrio;
5747         Uint8              context;
5748         Uint8              transID;
5749         SRIO_LSU_TRANSFER  lsuTransfer;
5750         Uint8              compCode;
5751         Uint8              contextBit;
5753         // Open the CSL SRIO Module 0
5754         hSrio = CSL_SRIO_Open (0);
5755         ...
5756         // Get the LSU Context and Transaction Information.
5757         CSL_SRIO_GetLSUContextTransaction (hSrio, &context, &transID);
5758         ...
5759         // Send the transfer on LSU 1 
5760         CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
5762         // Wait around till the transfer is completed.
5763         while (1)
5764         {
5765             if (CSL_SRIO_IsLSUBusy (hSrio, 1) == FALSE)
5766                 break;
5767         }
5768         // Get the completion code.
5769         CSL_SRIO_GetLSUCompletionCode (hSrio, 1, transID, &compCode, &contextBit);
5770         ...
5771      @endverbatim
5772  * =============================================================================
5773  */
5774 static inline void CSL_SRIO_GetLSUCompletionCode
5776     CSL_SrioHandle  hSrio, 
5777     Uint8           lsu,
5778     Uint8           transID,
5779     Uint8*          compCode,
5780     Uint8*          contextBit
5783     Uint8   lsuRegIndex;
5785     /* Check the LSU for which the completion code is required. */
5786     if ((lsu == 0) || (lsu == 4))
5787     {
5788         /* LSU0 or LSU4: Determine which register index we need to access.
5789          *  For LSU0 the register index is 0 and 1; but for LSU4 the register index is 3 and 4 */
5790         if (lsu == 0)
5791             lsuRegIndex = 0;
5792         else
5793             lsuRegIndex = 3;
5795         /* There are 9 pending LSU Transaction ID for this. */
5796         if (transID < 8)
5797         {
5798             /* Transaction ID 0-7 are handled here. */
5799             *compCode   = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 3), ((transID << 2) + 1));
5800             *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], (transID << 2), (transID << 2));
5801         }
5802         else
5803         {
5804             /* Transaction ID 8 is handled here. */
5805             *compCode   = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], 3, 1);
5806             *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], 0, 0);
5807         }
5808     }
5809     else if ((lsu == 1) || (lsu == 5))
5810     {
5811         /* LSU1 or LSU5: Determine which register index we need to access.
5812          *  For LSU1 the register index is 1; but for LSU5 the register index is 4 */
5813         if (lsu == 1)
5814             lsuRegIndex = 1;
5815         else
5816             lsuRegIndex = 4;
5818         /* There are 6 pending LSU Transaction ID for this. */
5819         *compCode   = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 7), ((transID << 2) + 5));
5820         *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 4), ((transID << 2) + 4));
5821     }
5822     else if ((lsu == 2) || (lsu == 6))
5823     {
5824         /* LSU2 or LSU6: Determine which register index we need to access.
5825          *  For LSU2 the register index is 1 and 2; but for LSU5 the register index is 4 and 5 */
5826         if (lsu == 2)
5827             lsuRegIndex = 1;
5828         else
5829             lsuRegIndex = 4;
5831         /* There are 5 pending LSU Transaction ID for this. */
5832         if (transID == 0)
5833         {
5834             /* Transaction ID 0 is handled here. */
5835             *compCode   = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], 31, 29);
5836             *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], 28, 28);
5837         }
5838         else
5839         {
5840             /* Transaction ID 1-4 are handled here. */
5841             *compCode   = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], ((transID << 2) - 1), ((transID << 2) - 3));
5842             *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], ((transID << 2) - 4), ((transID << 2) - 4));
5843         }
5844     }
5845     else if ((lsu == 3) || (lsu == 7))
5846     {
5847         /* LSU3 or LSU7: Determine which register index we need to access.
5848          *  For LSU3 the register index is 2; but for LSU5 the register index is 5 */
5849         if (lsu == 3)
5850             lsuRegIndex = 2;
5851         else
5852             lsuRegIndex = 5;
5854         /* There are 4 pending LSU Transaction ID for this. */
5855         *compCode   = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 19), ((transID << 2) + 17));
5856         *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 16), ((transID << 2) + 16));
5857     }
5860 /** ============================================================================
5861  *   @n@b CSL_SRIO_SetLSUFlowMask
5862  *
5863  *   @b Description
5864  *   @n The function is used to set the LSU Flow Masks
5865  *
5866  *   @b Arguments
5867      @verbatim
5868           hSrio             Handle of the SRIO device
5869           lsu               LSU Number for which flow mask is to be configured          
5870           flowMask          Flow Mask to be configured.
5871      @endverbatim
5872  *
5873  *   <b> Return Value </b>
5874  *   @n None
5875  *
5876  *   <b> Pre Condition </b>
5877  *   @n  CSL_SRIO_Open() must be called 
5878  *
5879  *   <b> Post Condition </b>
5880  *   @n None
5881  *
5882  *   @b Writes
5883  *   @n SRIO_RIO_LSU_FLOW_MASKS_LSU_EVEN_FLOW_MASK;SRIO_RIO_LSU_FLOW_MASKS_LSU_ODD_FLOW_MASK 
5884  *
5885  *   @b Example
5886  *   @verbatim
5887         CSL_SrioHandle     hSrio;
5888  
5889         // Open the CSL SRIO Module 0
5890         hSrio = CSL_SRIO_Open (0);
5891         ...
5892         // Set the LSU Flow Mask for LSU 0 to use Flow 1
5893         CSL_SRIO_SetLSUFlowMask (hSrio, 0, 1);
5894         ...
5895      @endverbatim
5896  * =============================================================================
5897  */
5898 static inline void CSL_SRIO_SetLSUFlowMask
5900     CSL_SrioHandle  hSrio,
5901     Uint8           lsu,
5902     Uint16          flowMask
5905     switch (lsu)
5906     {
5907         case 0:
5908         {
5909             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[0], 15, 0, flowMask);
5910             break;
5911         }
5912         case 1:
5913         {
5914             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[0], 31, 16,flowMask);
5915             break;
5916         }
5917         case 2:
5918         {
5919             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[1], 15, 0, flowMask);
5920             break;
5921         }
5922         case 3:
5923         {
5924             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[1], 31, 16,flowMask);
5925             break;
5926         }
5927         case 4:
5928         {
5929             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[2], 15, 0, flowMask);
5930             break;
5931         }
5932         case 5:
5933         {
5934             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[2], 31, 16,flowMask);
5935             break;
5936         }
5937         case 6:
5938         {
5939             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[3], 15, 0, flowMask);
5940             break;
5941         }
5942         case 7:
5943         {
5944             CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[3], 31, 16,flowMask);
5945             break;
5946         }
5947     }
5950 /** ============================================================================
5951  *   @n@b CSL_SRIO_GetLSUFlowMask
5952  *
5953  *   @b Description
5954  *   @n The function is used to get the LSU Flow Masks
5955  *
5956  *   @b Arguments
5957      @verbatim
5958           hSrio             Handle of the SRIO device
5959           lsu               LSU Number for which flow mask is to be retreived.
5960           flowMask          Flow Mask to be populated by this API
5961      @endverbatim
5962  *
5963  *   <b> Return Value </b>
5964  *   @n None
5965  *
5966  *   <b> Pre Condition </b>
5967  *   @n  CSL_SRIO_Open() must be called 
5968  *
5969  *   <b> Post Condition </b>
5970  *   @n None
5971  *
5972  *   @b Reads
5973  *   @n SRIO_RIO_LSU_FLOW_MASKS_LSU_FLOW_MASK 
5974  *
5975  *   @b Example
5976  *   @verbatim
5977         CSL_SrioHandle     hSrio;
5978         Uint16             flowMask;
5979  
5980         // Open the CSL SRIO Module 0
5981         hSrio = CSL_SRIO_Open (0);
5982         ...
5983         // Get the LSU Flow Mask for LSU 0 
5984         CSL_SRIO_GetLSUFlowMask (hSrio, 0, &flowMask);
5985         ...
5986      @endverbatim
5987  * =============================================================================
5988  */
5989 static inline void CSL_SRIO_GetLSUFlowMask
5991     CSL_SrioHandle  hSrio,
5992     Uint8           lsu,
5993     Uint16*         flowMask
5996     switch (lsu)
5997     {
5998         case 0:
5999         {
6000             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[0], 15, 0);
6001             break;
6002         }
6003         case 1:
6004         {
6005             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[0], 31, 16);
6006             break;
6007         }
6008         case 2:
6009         {
6010             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[1], 15, 0);
6011             break;
6012         }
6013         case 3:
6014         {
6015             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[1], 31, 16);
6016             break;
6017         }
6018         case 4:
6019         {
6020             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[2], 15, 0);
6021             break;
6022         }
6023         case 5:
6024         {
6025             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[2], 31, 16);
6026             break;
6027         }
6028         case 6:
6029         {
6030             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[3], 15, 0);
6031             break;
6032         }
6033         case 7:
6034         {
6035             *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[3], 31, 16);
6036             break;
6037         }
6038     }
6041 /** ============================================================================
6042  *   @n@b CSL_SRIO_SetSupervisorPerms
6043  *
6044  *   @b Description
6045  *   @n The function is used to set the supervisor permissions
6046  *
6047  *   @b Arguments
6048      @verbatim
6049           hSrio             Handle of the SRIO device
6050           supervisor16ID    16 bit Supervisor ID
6051           supervisor8ID     8 bit Supervisor ID
6052      @endverbatim
6053  *
6054  *   <b> Return Value </b>
6055  *   @n None
6056  *
6057  *   <b> Pre Condition </b>
6058  *   @n  CSL_SRIO_Open() must be called 
6059  *
6060  *   <b> Post Condition </b>
6061  *   @n None
6062  *
6063  *   @b Writes
6064  *   @n SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID,SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID 
6065  *
6066  *   @b Example
6067  *   @verbatim
6068         CSL_SrioHandle     hSrio;
6069  
6070         // Open the CSL SRIO Module 0
6071         hSrio = CSL_SRIO_Open (0);
6072         ...
6073         // Set the Supervisor Permissions for Source ID 0xBEEF
6074         CSL_SRIO_SetSupervisorPerms (hSrio, 0xBEEF, 0x0);
6075         ...
6076      @endverbatim
6077  * =============================================================================
6078  */
6079 static inline void CSL_SRIO_SetSupervisorPerms
6081     CSL_SrioHandle  hSrio,
6082     Uint16          supervisor16ID,
6083     Uint8           supervisor8ID
6086     hSrio->RIO_SUPERVISOR_ID = CSL_FMK(SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID,supervisor16ID) | 
6087                                CSL_FMK(SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID, supervisor8ID); 
6090 /** ============================================================================
6091  *   @n@b CSL_SRIO_GetSupervisorPerms
6092  *
6093  *   @b Description
6094  *   @n The function is used to get the supervisor source ID.
6095  *
6096  *   @b Arguments
6097      @verbatim
6098           hSrio             Handle of the SRIO device
6099           supervisor16ID    16 bit Supervisor ID populated by this API
6100           supervisor8ID     8 bit Supervisor ID populated by this API
6101      @endverbatim
6102  *
6103  *   <b> Return Value </b>
6104  *   @n None
6105  *
6106  *   <b> Pre Condition </b>
6107  *   @n  CSL_SRIO_Open() must be called 
6108  *
6109  *   <b> Post Condition </b>
6110  *   @n None
6111  *
6112  *   @b Reads
6113  *   @n SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID,SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID
6114  *
6115  *   @b Example
6116  *   @verbatim
6117         CSL_SrioHandle     hSrio;
6118         Uint8              super8ID;
6119         Uint16             super16ID;
6120  
6121         // Open the CSL SRIO Module 0
6122         hSrio = CSL_SRIO_Open (0);
6123         ...
6124         // Get the Supervisor Permissions.
6125         CSL_SRIO_GetSupervisorPerms (hSrio, &super16ID, &super8ID);
6126         ...
6127      @endverbatim
6128  * =============================================================================
6129  */
6130 static inline void CSL_SRIO_GetSupervisorPerms
6132     CSL_SrioHandle  hSrio,
6133     Uint16*         supervisor16ID,
6134     Uint8*          supervisor8ID
6137     *supervisor16ID = CSL_FEXT (hSrio->RIO_SUPERVISOR_ID, SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID);
6138     *supervisor8ID  = CSL_FEXT (hSrio->RIO_SUPERVISOR_ID, SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID); 
6141 /** ============================================================================
6142  *   @n@b CSL_SRIO_SetFlowControl
6143  *
6144  *   @b Description
6145  *   @n The function is used to set the RIO flow control.
6146  *
6147  *   @b Arguments
6148      @verbatim
6149           hSrio             Handle of the SRIO device
6150           flowControlIdx    Flow Control Index which is to be configured. 
6151           tt                Flag which defines 16 bit or 8 bit identifiers. Set to
6152                             1 for 16 bit identifiers 0 for 8 bit.
6153           dstID             Destination ID matching the flow
6154      @endverbatim
6155  *
6156  *   <b> Return Value </b>
6157  *   @n None
6158  *
6159  *   <b> Pre Condition </b>
6160  *   @n  CSL_SRIO_Open() must be called 
6161  *
6162  *   <b> Post Condition </b>
6163  *   @n None
6164  *
6165  *   @b Writes
6166  *   @n SRIO_RIO_FLOW_CNTL_TT, SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID
6167  *
6168  *   @b Example
6169  *   @verbatim
6170         CSL_SrioHandle     hSrio;
6171  
6172         // Open the CSL SRIO Module 0
6173         hSrio = CSL_SRIO_Open (0);
6174         ...
6175         // Set the SRIO Flow Control 0 for Destination ID 0xBEEF
6176         // since the destination ID is 16 bit we set the TT flag as 1
6177         CSL_SRIO_SetFlowControl (hSrio, 0, 1, 0xBEEF);
6178         ...
6179      @endverbatim
6180  * =============================================================================
6181  */
6182 static inline void CSL_SRIO_SetFlowControl
6184     CSL_SrioHandle  hSrio,
6185     Uint8           flowControlIdx,
6186     Uint8           tt,
6187     Uint16          dstID
6190     hSrio->RIO_FLOW_CNTL[flowControlIdx] = CSL_FMK(SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID,dstID) | 
6191                                            CSL_FMK(SRIO_RIO_FLOW_CNTL_TT, tt); 
6194 /** ============================================================================
6195  *   @n@b CSL_SRIO_GetFlowControl
6196  *
6197  *   @b Description
6198  *   @n The function is used to get the RIO flow control.
6199  *
6200  *   @b Arguments
6201      @verbatim
6202           hSrio             Handle of the SRIO device
6203           flowControlIdx    Flow Control Index for which the configuration is required.
6204           tt                Flag which defines 16 bit or 8 bit identifiers populated by
6205                             the API
6206           dstID             Destination ID matching the flow populated by the API
6207      @endverbatim
6208  *
6209  *   <b> Return Value </b>
6210  *   @n None
6211  *
6212  *   <b> Pre Condition </b>
6213  *   @n  CSL_SRIO_Open() must be called 
6214  *
6215  *   <b> Post Condition </b>
6216  *   @n None
6217  *
6218  *   @b Reads
6219  *   @n SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID,SRIO_RIO_FLOW_CNTL_TT 
6220  *
6221  *   @b Example
6222  *   @verbatim
6223         CSL_SrioHandle     hSrio;
6224         Uint8              tt;
6225         Uint16             dstID;
6226  
6227         // Open the CSL SRIO Module 0
6228         hSrio = CSL_SRIO_Open (0);
6229         ...
6230         // Get the SRIO Flow Control 0 
6231         CSL_SRIO_GetFlowControl (hSrio, 0, &tt, &dstID);
6232         ...
6233      @endverbatim
6234  * =============================================================================
6235  */
6236 static inline void CSL_SRIO_GetFlowControl
6238     CSL_SrioHandle  hSrio,
6239     Uint8           flowControlIdx,
6240     Uint8*          tt,
6241     Uint16*         dstID
6244     Uint32 value = hSrio->RIO_FLOW_CNTL[flowControlIdx];
6246     /* Extract the fields from the RIO Flow Control */
6247     *dstID = CSL_FEXT(value, SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID);
6248     *tt    = CSL_FEXT(value, SRIO_RIO_FLOW_CNTL_TT); 
6251 /** ============================================================================
6252  *   @n@b CSL_SRIO_SetTxCPPIFlowMask
6253  *
6254  *   @b Description
6255  *   @n The function is used to set the Transmit CPPI Flow Masks
6256  *
6257  *   @b Arguments
6258      @verbatim
6259           hSrio             Handle of the SRIO device
6260           txCPPI            Transmit CPPI Flow Index 
6261           flowMask          Flow Mask to be configured.
6262      @endverbatim
6263  *
6264  *   <b> Return Value </b>
6265  *   @n None
6266  *
6267  *   <b> Pre Condition </b>
6268  *   @n  CSL_SRIO_Open() must be called 
6269  *
6270  *   <b> Post Condition </b>
6271  *   @n None
6272  *
6273  *   @b Writes
6274  *   @n SRIO_RIO_TX_CPPI_FLOW_MASKS_TX_QUEUE_EVEN_FLOW_MASK;
6275  *   @n SRIO_RIO_TX_CPPI_FLOW_MASKS_TX_QUEUE_ODD_FLOW_MASK 
6276  *
6277  *   @b Example
6278  *   @verbatim
6279         CSL_SrioHandle     hSrio;
6280  
6281         // Open the CSL SRIO Module 0
6282         hSrio = CSL_SRIO_Open (0);
6283         ...
6284         // Set the Transmit CPPI Flow Mask for 0 to use Flow 1
6285         CSL_SRIO_SetTxCPPIFlowMask (hSrio, 0, 1);
6286         ...
6287      @endverbatim
6288  * =============================================================================
6289  */
6290 static inline void CSL_SRIO_SetTxCPPIFlowMask
6292     CSL_SrioHandle  hSrio,
6293     Uint8           txCPPI,
6294     Uint16          flowMask
6297     switch (txCPPI)
6298     {
6299         case 0:
6300         {
6301             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 15, 0, flowMask);
6302             break;
6303         }
6304         case 1:
6305         {
6306             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 31, 16, flowMask);
6307             break;
6308         }
6309         case 2:
6310         {
6311             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 15, 0, flowMask);
6312             break;
6313         }
6314         case 3:
6315         {
6316             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 31, 16, flowMask);
6317             break;
6318         }
6319         case 4:
6320         {
6321             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 15, 0, flowMask);
6322             break;
6323         }
6324         case 5:
6325         {
6326             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 31, 16, flowMask);
6327             break;
6328         }
6329         case 6:
6330         {
6331             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 15, 0, flowMask);
6332             break;
6333         }
6334         case 7:
6335         {
6336             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 31, 16, flowMask);
6337             break;
6338         }
6339         case 8:
6340         {
6341             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 15, 0, flowMask);
6342             break;
6343         }
6344         case 9:
6345         {
6346             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 31, 16, flowMask);
6347             break;
6348         }
6349         case 10:
6350         {
6351             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 15, 0, flowMask);
6352             break;
6353         }
6354         case 11:
6355         {
6356             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 31, 16, flowMask);
6357             break;
6358         }
6359         case 12:
6360         {
6361             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 15, 0, flowMask);
6362             break;
6363         }
6364         case 13:
6365         {
6366             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 31, 16, flowMask);
6367             break;
6368         }
6369         case 14:
6370         {
6371             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 15, 0, flowMask);
6372             break;
6373         }
6374         case 15:
6375         {
6376             CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 31, 16, flowMask);
6377             break;
6378         }        
6379     }
6382 /** ============================================================================
6383  *   @n@b CSL_SRIO_GetTxCPPIFlowMask
6384  *
6385  *   @b Description
6386  *   @n The function is used to get the Transmit CPPI Flow Masks
6387  *
6388  *   @b Arguments
6389      @verbatim
6390           hSrio             Handle of the SRIO device
6391           txCPPI            Transmit CPPI Flow Index 
6392           flowMask          Flow Mask to be populated by this API.
6393      @endverbatim
6394  *
6395  *   <b> Return Value </b>
6396  *   @n None
6397  *
6398  *   <b> Pre Condition </b>
6399  *   @n  CSL_SRIO_Open() must be called 
6400  *
6401  *   <b> Post Condition </b>
6402  *   @n None
6403  *
6404  *   @b Reads
6405  *   @n SRIO_RIO_TX_CPPI_FLOW_MASKS_TX_QUEUE_FLOW_MASK 
6406  *
6407  *   @b Example
6408  *   @verbatim
6409         CSL_SrioHandle     hSrio;
6410         Uint16             flowMask;
6411  
6412         // Open the CSL SRIO Module 0
6413         hSrio = CSL_SRIO_Open (0);
6414         ...
6415         // Get the Transmit CPPI Flow Mask for 0 to use Flow 1
6416         CSL_SRIO_GetTxCPPIFlowMask (hSrio, 0, &flowMask);
6417         ...
6418      @endverbatim
6419  * =============================================================================
6420  */
6421 static inline void CSL_SRIO_GetTxCPPIFlowMask
6423     CSL_SrioHandle  hSrio,
6424     Uint8           txCPPI,
6425     Uint16*         flowMask
6428     switch (txCPPI)
6429     {
6430         case 0:
6431         {
6432             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 15, 0);
6433             break;
6434         }
6435         case 1:
6436         {
6437             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 31, 16);
6438             break;
6439         }
6440         case 2:
6441         {
6442             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 15, 0);
6443             break;
6444         }
6445         case 3:
6446         {
6447             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 31, 16);
6448             break;
6449         }
6450         case 4:
6451         {
6452             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 15, 0);
6453             break;
6454         }
6455         case 5:
6456         {
6457             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 31, 16);
6458             break;
6459         }
6460         case 6:
6461         {
6462             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 15, 0);
6463             break;
6464         }
6465         case 7:
6466         {
6467             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 31, 16);
6468             break;
6469         }
6470         case 8:
6471         {
6472             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 15, 0);
6473             break;
6474         }
6475         case 9:
6476         {
6477             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 31, 16);
6478             break;
6479         }
6480         case 10:
6481         {
6482             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 15, 0);
6483             break;
6484         }
6485         case 11:
6486         {
6487             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 31, 16);
6488             break;
6489         }
6490         case 12:
6491         {
6492             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 15, 0);
6493             break;
6494         }
6495         case 13:
6496         {
6497             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 31, 16);
6498             break;
6499         }
6500         case 14:
6501         {
6502             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 15, 0);
6503             break;
6504         }
6505         case 15:
6506         {
6507             *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 31, 16);
6508             break;
6509         }
6510     }
6513 /** ============================================================================
6514  *   @n@b CSL_SRIO_SetTxQueueSchedInfo
6515  *
6516  *   @b Description
6517  *   @n The function is used to set the port and scheduler information for a 
6518  *      specific transmit queue.
6519  *
6520  *   @b Arguments
6521      @verbatim
6522           hSrio       Handle of the SRIO device
6523           txQueue     Transmit Queue Index for which information is configured.
6524           portNum     Port Number to which the queue is mapped.
6525           crf         Critical Resource Flow Value              
6526      @endverbatim
6527  *
6528  *   <b> Return Value </b>
6529  *   @n None
6530  *
6531  *   <b> Pre Condition </b>
6532  *   @n  CSL_SRIO_Open() must be called 
6533  *
6534  *   <b> Post Condition </b>
6535  *   @n None
6536  *
6537  *   @b Writes
6538  *   @n SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO; 
6539  *    SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
6540  *    SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
6541  *
6542  *   @b Example
6543  *   @verbatim
6544         CSL_SrioHandle     hSrio;
6545  
6546         // Open the CSL SRIO Module 0
6547         hSrio = CSL_SRIO_Open (0);
6548         ...
6549         // Set the Tx Queue 0 Scheduler Information
6550         //  - The Queue needs to be mapped to SRIO Port 1
6551         //  - The Queue sets the CRF Bit.
6552         CSL_SRIO_SetTxQueueSchedInfo (hSrio, 0, 1, 1);
6553         ...
6554      @endverbatim
6555  * =============================================================================
6556  */
6557 static inline void CSL_SRIO_SetTxQueueSchedInfo
6559     CSL_SrioHandle  hSrio,
6560     Uint8           txQueue,
6561     Uint8           portNum,
6562     Uint8           crf
6565     if (txQueue < 4)
6566     {
6567         /* Transmit Queue 0, 1, 2 and 3 are handed in RIO_TX_QUEUE_SCH_INFO[0] */
6568         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[0], (txQueue << 3), (txQueue << 3), crf);
6569         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[0], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
6570     }
6571     else if (txQueue < 8)
6572     {
6573         /* Transmit Queue 4, 5, 6 and 7 are handed in RIO_TX_QUEUE_SCH_INFO[1] */
6574         txQueue = txQueue - 4;
6576         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[1], (txQueue << 3), (txQueue << 3), crf);
6577         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[1], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
6578     } 
6579     else if (txQueue < 12)
6580     {
6581         /* Transmit Queue 8, 9, 10 and 11 are handed in RIO_TX_QUEUE_SCH_INFO[2] */
6582         txQueue = txQueue - 8;
6584         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[2], (txQueue << 3), (txQueue << 3), crf);
6585         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[2], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
6586     } 
6587     else if (txQueue < 16)
6588     {
6589         /* Transmit Queue 12, 13, 14 and 15 are handed in RIO_TX_QUEUE_SCH_INFO[2] */
6590         txQueue = txQueue - 12;
6592         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[3], (txQueue << 3), (txQueue << 3), crf);
6593         CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[3], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
6594     }
6597 /** ============================================================================
6598  *   @n@b CSL_SRIO_GetTxQueueSchedInfo
6599  *
6600  *   @b Description
6601  *   @n The function is used to get the port and scheduler information for a 
6602  *      specific transmit queue.
6603  *
6604  *   @b Arguments
6605      @verbatim
6606           hSrio       Handle of the SRIO device
6607           txQueue     Transmit Queue Index for which information is configured.
6608           portNum     Port Number to which the queue is mapped populated by this API
6609           priority    Priority of the Transmit Queue populated by this API
6610           crf         Critical Resource Flow Value populated by this API
6611      @endverbatim
6612  *
6613  *   <b> Return Value </b>
6614  *   @n None
6615  *
6616  *   <b> Pre Condition </b>
6617  *   @n  CSL_SRIO_Open() must be called 
6618  *
6619  *   <b> Post Condition </b>
6620  *   @n None
6621  *
6622  *   @b Reads
6623  *   @n SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO; 
6624  *    SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
6625  *    SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
6626  *
6627  *
6628  *   @b Example
6629  *   @verbatim
6630         CSL_SrioHandle     hSrio;
6631         Uint8              portNum;
6632         Uint8              priority;
6633         Uint8              crf;
6635         // Open the CSL SRIO Module 0
6636         hSrio = CSL_SRIO_Open (0);
6637         ...
6638         // Get the Tx Queue 1 Information.
6639         CSL_SRIO_GetTxQueueSchedInfo (hSrio, 1, &portNum, &priority, &crf);
6640         ...
6641      @endverbatim
6642  * =============================================================================
6643  */
6644 static inline void CSL_SRIO_GetTxQueueSchedInfo
6646     CSL_SrioHandle  hSrio,
6647     Uint8           txQueue,
6648     Uint8*          portNum,
6649     Uint8*          priority,
6650     Uint8*          crf
6653     Uint32 value;
6655     if (txQueue < 4)
6656     {
6657         /* Transmit Queue 0, 1, 2 and 3 are handed in RIO_TX_QUEUE_SCH_INFO[0] */
6658         value = hSrio->RIO_TX_QUEUE_SCH_INFO[0];
6659         *crf      = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
6660         *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
6661         *portNum  = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
6662     }
6663     else if (txQueue < 8)
6664     {
6665         /* Transmit Queue 4, 5, 6 and 7 are handed in RIO_TX_QUEUE_SCH_INFO[1] */
6666         txQueue = txQueue - 4;
6667         value = hSrio->RIO_TX_QUEUE_SCH_INFO[1];
6669         *crf      = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
6670         *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
6671         *portNum  = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
6672     } 
6673     else if (txQueue < 12)
6674     {
6675         /* Transmit Queue 8, 9, 10 and 11 are handed in RIO_TX_QUEUE_SCH_INFO[2] */
6676         txQueue = txQueue - 8;
6677         value = hSrio->RIO_TX_QUEUE_SCH_INFO[2];
6679         *crf      = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
6680         *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
6681         *portNum  = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
6682     } 
6683     else if (txQueue < 16)
6684     {
6685         /* Transmit Queue 12, 13, 14 and 15 are handed in RIO_TX_QUEUE_SCH_INFO[3] */
6686         txQueue = txQueue - 12;
6687         value = hSrio->RIO_TX_QUEUE_SCH_INFO[3];
6689         *crf      = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
6690         *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
6691         *portNum  = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
6692     }
6695 /** ============================================================================
6696  *   @n@b CSL_SRIO_SetTxGarbageCollectionInfo
6697  *
6698  *   @b Description
6699  *   @n The function sets the Transmit Garbage collection information. 
6700  *
6701  *   @b Arguments
6702      @verbatim
6703           hSrio         Handle of the SRIO device
6704           qidLength     Length mismatch between size in the UDI to be configured. 
6705           qidTimeout    Timeout on receiving the segments to be configured.
6706           qidRetry      Excessive retries to be configured
6707           qidTransErr   Transaction Error to be configured
6708           qidProg       Programming Error queue to be configured
6709           qidSsize      Queue ID Ssize to be configured
6711      @endverbatim
6712  *
6713  *   <b> Return Value </b>
6714  *   @n None
6715  *
6716  *   <b> Pre Condition </b>
6717  *   @n  CSL_SRIO_Open() must be called 
6718  *
6719  *   <b> Post Condition </b>
6720  *   @n None
6721  *
6722  *   @b Writes
6723  *   @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN, 
6724  *   @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT,
6725  *   @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY,
6726  *   @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR,
6727  *   @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG,
6728  *   @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE
6729  *
6730  *   @b Example
6731  *   @verbatim
6732         CSL_SrioHandle  hSrio;
6734         // Open the CSL SRIO Module 0
6735         hSrio = CSL_SRIO_Open (0);
6736         ...
6737         // Set the Transmit Garbage Collection Information.
6738         CSL_SRIO_SetTxGarbageCollectionInfo (hSrio, 2, 3, 4, 5, 6, 10);
6739         ...
6740      @endverbatim
6741  * =============================================================================
6742  */
6743 static inline void CSL_SRIO_SetTxGarbageCollectionInfo
6745     CSL_SrioHandle  hSrio,
6746     Uint16          qidLength,
6747     Uint16          qidTimeout,
6748     Uint16          qidRetry,
6749     Uint16          qidTransErr,
6750     Uint16          qidProg,
6751     Uint16          qidSsize
6754     hSrio->RIO_GARBAGE_COLL_QID0 = 
6755             CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN,       qidLength)   | 
6756             CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT,      qidTimeout);
6758     hSrio->RIO_GARBAGE_COLL_QID1 = 
6759             CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY,     qidRetry)    |
6760             CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR, qidTransErr);
6762     hSrio->RIO_GARBAGE_COLL_QID2 = 
6763             CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG, qidProg) |
6764             CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE, qidSsize);
6767 /** ============================================================================
6768  *   @n@b CSL_SRIO_GetTxGarbageCollectionInfo
6769  *
6770  *   @b Description
6771  *   @n The function gets the Transmit Garbage collection information. Descriptors
6772  *      are placed into the Garbage collection queue when there is an error 
6773  *      response detected.
6774  *
6775  *   @b Arguments
6776      @verbatim
6777           hSrio         Handle of the SRIO device
6778           qidLength     Length mismatch between size in the UDI 
6779                         packet and receieved payload populated by this API
6780           qidTimeout    Timeout on receiving the segments populated by this API
6781           qidRetry      Excessive retries populated by this API
6782           qidTransErr   Transaction Error populated by this API
6783           qidProg       Programming error queue read
6784           qidSsize      Queue ID Ssize populated by this API
6786      @endverbatim
6787  *
6788  *   <b> Return Value </b>
6789  *   @n None
6790  *
6791  *   <b> Pre Condition </b>
6792  *   @n  CSL_SRIO_Open() must be called 
6793  *
6794  *   <b> Post Condition </b>
6795  *   @n None
6796  *
6797  *   @b Reads
6798  *   @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN, 
6799  *   @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT,
6800  *   @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY,
6801  *   @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR,
6802  *   @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG, 
6803  *   @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE
6804  *
6805  *   @b Example
6806  *   @verbatim
6807         CSL_SrioHandle  hSrio;
6808         Uint16          qidLength;
6809         Uint16          qidTimeout;
6810         Uint16          qidRetry;
6811         Uint16          qidTransErr;
6812         Uint16          qidProg;
6813         Uint16          qidSsize;
6815         // Open the CSL SRIO Module 0
6816         hSrio = CSL_SRIO_Open (0);
6817         ...
6818         // Get the Transmit Garbage Collection Information.
6819         CSL_SRIO_GetTxGarbageCollectionInfo (hSrio, &qidLength, &qidTimeout, 
6820                                              &qidRetry, &qidTransErr, &qidProg, &qidSsize);
6821         ...
6822      @endverbatim
6823  * =============================================================================
6824  */
6825 static inline void CSL_SRIO_GetTxGarbageCollectionInfo
6827     CSL_SrioHandle  hSrio,
6828     Uint16*         qidLength,
6829     Uint16*         qidTimeout,
6830     Uint16*         qidRetry,
6831     Uint16*         qidTransErr,
6832     Uint16*         qidProg,
6833     Uint16*         qidSsize
6836     *qidLength  = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID0, SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN);
6837     *qidTimeout = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID0, SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT);
6838     *qidRetry   = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID1, SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY);
6839     *qidTransErr= CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID1, SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR);
6840     *qidProg    = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID2, SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG);
6841     *qidSsize   = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID2, SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE);
6844 /** ============================================================================
6845  *   @n@b CSL_SRIO_GetQMBaseAddress
6846  *
6847  *   @b Description
6848  *   @n The function gets the QM base address
6849  *
6850  *   @b Arguments
6851      @verbatim
6852           hSrio             Handle of the SRIO device
6853           qmIndex           Index of the Queue Manager whose base address is needed
6854           qmBaseAddress     QM Base Address populated by this API
6855      @endverbatim
6856  *
6857  *   <b> Return Value </b>
6858  *   @n None
6859  *
6860  *   <b> Pre Condition </b>
6861  *   @n  CSL_SRIO_Open() must be called 
6862  *
6863  *   <b> Post Condition </b>
6864  *   @n None
6865  *
6866  *   @b Reads
6867  *   @n SRIO_QM_BASE_ADDRESS_REG
6868  *
6869  *   @b Example
6870  *   @verbatim
6871         CSL_SrioHandle  hSrio;
6872         Uint32          qmBaseAddress;
6874         // Open the CSL SRIO Module 0
6875         hSrio = CSL_SRIO_Open (0);
6876         ...
6877         // Get the QM Base Address information for 0
6878         CSL_SRIO_GetQMBaseAddress(hSrio, 0, &qmBaseAddress);
6879         ...
6880      @endverbatim
6881  * =============================================================================
6882  */
6883 static inline void CSL_SRIO_GetQMBaseAddress
6885     CSL_SrioHandle  hSrio,
6886     Uint8           qmIndex,
6887     Uint32*         qmBaseAddress
6890     *qmBaseAddress = hSrio->QM_BASE_ADDRESS_REG[qmIndex];
6893 /** ============================================================================
6894  *   @n@b CSL_SRIO_SetQMBaseAddress
6895  *
6896  *   @b Description
6897  *   @n The function sets the QM base address
6898  *
6899  *   @b Arguments
6900      @verbatim
6901           hSrio             Handle of the SRIO device
6902           qmIndex           Index of the Queue Manager whose base address is to be set
6903           qmBaseAddress     QM Base Address to be configured
6904      @endverbatim
6905  *
6906  *   <b> Return Value </b>
6907  *   @n None
6908  *
6909  *   <b> Pre Condition </b>
6910  *   @n  CSL_SRIO_Open() must be called 
6911  *
6912  *   <b> Post Condition </b>
6913  *   @n None
6914  *
6915  *   @b Writes
6916  *   @n SRIO_QM_BASE_ADDRESS_REG
6917  *
6918  *   @b Example
6919  *   @verbatim
6920         CSL_SrioHandle  hSrio;
6922         // Open the CSL SRIO Module 0
6923         hSrio = CSL_SRIO_Open (0);
6924         ...
6925         // Set the QM Base Address information for 0
6926         CSL_SRIO_SetQMBaseAddress(hSrio, 0, 0x10800000);
6927         ...
6928      @endverbatim
6929  * =============================================================================
6930  */
6931 static inline void CSL_SRIO_SetQMBaseAddress
6933     CSL_SrioHandle  hSrio,
6934     Uint8           qmIndex,
6935     Uint32          qmBaseAddress
6938     hSrio->QM_BASE_ADDRESS_REG[qmIndex] = qmBaseAddress;
6942 /**
6943 @}
6944 */
6946 #ifdef __cplusplus
6948 #endif
6950 #endif /* CSL_SRIOAUX_H_ */