drivers/dma/tegra210-adma.c
Source file repositories/reference/linux-study-clean/drivers/dma/tegra210-adma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/tegra210-adma.c- Extension
.c- Size
- 35080 bytes
- Lines
- 1245
- 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/clk.hlinux/iopoll.hlinux/module.hlinux/of.hlinux/of_dma.hlinux/of_irq.hlinux/platform_device.hlinux/pm_runtime.hlinux/slab.hvirt-dma.h
Detected Declarations
struct tegra_admastruct tegra_adma_chip_datastruct tegra_adma_chan_regsstruct tegra_adma_descstruct tegra_adma_chanstruct tegra_admafunction tdma_writefunction tdma_readfunction tdma_ch_global_writefunction tdma_ch_writefunction tdma_ch_readfunction tegra_adma_desc_freefunction tegra_adma_slave_configfunction tegra186_adma_global_page_configfunction tegra264_adma_global_page_configfunction tegra_adma_initfunction tegra_adma_request_allocfunction tegra_adma_request_freefunction tegra_adma_irq_statusfunction tegra_adma_irq_clearfunction tegra_adma_stopfunction tegra_adma_synchronizefunction tegra_adma_startfunction tegra_adma_get_residuefunction tegra_adma_isrfunction tegra_adma_issue_pendingfunction tegra_adma_is_pausedfunction tegra_adma_pausefunction tegra_adma_resumefunction tegra_adma_terminate_allfunction tegra_adma_tx_statusfunction tegra210_adma_get_burst_configfunction tegra186_adma_get_burst_configfunction tegra_adma_set_xfer_paramsfunction tegra_adma_alloc_chan_resourcesfunction tegra_adma_free_chan_resourcesfunction tegra_adma_runtime_suspendfunction tegra_adma_runtime_resumefunction tegra_adma_probefunction tegra_adma_remove
Annotated Snippet
struct tegra_adma_chip_data {
unsigned int (*adma_get_burst_config)(unsigned int burst_size);
unsigned int global_reg_offset;
unsigned int global_int_clear;
unsigned int global_ch_fifo_base;
unsigned int global_ch_config_base;
unsigned int ch_req_tx_shift;
unsigned int ch_req_rx_shift;
unsigned int ch_dir_shift;
unsigned int ch_mode_shift;
unsigned int ch_base_offset;
unsigned int ch_tc_offset_diff;
unsigned int ch_fifo_ctrl;
unsigned int ch_config;
unsigned int ch_req_mask;
unsigned int ch_dir_mask;
unsigned int ch_req_max;
unsigned int ch_reg_size;
unsigned int nr_channels;
unsigned int ch_fifo_size_mask;
unsigned int sreq_index_offset;
unsigned int max_page;
void (*set_global_pg_config)(struct tegra_adma *tdma);
};
/*
* struct tegra_adma_chan_regs - Tegra ADMA channel registers
*/
struct tegra_adma_chan_regs {
unsigned int ctrl;
unsigned int config;
unsigned int global_config;
unsigned int src_addr;
unsigned int trg_addr;
unsigned int fifo_ctrl;
unsigned int cmd;
unsigned int tc;
};
/*
* struct tegra_adma_desc - Tegra ADMA descriptor to manage transfer requests.
*/
struct tegra_adma_desc {
struct virt_dma_desc vd;
struct tegra_adma_chan_regs ch_regs;
size_t buf_len;
size_t period_len;
size_t num_periods;
};
/*
* struct tegra_adma_chan - Tegra ADMA channel information
*/
struct tegra_adma_chan {
struct virt_dma_chan vc;
struct tegra_adma_desc *desc;
struct tegra_adma *tdma;
int irq;
void __iomem *chan_addr;
/* Slave channel configuration info */
struct dma_slave_config sconfig;
enum dma_transfer_direction sreq_dir;
unsigned int sreq_index;
bool sreq_reserved;
struct tegra_adma_chan_regs ch_regs;
/* Transfer count and position info */
unsigned int tx_buf_count;
unsigned int tx_buf_pos;
unsigned int global_ch_fifo_offset;
unsigned int global_ch_config_offset;
};
/*
* struct tegra_adma - Tegra ADMA controller information
*/
struct tegra_adma {
struct dma_device dma_dev;
struct device *dev;
void __iomem *base_addr;
void __iomem *ch_base_addr;
struct clk *ahub_clk;
unsigned int nr_channels;
unsigned long *dma_chan_mask;
unsigned long rx_requests_reserved;
unsigned long tx_requests_reserved;
/* Used to store global command register state when suspending */
Annotation
- Immediate include surface: `linux/clk.h`, `linux/iopoll.h`, `linux/module.h`, `linux/of.h`, `linux/of_dma.h`, `linux/of_irq.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct tegra_adma`, `struct tegra_adma_chip_data`, `struct tegra_adma_chan_regs`, `struct tegra_adma_desc`, `struct tegra_adma_chan`, `struct tegra_adma`, `function tdma_write`, `function tdma_read`, `function tdma_ch_global_write`, `function tdma_ch_write`.
- 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.