drivers/dma/tegra20-apb-dma.c
Source file repositories/reference/linux-study-clean/drivers/dma/tegra20-apb-dma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/tegra20-apb-dma.c- Extension
.c- Size
- 45526 bytes
- Lines
- 1686
- 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/clk.hlinux/delay.hlinux/dmaengine.hlinux/dma-mapping.hlinux/err.hlinux/init.hlinux/interrupt.hlinux/io.hlinux/mm.hlinux/module.hlinux/of.hlinux/of_dma.hlinux/platform_device.hlinux/pm.hlinux/pm_runtime.hlinux/reset.hlinux/slab.hlinux/wait.hdmaengine.htrace/events/tegra_apb_dma.h
Detected Declarations
struct tegra_dmastruct tegra_dma_chip_datastruct tegra_dma_channel_regsstruct tegra_dma_sg_reqstruct tegra_dma_descstruct tegra_dma_channelstruct tegra_dma_channelstruct tegra_dmafunction tdma_writefunction tdc_writefunction tdc_readfunction txd_to_tegra_dma_descfunction tegra_dma_desc_putfunction tegra_dma_sg_req_getfunction tegra_dma_slave_configfunction tegra_dma_global_pausefunction tegra_dma_global_resumefunction tegra_dma_pausefunction tegra_dma_resumefunction tegra_dma_stopfunction tegra_dma_startfunction tegra_dma_configure_for_nextfunction tdc_start_head_reqfunction tdc_configure_next_head_descfunction get_current_xferred_countfunction tegra_dma_abort_allfunction handle_continuous_head_requestfunction handle_once_dma_donefunction handle_cont_sngl_cycle_dma_donefunction tegra_dma_taskletfunction tegra_dma_isrfunction tegra_dma_tx_submitfunction tegra_dma_issue_pendingfunction tegra_dma_terminate_allfunction tegra_dma_eoc_interrupt_deassertedfunction tegra_dma_synchronizefunction tegra_dma_sg_bytes_xferredfunction tegra_dma_tx_statusfunction get_bus_widthfunction get_burst_sizefunction get_transfer_paramfunction tegra_dma_prep_wcountfunction tegra_dma_prep_slave_sgfunction tegra_dma_prep_dma_cyclicfunction tegra_dma_alloc_chan_resourcesfunction tegra_dma_free_chan_resourcesfunction tegra_dma_init_hwfunction tegra_dma_probe
Annotated Snippet
struct tegra_dma_chip_data {
unsigned int nr_channels;
unsigned int channel_reg_size;
unsigned int max_dma_count;
bool support_channel_pause;
bool support_separate_wcount_reg;
};
/* DMA channel registers */
struct tegra_dma_channel_regs {
u32 csr;
u32 ahb_ptr;
u32 apb_ptr;
u32 ahb_seq;
u32 apb_seq;
u32 wcount;
};
/*
* tegra_dma_sg_req: DMA request details to configure hardware. This
* contains the details for one transfer to configure DMA hw.
* The client's request for data transfer can be broken into multiple
* sub-transfer as per requester details and hw support.
* This sub transfer get added in the list of transfer and point to Tegra
* DMA descriptor which manages the transfer details.
*/
struct tegra_dma_sg_req {
struct tegra_dma_channel_regs ch_regs;
unsigned int req_len;
bool configured;
bool last_sg;
struct list_head node;
struct tegra_dma_desc *dma_desc;
unsigned int words_xferred;
};
/*
* tegra_dma_desc: Tegra DMA descriptors which manages the client requests.
* This descriptor keep track of transfer status, callbacks and request
* counts etc.
*/
struct tegra_dma_desc {
struct dma_async_tx_descriptor txd;
unsigned int bytes_requested;
unsigned int bytes_transferred;
enum dma_status dma_status;
struct list_head node;
struct list_head tx_list;
struct list_head cb_node;
unsigned int cb_count;
};
struct tegra_dma_channel;
typedef void (*dma_isr_handler)(struct tegra_dma_channel *tdc,
bool to_terminate);
/* tegra_dma_channel: Channel specific information */
struct tegra_dma_channel {
struct dma_chan dma_chan;
char name[12];
bool config_init;
unsigned int id;
void __iomem *chan_addr;
spinlock_t lock;
bool busy;
struct tegra_dma *tdma;
bool cyclic;
/* Different lists for managing the requests */
struct list_head free_sg_req;
struct list_head pending_sg_req;
struct list_head free_dma_desc;
struct list_head cb_desc;
/* ISR handler and tasklet for bottom half of isr handling */
dma_isr_handler isr_handler;
struct tasklet_struct tasklet;
/* Channel-slave specific configuration */
unsigned int slave_id;
struct dma_slave_config dma_sconfig;
struct tegra_dma_channel_regs channel_reg;
struct wait_queue_head wq;
};
/* tegra_dma: Tegra DMA specific information */
struct tegra_dma {
struct dma_device dma_dev;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/clk.h`, `linux/delay.h`, `linux/dmaengine.h`, `linux/dma-mapping.h`, `linux/err.h`, `linux/init.h`, `linux/interrupt.h`.
- Detected declarations: `struct tegra_dma`, `struct tegra_dma_chip_data`, `struct tegra_dma_channel_regs`, `struct tegra_dma_sg_req`, `struct tegra_dma_desc`, `struct tegra_dma_channel`, `struct tegra_dma_channel`, `struct tegra_dma`, `function tdma_write`, `function tdc_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.