]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/ti/drv/udma/unit_test/udma_ut/src/udma_test.h
[PDK-7909][PDK-6282] UDMA UT: Added new testcase for PKTDMA Mapped Channel Parameter...
[processor-sdk/pdk.git] / packages / ti / drv / udma / unit_test / udma_ut / src / udma_test.h
1 /*
2  *  Copyright (c) Texas Instruments Incorporated 2018
3  *
4  *  Redistribution and use in source and binary forms, with or without
5  *  modification, are permitted provided that the following conditions
6  *  are met:
7  *
8  *    Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  *
11  *    Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the
14  *    distribution.
15  *
16  *    Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
33 /**
34  *  \file udma_test.h
35  *
36  *  \brief This file contains all the structures, macros, enums
37  *  used by the UDMA test application.
38  *
39  */
41 #ifndef UDMA_TEST_H_
42 #define UDMA_TEST_H_
44 /* ========================================================================== */
45 /*                             Include Files                                  */
46 /* ========================================================================== */
48 #include <stdint.h>
49 #include <stdio.h>
50 #include <string.h>
52 #include <ti/drv/udma/udma.h>
53 #include <ti/drv/udma/src/udma_priv.h>
55 #include <ti/osal/SemaphoreP.h>
56 #include <ti/osal/TaskP.h>
57 #include <ti/drv/uart/UART.h>
58 #include <ti/drv/uart/UART_stdio.h>
59 #include <ti/drv/udma/examples/udma_apputils/udma_apputils.h>
61 #include "utils_mem.h"
62 #include "utils_prf.h"
63 #include "utils_trace.h"
65 #include "udma_test_soc.h"
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
71 /* ========================================================================== */
72 /*                           Macros & Typedefs                                */
73 /* ========================================================================== */
75 /** \brief Log enable for example application. */
76 #define UdmaUtTrace                     (GT_INFO1 | GT_TraceState_Enable)
78 /* UART read timeout in msec */
79 #define UDMA_TEST_UART_TIMEOUT_MSEC     (10000U)
81 /* Application name string used in print statements */
82 #define APP_NAME                        "UDMA_TEST"
84 /* Default values */
85 #define UDMA_TEST_USE_DEF               (0xFAFAU)
86 #define UDMA_TEST_DEF_LOOP_CNT          (100U)
87 #define UDMA_TEST_DEF_QDEPTH            (1U)
88 #define UDMA_TEST_PERF_LOOP_CNT         (10000U)
89 #define UDMA_TEST_PERF_QDEPTH           (1U)
91 #define UDMA_TEST_DEF_ICNT0             (1000U)
92 #define UDMA_TEST_DEF_DICNT0            (1000U)
94 #define UDMA_TEST_PERF_ICNT0            (10000U)
95 #define UDMA_TEST_PERF_DICNT0           (10000U)
97 #define UDMA_TEST_PRINT_BUFSIZE         (0x4000U)
99 #define UDMA_TEST_MAX_TASKS             (10U)
100 #define UDMA_TEST_MAX_CH                (15U)
101 #define UDMA_TEST_MAX_QDEPTH            (500U)
103 #define UDMA_TEST_MAX_ICNT              (4U)
104 #define UDMA_TEST_MAX_DIM               (3U)
106 /* Defined the following so that it is easy to understand a particular config */
107 #define USE_DEF_LP_CNT                  (UDMA_TEST_USE_DEF)
108 #define USE_DEF_QDEPTH                  (UDMA_TEST_USE_DEF)
109 #define DEF_HEAP_ID                     (UTILS_MEM_HEAP_ID_DDR)
110 #define TEST_ENABLE                     (TRUE)
111 #define TEST_DISABLE                    (FALSE)
112 #define PRF_ENABLE                      (TRUE)
113 #define PRF_DISABLE                     (FALSE)
114 #define PRINT_ENABLE                    (TRUE)
115 #define PRINT_DISABLE                   (FALSE)
116 #define TIMEST_ENABLE                   (TRUE)
117 #define TIMEST_DISABLE                  (FALSE)
118 #define DATA_CHECK_ENABLE               (TRUE)
119 #define DATA_CHECK_DISABLE              (FALSE)
120 #define PACING_NONE                     (0U)
121 #define DEF_PACING                      (20U)
123 #define UDMA_TEST_RING_ACC_DIRECTION_FORWARD    (0U)
124 #define UDMA_TEST_RING_ACC_DIRECTION_REVERSE    (1U)
126 #define UDMA_TEST_INST_ID_MAIN_0        (UDMA_INST_ID_0)
127 #define UDMA_TEST_INST_ID_MCU_0         (UDMA_INST_ID_1)
128 #define UDMA_TEST_INST_ID_BCDMA_0       (UDMA_INST_ID_2)
129 #define UDMA_TEST_INST_ID_PKTDMA_0      (UDMA_INST_ID_3)
131 #define UDMA_TEST_RF_SOC_AM65XX         ((uint64_t) 0x00000001U)
132 #define UDMA_TEST_RF_SOC_J721E          ((uint64_t) 0x00000002U)
133 #define UDMA_TEST_RF_SOC_J7200          ((uint64_t) 0x00000004U)
134 #define UDMA_TEST_RF_SOC_AM64X          ((uint64_t) 0x00000008U)
135 #define UDMA_TEST_RF_SOC_ALL            ((uint64_t) 0xFFFFFFFFU)
137 #define UDMA_TEST_RF_CORE_MPU1_0        ((uint64_t)(((uint64_t) 0x0001U) << 32U))
138 #define UDMA_TEST_RF_CORE_MCU1_0        ((uint64_t)(((uint64_t) 0x0002U) << 32U))
139 #define UDMA_TEST_RF_CORE_MCU1_1        ((uint64_t)(((uint64_t) 0x0004U) << 32U))
140 #define UDMA_TEST_RF_CORE_MCU2_0        ((uint64_t)(((uint64_t) 0x0008U) << 32U))
141 #define UDMA_TEST_RF_CORE_MCU2_1        ((uint64_t)(((uint64_t) 0x0010U) << 32U))
142 #define UDMA_TEST_RF_CORE_MCU3_0        ((uint64_t)(((uint64_t) 0x0020U) << 32U))
143 #define UDMA_TEST_RF_CORE_MCU3_1        ((uint64_t)(((uint64_t) 0x0040U) << 32U))
144 #define UDMA_TEST_RF_CORE_C7X_1         ((uint64_t)(((uint64_t) 0x0080U) << 32U))
145 #define UDMA_TEST_RF_CORE_C66X_1        ((uint64_t)(((uint64_t) 0x0100U) << 32U))
146 #define UDMA_TEST_RF_CORE_C66X_2        ((uint64_t)(((uint64_t) 0x0200U) << 32U))
147 #define UDMA_TEST_RF_CORE_M4F_0         ((uint64_t)(((uint64_t) 0x0400U) << 32U))
148 #define UDMA_TEST_RF_CORE_ALL           ((uint64_t)(((uint64_t) 0xFFFFU) << 32U))
149 #define UDMA_TEST_RF_CORE_MCU_ALL       (UDMA_TEST_RF_CORE_MCU1_0 | UDMA_TEST_RF_CORE_MCU1_1 | \
150                                          UDMA_TEST_RF_CORE_MCU2_0 | UDMA_TEST_RF_CORE_MCU2_1 | \
151                                          UDMA_TEST_RF_CORE_MCU3_0 | UDMA_TEST_RF_CORE_MCU3_1)
153 /* For future when we have dynamic coverage testcases */
154 #define UDMA_TEST_RF_CFG_DEF            ((uint64_t)(((uint64_t) 0x00001U) << 48U))
155 #define UDMA_TEST_RF_CFG_DYN            ((uint64_t)(((uint64_t) 0x00002U) << 48U))
157 /**
158  *  \brief Test types - based on this the different application flow will be
159  *  determined.
160  */
161 typedef enum
163     UDMA_TT_BLK_CPY,
164     UDMA_TT_DRU_DIRECT,
165     UDMA_TT_DRU_INDIRECT,
166     UDMA_TT_PDMA_UART,
167     UDMA_TT_PDMA_OSPI,
168     UDMA_TT_PDMA_MCSPI,
169     UDMA_TT_PDMA_MCASP,
170     UDMA_TT_PDMA_CRC,
171     UDMA_TT_PDMA_ADC,
172     UDMA_TT_MISC,
173     UDMA_TT_CUSTOM
174 } UdmaTestType;
176 /**
177  *  \brief Testcase types.
178  */
179 typedef enum
181     /* Category */
182     UDMA_TCT_SANITY     = 0x01U,
183     UDMA_TCT_REGRESSION = 0x02U,
184     UDMA_TCT_FULL       = 0x04U,
185     /* Adequacy */
186     UDMA_TCT_FUNCTIONAL  = 0x08U,
187     UDMA_TCT_STRESS      = 0x10U,
188     UDMA_TCT_NEGATIVE    = 0x20U,
189     UDMA_TCT_PERFORMANCE = 0x40U,
190     UDMA_TCT_MISC        = 0x80U,
191     UDMA_TCT_API         = 0x100U,
192     /* Used for Test parser dont use in test case */
193     UDMA_TCT_ALL = 0x1FFU
194 } UdmaTestCaseType;
196 /**
197  *  \brief Event types.
198  */
199 typedef enum
201     UDMA_TEST_EVENT_NONE,
202     /**< No events are used - use direct dequeue API to poll for completion */
203     UDMA_TEST_EVENT_INTR,
204     /**< Events with interrupt callback - use sempahore post for completion */
205     UDMA_TEST_EVENT_POLLED,
206     /**< Events with polled mode at IA - use IA status poll for completion */
207 } UdmaTestEventMode;
209 /**
210  *  UDMA UT TX param IDs.
211  */
212 typedef enum
214     UDMA_TEST_TXCH_PRMID_DEF,
215     UDMA_TEST_TXCH_PRMID_DMA_PRIORITY_HIGH,
216     UDMA_TEST_TXCH_PRMID_INVALID,
217 } UdmaTestTxChPrmId;
219 /**
220  *  UDMA UT RX parameter IDs.
221  */
222 typedef enum
224     UDMA_TEST_RXCH_PRMID_DEF,
225     UDMA_TEST_RXCH_PRMID_DMA_PRIORITY_HIGH,
226     UDMA_TEST_RXCH_PRMID_INVALID,
227 } UdmaTestRxChPrmId;
229 /**
230  *  UDMA UT UTC parameter IDs.
231  */
232 typedef enum
234     UDMA_TEST_UTCCH_PRMID_DEF,
235     UDMA_TEST_UTCCH_PRMID_DMA_PRIORITY_HIGH,
236     UDMA_TEST_UTCCH_PRMID_INVALID,
237 } UdmaTestUtcChPrmId;
239 /**
240  *  UDMA UT PDMA parameter IDs.
241  */
242 typedef enum
244     UDMA_TEST_PDMACH_PRMID_DEF,
245     UDMA_TEST_PDMACH_PRMID_ES_16BITS,
246     UDMA_TEST_PDMACH_PRMID_INVALID,
247 } UdmaTestPdmaChPrmId;
249 /**
250  *  UDMA UT channel param IDs.
251  */
252 typedef enum
254     UDMA_TEST_CH_PRMID_DEF,
255     UDMA_TEST_CH_PRMID_INTR_DEF,
256     UDMA_TEST_CH_PRMID_TRIGGER_GLOBAL0,
257     UDMA_TEST_CH_PRMID_TRIGGER_GLOBAL0_INTR,
258     UDMA_TEST_CH_PRMID_EVENTSIZE_ICNT1,
259     UDMA_TEST_CH_PRMID_EVENTSIZE_ICNT2,
260     UDMA_TEST_CH_PRMID_EVENTSIZE_ICNT3,
261     UDMA_TEST_CH_PRMID_DRU_DEF,
262     UDMA_TEST_CH_PRMID_DRU_INTR_DEF,
263     UDMA_TEST_CH_PRMID_DRU_TRIGGER_GLOBAL0,
264     UDMA_TEST_CH_PRMID_DRU_TRIGGER_GLOBAL0_INTR,
265     UDMA_TEST_CH_PRMID_DRU_EVENTSIZE_ICNT1,
266     UDMA_TEST_CH_PRMID_DRU_EVENTSIZE_ICNT2,
267     UDMA_TEST_CH_PRMID_DRU_EVENTSIZE_ICNT3,
268     UDMA_TEST_CH_PRMID_BLKCPY_HC_DEF,
269     UDMA_TEST_CH_PRMID_BLKCPY_HC_INTR_DEF,
270     UDMA_TEST_CH_PRMID_BLKCPY_UHC_DEF,
271     UDMA_TEST_CH_PRMID_BLKCPY_UHC_INTR_DEF,
272     UDMA_TEST_CH_PRMID_INVALID,
273 } UdmaTestChPrmId;
275 /**
276  *  UDMA UT ring param IDs.
277  */
278 typedef enum
280     UDMA_TEST_RING_PRMID_EVENT_NONE,
281     UDMA_TEST_RING_PRMID_EVENT_INTR,
282     UDMA_TEST_RING_PRMID_EVENT_POLLED,
283     UDMA_TEST_RING_PRMID_INVALID,
284 } UdmaTestRingPrmId;
286 /* ========================================================================== */
287 /*                         Structure Declarations                             */
288 /* ========================================================================== */
290 /* Forward declaration. */
291 typedef struct UdmaTestSystemCtrl_t UdmaTestSystemCtrl;
292 typedef struct UdmaTestParams_t     UdmaTestParams;
293 typedef struct UdmaTestTaskObj_t    UdmaTestTaskObj;
294 typedef struct UdmaTestObj_t        UdmaTestObj;
296 /** \brief Typedef for test case type function pointer */
297 typedef int32_t (*UdmaTestFxnPtr)(UdmaTestTaskObj *taskObj);
299 /**
300  *  \brief Test parameters for a TX channel.
301  */
302 typedef struct
304     UdmaTestTxChPrmId       txChPrmId;
305     /**< TX Channel parameter ID. */
306     Udma_ChTxPrms           txPrms;
307     /**< TX channel parameter */
308 } UdmaTestTxChPrm;
310 /**
311  *  \brief Test parameters for a RX channel.
312  */
313 typedef struct
315     UdmaTestRxChPrmId       rxChPrmId;
316     /**< RX Channel parameter ID. */
317     Udma_ChRxPrms           rxPrms;
318     /**< RX channel parameter */
319 } UdmaTestRxChPrm;
321 /**
322  *  \brief Test parameters for a UTC channel.
323  */
324 typedef struct
326     UdmaTestUtcChPrmId      utcChPrmId;
327     /**< UTC Channel parameter ID. */
328     Udma_ChUtcPrms          utcPrms;
329     /**< UTC channel parameter */
330 } UdmaTestUtcChPrm;
332 /**
333  *  \brief Test parameters for a PDMA channel.
334  */
335 typedef struct
337     UdmaTestPdmaChPrmId     pdmaChPrmId;
338     /**< PDMA Channel parameter ID. */
339     Udma_ChPdmaPrms         pdmaPrms;
340     /**< PDMA channel parameter */
341 } UdmaTestPdmaChPrm;
343 /**
344  *  \brief Test parameters for a channel.
345  */
346 typedef struct
348     UdmaTestChPrmId         chPrmId;
349     /**< Channel parameter ID. */
350     uint32_t                chType;
351     /**< UDMA channel type. */
352     uint32_t                utcId;
353     /**< UTC ID incase of DRU/external channel. */
354     uint32_t                eventMode;
355     /**< Use no event, event with interrupt or event with polled mode.
356      *   Refer #UdmaTestEventMode */
357     uint32_t                trigger;
358     /**< Global0 or Global 1 Trigger - refer \ref CSL_UdmapTrFlagsTrigger. */
359     uint32_t                eventSize;
360     /**< Refer \ref CSL_UdmapTrFlagsEventSize. */
361     uint32_t                triggerType;
362     /**< Refer \ref CSL_UdmapTrFlagsTriggerType. */
363     UdmaTestTxChPrmId       txPrmId;
364     /**< TX Channel parameter ID. */
365     UdmaTestRxChPrmId       rxPrmId;
366     /**< RX Channel parameter ID. */
367     UdmaTestUtcChPrmId      utcPrmId;
368     /**< UTC Channel parameter ID. */
369     UdmaTestPdmaChPrmId     pdmaPrmId;
370     /**< PDMA Channel parameter ID. */
371 } UdmaTestChPrm;
373 /**
374  *  \brief Test parameters for a ring.
375  */
376 typedef struct
378     UdmaTestRingPrmId       ringPrmId;
379     /**< Ring parameter ID. */
380     uint32_t                eventMode;
381     /**< Use no event, event with interrupt or event with polled mode.
382      *   Refer #UdmaTestEventMode */
383 } UdmaTestRingPrm;
385 /**
386  *  \brief Test case parameter structure.
387  */
388 struct UdmaTestParams_t
390     bool                    enableTest;
391     /**< Whether test case should be executed or not. */
392     uint32_t                tcId;
393     /**< Test case ID. */
394     char                   *tcName;
395     /**< Test case name. */
396     char                   *disableInfo;
397     /**< Reason string for disabling a test case. */
398     bool                    printEnable;
399     /**< Enable/disable print statements, used for stress testing. */
400     bool                    prfEnable;
401     /**< Enable performance prints. */
402     uint32_t                tcType;
403     /**< Type of testcase  - like BFT, stress etc... */
404     uint32_t                dcEnable;
405     /**< Enable/disable data check - used for performance. */
406     uint32_t                loopCnt;
407     /**< Loop count for test. */
409     uint32_t                numTasks;
410     /**< Number of tasks to test. */
411     uint32_t                testType[UDMA_TEST_MAX_TASKS];
412     /**< Type of test */
413     UdmaTestFxnPtr          testFxnPtr[UDMA_TEST_MAX_TASKS];
414     /**< Type of test case to run. */
415     uint32_t                pacingTime[UDMA_TEST_MAX_TASKS];
416     /**< Pacing Interval in ms. */
417     uint32_t                numCh[UDMA_TEST_MAX_TASKS];
418     /**< Number of channels per task to test. */
419     uint32_t                instId[UDMA_TEST_MAX_CH];
420     /**< NAVSS/DMSS instance ID. */
421     UdmaTestChPrmId         chPrmId[UDMA_TEST_MAX_CH];
422     /**< Channel config IDs for all the tasks.
423      *   Task 0 channel configs will be first (0 to (numCh[0] - 1)),
424      *   (numCh[0] to (numCh[1] - 1)) and so on. */
425     uint32_t                qdepth[UDMA_TEST_MAX_CH];
426     /**< Queue depth. */
427     uint32_t                icnt[UDMA_TEST_MAX_CH][UDMA_TEST_MAX_ICNT];
428     /**< Source counts. */
429     uint32_t                dicnt[UDMA_TEST_MAX_CH][UDMA_TEST_MAX_ICNT];
430     /**< Destination counts. */
431     uint32_t                dim[UDMA_TEST_MAX_CH][UDMA_TEST_MAX_DIM];
432     /**< Source dims. */
433     uint32_t                ddim[UDMA_TEST_MAX_CH][UDMA_TEST_MAX_DIM];
434     /**< Destination dims. */
435     uint32_t                heapIdSrc[UDMA_TEST_MAX_CH];
436     /**< Heap ID to allocate source buffer. */
437     uint32_t                heapIdDest[UDMA_TEST_MAX_CH];
438     /**< Heap ID to allocate destination buffer. */
439     uint32_t                srcBufSize[UDMA_TEST_MAX_CH];
440     /**< Source buffer size to allocate. */
441     uint32_t                destBufSize[UDMA_TEST_MAX_CH];
442     /**< Destination buffer size to allocate. */
443     uint64_t                runFlag;
444     /**< Flag to indicate whether the test needs to be run on a particular
445      *   SOC, CORE and other configurations. */
446     UdmaTestRingPrmId       ringPrmId;
447     /**< Ring config ID. Applicable only for ring testcases */
449     /*
450      * Below variables are initialized in code and not in table!!
451      */
452     bool                    isRun;
453     /**< Flag to indicate whether the test case is run or not. */
454     int32_t                 testResult;
455     /**< Test result. */
456 };
458 /**
459  *  \brief Structure used for UDMA UT control parameters.
460  */
461 struct UdmaTestSystemCtrl_t
463     uint32_t    loopCnt;
464     /**< Default loop count. */
465     uint32_t    qdepth;
466     /**< Default queue depth for queue and dequeue operation. */
467     uint32_t    rtPrintEnable;
468     /**< Enables runtime remote prints like VENC underflow status etc. */
469 };
471 typedef struct UdmaTestChObj_t
473     int32_t                 chIdx;
475     struct Udma_ChObj       drvChObj;
476     struct Udma_EventObj    cqEventObj;
477     struct Udma_EventObj    tdCqEventObj;
478     struct Udma_EventObj    trEventObj;
480     Udma_ChHandle           chHandle;
481     Udma_EventHandle        cqEventHandle;
482     Udma_EventHandle        tdCqEventHandle;
483     Udma_EventHandle        trEventHandle;
485     Udma_EventPrms          trEventPrms;
487     Udma_DrvHandle          drvHandle;
488     uint32_t                instId;
489     SemaphoreP_Handle       transferDoneSem;
490     /**< Semaphore to indicate transfer completion */
492     uint32_t                queueCnt;
493     uint32_t                dequeueCnt;
495     uint8_t                 *fqRingMem;
496     uint8_t                 *cqRingMem;
497     uint8_t                 *tdCqRingMem;
498     uint8_t                 *trpdMem[UDMA_TEST_MAX_QDEPTH];
500     uint8_t                 *srcBuf;
501     uint8_t                 *destBuf[UDMA_TEST_MAX_QDEPTH];
503     const UdmaTestChPrm     *chPrms;
504     const Udma_ChTxPrms     *txPrms;
505     const Udma_ChRxPrms     *rxPrms;
506     const Udma_ChUtcPrms    *utcPrms;
507     const Udma_ChPdmaPrms   *pdmaPrms;
508     uint32_t                qdepth;
509     uint32_t                icnt[UDMA_TEST_MAX_ICNT];
510     uint32_t                dicnt[UDMA_TEST_MAX_ICNT];
511     uint32_t                dim[UDMA_TEST_MAX_DIM];
512     uint32_t                ddim[UDMA_TEST_MAX_DIM];
513     uint32_t                heapIdSrc;
514     uint32_t                heapIdDest;
515     uint32_t                srcBufSize;
516     uint32_t                destBufSize;
518     uint32_t                ringMemSize;
519     uint32_t                trpdSize;
520 } UdmaTestChObj;
522 /**
523  *  \brief Structure used for UDMA UT task object parameters.
524  */
525 struct UdmaTestTaskObj_t
527     UdmaTestParams         *testPrms;
528     /**< Pointer to test params for reference. */
529     uint32_t                testType;
530     UdmaTestFxnPtr          testFxnPtr;
531     uint32_t                pacingTime;
532     /**< Pacing Interval in ms. */
533     uint32_t                numCh;
534     UdmaTestChObj          *chObj[UDMA_TEST_MAX_CH];
535     uint32_t                traceMask;
536     int32_t                 testResult;
537     uint64_t                totalTransfer;
538     /**< Total bytes transferred */
539     uint32_t                durationMs;
540     /**< Time taken in ms */
541     uint64_t                mps;
542     /**< Mega bytes per second */
543     UdmaTestObj            *testObj;
544     uint32_t                taskId;
545     TaskP_Handle            taskHandle;
546     Utils_PrfTsHndl        *prfTsHandle;
547     char                    prfTsName[15];
548     uint32_t                loopCnt;
549     const UdmaTestRingPrm  *ringPrms;
550 };
552 /**
553  *  \brief Structure used for UDMA test object common for all the tasks.
554  */
555 struct UdmaTestObj_t
557     UdmaTestSystemCtrl  sysCtrl;
558     /**< System control information. */
559     UdmaTestParams     *testPrms;
560     /**< Pointer to test params for reference. */
561     uint32_t            skipCount;
562     /**< Number of test cases skipped because of platform/user settings. */
563     uint32_t            disableCount;
564     /**< Number of test cases disabled because of any bug etc. */
565     uint32_t            traceMask;
566     /**< Masks for the debug prints. */
567     uint64_t            runFlag;
568     /**< Current run flag for a SOC, CORE and other configurations. */
570     struct Udma_DrvObj  drvObj[UDMA_INST_ID_MAX + 1U];
571     /**< Driver Object for all applicable instances. (max+1 since instance index starts from 0) */
573     SemaphoreP_Handle   taskCompleteSem;
574     SemaphoreP_Handle   lockSem;
576     UdmaTestTaskObj     taskObj[UDMA_TEST_MAX_TASKS];
577     UdmaTestChObj       chObjs[UDMA_TEST_MAX_CH];
578 };
580 /* ========================================================================== */
581 /*                          Function Declarations                             */
582 /* ========================================================================== */
584 /*
585  * Parser functions
586  */
587 int32_t udmaTestParser(void);
588 void udmaTestPrint(const char *str, ...);
589 void udmaDrvPrint(const char *str);
591 /*
592  * UDMA block copy test case functions
593  */
594 int32_t udmaTestBlkcpyTc(UdmaTestTaskObj *taskObj);
595 int32_t udmaTestBlkcpyPauseResumeTc(UdmaTestTaskObj *taskObj);
596 int32_t udmaTestBlkcpyChainingTc(UdmaTestTaskObj *taskObj);
597 /*
598  * UDMA ring test functions
599  */
600 int32_t udmaTestRingProxyTc(UdmaTestTaskObj *taskObj);
601 int32_t udmaTestRingFlushTc(UdmaTestTaskObj *taskObj);
602 int32_t udmaTestRingEventTc(UdmaTestTaskObj *taskObj);
603 int32_t udmaTestRingParamCheckTc(UdmaTestTaskObj *taskObj);
604 int32_t udmaTestRingUtilsMemSizeTc(UdmaTestTaskObj *taskObj);
605 int32_t udmaTestRingMemPtrTc(UdmaTestTaskObj *taskObj);
606 int32_t udmaTestRingAttachTc(UdmaTestTaskObj *taskObj);
607 int32_t udmaTestRingResetTc(UdmaTestTaskObj *taskObj);
608 int32_t udmaTestRingPrimeTc(UdmaTestTaskObj *taskObj);
609 int32_t udmaTestRingPrimeLcdmaTc(UdmaTestTaskObj *taskObj);
610 /*
611  * UDMA ring monitor test functions
612  */
613 int32_t udmaTestRingMonPushPopTc(UdmaTestTaskObj *taskObj);
614 int32_t udmaTestRingMonLowThresholdTc(UdmaTestTaskObj *taskObj);
615 int32_t udmaTestRingMonHighThresholdTc(UdmaTestTaskObj *taskObj);
616 /*
617  * UDMA proxy test functions
618  */
619 int32_t udmaTestProxyPerformanceTc(UdmaTestTaskObj *taskObj);
620 /*
621  * UDMA flow test functions
622  */
623 int32_t udmaTestFlowAttachTc(UdmaTestTaskObj *taskObj);
624 int32_t udmaTestFlowAttachMappedTc(UdmaTestTaskObj *taskObj);
625 int32_t udmaTestFlowAllocTc(UdmaTestTaskObj *taskObj);
626 /*
627  * UDMA event test functions
628  */
629 int32_t udmaTestEventOutOfRangeFlow(UdmaTestTaskObj *taskObj);
630 /*
631  * UDMA misc test functions
632  */
633 int32_t udmaTestPsilMacroTc(UdmaTestTaskObj *taskObj);
634 int32_t udmaTestOsalPrmsTc(UdmaTestTaskObj *taskObj);
635 int32_t udmaTestTrMakeTc(UdmaTestTaskObj *taskObj);
636 int32_t udmaTestStructSizeTc(UdmaTestTaskObj *taskObj);
637 /*
638  * UDMA bug test functions
639  */
640 int32_t udmaTestBugTcPDK_3863(UdmaTestTaskObj *taskObj);
641 int32_t udmaTestBugTcPDK_4654(UdmaTestTaskObj *taskObj);
642 /*
643  * UDMA channel test functions
644  */
645 int32_t udmaTestChPktdmaParamCheckTc(UdmaTestTaskObj *taskObj);
647 /*
648  * UDMA Negative test case functions
649  */
651 /*
652  * UDMA SOC specific functions
653  */
654 int32_t udmaTestPrintPsilMacro(UdmaTestTaskObj *taskObj);
655 int32_t udmaTestPrintPdmaMacro(UdmaTestTaskObj *taskObj);
657 /*
658  * UDMA common functions
659  */
660 int32_t udmaTestInitDriver(UdmaTestObj *testObj);
661 int32_t udmaTestDeinitDriver(UdmaTestObj *testObj);
662 int32_t udmaTestInitVariables(const UdmaTestObj *testObj);
663 void udmaTestFreeVariables(const UdmaTestObj *testObj);
664 void udmaTestLogTestResult(const UdmaTestObj *testObj,
665                            int32_t            testResult,
666                            uint32_t           tcId,
667                            char              *tcInfo);
668 void udmaTestPrintTestResult(const UdmaTestObj *testObj,
669                              uint32_t           skipCount,
670                              uint32_t           disableCount);
671 void udmaTestResetTestResult(void);
672 void udmaTestCalcPerformance(UdmaTestTaskObj *taskObj, uint32_t durationMs);
673 void udmaTestCalcTotalPerformance(UdmaTestObj *testObj, uint32_t durationMs);
674 int32_t udmaTestCompareRingHwOccDriver(Udma_RingHandle ringHandle, uint32_t cnt, uint32_t direction);
675 uint32_t udmaTestGetRingHwOccDriver(Udma_RingHandle ringHandle, uint32_t direction);
676 int32_t udmaTestBlkCpyRingPrimeLcdmaTest(UdmaTestTaskObj *taskObj);
678 char AppUtils_getChar(void);
679 int32_t AppUtils_getCharTimeout(char *ch, uint32_t msec);
680 int32_t AppUtils_getNum(void);
682 uint32_t AppUtils_getCurTimeInMsec(void);
683 uint32_t AppUtils_getElapsedTimeInMsec(uint32_t startTime);
685 /* ========================================================================== */
686 /*      Internal Function Declarations (Needed for other static inlines)      */
687 /* ========================================================================== */
689 /* None */
691 /* ========================================================================== */
692 /*                       Static Function Definitions                          */
693 /* ========================================================================== */
695 /* None */
697 #ifdef __cplusplus
699 #endif
701 #endif /* #ifndef UDMA_TEST_H_ */