summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 959f036)
raw | patch | inline | side by side (parent: 959f036)
author | Govind Jeyaram <govind.j@ti.com> | |
Tue, 18 Jul 2017 00:37:00 +0000 (17:37 -0700) | ||
committer | Govind Jeyaram <govind.j@ti.com> | |
Tue, 18 Jul 2017 00:37:00 +0000 (17:37 -0700) |
pasdk/test_dsp/sap/sap_mcasp.c | patch | blob | history |
index 2adffe09b954e3e36b7862235ebe2f1de7f250ca..747e7666cf98b7f4f354d17dfde56d890f203b6b 100644 (file)
base[_MCASP_PDIR_OFFSET] = 0; // all input by default
}
-
-
} // SAP_MCASP_init
// -----------------------------------------------------------------------------
pSers =&base[_MCASP_SRCTL0_OFFSET];
for (i=0; i < _MCASP_CHANNEL_CNT; i++)
{
- timeout = 0;
if (pDevExt->pParams->sap.pinMask & (1 << i))
{
//Log_info3(( "SAP_MCASP_enable(): wait for serializer %d. pSers: 0x%x, *pSers: 0x%x", i, pSers, *pSers));
- while ((*pSers & _MCASP_SRCTL_XRDY_MASK) != 0)
- {
- timeout++;
- if (timeout > 10000)
- {
- Log_info1("SAP_MCASP_enable(): McASP serializer %d timed out.\n", i);
- result = SIO2_ETIMEOUT;
- break;
- }
-
- }
+ while ((*pSers & _MCASP_SRCTL_XRDY_MASK) != 0);
}
*pSers++;
}
{
//TRACE_TERSE1(( "SAP_MCASP_reset(0x%x) input device.", device));
// disable FIFO if present
- Log_info1("SAP_MCASP_reset(0x%x) input device.", device); //DJDBG
+ Log_info1("SAP_MCASP_reset(0x%x) input device.", device);
if (sapMcaspDrv.fifoPresent[mcaspNum])
fifoBase[_MCASP_RFIFOCTL_OFFSET] &=
~(MCASP_RFIFOCTL_RENA_ENABLE << _MCASP_RFIFOCTL_RENA_SHIFT);
else
{
//TRACE_TERSE1(("SAP_MCASP_reset(0x%x) output device.", device));
- Log_info1("SAP_MCASP_reset(0x%x) output device.", device); //DJDBG
+ Log_info1("SAP_MCASP_reset(0x%x) output device.", device);
// disable FIFO if present
if (sapMcaspDrv.fifoPresent[mcaspNum])
fifoBase[_MCASP_WFIFOCTL_OFFSET] &=
// the settings will never take affect which would lead to a lockup condition.
#define INT_MAX 0xFFFFFFFF // maximum value returned by Clock_getTicks
-#define USEC_PER_MSEC ( 1000 ) // microseconds per millisecond
Int SAP_MCASP_waitSet (MCASP_Handle hMcasp, Uint32 wrReg, Uint32 rdReg, Uint32 mask, Uint32 timeout)
{
@@ -729,27 +715,6 @@ Int SAP_MCASP_waitSet (MCASP_Handle hMcasp, Uint32 wrReg, Uint32 rdReg, Uint32 m
// set register with mask value
base[wrReg] = (base[rdReg] | mask) & resMask;
-#if 0
- // convert timeout from milliseconds to nTicks
- timeout = CLK_countspms () * timeout;
-
- timeStart = CLK_gethtime ();
- while (1) {
- // return success if register has latched value
- if ((base[rdReg] & mask) == mask)
- break;
- timeNow = CLK_gethtime ();
- elapsed = timeNow - timeStart;
- // check for wrap aound
- if (timeNow <= timeStart)
- elapsed = INT_MAX - timeStart + timeNow;
-
- // return error if timeout reached
- if (elapsed > timeout)
- return SYS_ETIMEOUT;
- }
-#endif
-
timeStart = Clock_getTicks();
while (1) {
if ((base[rdReg] & mask) == mask)