drivers/dma/xilinx/xilinx_dma.c
Source file repositories/reference/linux-study-clean/drivers/dma/xilinx/xilinx_dma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/xilinx/xilinx_dma.c- Extension
.c- Size
- 97371 bytes
- Lines
- 3419
- Domain
- Driver Families
- Bucket
- drivers/dma
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/dmapool.hlinux/dma/xilinx_dma.hlinux/init.hlinux/interrupt.hlinux/io.hlinux/iopoll.hlinux/module.hlinux/of.hlinux/of_dma.hlinux/of_irq.hlinux/platform_device.hlinux/slab.hlinux/string_choices.hlinux/clk.hlinux/io-64-nonatomic-lo-hi.h../dmaengine.h
Detected Declarations
struct xilinx_vdma_desc_hwstruct xilinx_axidma_desc_hwstruct xilinx_aximcdma_desc_hwstruct xilinx_cdma_desc_hwstruct xilinx_vdma_tx_segmentstruct xilinx_axidma_tx_segmentstruct xilinx_aximcdma_tx_segmentstruct xilinx_cdma_tx_segmentstruct xilinx_dma_tx_descriptorstruct xilinx_dma_chanstruct xilinx_dma_configstruct xilinx_dma_deviceenum xdma_ip_typefunction dma_readfunction dma_writefunction vdma_desc_writefunction dma_ctrl_readfunction dma_ctrl_writefunction dma_ctrl_clrfunction dma_ctrl_setfunction bitsfunction dma_writeqfunction xilinx_writefunction xilinx_axidma_buffunction xilinx_aximcdma_buffunction xilinx_vdma_alloc_tx_segmentfunction xilinx_cdma_alloc_tx_segmentfunction xilinx_axidma_alloc_tx_segmentfunction xilinx_aximcdma_alloc_tx_segmentfunction xilinx_dma_clean_hw_descfunction xilinx_mcdma_clean_hw_descfunction xilinx_dma_free_tx_segmentfunction xilinx_mcdma_free_tx_segmentfunction xilinx_cdma_free_tx_segmentfunction xilinx_vdma_free_tx_segmentfunction xilinx_dma_alloc_tx_descriptorfunction xilinx_dma_free_tx_descriptorfunction list_for_each_entry_safefunction list_for_each_entry_safefunction list_for_each_entry_safefunction xilinx_dma_free_desc_listfunction list_for_each_entry_safefunction xilinx_dma_free_descriptorsfunction xilinx_dma_free_chan_resourcesfunction xilinx_dma_get_residuefunction list_for_eachfunction xilinx_dma_get_residue_axidma_direct_s2mmfunction xilinx_dma_chan_handle_cyclic
Annotated Snippet
struct xilinx_vdma_desc_hw {
u32 next_desc;
u32 pad1;
u32 buf_addr;
u32 buf_addr_msb;
u32 vsize;
u32 hsize;
u32 stride;
} __aligned(64);
/**
* struct xilinx_axidma_desc_hw - Hardware Descriptor for AXI DMA
* @next_desc: Next Descriptor Pointer @0x00
* @next_desc_msb: MSB of Next Descriptor Pointer @0x04
* @buf_addr: Buffer address @0x08
* @buf_addr_msb: MSB of Buffer address @0x0C
* @reserved1: Reserved @0x10
* @reserved2: Reserved @0x14
* @control: Control field @0x18
* @status: Status field @0x1C
* @app: APP Fields @0x20 - 0x30
*/
struct xilinx_axidma_desc_hw {
u32 next_desc;
u32 next_desc_msb;
u32 buf_addr;
u32 buf_addr_msb;
u32 reserved1;
u32 reserved2;
u32 control;
u32 status;
u32 app[XILINX_DMA_NUM_APP_WORDS];
} __aligned(64);
/**
* struct xilinx_aximcdma_desc_hw - Hardware Descriptor for AXI MCDMA
* @next_desc: Next Descriptor Pointer @0x00
* @next_desc_msb: MSB of Next Descriptor Pointer @0x04
* @buf_addr: Buffer address @0x08
* @buf_addr_msb: MSB of Buffer address @0x0C
* @rsvd: Reserved field @0x10
* @control: Control Information field @0x14
* @status: Status field @0x18
* @sideband_status: Status of sideband signals @0x1C
* @app: APP Fields @0x20 - 0x30
*/
struct xilinx_aximcdma_desc_hw {
u32 next_desc;
u32 next_desc_msb;
u32 buf_addr;
u32 buf_addr_msb;
u32 rsvd;
u32 control;
u32 status;
u32 sideband_status;
u32 app[XILINX_DMA_NUM_APP_WORDS];
} __aligned(64);
/**
* struct xilinx_cdma_desc_hw - Hardware Descriptor
* @next_desc: Next Descriptor Pointer @0x00
* @next_desc_msb: Next Descriptor Pointer MSB @0x04
* @src_addr: Source address @0x08
* @src_addr_msb: Source address MSB @0x0C
* @dest_addr: Destination address @0x10
* @dest_addr_msb: Destination address MSB @0x14
* @control: Control field @0x18
* @status: Status field @0x1C
*/
struct xilinx_cdma_desc_hw {
u32 next_desc;
u32 next_desc_msb;
u32 src_addr;
u32 src_addr_msb;
u32 dest_addr;
u32 dest_addr_msb;
u32 control;
u32 status;
} __aligned(64);
/**
* struct xilinx_vdma_tx_segment - Descriptor segment
* @hw: Hardware descriptor
* @node: Node in the descriptor segments list
* @phys: Physical address of segment
*/
struct xilinx_vdma_tx_segment {
struct xilinx_vdma_desc_hw hw;
struct list_head node;
dma_addr_t phys;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/dmapool.h`, `linux/dma/xilinx_dma.h`, `linux/init.h`, `linux/interrupt.h`, `linux/io.h`, `linux/iopoll.h`, `linux/module.h`.
- Detected declarations: `struct xilinx_vdma_desc_hw`, `struct xilinx_axidma_desc_hw`, `struct xilinx_aximcdma_desc_hw`, `struct xilinx_cdma_desc_hw`, `struct xilinx_vdma_tx_segment`, `struct xilinx_axidma_tx_segment`, `struct xilinx_aximcdma_tx_segment`, `struct xilinx_cdma_tx_segment`, `struct xilinx_dma_tx_descriptor`, `struct xilinx_dma_chan`.
- Atlas domain: Driver Families / drivers/dma.
- Implementation status: integration 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.