Lines Matching refs:tcd

149 		dma_pool_free(fsl_desc->echan->tcd_pool, fsl_desc->tcd[i].vtcd,  in fsl_edma_free_desc()
150 fsl_desc->tcd[i].ptcd); in fsl_edma_free_desc()
278 len += le32_to_cpu(edesc->tcd[i].vtcd->nbytes) in fsl_edma_desc_residue()
279 * le16_to_cpu(edesc->tcd[i].vtcd->biter); in fsl_edma_desc_residue()
285 cur_addr = edma_readl(fsl_chan->edma, &regs->tcd[ch].saddr); in fsl_edma_desc_residue()
287 cur_addr = edma_readl(fsl_chan->edma, &regs->tcd[ch].daddr); in fsl_edma_desc_residue()
291 size = le32_to_cpu(edesc->tcd[i].vtcd->nbytes) in fsl_edma_desc_residue()
292 * le16_to_cpu(edesc->tcd[i].vtcd->biter); in fsl_edma_desc_residue()
294 dma_addr = le32_to_cpu(edesc->tcd[i].vtcd->saddr); in fsl_edma_desc_residue()
296 dma_addr = le32_to_cpu(edesc->tcd[i].vtcd->daddr); in fsl_edma_desc_residue()
341 struct fsl_edma_hw_tcd *tcd) in fsl_edma_set_tcd_regs() argument
352 edma_writew(edma, 0, &regs->tcd[ch].csr); in fsl_edma_set_tcd_regs()
353 edma_writel(edma, le32_to_cpu(tcd->saddr), &regs->tcd[ch].saddr); in fsl_edma_set_tcd_regs()
354 edma_writel(edma, le32_to_cpu(tcd->daddr), &regs->tcd[ch].daddr); in fsl_edma_set_tcd_regs()
356 edma_writew(edma, le16_to_cpu(tcd->attr), &regs->tcd[ch].attr); in fsl_edma_set_tcd_regs()
357 edma_writew(edma, le16_to_cpu(tcd->soff), &regs->tcd[ch].soff); in fsl_edma_set_tcd_regs()
359 edma_writel(edma, le32_to_cpu(tcd->nbytes), &regs->tcd[ch].nbytes); in fsl_edma_set_tcd_regs()
360 edma_writel(edma, le32_to_cpu(tcd->slast), &regs->tcd[ch].slast); in fsl_edma_set_tcd_regs()
362 edma_writew(edma, le16_to_cpu(tcd->citer), &regs->tcd[ch].citer); in fsl_edma_set_tcd_regs()
363 edma_writew(edma, le16_to_cpu(tcd->biter), &regs->tcd[ch].biter); in fsl_edma_set_tcd_regs()
364 edma_writew(edma, le16_to_cpu(tcd->doff), &regs->tcd[ch].doff); in fsl_edma_set_tcd_regs()
366 edma_writel(edma, le32_to_cpu(tcd->dlast_sga), in fsl_edma_set_tcd_regs()
367 &regs->tcd[ch].dlast_sga); in fsl_edma_set_tcd_regs()
369 edma_writew(edma, le16_to_cpu(tcd->csr), &regs->tcd[ch].csr); in fsl_edma_set_tcd_regs()
373 void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, in fsl_edma_fill_tcd() argument
386 tcd->saddr = cpu_to_le32(src); in fsl_edma_fill_tcd()
387 tcd->daddr = cpu_to_le32(dst); in fsl_edma_fill_tcd()
389 tcd->attr = cpu_to_le16(attr); in fsl_edma_fill_tcd()
391 tcd->soff = cpu_to_le16(soff); in fsl_edma_fill_tcd()
393 tcd->nbytes = cpu_to_le32(nbytes); in fsl_edma_fill_tcd()
394 tcd->slast = cpu_to_le32(slast); in fsl_edma_fill_tcd()
396 tcd->citer = cpu_to_le16(EDMA_TCD_CITER_CITER(citer)); in fsl_edma_fill_tcd()
397 tcd->doff = cpu_to_le16(doff); in fsl_edma_fill_tcd()
399 tcd->dlast_sga = cpu_to_le32(dlast_sga); in fsl_edma_fill_tcd()
401 tcd->biter = cpu_to_le16(EDMA_TCD_BITER_BITER(biter)); in fsl_edma_fill_tcd()
411 tcd->csr = cpu_to_le16(csr); in fsl_edma_fill_tcd()
420 fsl_desc = kzalloc(struct_size(fsl_desc, tcd, sg_len), GFP_NOWAIT); in fsl_edma_alloc_desc()
427 fsl_desc->tcd[i].vtcd = dma_pool_alloc(fsl_chan->tcd_pool, in fsl_edma_alloc_desc()
428 GFP_NOWAIT, &fsl_desc->tcd[i].ptcd); in fsl_edma_alloc_desc()
429 if (!fsl_desc->tcd[i].vtcd) in fsl_edma_alloc_desc()
436 dma_pool_free(fsl_chan->tcd_pool, fsl_desc->tcd[i].vtcd, in fsl_edma_alloc_desc()
437 fsl_desc->tcd[i].ptcd); in fsl_edma_alloc_desc()
487 last_sg = fsl_desc->tcd[(i + 1) % sg_len].ptcd; in fsl_edma_prep_dma_cyclic()
501 fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, dst_addr, in fsl_edma_prep_dma_cyclic()
549 last_sg = fsl_desc->tcd[(i + 1) % sg_len].ptcd; in fsl_edma_prep_slave_sg()
565 last_sg = fsl_desc->tcd[(i + 1)].ptcd; in fsl_edma_prep_slave_sg()
566 fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, in fsl_edma_prep_slave_sg()
572 fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, in fsl_edma_prep_slave_sg()
591 fsl_edma_set_tcd_regs(fsl_chan, fsl_chan->edesc->tcd[0].vtcd); in fsl_edma_xfer_desc()
705 edma->regs.tcd = edma->membase + EDMA_TCD; in fsl_edma_setup_regs()