drivers/dma/ti/k3-udma.c
Source file repositories/reference/linux-study-clean/drivers/dma/ti/k3-udma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/ti/k3-udma.c- Extension
.c- Size
- 149607 bytes
- Lines
- 5723
- 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/kernel.hlinux/module.hlinux/delay.hlinux/dmaengine.hlinux/dma-mapping.hlinux/dmapool.hlinux/err.hlinux/init.hlinux/interrupt.hlinux/list.hlinux/platform_device.hlinux/slab.hlinux/spinlock.hlinux/sys_soc.hlinux/of.hlinux/of_dma.hlinux/of_irq.hlinux/workqueue.hlinux/completion.hlinux/soc/ti/k3-ringacc.hlinux/soc/ti/ti_sci_protocol.hlinux/soc/ti/ti_sci_inta_msi.hlinux/dma/k3-event-router.hlinux/dma/ti-cppi5.h../virt-dma.hk3-udma.hk3-psil-priv.hk3-udma-private.c
Detected Declarations
struct udma_static_trstruct udma_chanstruct udma_tchanstruct udma_rflowstruct udma_rchanstruct udma_oes_offsetsstruct udma_match_datastruct udma_soc_datastruct udma_hwdescstruct udma_rx_flushstruct udma_tplstruct udma_devstruct udma_descstruct udma_tx_drainstruct udma_chan_configstruct udma_chanstruct udma_filter_paramenum k3_dma_typeenum udma_mmrenum udma_chan_statefunction udma_readfunction udma_writefunction udma_update_bitsfunction udma_tchanrt_readfunction udma_tchanrt_writefunction udma_tchanrt_update_bitsfunction udma_rchanrt_readfunction udma_rchanrt_writefunction udma_rchanrt_update_bitsfunction navss_psil_pairfunction navss_psil_unpairfunction k3_configure_chan_coherencyfunction udma_get_chan_tpl_indexfunction udma_reset_uchanfunction udma_dump_chan_stdatafunction udma_curr_cppi5_desc_paddrfunction udma_free_hwdescfunction udma_purge_desc_workfunction list_for_each_entry_safefunction udma_desc_freefunction udma_is_chan_runningfunction udma_is_chan_pausedfunction udma_get_rx_flush_hwdesc_paddrfunction udma_push_to_ringfunction udma_desc_is_rx_flushfunction udma_pop_from_ringfunction udma_reset_ringsfunction udma_decrement_byte_counters
Annotated Snippet
struct udma_static_tr {
u8 elsize; /* RPSTR0 */
u16 elcnt; /* RPSTR0 */
u16 bstcnt; /* RPSTR1 */
};
#define K3_UDMA_MAX_RFLOWS 1024
#define K3_UDMA_DEFAULT_RING_SIZE 16
/* How SRC/DST tag should be updated by UDMA in the descriptor's Word 3 */
#define UDMA_RFLOW_SRCTAG_NONE 0
#define UDMA_RFLOW_SRCTAG_CFG_TAG 1
#define UDMA_RFLOW_SRCTAG_FLOW_ID 2
#define UDMA_RFLOW_SRCTAG_SRC_TAG 4
#define UDMA_RFLOW_DSTTAG_NONE 0
#define UDMA_RFLOW_DSTTAG_CFG_TAG 1
#define UDMA_RFLOW_DSTTAG_FLOW_ID 2
#define UDMA_RFLOW_DSTTAG_DST_TAG_LO 4
#define UDMA_RFLOW_DSTTAG_DST_TAG_HI 5
struct udma_chan;
enum k3_dma_type {
DMA_TYPE_UDMA = 0,
DMA_TYPE_BCDMA,
DMA_TYPE_PKTDMA,
};
enum udma_mmr {
MMR_GCFG = 0,
MMR_BCHANRT,
MMR_RCHANRT,
MMR_TCHANRT,
MMR_LAST,
};
static const char * const mmr_names[] = {
[MMR_GCFG] = "gcfg",
[MMR_BCHANRT] = "bchanrt",
[MMR_RCHANRT] = "rchanrt",
[MMR_TCHANRT] = "tchanrt",
};
struct udma_tchan {
void __iomem *reg_rt;
int id;
struct k3_ring *t_ring; /* Transmit ring */
struct k3_ring *tc_ring; /* Transmit Completion ring */
int tflow_id; /* applicable only for PKTDMA */
};
#define udma_bchan udma_tchan
struct udma_rflow {
int id;
struct k3_ring *fd_ring; /* Free Descriptor ring */
struct k3_ring *r_ring; /* Receive ring */
};
struct udma_rchan {
void __iomem *reg_rt;
int id;
};
struct udma_oes_offsets {
/* K3 UDMA Output Event Offset */
u32 udma_rchan;
/* BCDMA Output Event Offsets */
u32 bcdma_bchan_data;
u32 bcdma_bchan_ring;
u32 bcdma_tchan_data;
u32 bcdma_tchan_ring;
u32 bcdma_rchan_data;
u32 bcdma_rchan_ring;
/* PKTDMA Output Event Offsets */
u32 pktdma_tchan_flow;
u32 pktdma_rchan_flow;
};
#define UDMA_FLAG_PDMA_ACC32 BIT(0)
#define UDMA_FLAG_PDMA_BURST BIT(1)
#define UDMA_FLAG_TDTYPE BIT(2)
#define UDMA_FLAG_BURST_SIZE BIT(3)
#define UDMA_FLAGS_J7_CLASS (UDMA_FLAG_PDMA_ACC32 | \
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/delay.h`, `linux/dmaengine.h`, `linux/dma-mapping.h`, `linux/dmapool.h`, `linux/err.h`, `linux/init.h`.
- Detected declarations: `struct udma_static_tr`, `struct udma_chan`, `struct udma_tchan`, `struct udma_rflow`, `struct udma_rchan`, `struct udma_oes_offsets`, `struct udma_match_data`, `struct udma_soc_data`, `struct udma_hwdesc`, `struct udma_rx_flush`.
- 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.