summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e218e6)
raw | patch | inline | side by side (parent: 0e218e6)
author | Don Dominic <a0486429@ti.com> | |
Thu, 3 Dec 2020 12:28:02 +0000 (17:58 +0530) | ||
committer | Sivaraj R <sivaraj@ti.com> | |
Fri, 4 Dec 2020 04:18:01 +0000 (22:18 -0600) |
- For LCDMA with Dual ring,
- Ring Prime Read checks for Reverse occupancy.
- In this case, actual transfer should happen to populate
- reverse occupancy count and successfully do a ring prime read.
- This testcase, implements block copy using ring prime API's
- This tests only Ring Prime API's.
- Data check and TR Responce checks are NOT carried out.
Signed-off-by: Don Dominic <a0486429@ti.com>
- Ring Prime Read checks for Reverse occupancy.
- In this case, actual transfer should happen to populate
- reverse occupancy count and successfully do a ring prime read.
- This testcase, implements block copy using ring prime API's
- This tests only Ring Prime API's.
- Data check and TR Responce checks are NOT carried out.
Signed-off-by: Don Dominic <a0486429@ti.com>
diff --git a/packages/ti/drv/udma/unit_test/udma_ut/src/udma_test.h b/packages/ti/drv/udma/unit_test/udma_ut/src/udma_test.h
index b120582cd9ac8d0fe521867949f26fe703556ea0..e1168f2ed80b9abda9bd05f5e1b9ea5605b01e7b 100755 (executable)
#define UDMA_TEST_MAX_TASKS (10U)
#define UDMA_TEST_MAX_CH (15U)
-#define UDMA_TEST_MAX_QDEPTH (5U)
+#define UDMA_TEST_MAX_QDEPTH (500U)
#define UDMA_TEST_MAX_ICNT (4U)
#define UDMA_TEST_MAX_DIM (3U)
int32_t udmaTestRingAttachTc(UdmaTestTaskObj *taskObj);
int32_t udmaTestRingResetTc(UdmaTestTaskObj *taskObj);
int32_t udmaTestRingPrimeTc(UdmaTestTaskObj *taskObj);
+int32_t udmaTestRingPrimeLcdmaTc(UdmaTestTaskObj *taskObj);
/*
* UDMA ring monitor test functions
*/
void udmaTestCalcTotalPerformance(UdmaTestObj *testObj, uint32_t durationMs);
int32_t udmaTestCompareRingHwOccDriver(Udma_RingHandle ringHandle, uint32_t cnt, uint32_t direction);
uint32_t udmaTestGetRingHwOccDriver(Udma_RingHandle ringHandle, uint32_t direction);
+int32_t udmaTestBlkCpyRingPrimeLcdmaTest(UdmaTestTaskObj *taskObj);
char AppUtils_getChar(void);
int32_t AppUtils_getCharTimeout(char *ch, uint32_t msec);
diff --git a/packages/ti/drv/udma/unit_test/udma_ut/src/udma_test_blkcpy.c b/packages/ti/drv/udma/unit_test/udma_ut/src/udma_test_blkcpy.c
index bcc9e222da2ab6df031f76992303d991c51eebe8..97f668642927b2784f7585eaed49796e2dde7d80 100755 (executable)
static int32_t udmaTestBlkcpyTestLoop(UdmaTestTaskObj *taskObj, uint32_t pauseTest, uint32_t chainTest);
static int32_t udmaTestBlkcpyTest(UdmaTestTaskObj *taskObj, uint32_t pauseTest, uint32_t chainTest);
+static int32_t udmaTestBlkCpyRingPrimeLcdmaTestLoop(UdmaTestTaskObj *taskObj);
+
static int32_t udmaTestBlkcpyCreate(UdmaTestTaskObj *taskObj, uint32_t chainTest);
static int32_t udmaTestBlkcpyDelete(UdmaTestTaskObj *taskObj, uint32_t chainTest);
static int32_t udmaTestBlkcpyAlloc(UdmaTestTaskObj *taskObj);
return (retVal);
}
+int32_t udmaTestBlkCpyRingPrimeLcdmaTest(UdmaTestTaskObj *taskObj)
+{
+ int32_t retVal = UDMA_SOK;
+ uint32_t loopCnt = 0U;
+
+ retVal = udmaTestBlkcpyAlloc(taskObj);
+ retVal += udmaTestBlkcpyCreate(taskObj, FALSE);
+
+ while(loopCnt < taskObj->loopCnt)
+ {
+ /* Perform block copy with ring prime */
+ retVal = udmaTestBlkCpyRingPrimeLcdmaTestLoop(taskObj);
+ if(UDMA_SOK != retVal)
+ {
+ break;
+ }
+
+ loopCnt++;
+ }
+
+ retVal += udmaTestBlkcpyDelete(taskObj, FALSE);
+ retVal += udmaTestBlkcpyFree(taskObj);
+
+ retVal += gUdmaTestBlkcpyResult;
+
+ return (retVal);
+}
+
static int32_t udmaTestBlkcpyTestLoop(UdmaTestTaskObj *taskObj, uint32_t pauseTest, uint32_t chainTest)
{
int32_t retVal = UDMA_SOK;
@@ -526,6 +556,173 @@ static int32_t udmaTestBlkcpyTest(UdmaTestTaskObj *taskObj, uint32_t pauseTest,
return (retVal);
}
+static int32_t udmaTestBlkCpyRingPrimeLcdmaTestLoop(UdmaTestTaskObj *taskObj)
+{
+ int32_t retVal = UDMA_SOK;
+ uint32_t chCnt, qCnt;
+ UdmaTestChObj *chObj;
+ Udma_RingHandle ringHandle;
+ void *trpdMem;
+ uint64_t pDesc = 0;
+ uint32_t elemCnt, ringMemSize, rOcc;
+ void *ringMem = NULL;
+
+ /* Update TR packet descriptor */
+ for(chCnt = 0U ; chCnt < taskObj->numCh; chCnt++)
+ {
+ chObj = taskObj->chObj[chCnt];
+ GT_assert(taskObj->traceMask, chObj != NULL);
+ for(qCnt = 0U; qCnt < chObj->qdepth; qCnt++)
+ {
+ udmaTestBlkcpyTrpdInit(chObj, qCnt);
+ }
+ }
+
+ for(chCnt = 0U ; chCnt < taskObj->numCh; chCnt++)
+ {
+ chObj = taskObj->chObj[chCnt];
+ ringHandle = Udma_chGetFqRingHandle(chObj->chHandle);
+ elemCnt = chObj->qdepth;
+ ringMem = chObj->chHandle->chPrms.fqRingPrms.ringMem;
+ ringMemSize = chObj->chHandle->chPrms.fqRingPrms.ringMemSize;
+
+ /* Check ring mode after allocation */
+ if (Udma_ringGetMode(ringHandle) != TISCI_MSG_VALUE_RM_RING_MODE_RING)
+ {
+ GT_0trace (taskObj->traceMask, GT_ERR, " Ring mode mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* Check ring elements count after allocation */
+ if (Udma_ringGetElementCnt(ringHandle) != elemCnt)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring elements count mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* Check wrIdx of ring after allocation */
+ if (Udma_ringGetWrIdx(ringHandle) != 0U)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring rwIdx value mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* Queue through prime API */
+ for(qCnt = 0U; qCnt < elemCnt; qCnt++)
+ {
+ Udma_ringPrime(ringHandle,
+ Udma_appVirtToPhyFxn(chObj->trpdMem[qCnt], 0U, NULL));
+ }
+
+ /* Check if the HW occupancy is zero as the queue is not committed */
+ if(udmaTestCompareRingHwOccDriver(ringHandle, 0U, UDMA_TEST_RING_ACC_DIRECTION_FORWARD) != UDMA_SOK)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring element count mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* Pause the channel before setting the doorbell, to verify the Forward Occupancy.
+ * Else, as soon as doorbell is set, transfer happens and FOCC can't be verified. */
+ retVal = Udma_chPause(chObj->chHandle);
+ if(UDMA_SOK != retVal)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Channel pause failed!!\n");
+ break;
+ }
+
+ /* Do Cache flush and commit to ring */
+ Udma_appUtilsCacheWb(ringMem, ringMemSize);
+ Udma_ringSetDoorBell(ringHandle, elemCnt);
+
+ /* Check if the HW occupancy is same as what is queued */
+ if(udmaTestCompareRingHwOccDriver(ringHandle, elemCnt, UDMA_TEST_RING_ACC_DIRECTION_FORWARD) != UDMA_SOK)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring element count mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* Check wrIdx of ring after queuing, wrIdx should be back to zero as
+ * ring is full */
+ if (Udma_ringGetWrIdx(ringHandle) != 0U)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring wrIdx value mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* After verifying FOCC and wrIdx, Resume channel to start the transfer */
+ retVal = Udma_chResume(chObj->chHandle);
+ if(UDMA_SOK != retVal)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Channel resume failed!!\n");
+ break;
+ }
+
+ /* Wait for the reverse occupancy of the Dual ring to become elemCnt
+ * (waiting for the transfer to complete),
+ * before starting ring prime read. */
+ while(1)
+ {
+ /* Update cfg->occ count */
+ rOcc = Udma_ringGetReverseRingOcc(ringHandle);
+
+ if(elemCnt == rOcc)
+ {
+ break;
+ }
+ }
+
+ /* Do Cache invalidate before reading ring elements */
+ Udma_appUtilsCacheInv(ringMem, ringMemSize);
+
+ /* Dequeue using prime read API */
+ for(qCnt = 0U; qCnt < elemCnt; qCnt++)
+ {
+ trpdMem = (void *) chObj->trpdMem[qCnt];
+
+ Udma_ringPrimeRead(ringHandle, &pDesc);
+ /* Check returned descriptor pointer */
+ if(Udma_appPhyToVirtFxn(pDesc, 0U, NULL) != trpdMem)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR,
+ " TR descriptor pointer returned doesn't match the submitted address!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+ }
+ if(UDMA_SOK != retVal)
+ {
+ break;
+ }
+
+ /* Check if the HW occupancy is same as elemCnt as the queue is not committed */
+ if(udmaTestCompareRingHwOccDriver(ringHandle, elemCnt, UDMA_TEST_RING_ACC_DIRECTION_REVERSE) != UDMA_SOK)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring element count mismatch!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+
+ /* Set door bell value as -1 * elemCnt to reduce ring occupancy after reading */
+ Udma_ringSetDoorBell(ringHandle, (-1 * (int32_t)elemCnt));
+
+ /* Check if the HW occupancy is zero */
+ if(udmaTestCompareRingHwOccDriver(ringHandle, 0U, UDMA_TEST_RING_ACC_DIRECTION_REVERSE) != UDMA_SOK)
+ {
+ GT_0trace(taskObj->traceMask, GT_ERR, " Ring not empty!!\n");
+ retVal = UDMA_EFAIL;
+ break;
+ }
+ }
+
+ return (retVal);
+}
+
static int32_t udmaTestBlkcpyCreate(UdmaTestTaskObj *taskObj, uint32_t chainTest)
{
int32_t retVal = UDMA_SOK;
diff --git a/packages/ti/drv/udma/unit_test/udma_ut/src/udma_test_ring.c b/packages/ti/drv/udma/unit_test/udma_ut/src/udma_test_ring.c
index 99d9a797e619a6e67611eca519ea0b7b2073c117..8d24f93c1ae639dbcd195ce92a7b4dbcb8439631 100755 (executable)
return (retVal);
}
+int32_t udmaTestRingPrimeLcdmaTc(UdmaTestTaskObj *taskObj)
+{
+ int32_t retVal = UDMA_SOK;
+
+ GT_1trace(taskObj->traceMask, GT_INFO1,
+ " |TEST INFO|:: Task:%d: LCDMA Ring Prime Testcase ::\r\n", taskObj->taskId);
+ GT_2trace(taskObj->traceMask, GT_INFO1,
+ " |TEST INFO|:: Task:%d: Loop count : %d ::\r\n", taskObj->taskId, taskObj->loopCnt);
+
+ /* Perform ring prime lcdma test using block copy */
+ retVal = udmaTestBlkCpyRingPrimeLcdmaTest(taskObj);
+
+ return (retVal);
+}
+
static int32_t udmaTestRingProxyTestLoop(UdmaTestTaskObj *taskObj)
{
int32_t retVal = UDMA_SOK;
diff --git a/packages/ti/drv/udma/unit_test/udma_ut/src/udma_testcases.h b/packages/ti/drv/udma/unit_test/udma_ut/src/udma_testcases.h
index 17fdecba1f03c10447c5c66904286c5c39c1c1d2..fdf283d7474cec86244f400f2004a7b14f7408ab 100755 (executable)
.runFlag = (UDMA_TEST_RF_SOC_AM65XX | UDMA_TEST_RF_CORE_ALL | UDMA_TEST_RF_CFG_DEF | UDMA_TEST_RF_CFG_DYN),
.ringPrmId = UDMA_TEST_RING_PRMID_EVENT_NONE,
},
+#if (UDMA_SOC_CFG_RA_NORMAL_PRESENT == 1)
{
.enableTest = TEST_ENABLE,
.tcId = 4693U,
.runFlag = (UDMA_TEST_RF_SOC_ALL | UDMA_TEST_RF_CORE_ALL | UDMA_TEST_RF_CFG_DEF | UDMA_TEST_RF_CFG_DYN),
.ringPrmId = UDMA_TEST_RING_PRMID_EVENT_NONE,
},
+#endif /* #if (UDMA_SOC_CFG_RA_NORMAL_PRESENT == 1) */
+#if (UDMA_SOC_CFG_RA_LCDMA_PRESENT == 1)
+ {
+ /* For LCDMA with Dual ring,
+ * Ring Prime Read checks for Reverse occupancy.
+ * In this case, actual transfer should happen to populate
+ * reverse occupancy count and successfully do a ring prime read.
+ * This testcase, implements block copy using ring prime API's
+ * This tests only Ring Prime API's.
+ * Data check and TR Responce checks are NOT carried out.*/
+ .enableTest = TEST_ENABLE,
+ .tcId = 8837U,
+ .tcName = "LCDMA Ring Prime Test",
+ .disableInfo= NULL,
+ .printEnable= PRINT_ENABLE,
+ .prfEnable = PRF_DISABLE,
+ .tcType = (UDMA_TCT_SANITY | UDMA_TCT_FUNCTIONAL),
+ .dcEnable = DATA_CHECK_DISABLE,
+ .loopCnt = 1U,
+ .numTasks = 1U,
+ .numCh = {1U},
+ .instId = {UDMA_TEST_INST_ID_BCDMA_BC},
+ .testType = {UDMA_TT_MISC},
+ .testFxnPtr = {&udmaTestRingPrimeLcdmaTc},
+ .qdepth = {500U},
+ .pacingTime = {PACING_NONE},
+ .chPrmId = {UDMA_TEST_CH_PRMID_DEF},
+ .icnt = {
+ {16U, 1U, 1U, 1U}
+ },
+ .dicnt = {
+ {16U, 1U, 1U, 1U}
+ },
+ .dim = {
+ {0U, 0U, 0U}
+ },
+ .ddim = {
+ {0U, 0U, 0U}
+ },
+ .heapIdSrc = {DEF_HEAP_ID},
+ .heapIdDest = {DEF_HEAP_ID},
+ .srcBufSize = {UDMA_TEST_DEF_ICNT0},
+ .destBufSize= {UDMA_TEST_DEF_DICNT0},
+ .runFlag = (UDMA_TEST_RF_BCDMA_BC | UDMA_TEST_RF_CFG_DYN),
+ .ringPrmId = UDMA_TEST_RING_PRMID_EVENT_NONE,
+ },
+#endif /* #if (UDMA_SOC_CFG_RA_LCDMA_PRESENT == 1) */
#if (UDMA_SOC_CFG_RING_MON_PRESENT == 1)
{
.enableTest = TEST_ENABLE,