Lines Matching refs:channel

46 static void MCD_resmActions(int channel);
308 int MCD_dmaStatus(int channel) in MCD_dmaStatus() argument
312 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_dmaStatus()
315 tcrValue = MCD_dmaBar->taskControl[channel]; in MCD_dmaStatus()
318 if (MCD_chStatus[channel] == MCD_RUNNING in MCD_dmaStatus()
319 || MCD_chStatus[channel] == MCD_IDLE) in MCD_dmaStatus()
320 MCD_chStatus[channel] = MCD_DONE; in MCD_dmaStatus()
324 if (MCD_chStatus[channel] == MCD_RUNNING in MCD_dmaStatus()
325 || MCD_chStatus[channel] == MCD_IDLE) { in MCD_dmaStatus()
329 if ((MCD_dmaBar->ptdDebug >> channel) & 0x1) in MCD_dmaStatus()
330 MCD_chStatus[channel] = MCD_RUNNING; in MCD_dmaStatus()
332 MCD_chStatus[channel] = MCD_IDLE; in MCD_dmaStatus()
336 return MCD_chStatus[channel]; in MCD_dmaStatus()
359 int MCD_startDma(int channel, s8 * srcAddr, s16 srcIncr, s8 * destAddr, in MCD_startDma() argument
375 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_startDma()
405 MCD_remVariants.remSrcRsdIncr[channel] = srcRsdIncr; in MCD_startDma()
406 MCD_remVariants.remDestRsdIncr[channel] = destRsdIncr; in MCD_startDma()
407 MCD_remVariants.remDestIncr[channel] = destIncr; in MCD_startDma()
408 MCD_remVariants.remSrcIncr[channel] = srcIncr; in MCD_startDma()
409 MCD_remVariants.remXferSize[channel] = xferSize; in MCD_startDma()
413 (int *)(MCD_taskTable[channel].contextSaveSpace) + CSAVE_OFFSET + in MCD_startDma()
419 (u32 *) (MCD_taskTable[channel].FDTandFlags & 0xffffff00); in MCD_startDma()
433 MCD_dmaBar->taskControl[channel] = in MCD_startDma()
436 while (((MCD_dmaBar->taskControl[channel] & 0x1fff) != in MCD_startDma()
441 MCD_dmaBar->taskControl[channel] = in MCD_startDma()
446 MCD_dmaBar->priority[channel] = (u8) priority & PRIORITY_PRI_MASK; in MCD_startDma()
449 if (channel < 8 && channel >= 0) { in MCD_startDma()
450 MCD_dmaBar->taskSize0 &= ~(0xf << (7 - channel) * 4); in MCD_startDma()
452 (xferSize & 3) << (((7 - channel) * 4) + 2); in MCD_startDma()
453 MCD_dmaBar->taskSize0 |= (xferSize & 3) << ((7 - channel) * 4); in MCD_startDma()
455 MCD_dmaBar->taskSize1 &= ~(0xf << (15 - channel) * 4); in MCD_startDma()
457 (xferSize & 3) << (((15 - channel) * 4) + 2); in MCD_startDma()
458 MCD_dmaBar->taskSize1 |= (xferSize & 3) << ((15 - channel) * 4); in MCD_startDma()
463 MCD_taskTable[channel].FDTandFlags &= ~MCD_TT_FLAGS_MASK; in MCD_startDma()
464 MCD_taskTable[channel].FDTandFlags |= (MCD_TT_FLAGS_MASK & flags); in MCD_startDma()
468 MCD_taskTable[channel].TDTstart = in MCD_startDma()
470 MCD_taskTable[channel].TDTend = in MCD_startDma()
474 channel); in MCD_startDma()
477 MCD_taskTable[channel].TDTstart = in MCD_startDma()
479 MCD_taskTable[channel].TDTend = in MCD_startDma()
483 channel); in MCD_startDma()
490 MCD_relocBuffDesc[channel].srcAddr = srcAddr; in MCD_startDma()
491 MCD_relocBuffDesc[channel].destAddr = destAddr; in MCD_startDma()
494 MCD_relocBuffDesc[channel].lastDestAddr = destAddr; in MCD_startDma()
496 MCD_relocBuffDesc[channel].dmaSize = dmaSize; in MCD_startDma()
497 MCD_relocBuffDesc[channel].flags = 0; /* not used */ in MCD_startDma()
498 MCD_relocBuffDesc[channel].csumResult = 0; /* not used */ in MCD_startDma()
499 MCD_relocBuffDesc[channel].next = 0; /* not used */ in MCD_startDma()
503 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
505 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
507 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
509 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
511 (u32) & (MCD_relocBuffDesc[channel]); in MCD_startDma()
516 MCD_taskTable[channel].TDTstart = in MCD_startDma()
518 MCD_taskTable[channel].TDTend = in MCD_startDma()
524 &(MCD_relocBuffDesc[channel]), in MCD_startDma()
525 cSave, MCD_taskTable, channel); in MCD_startDma()
528 MCD_taskTable[channel].TDTstart = in MCD_startDma()
530 MCD_taskTable[channel].TDTend = in MCD_startDma()
536 &(MCD_relocBuffDesc[channel]), in MCD_startDma()
537 cSave, MCD_taskTable, channel); in MCD_startDma()
544 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
547 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
553 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
556 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
560 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
562 ((volatile int *)MCD_taskTable[channel]. in MCD_startDma()
567 MCD_taskTable[channel].TDTstart = in MCD_startDma()
569 MCD_taskTable[channel].TDTend = in MCD_startDma()
574 MCD_taskTable, channel); in MCD_startDma()
577 MCD_taskTable[channel].TDTstart = in MCD_startDma()
579 MCD_taskTable[channel].TDTend = in MCD_startDma()
583 MCD_taskTable, channel); in MCD_startDma()
586 MCD_chStatus[channel] = MCD_IDLE; in MCD_startDma()
622 int MCD_XferProgrQuery(int channel, MCD_XferProg * progRep) in MCD_XferProgrQuery() argument
636 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_XferProgrQuery()
641 (s8 *) ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
644 (s8 *) ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
647 ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[DCOUNT + in MCD_XferProgrQuery()
650 (MCD_bufDesc *) ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
662 (s8 *) ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
665 (s8 *) ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
668 ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
671 (MCD_bufDesc *) ((volatile int *)MCD_taskTable[channel]. in MCD_XferProgrQuery()
692 switch (MCD_remVariants.remDestRsdIncr[channel]) { in MCD_XferProgrQuery()
696 lastDestAddr) & ((MCD_remVariants.remXferSize[channel]) - in MCD_XferProgrQuery()
700 destAddr) & ((MCD_remVariants.remXferSize[channel]) - 1); in MCD_XferProgrQuery()
706 (destDiffBytes / MCD_remVariants.remDestIncr[channel]) * in MCD_XferProgrQuery()
707 (MCD_remVariants.remDestIncr[channel] in MCD_XferProgrQuery()
708 + MCD_remVariants.remXferSize[channel]); in MCD_XferProgrQuery()
720 destAddr) & ((MCD_remVariants.remXferSize[channel]) - 1); in MCD_XferProgrQuery()
724 lastDestAddr) & ((MCD_remVariants.remXferSize[channel]) - in MCD_XferProgrQuery()
733 MCD_remVariants.remDestIncr[channel]; in MCD_XferProgrQuery()
735 numIterations * (MCD_remVariants.remDestIncr[channel] in MCD_XferProgrQuery()
736 - MCD_remVariants.remXferSize[channel]); in MCD_XferProgrQuery()
744 switch (MCD_remVariants.remSrcRsdIncr[channel]) { in MCD_XferProgrQuery()
748 (MCD_remVariants.remSrcIncr[channel] * in MCD_XferProgrQuery()
749 (progRep->dmaSize / MCD_remVariants.remXferSize[channel])); in MCD_XferProgrQuery()
757 (MCD_remVariants.remSrcIncr[channel] * in MCD_XferProgrQuery()
758 (progRep->dmaSize / MCD_remVariants.remXferSize[channel])); in MCD_XferProgrQuery()
776 static void MCD_resmActions(int channel) in MCD_resmActions() argument
784 if ((MCD_dmaBar->ptdDebug >> channel) & 0x1) in MCD_resmActions()
785 MCD_chStatus[channel] = MCD_RUNNING; in MCD_resmActions()
787 MCD_chStatus[channel] = MCD_IDLE; in MCD_resmActions()
804 int MCD_killDma(int channel) in MCD_killDma() argument
808 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_killDma()
811 MCD_dmaBar->taskControl[channel] = 0x0; in MCD_killDma()
812 MCD_resumeDma(channel); in MCD_killDma()
819 MCD_chStatus[channel] = MCD_HALTED; in MCD_killDma()
843 int MCD_continDma(int channel) in MCD_continDma() argument
845 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_continDma()
848 MCD_dmaBar->taskControl[channel] |= TASK_CTL_EN; in MCD_continDma()
849 MCD_chStatus[channel] = MCD_RUNNING; in MCD_continDma()
895 int MCD_pauseDma(int channel) in MCD_pauseDma() argument
899 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_pauseDma()
902 if (MCD_dmaBar->taskControl[channel] & TASK_CTL_EN) { in MCD_pauseDma()
903 MCD_dmaBar->debugComp1 = channel; in MCD_pauseDma()
905 DBG_CTL_ENABLE | (1 << (channel + 16)); in MCD_pauseDma()
906 MCD_chStatus[channel] = MCD_PAUSED; in MCD_pauseDma()
927 int MCD_resumeDma(int channel) in MCD_resumeDma() argument
929 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_resumeDma()
932 if (MCD_dmaBar->taskControl[channel] & TASK_CTL_EN) in MCD_resumeDma()
933 MCD_resmActions(channel); in MCD_resumeDma()
950 int MCD_csumQuery(int channel, u32 * csum) in MCD_csumQuery() argument
953 if ((channel < 0) || (channel >= NCHANNELS)) in MCD_csumQuery()
956 *csum = MCD_relocBuffDesc[channel].csumResult; in MCD_csumQuery()