drivers/dma/pl330.c
Source file repositories/reference/linux-study-clean/drivers/dma/pl330.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/pl330.c- Extension
.c- Size
- 74542 bytes
- Lines
- 3268
- 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/debugfs.hlinux/kernel.hlinux/io.hlinux/init.hlinux/slab.hlinux/module.hlinux/string.hlinux/delay.hlinux/interrupt.hlinux/dma-mapping.hlinux/dmaengine.hlinux/amba/bus.hlinux/scatterlist.hlinux/of.hlinux/of_dma.hlinux/err.hlinux/pm_runtime.hlinux/bug.hlinux/reset.hdmaengine.h
Detected Declarations
struct pl330_configstruct pl330_reqcfgstruct pl330_xferstruct dma_pl330_descstruct _pl330_reqstruct _pl330_tbdstruct pl330_threadstruct dma_pl330_chanstruct pl330_dmacstruct dma_pl330_descstruct _xfer_specstruct _arg_LPENDstruct _arg_GOenum pl330_cachectrlenum pl330_byteswapenum pl330_op_errenum dmamov_dstenum pl330_dstenum pl330_condenum pl330_dmac_stateenum desc_statusfunction _queue_fullfunction is_managerfunction _manager_nsfunction get_revisionfunction _emit_ENDfunction _emit_FLUSHPfunction _emit_LDfunction _emit_LDPfunction _emit_LPfunction _emit_LPENDfunction _emit_KILLfunction _emit_MOVfunction _emit_RMBfunction _emit_SEVfunction _emit_STfunction _emit_STPfunction _emit_WFPfunction _emit_WMBfunction _emit_GOfunction _until_dmac_idlefunction _execute_DBGINSNfunction _statefunction _stopfunction _triggerfunction pl330_start_threadfunction _ldst_memtomemfunction _emit_load
Annotated Snippet
struct pl330_config {
u32 periph_id;
#define DMAC_MODE_NS (1 << 0)
unsigned int mode;
unsigned int data_bus_width:10; /* In number of bits */
unsigned int data_buf_dep:11;
unsigned int num_chan:4;
unsigned int num_peri:6;
u32 peri_ns;
unsigned int num_events:6;
u32 irq_ns;
};
/*
* Request Configuration.
* The PL330 core does not modify this and uses the last
* working configuration if the request doesn't provide any.
*
* The Client may want to provide this info only for the
* first request and a request with new settings.
*/
struct pl330_reqcfg {
/* Address Incrementing */
unsigned dst_inc:1;
unsigned src_inc:1;
/*
* For now, the SRC & DST protection levels
* and burst size/length are assumed same.
*/
bool nonsecure;
bool privileged;
bool insnaccess;
unsigned brst_len:5;
unsigned brst_size:3; /* in power of 2 */
enum pl330_cachectrl dcctl;
enum pl330_cachectrl scctl;
enum pl330_byteswap swap;
struct pl330_config *pcfg;
};
/*
* One cycle of DMAC operation.
* There may be more than one xfer in a request.
*/
struct pl330_xfer {
u32 src_addr;
u32 dst_addr;
/* Size to xfer */
u32 bytes;
};
/* The xfer callbacks are made with one of these arguments. */
enum pl330_op_err {
/* The all xfers in the request were success. */
PL330_ERR_NONE,
/* If req aborted due to global error. */
PL330_ERR_ABORT,
/* If req failed due to problem with Channel. */
PL330_ERR_FAIL,
};
enum dmamov_dst {
SAR = 0,
CCR,
DAR,
};
enum pl330_dst {
SRC = 0,
DST,
};
enum pl330_cond {
SINGLE,
BURST,
ALWAYS,
};
struct dma_pl330_desc;
struct _pl330_req {
u32 mc_bus;
void *mc_cpu;
struct dma_pl330_desc *desc;
};
/* ToBeDone for tasklet */
struct _pl330_tbd {
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/kernel.h`, `linux/io.h`, `linux/init.h`, `linux/slab.h`, `linux/module.h`, `linux/string.h`, `linux/delay.h`.
- Detected declarations: `struct pl330_config`, `struct pl330_reqcfg`, `struct pl330_xfer`, `struct dma_pl330_desc`, `struct _pl330_req`, `struct _pl330_tbd`, `struct pl330_thread`, `struct dma_pl330_chan`, `struct pl330_dmac`, `struct dma_pl330_desc`.
- 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.