Lines Matching refs:sg
116 struct axi_dmac_sg sg[]; member
208 struct axi_dmac_sg *sg; in axi_dmac_start_transfer() local
225 sg = &desc->sg[desc->num_submitted]; in axi_dmac_start_transfer()
228 if (sg->id != AXI_DMAC_SG_UNUSED) { in axi_dmac_start_transfer()
229 sg->schedule_when_free = true; in axi_dmac_start_transfer()
245 sg->id = axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID); in axi_dmac_start_transfer()
248 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS, sg->dest_addr); in axi_dmac_start_transfer()
249 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_STRIDE, sg->dest_stride); in axi_dmac_start_transfer()
253 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS, sg->src_addr); in axi_dmac_start_transfer()
254 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_STRIDE, sg->src_stride); in axi_dmac_start_transfer()
269 axi_dmac_write(dmac, AXI_DMAC_REG_X_LENGTH, sg->x_len - 1); in axi_dmac_start_transfer()
270 axi_dmac_write(dmac, AXI_DMAC_REG_Y_LENGTH, sg->y_len - 1); in axi_dmac_start_transfer()
282 struct axi_dmac_sg *sg) in axi_dmac_total_sg_bytes() argument
285 return sg->x_len * sg->y_len; in axi_dmac_total_sg_bytes()
287 return sg->x_len; in axi_dmac_total_sg_bytes()
294 struct axi_dmac_sg *sg; in axi_dmac_dequeue_partial_xfers() local
305 sg = &desc->sg[i]; in axi_dmac_dequeue_partial_xfers()
306 if (sg->id == AXI_DMAC_SG_UNUSED) in axi_dmac_dequeue_partial_xfers()
308 if (sg->id == id) { in axi_dmac_dequeue_partial_xfers()
310 sg->partial_len = len; in axi_dmac_dequeue_partial_xfers()
341 struct axi_dmac_sg *sg; in axi_dmac_compute_residue() local
352 sg = &active->sg[i]; in axi_dmac_compute_residue()
353 total = axi_dmac_total_sg_bytes(chan, sg); in axi_dmac_compute_residue()
354 rslt->residue += (total - sg->partial_len); in axi_dmac_compute_residue()
362 struct axi_dmac_sg *sg; in axi_dmac_transfer_done() local
374 sg = &active->sg[active->num_completed]; in axi_dmac_transfer_done()
375 if (sg->id == AXI_DMAC_SG_UNUSED) /* Not yet submitted */ in axi_dmac_transfer_done()
377 if (!(BIT(sg->id) & completed_transfers)) in axi_dmac_transfer_done()
380 sg->id = AXI_DMAC_SG_UNUSED; in axi_dmac_transfer_done()
381 if (sg->schedule_when_free) { in axi_dmac_transfer_done()
382 sg->schedule_when_free = false; in axi_dmac_transfer_done()
386 if (sg->partial_len) in axi_dmac_transfer_done()
393 sg->partial_len) { in axi_dmac_transfer_done()
480 desc = kzalloc(struct_size(desc, sg, num_sgs), GFP_NOWAIT); in axi_dmac_alloc_desc()
485 desc->sg[i].id = AXI_DMAC_SG_UNUSED; in axi_dmac_alloc_desc()
495 struct axi_dmac_sg *sg) in axi_dmac_fill_linear_sg() argument
512 sg->dest_addr = addr; in axi_dmac_fill_linear_sg()
514 sg->src_addr = addr; in axi_dmac_fill_linear_sg()
515 sg->x_len = segment_size; in axi_dmac_fill_linear_sg()
516 sg->y_len = 1; in axi_dmac_fill_linear_sg()
517 sg++; in axi_dmac_fill_linear_sg()
523 sg->dest_addr = addr; in axi_dmac_fill_linear_sg()
525 sg->src_addr = addr; in axi_dmac_fill_linear_sg()
526 sg->x_len = len; in axi_dmac_fill_linear_sg()
527 sg->y_len = 1; in axi_dmac_fill_linear_sg()
528 sg++; in axi_dmac_fill_linear_sg()
532 return sg; in axi_dmac_fill_linear_sg()
543 struct scatterlist *sg; in axi_dmac_prep_slave_sg() local
551 for_each_sg(sgl, sg, sg_len, i) in axi_dmac_prep_slave_sg()
552 num_sgs += DIV_ROUND_UP(sg_dma_len(sg), chan->max_length); in axi_dmac_prep_slave_sg()
558 dsg = desc->sg; in axi_dmac_prep_slave_sg()
560 for_each_sg(sgl, sg, sg_len, i) { in axi_dmac_prep_slave_sg()
561 if (!axi_dmac_check_addr(chan, sg_dma_address(sg)) || in axi_dmac_prep_slave_sg()
562 !axi_dmac_check_len(chan, sg_dma_len(sg))) { in axi_dmac_prep_slave_sg()
567 dsg = axi_dmac_fill_linear_sg(chan, direction, sg_dma_address(sg), 1, in axi_dmac_prep_slave_sg()
568 sg_dma_len(sg), dsg); in axi_dmac_prep_slave_sg()
603 period_len, desc->sg); in axi_dmac_prep_dma_cyclic()
658 desc->sg[0].src_addr = xt->src_start; in axi_dmac_prep_interleaved()
659 desc->sg[0].src_stride = xt->sgl[0].size + src_icg; in axi_dmac_prep_interleaved()
663 desc->sg[0].dest_addr = xt->dst_start; in axi_dmac_prep_interleaved()
664 desc->sg[0].dest_stride = xt->sgl[0].size + dst_icg; in axi_dmac_prep_interleaved()
668 desc->sg[0].x_len = xt->sgl[0].size; in axi_dmac_prep_interleaved()
669 desc->sg[0].y_len = xt->numf; in axi_dmac_prep_interleaved()
671 desc->sg[0].x_len = xt->sgl[0].size * xt->numf; in axi_dmac_prep_interleaved()
672 desc->sg[0].y_len = 1; in axi_dmac_prep_interleaved()