Lines Matching refs:sdesc
126 void (*exec_desc)(struct sirfsoc_dma_desc *sdesc,
132 void (*exec)(struct sirfsoc_dma_desc *sdesc,
162 static void sirfsoc_dma_execute_hw_a7v2(struct sirfsoc_dma_desc *sdesc,
165 if (sdesc->chain) {
167 writel_relaxed((sdesc->dir << SIRFSOC_DMA_DIR_CTRL_BIT_ATLAS7) |
168 (sdesc->chain <<
174 writel_relaxed(sdesc->xlen, base + SIRFSOC_DMA_CH_XLEN);
175 writel_relaxed(sdesc->ylen, base + SIRFSOC_DMA_CH_YLEN);
176 writel_relaxed(sdesc->width, base + SIRFSOC_DMA_WIDTH_ATLAS7);
177 writel_relaxed((sdesc->width*((sdesc->ylen+1)>>1)),
179 writel_relaxed((sdesc->dir << SIRFSOC_DMA_DIR_CTRL_BIT_ATLAS7) |
180 (sdesc->chain <<
184 writel_relaxed(sdesc->chain ? SIRFSOC_DMA_INT_END_INT_ATLAS7 :
188 writel(sdesc->addr, base + SIRFSOC_DMA_CH_ADDR);
189 if (sdesc->cyclic)
193 static void sirfsoc_dma_execute_hw_a7v1(struct sirfsoc_dma_desc *sdesc,
198 writel_relaxed(sdesc->width, base + SIRFSOC_DMA_WIDTH_0 + cid * 4);
200 (sdesc->dir << SIRFSOC_DMA_DIR_CTRL_BIT),
202 writel_relaxed(sdesc->xlen, base + cid * 0x10 + SIRFSOC_DMA_CH_XLEN);
203 writel_relaxed(sdesc->ylen, base + cid * 0x10 + SIRFSOC_DMA_CH_YLEN);
206 writel(sdesc->addr >> 2, base + cid * 0x10 + SIRFSOC_DMA_CH_ADDR);
207 if (sdesc->cyclic) {
215 static void sirfsoc_dma_execute_hw_a6(struct sirfsoc_dma_desc *sdesc,
218 writel_relaxed(sdesc->width, base + SIRFSOC_DMA_WIDTH_0 + cid * 4);
220 (sdesc->dir << SIRFSOC_DMA_DIR_CTRL_BIT),
222 writel_relaxed(sdesc->xlen, base + cid * 0x10 + SIRFSOC_DMA_CH_XLEN);
223 writel_relaxed(sdesc->ylen, base + cid * 0x10 + SIRFSOC_DMA_CH_YLEN);
226 writel(sdesc->addr >> 2, base + cid * 0x10 + SIRFSOC_DMA_CH_ADDR);
227 if (sdesc->cyclic) {
240 struct sirfsoc_dma_desc *sdesc = NULL;
248 sdesc = list_first_entry(&schan->queued, struct sirfsoc_dma_desc,
251 list_move_tail(&sdesc->node, &schan->active);
257 sdma->exec_desc(sdesc, cid, schan->mode, base);
259 if (sdesc->cyclic)
268 struct sirfsoc_dma_desc *sdesc = NULL;
284 sdesc = list_first_entry(&schan->active,
286 if (!sdesc->cyclic) {
290 dma_cookie_complete(&sdesc->desc);
306 sdesc = list_first_entry(&schan->active,
308 if (!sdesc->cyclic) {
309 chain = sdesc->chain;
316 dma_cookie_complete(&sdesc->desc);
320 } else if (sdesc->cyclic && (is &
342 struct sirfsoc_dma_desc *sdesc;
359 list_for_each_entry(sdesc, &list, node) {
360 desc = &sdesc->desc;
379 sdesc = list_first_entry(&schan->active,
386 desc = &sdesc->desc;
407 struct sirfsoc_dma_desc *sdesc;
411 sdesc = container_of(txd, struct sirfsoc_dma_desc, desc);
416 list_move_tail(&sdesc->node, &schan->queued);
560 struct sirfsoc_dma_desc *sdesc;
569 sdesc = kzalloc(sizeof(*sdesc), GFP_KERNEL);
570 if (!sdesc) {
576 dma_async_tx_descriptor_init(&sdesc->desc, chan);
577 sdesc->desc.flags = DMA_CTRL_ACK;
578 sdesc->desc.tx_submit = sirfsoc_dma_tx_submit;
580 list_add_tail(&sdesc->node, &descs);
600 struct sirfsoc_dma_desc *sdesc, *tmp;
618 list_for_each_entry_safe(sdesc, tmp, &descs, node)
619 kfree(sdesc);
647 struct sirfsoc_dma_desc *sdesc;
661 sdesc = list_first_entry(&schan->active, struct sirfsoc_dma_desc, node);
662 if (sdesc->cyclic)
663 dma_request_bytes = (sdesc->xlen + 1) * (sdesc->ylen + 1) *
664 (sdesc->width * SIRFSOC_DMA_WORD_LEN);
666 dma_request_bytes = sdesc->xlen * SIRFSOC_DMA_WORD_LEN;
680 residue = dma_request_bytes - (dma_pos - sdesc->addr);
694 struct sirfsoc_dma_desc *sdesc = NULL;
706 sdesc = list_first_entry(&schan->free, struct sirfsoc_dma_desc,
708 list_del(&sdesc->node);
712 if (!sdesc) {
727 sdesc->cyclic = 0;
728 sdesc->xlen = xt->sgl[0].size / SIRFSOC_DMA_WORD_LEN;
729 sdesc->width = (xt->sgl[0].size + xt->sgl[0].icg) /
731 sdesc->ylen = xt->numf - 1;
733 sdesc->addr = xt->src_start;
734 sdesc->dir = 1;
736 sdesc->addr = xt->dst_start;
737 sdesc->dir = 0;
740 list_add_tail(&sdesc->node, &schan->prepared);
748 return &sdesc->desc;
762 struct sirfsoc_dma_desc *sdesc = NULL;
782 sdesc = list_first_entry(&schan->free, struct sirfsoc_dma_desc,
784 list_del(&sdesc->node);
788 if (!sdesc)
793 sdesc->addr = addr;
794 sdesc->cyclic = 1;
795 sdesc->xlen = 0;
796 sdesc->ylen = buf_len / SIRFSOC_DMA_WORD_LEN - 1;
797 sdesc->width = 1;
798 list_add_tail(&sdesc->node, &schan->prepared);
801 return &sdesc->desc;
1060 struct sirfsoc_dma_desc *sdesc;
1088 sdesc = list_first_entry(&schan->active,
1091 writel_relaxed(sdesc->width,
1093 writel_relaxed(sdesc->xlen,
1095 writel_relaxed(sdesc->ylen,
1100 writel_relaxed(sdesc->addr,
1103 writel_relaxed(sdesc->addr >> 2,