Lines Matching full:segment
313 * struct xilinx_vdma_tx_segment - Descriptor segment
316 * @phys: Physical address of segment
325 * struct xilinx_axidma_tx_segment - Descriptor segment
328 * @phys: Physical address of segment
337 * struct xilinx_aximcdma_tx_segment - Descriptor segment
340 * @phys: Physical address of segment
349 * struct xilinx_cdma_tx_segment - Descriptor segment
352 * @phys: Physical address of segment
410 * @cyclic_seg_v: Statically allocated segment base for cyclic transfers
661 * xilinx_vdma_alloc_tx_segment - Allocate transaction segment
664 * Return: The allocated segment on success and NULL on failure.
669 struct xilinx_vdma_tx_segment *segment; in xilinx_vdma_alloc_tx_segment() local
672 segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); in xilinx_vdma_alloc_tx_segment()
673 if (!segment) in xilinx_vdma_alloc_tx_segment()
676 segment->phys = phys; in xilinx_vdma_alloc_tx_segment()
678 return segment; in xilinx_vdma_alloc_tx_segment()
682 * xilinx_cdma_alloc_tx_segment - Allocate transaction segment
685 * Return: The allocated segment on success and NULL on failure.
690 struct xilinx_cdma_tx_segment *segment; in xilinx_cdma_alloc_tx_segment() local
693 segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); in xilinx_cdma_alloc_tx_segment()
694 if (!segment) in xilinx_cdma_alloc_tx_segment()
697 segment->phys = phys; in xilinx_cdma_alloc_tx_segment()
699 return segment; in xilinx_cdma_alloc_tx_segment()
703 * xilinx_axidma_alloc_tx_segment - Allocate transaction segment
706 * Return: The allocated segment on success and NULL on failure.
711 struct xilinx_axidma_tx_segment *segment = NULL; in xilinx_axidma_alloc_tx_segment() local
716 segment = list_first_entry(&chan->free_seg_list, in xilinx_axidma_alloc_tx_segment()
719 list_del(&segment->node); in xilinx_axidma_alloc_tx_segment()
723 if (!segment) in xilinx_axidma_alloc_tx_segment()
724 dev_dbg(chan->dev, "Could not find free tx segment\n"); in xilinx_axidma_alloc_tx_segment()
726 return segment; in xilinx_axidma_alloc_tx_segment()
730 * xilinx_aximcdma_alloc_tx_segment - Allocate transaction segment
733 * Return: The allocated segment on success and NULL on failure.
738 struct xilinx_aximcdma_tx_segment *segment = NULL; in xilinx_aximcdma_alloc_tx_segment() local
743 segment = list_first_entry(&chan->free_seg_list, in xilinx_aximcdma_alloc_tx_segment()
746 list_del(&segment->node); in xilinx_aximcdma_alloc_tx_segment()
750 return segment; in xilinx_aximcdma_alloc_tx_segment()
776 * xilinx_dma_free_tx_segment - Free transaction segment
778 * @segment: DMA transaction segment
781 struct xilinx_axidma_tx_segment *segment) in xilinx_dma_free_tx_segment() argument
783 xilinx_dma_clean_hw_desc(&segment->hw); in xilinx_dma_free_tx_segment()
785 list_add_tail(&segment->node, &chan->free_seg_list); in xilinx_dma_free_tx_segment()
789 * xilinx_mcdma_free_tx_segment - Free transaction segment
791 * @segment: DMA transaction segment
795 segment) in xilinx_mcdma_free_tx_segment()
797 xilinx_mcdma_clean_hw_desc(&segment->hw); in xilinx_mcdma_free_tx_segment()
799 list_add_tail(&segment->node, &chan->free_seg_list); in xilinx_mcdma_free_tx_segment()
803 * xilinx_cdma_free_tx_segment - Free transaction segment
805 * @segment: DMA transaction segment
808 struct xilinx_cdma_tx_segment *segment) in xilinx_cdma_free_tx_segment() argument
810 dma_pool_free(chan->desc_pool, segment, segment->phys); in xilinx_cdma_free_tx_segment()
814 * xilinx_vdma_free_tx_segment - Free transaction segment
816 * @segment: DMA transaction segment
819 struct xilinx_vdma_tx_segment *segment) in xilinx_vdma_free_tx_segment() argument
821 dma_pool_free(chan->desc_pool, segment, segment->phys); in xilinx_vdma_free_tx_segment()
853 struct xilinx_vdma_tx_segment *segment, *next; in xilinx_dma_free_tx_descriptor() local
862 list_for_each_entry_safe(segment, next, &desc->segments, node) { in xilinx_dma_free_tx_descriptor()
863 list_del(&segment->node); in xilinx_dma_free_tx_descriptor()
864 xilinx_vdma_free_tx_segment(chan, segment); in xilinx_dma_free_tx_descriptor()
1138 * so allocating a desc segment during channel allocation for in xilinx_dma_alloc_chan_resources()
1147 "unable to allocate desc segment for cyclic DMA\n"); in xilinx_dma_alloc_chan_resources()
1365 struct xilinx_vdma_tx_segment *segment, *last = NULL; in xilinx_vdma_start_transfer() local
1426 list_for_each_entry(segment, &desc->segments, node) { in xilinx_vdma_start_transfer()
1430 segment->hw.buf_addr, in xilinx_vdma_start_transfer()
1431 segment->hw.buf_addr_msb); in xilinx_vdma_start_transfer()
1435 segment->hw.buf_addr); in xilinx_vdma_start_transfer()
1437 last = segment; in xilinx_vdma_start_transfer()
1506 struct xilinx_cdma_tx_segment *segment; in xilinx_cdma_start_transfer() local
1509 segment = list_first_entry(&head_desc->segments, in xilinx_cdma_start_transfer()
1513 hw = &segment->hw; in xilinx_cdma_start_transfer()
1586 struct xilinx_axidma_tx_segment *segment; in xilinx_dma_start_transfer() local
1589 segment = list_first_entry(&head_desc->segments, in xilinx_dma_start_transfer()
1592 hw = &segment->hw; in xilinx_dma_start_transfer()
2044 struct xilinx_vdma_tx_segment *segment; in xilinx_vdma_dma_prep_interleaved() local
2066 segment = xilinx_vdma_alloc_tx_segment(chan); in xilinx_vdma_dma_prep_interleaved()
2067 if (!segment) in xilinx_vdma_dma_prep_interleaved()
2071 hw = &segment->hw; in xilinx_vdma_dma_prep_interleaved()
2095 /* Insert the segment into the descriptor segments list. */ in xilinx_vdma_dma_prep_interleaved()
2096 list_add_tail(&segment->node, &desc->segments); in xilinx_vdma_dma_prep_interleaved()
2099 segment = list_first_entry(&desc->segments, in xilinx_vdma_dma_prep_interleaved()
2101 desc->async_tx.phys = segment->phys; in xilinx_vdma_dma_prep_interleaved()
2126 struct xilinx_cdma_tx_segment *segment; in xilinx_cdma_prep_memcpy() local
2140 segment = xilinx_cdma_alloc_tx_segment(chan); in xilinx_cdma_prep_memcpy()
2141 if (!segment) in xilinx_cdma_prep_memcpy()
2144 hw = &segment->hw; in xilinx_cdma_prep_memcpy()
2153 /* Insert the segment into the descriptor segments list. */ in xilinx_cdma_prep_memcpy()
2154 list_add_tail(&segment->node, &desc->segments); in xilinx_cdma_prep_memcpy()
2156 desc->async_tx.phys = segment->phys; in xilinx_cdma_prep_memcpy()
2157 hw->next_desc = segment->phys; in xilinx_cdma_prep_memcpy()
2184 struct xilinx_axidma_tx_segment *segment = NULL; in xilinx_dma_prep_slave_sg() local
2210 /* Get a free segment */ in xilinx_dma_prep_slave_sg()
2211 segment = xilinx_axidma_alloc_tx_segment(chan); in xilinx_dma_prep_slave_sg()
2212 if (!segment) in xilinx_dma_prep_slave_sg()
2221 hw = &segment->hw; in xilinx_dma_prep_slave_sg()
2238 * Insert the segment into the descriptor segments in xilinx_dma_prep_slave_sg()
2241 list_add_tail(&segment->node, &desc->segments); in xilinx_dma_prep_slave_sg()
2245 segment = list_first_entry(&desc->segments, in xilinx_dma_prep_slave_sg()
2247 desc->async_tx.phys = segment->phys; in xilinx_dma_prep_slave_sg()
2251 segment->hw.control |= XILINX_DMA_BD_SOP; in xilinx_dma_prep_slave_sg()
2252 segment = list_last_entry(&desc->segments, in xilinx_dma_prep_slave_sg()
2255 segment->hw.control |= XILINX_DMA_BD_EOP; in xilinx_dma_prep_slave_sg()
2286 struct xilinx_axidma_tx_segment *segment, *head_segment, *prev = NULL; in xilinx_dma_prep_dma_cyclic() local
2318 /* Get a free segment */ in xilinx_dma_prep_dma_cyclic()
2319 segment = xilinx_axidma_alloc_tx_segment(chan); in xilinx_dma_prep_dma_cyclic()
2320 if (!segment) in xilinx_dma_prep_dma_cyclic()
2329 hw = &segment->hw; in xilinx_dma_prep_dma_cyclic()
2335 prev->hw.next_desc = segment->phys; in xilinx_dma_prep_dma_cyclic()
2337 prev = segment; in xilinx_dma_prep_dma_cyclic()
2341 * Insert the segment into the descriptor segments in xilinx_dma_prep_dma_cyclic()
2344 list_add_tail(&segment->node, &desc->segments); in xilinx_dma_prep_dma_cyclic()
2357 segment = list_last_entry(&desc->segments, in xilinx_dma_prep_dma_cyclic()
2360 segment->hw.next_desc = (u32) head_segment->phys; in xilinx_dma_prep_dma_cyclic()
2365 segment->hw.control |= XILINX_DMA_BD_EOP; in xilinx_dma_prep_dma_cyclic()
2394 struct xilinx_aximcdma_tx_segment *segment = NULL; in xilinx_mcdma_prep_slave_sg() local
2420 /* Get a free segment */ in xilinx_mcdma_prep_slave_sg()
2421 segment = xilinx_aximcdma_alloc_tx_segment(chan); in xilinx_mcdma_prep_slave_sg()
2422 if (!segment) in xilinx_mcdma_prep_slave_sg()
2431 hw = &segment->hw; in xilinx_mcdma_prep_slave_sg()
2445 * Insert the segment into the descriptor segments in xilinx_mcdma_prep_slave_sg()
2448 list_add_tail(&segment->node, &desc->segments); in xilinx_mcdma_prep_slave_sg()
2452 segment = list_first_entry(&desc->segments, in xilinx_mcdma_prep_slave_sg()
2454 desc->async_tx.phys = segment->phys; in xilinx_mcdma_prep_slave_sg()
2458 segment->hw.control |= XILINX_MCDMA_BD_SOP; in xilinx_mcdma_prep_slave_sg()
2459 segment = list_last_entry(&desc->segments, in xilinx_mcdma_prep_slave_sg()
2462 segment->hw.control |= XILINX_MCDMA_BD_EOP; in xilinx_mcdma_prep_slave_sg()