arch/arm/mach-omap1/omap-dma.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap1/omap-dma.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap1/omap-dma.c- Extension
.c- Size
- 20535 bytes
- Lines
- 870
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/init.hlinux/sched.hlinux/spinlock.hlinux/errno.hlinux/interrupt.hlinux/irq.hlinux/io.hlinux/slab.hlinux/delay.hlinux/omap-dma.hlinux/soc/ti/omap1-io.hlinux/soc/ti/omap1-soc.htc.h
Detected Declarations
function omap_disable_channel_irqfunction set_gdma_devfunction omap_set_dma_priorityfunction omap_dma_in_1510_modefunction omap_set_dma_transfer_paramsfunction omap_set_dma_channel_modefunction omap_set_dma_src_paramsfunction omap_set_dma_src_data_packfunction omap_set_dma_src_burst_modefunction omap_set_dma_dest_paramsfunction omap_set_dma_dest_data_packfunction omap_set_dma_dest_burst_modefunction omap_enable_channel_irqfunction omap_disable_dma_irqfunction enable_lnkfunction disable_lnkfunction omap_request_dmafunction omap_free_dmafunction omap_start_dmafunction omap_start_dmafunction omap_stop_dmafunction omap_get_dma_src_posfunction omap_get_dma_dst_posfunction omap_get_dma_active_statusfunction omap_dma_runningfunction omap1_dma_handle_chfunction omap1_dma_irq_handlerfunction omap_system_dma_probefunction omap_system_dma_removefunction omap_system_dma_initfunction omap_system_dma_exitfunction omap_dma_cmdline_reserve_chexport omap_set_dma_priorityexport omap_set_dma_transfer_paramsexport omap_set_dma_channel_modeexport omap_set_dma_src_paramsexport omap_set_dma_src_data_packexport omap_set_dma_src_burst_modeexport omap_set_dma_dest_paramsexport omap_set_dma_dest_data_packexport omap_set_dma_dest_burst_modeexport omap_disable_dma_irqexport omap_request_dmaexport omap_free_dmaexport omap_start_dmaexport omap_stop_dmaexport omap_get_dma_src_posexport omap_get_dma_dst_pos
Annotated Snippet
switch (dst_port) {
case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */
reg = OMAP_TC_OCPT1_PRIOR;
break;
case OMAP_DMA_PORT_OCP_T2: /* FFFECCD0 */
reg = OMAP_TC_OCPT2_PRIOR;
break;
case OMAP_DMA_PORT_EMIFF: /* FFFECC08 */
reg = OMAP_TC_EMIFF_PRIOR;
break;
case OMAP_DMA_PORT_EMIFS: /* FFFECC04 */
reg = OMAP_TC_EMIFS_PRIOR;
break;
default:
BUG();
return;
}
l = omap_readl(reg);
l &= ~(0xf << 8);
l |= (priority & 0xf) << 8;
omap_writel(l, reg);
}
}
EXPORT_SYMBOL(omap_set_dma_priority);
#endif
#if IS_ENABLED(CONFIG_USB_OMAP)
#ifdef CONFIG_ARCH_OMAP15XX
/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
static int omap_dma_in_1510_mode(void)
{
return enable_1510_mode;
}
#else
#define omap_dma_in_1510_mode() 0
#endif
void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
int frame_count, int sync_mode,
int dma_trigger, int src_or_dst_synch)
{
u32 l;
u16 ccr;
l = p->dma_read(CSDP, lch);
l &= ~0x03;
l |= data_type;
p->dma_write(l, CSDP, lch);
ccr = p->dma_read(CCR, lch);
ccr &= ~(1 << 5);
if (sync_mode == OMAP_DMA_SYNC_FRAME)
ccr |= 1 << 5;
p->dma_write(ccr, CCR, lch);
ccr = p->dma_read(CCR2, lch);
ccr &= ~(1 << 2);
if (sync_mode == OMAP_DMA_SYNC_BLOCK)
ccr |= 1 << 2;
p->dma_write(ccr, CCR2, lch);
p->dma_write(elem_count, CEN, lch);
p->dma_write(frame_count, CFN, lch);
}
EXPORT_SYMBOL(omap_set_dma_transfer_params);
void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode)
{
if (!dma_omap15xx()) {
u32 l;
l = p->dma_read(LCH_CTRL, lch);
l &= ~0x7;
l |= mode;
p->dma_write(l, LCH_CTRL, lch);
}
}
EXPORT_SYMBOL(omap_set_dma_channel_mode);
/* Note that src_port is only for omap1 */
void omap_set_dma_src_params(int lch, int src_port, int src_amode,
unsigned long src_start,
int src_ei, int src_fi)
{
u32 l;
u16 w;
w = p->dma_read(CSDP, lch);
w &= ~(0x1f << 2);
w |= src_port << 2;
p->dma_write(w, CSDP, lch);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/sched.h`, `linux/spinlock.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/io.h`.
- Detected declarations: `function omap_disable_channel_irq`, `function set_gdma_dev`, `function omap_set_dma_priority`, `function omap_dma_in_1510_mode`, `function omap_set_dma_transfer_params`, `function omap_set_dma_channel_mode`, `function omap_set_dma_src_params`, `function omap_set_dma_src_data_pack`, `function omap_set_dma_src_burst_mode`, `function omap_set_dma_dest_params`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.