drivers/dma/xilinx/zynqmp_dma.c
Source file repositories/reference/linux-study-clean/drivers/dma/xilinx/zynqmp_dma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/xilinx/zynqmp_dma.c- Extension
.c- Size
- 33429 bytes
- Lines
- 1201
- Domain
- Driver Families
- Bucket
- drivers/dma
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/dma-mapping.hlinux/init.hlinux/interrupt.hlinux/io.hlinux/module.hlinux/of.hlinux/of_dma.hlinux/platform_device.hlinux/slab.hlinux/clk.hlinux/io-64-nonatomic-lo-hi.hlinux/pm_runtime.h../dmaengine.h
Detected Declarations
struct zynqmp_dma_desc_llstruct zynqmp_dma_desc_swstruct zynqmp_dma_chanstruct zynqmp_dma_devicestruct zynqmp_dma_configfunction zynqmp_dma_writeqfunction zynqmp_dma_update_desc_to_ctrlrfunction zynqmp_dma_desc_config_eodfunction zynqmp_dma_config_sg_ll_descfunction zynqmp_dma_initfunction zynqmp_dma_tx_submitfunction zynqmp_dma_get_descriptorfunction zynqmp_dma_free_descriptorfunction zynqmp_dma_free_desc_listfunction zynqmp_dma_alloc_chan_resourcesfunction zynqmp_dma_startfunction zynqmp_dma_handle_ovfl_intfunction zynqmp_dma_configfunction zynqmp_dma_device_configfunction zynqmp_dma_start_transferfunction zynqmp_dma_chan_desc_cleanupfunction list_for_each_entry_safefunction zynqmp_dma_complete_descriptorfunction zynqmp_dma_issue_pendingfunction zynqmp_dma_free_descriptorsfunction zynqmp_dma_free_chan_resourcesfunction zynqmp_dma_resetfunction zynqmp_dma_irq_handlerfunction zynqmp_dma_do_taskletfunction zynqmp_dma_device_terminate_allfunction zynqmp_dma_synchronizefunction zynqmp_dma_chan_removefunction zynqmp_dma_chan_probefunction zynqmp_dma_suspendfunction zynqmp_dma_resumefunction zynqmp_dma_runtime_suspendfunction zynqmp_dma_runtime_resumefunction zynqmp_dma_probefunction zynqmp_dma_remove
Annotated Snippet
struct zynqmp_dma_desc_ll {
u64 addr;
u32 size;
u32 ctrl;
u64 nxtdscraddr;
u64 rsvd;
};
/**
* struct zynqmp_dma_desc_sw - Per Transaction structure
* @src: Source address for simple mode dma
* @dst: Destination address for simple mode dma
* @len: Transfer length for simple mode dma
* @node: Node in the channel descriptor list
* @tx_list: List head for the current transfer
* @async_tx: Async transaction descriptor
* @src_v: Virtual address of the src descriptor
* @src_p: Physical address of the src descriptor
* @dst_v: Virtual address of the dst descriptor
* @dst_p: Physical address of the dst descriptor
*/
struct zynqmp_dma_desc_sw {
u64 src;
u64 dst;
u32 len;
struct list_head node;
struct list_head tx_list;
struct dma_async_tx_descriptor async_tx;
struct zynqmp_dma_desc_ll *src_v;
dma_addr_t src_p;
struct zynqmp_dma_desc_ll *dst_v;
dma_addr_t dst_p;
};
/**
* struct zynqmp_dma_chan - Driver specific DMA channel structure
* @zdev: Driver specific device structure
* @regs: Control registers offset
* @lock: Descriptor operation lock
* @pending_list: Descriptors waiting
* @free_list: Descriptors free
* @active_list: Descriptors active
* @sw_desc_pool: SW descriptor pool
* @done_list: Complete descriptors
* @common: DMA common channel
* @desc_pool_v: Statically allocated descriptor base
* @desc_pool_p: Physical allocated descriptor base
* @desc_free_cnt: Descriptor available count
* @dev: The dma device
* @irq: Channel IRQ
* @is_dmacoherent: Tells whether dma operations are coherent or not
* @tasklet: Cleanup work after irq
* @idle : Channel status;
* @desc_size: Size of the low level descriptor
* @err: Channel has errors
* @bus_width: Bus width
* @src_burst_len: Source burst length
* @dst_burst_len: Dest burst length
* @irq_offset: Irq register offset
*/
struct zynqmp_dma_chan {
struct zynqmp_dma_device *zdev;
void __iomem *regs;
spinlock_t lock;
struct list_head pending_list;
struct list_head free_list;
struct list_head active_list;
struct zynqmp_dma_desc_sw *sw_desc_pool;
struct list_head done_list;
struct dma_chan common;
void *desc_pool_v;
dma_addr_t desc_pool_p;
u32 desc_free_cnt;
struct device *dev;
int irq;
bool is_dmacoherent;
struct tasklet_struct tasklet;
bool idle;
size_t desc_size;
bool err;
u32 bus_width;
u32 src_burst_len;
u32 dst_burst_len;
u32 irq_offset;
};
/**
* struct zynqmp_dma_device - DMA device structure
* @dev: Device Structure
* @common: DMA device structure
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/dma-mapping.h`, `linux/init.h`, `linux/interrupt.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/of_dma.h`.
- Detected declarations: `struct zynqmp_dma_desc_ll`, `struct zynqmp_dma_desc_sw`, `struct zynqmp_dma_chan`, `struct zynqmp_dma_device`, `struct zynqmp_dma_config`, `function zynqmp_dma_writeq`, `function zynqmp_dma_update_desc_to_ctrlr`, `function zynqmp_dma_desc_config_eod`, `function zynqmp_dma_config_sg_ll_desc`, `function zynqmp_dma_init`.
- Atlas domain: Driver Families / drivers/dma.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.