Lines Matching full:segment

315  * struct xilinx_vdma_tx_segment - Descriptor segment
318 * @phys: Physical address of segment
327 * struct xilinx_axidma_tx_segment - Descriptor segment
330 * @phys: Physical address of segment
339 * struct xilinx_aximcdma_tx_segment - Descriptor segment
342 * @phys: Physical address of segment
351 * struct xilinx_cdma_tx_segment - Descriptor segment
354 * @phys: Physical address of segment
412 * @cyclic_seg_v: Statically allocated segment base for cyclic transfers
663 * xilinx_vdma_alloc_tx_segment - Allocate transaction segment
666 * Return: The allocated segment on success and NULL on failure.
671 struct xilinx_vdma_tx_segment *segment; in xilinx_vdma_alloc_tx_segment() local
674 segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); in xilinx_vdma_alloc_tx_segment()
675 if (!segment) in xilinx_vdma_alloc_tx_segment()
678 segment->phys = phys; in xilinx_vdma_alloc_tx_segment()
680 return segment; in xilinx_vdma_alloc_tx_segment()
684 * xilinx_cdma_alloc_tx_segment - Allocate transaction segment
687 * Return: The allocated segment on success and NULL on failure.
692 struct xilinx_cdma_tx_segment *segment; in xilinx_cdma_alloc_tx_segment() local
695 segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); in xilinx_cdma_alloc_tx_segment()
696 if (!segment) in xilinx_cdma_alloc_tx_segment()
699 segment->phys = phys; in xilinx_cdma_alloc_tx_segment()
701 return segment; in xilinx_cdma_alloc_tx_segment()
705 * xilinx_axidma_alloc_tx_segment - Allocate transaction segment
708 * Return: The allocated segment on success and NULL on failure.
713 struct xilinx_axidma_tx_segment *segment = NULL; in xilinx_axidma_alloc_tx_segment() local
718 segment = list_first_entry(&chan->free_seg_list, in xilinx_axidma_alloc_tx_segment()
721 list_del(&segment->node); in xilinx_axidma_alloc_tx_segment()
725 if (!segment) in xilinx_axidma_alloc_tx_segment()
726 dev_dbg(chan->dev, "Could not find free tx segment\n"); in xilinx_axidma_alloc_tx_segment()
728 return segment; in xilinx_axidma_alloc_tx_segment()
732 * xilinx_aximcdma_alloc_tx_segment - Allocate transaction segment
735 * Return: The allocated segment on success and NULL on failure.
740 struct xilinx_aximcdma_tx_segment *segment = NULL; in xilinx_aximcdma_alloc_tx_segment() local
745 segment = list_first_entry(&chan->free_seg_list, in xilinx_aximcdma_alloc_tx_segment()
748 list_del(&segment->node); in xilinx_aximcdma_alloc_tx_segment()
752 return segment; in xilinx_aximcdma_alloc_tx_segment()
778 * xilinx_dma_free_tx_segment - Free transaction segment
780 * @segment: DMA transaction segment
783 struct xilinx_axidma_tx_segment *segment) in xilinx_dma_free_tx_segment() argument
785 xilinx_dma_clean_hw_desc(&segment->hw); in xilinx_dma_free_tx_segment()
787 list_add_tail(&segment->node, &chan->free_seg_list); in xilinx_dma_free_tx_segment()
791 * xilinx_mcdma_free_tx_segment - Free transaction segment
793 * @segment: DMA transaction segment
797 segment) in xilinx_mcdma_free_tx_segment()
799 xilinx_mcdma_clean_hw_desc(&segment->hw); in xilinx_mcdma_free_tx_segment()
801 list_add_tail(&segment->node, &chan->free_seg_list); in xilinx_mcdma_free_tx_segment()
805 * xilinx_cdma_free_tx_segment - Free transaction segment
807 * @segment: DMA transaction segment
810 struct xilinx_cdma_tx_segment *segment) in xilinx_cdma_free_tx_segment() argument
812 dma_pool_free(chan->desc_pool, segment, segment->phys); in xilinx_cdma_free_tx_segment()
816 * xilinx_vdma_free_tx_segment - Free transaction segment
818 * @segment: DMA transaction segment
821 struct xilinx_vdma_tx_segment *segment) in xilinx_vdma_free_tx_segment() argument
823 dma_pool_free(chan->desc_pool, segment, segment->phys); in xilinx_vdma_free_tx_segment()
855 struct xilinx_vdma_tx_segment *segment, *next; in xilinx_dma_free_tx_descriptor() local
864 list_for_each_entry_safe(segment, next, &desc->segments, node) { in xilinx_dma_free_tx_descriptor()
865 list_del(&segment->node); in xilinx_dma_free_tx_descriptor()
866 xilinx_vdma_free_tx_segment(chan, segment); in xilinx_dma_free_tx_descriptor()
1140 * so allocating a desc segment during channel allocation for in xilinx_dma_alloc_chan_resources()
1149 "unable to allocate desc segment for cyclic DMA\n"); in xilinx_dma_alloc_chan_resources()
1367 struct xilinx_vdma_tx_segment *segment, *last = NULL; in xilinx_vdma_start_transfer() local
1428 list_for_each_entry(segment, &desc->segments, node) { in xilinx_vdma_start_transfer()
1432 segment->hw.buf_addr, in xilinx_vdma_start_transfer()
1433 segment->hw.buf_addr_msb); in xilinx_vdma_start_transfer()
1437 segment->hw.buf_addr); in xilinx_vdma_start_transfer()
1439 last = segment; in xilinx_vdma_start_transfer()
1508 struct xilinx_cdma_tx_segment *segment; in xilinx_cdma_start_transfer() local
1511 segment = list_first_entry(&head_desc->segments, in xilinx_cdma_start_transfer()
1515 hw = &segment->hw; in xilinx_cdma_start_transfer()
1588 struct xilinx_axidma_tx_segment *segment; in xilinx_dma_start_transfer() local
1591 segment = list_first_entry(&head_desc->segments, in xilinx_dma_start_transfer()
1594 hw = &segment->hw; in xilinx_dma_start_transfer()
2046 struct xilinx_vdma_tx_segment *segment; in xilinx_vdma_dma_prep_interleaved() local
2072 segment = xilinx_vdma_alloc_tx_segment(chan); in xilinx_vdma_dma_prep_interleaved()
2073 if (!segment) in xilinx_vdma_dma_prep_interleaved()
2077 hw = &segment->hw; in xilinx_vdma_dma_prep_interleaved()
2101 /* Insert the segment into the descriptor segments list. */ in xilinx_vdma_dma_prep_interleaved()
2102 list_add_tail(&segment->node, &desc->segments); in xilinx_vdma_dma_prep_interleaved()
2105 segment = list_first_entry(&desc->segments, in xilinx_vdma_dma_prep_interleaved()
2107 desc->async_tx.phys = segment->phys; in xilinx_vdma_dma_prep_interleaved()
2132 struct xilinx_cdma_tx_segment *segment; in xilinx_cdma_prep_memcpy() local
2146 segment = xilinx_cdma_alloc_tx_segment(chan); in xilinx_cdma_prep_memcpy()
2147 if (!segment) in xilinx_cdma_prep_memcpy()
2150 hw = &segment->hw; in xilinx_cdma_prep_memcpy()
2159 /* Insert the segment into the descriptor segments list. */ in xilinx_cdma_prep_memcpy()
2160 list_add_tail(&segment->node, &desc->segments); in xilinx_cdma_prep_memcpy()
2162 desc->async_tx.phys = segment->phys; in xilinx_cdma_prep_memcpy()
2163 hw->next_desc = segment->phys; in xilinx_cdma_prep_memcpy()
2190 struct xilinx_axidma_tx_segment *segment = NULL; in xilinx_dma_prep_slave_sg() local
2216 /* Get a free segment */ in xilinx_dma_prep_slave_sg()
2217 segment = xilinx_axidma_alloc_tx_segment(chan); in xilinx_dma_prep_slave_sg()
2218 if (!segment) in xilinx_dma_prep_slave_sg()
2227 hw = &segment->hw; in xilinx_dma_prep_slave_sg()
2244 * Insert the segment into the descriptor segments in xilinx_dma_prep_slave_sg()
2247 list_add_tail(&segment->node, &desc->segments); in xilinx_dma_prep_slave_sg()
2251 segment = list_first_entry(&desc->segments, in xilinx_dma_prep_slave_sg()
2253 desc->async_tx.phys = segment->phys; in xilinx_dma_prep_slave_sg()
2257 segment->hw.control |= XILINX_DMA_BD_SOP; in xilinx_dma_prep_slave_sg()
2258 segment = list_last_entry(&desc->segments, in xilinx_dma_prep_slave_sg()
2261 segment->hw.control |= XILINX_DMA_BD_EOP; in xilinx_dma_prep_slave_sg()
2292 struct xilinx_axidma_tx_segment *segment, *head_segment, *prev = NULL; in xilinx_dma_prep_dma_cyclic() local
2324 /* Get a free segment */ in xilinx_dma_prep_dma_cyclic()
2325 segment = xilinx_axidma_alloc_tx_segment(chan); in xilinx_dma_prep_dma_cyclic()
2326 if (!segment) in xilinx_dma_prep_dma_cyclic()
2335 hw = &segment->hw; in xilinx_dma_prep_dma_cyclic()
2341 prev->hw.next_desc = segment->phys; in xilinx_dma_prep_dma_cyclic()
2343 prev = segment; in xilinx_dma_prep_dma_cyclic()
2347 * Insert the segment into the descriptor segments in xilinx_dma_prep_dma_cyclic()
2350 list_add_tail(&segment->node, &desc->segments); in xilinx_dma_prep_dma_cyclic()
2363 segment = list_last_entry(&desc->segments, in xilinx_dma_prep_dma_cyclic()
2366 segment->hw.next_desc = (u32) head_segment->phys; in xilinx_dma_prep_dma_cyclic()
2371 segment->hw.control |= XILINX_DMA_BD_EOP; in xilinx_dma_prep_dma_cyclic()
2400 struct xilinx_aximcdma_tx_segment *segment = NULL; in xilinx_mcdma_prep_slave_sg() local
2426 /* Get a free segment */ in xilinx_mcdma_prep_slave_sg()
2427 segment = xilinx_aximcdma_alloc_tx_segment(chan); in xilinx_mcdma_prep_slave_sg()
2428 if (!segment) in xilinx_mcdma_prep_slave_sg()
2437 hw = &segment->hw; in xilinx_mcdma_prep_slave_sg()
2451 * Insert the segment into the descriptor segments in xilinx_mcdma_prep_slave_sg()
2454 list_add_tail(&segment->node, &desc->segments); in xilinx_mcdma_prep_slave_sg()
2458 segment = list_first_entry(&desc->segments, in xilinx_mcdma_prep_slave_sg()
2460 desc->async_tx.phys = segment->phys; in xilinx_mcdma_prep_slave_sg()
2464 segment->hw.control |= XILINX_MCDMA_BD_SOP; in xilinx_mcdma_prep_slave_sg()
2465 segment = list_last_entry(&desc->segments, in xilinx_mcdma_prep_slave_sg()
2468 segment->hw.control |= XILINX_MCDMA_BD_EOP; in xilinx_mcdma_prep_slave_sg()