drivers/remoteproc/da8xx_remoteproc.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/da8xx_remoteproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/da8xx_remoteproc.c- Extension
.c- Size
- 9060 bytes
- Lines
- 337
- Domain
- Driver Families
- Bucket
- drivers/remoteproc
- 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.
- 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/bitops.hlinux/clk.hlinux/reset.hlinux/err.hlinux/interrupt.hlinux/io.hlinux/irq.hlinux/kernel.hlinux/module.hlinux/of_reserved_mem.hlinux/platform_device.hlinux/remoteproc.hremoteproc_internal.h
Detected Declarations
struct da8xx_rproc_memstruct da8xx_rprocfunction handle_eventfunction da8xx_rproc_callbackfunction da8xx_rproc_startfunction da8xx_rproc_stopfunction da8xx_rproc_kickfunction da8xx_rproc_get_internal_memoriesfunction da8xx_rproc_mem_releasefunction da8xx_rproc_probe
Annotated Snippet
struct da8xx_rproc_mem {
void __iomem *cpu_addr;
phys_addr_t bus_addr;
u32 dev_addr;
size_t size;
};
/**
* struct da8xx_rproc - da8xx remote processor instance state
* @rproc: rproc handle
* @mem: internal memory regions data
* @num_mems: number of internal memory regions
* @dsp_clk: placeholder for platform's DSP clk
* @dsp_reset: control for local reset
* @irq_data: ack_fxn function parameter
* @chipsig: virt ptr to DSP interrupt registers (CHIPSIG & CHIPSIG_CLR)
* @bootreg: virt ptr to DSP boot address register (HOST1CFG)
*/
struct da8xx_rproc {
struct rproc *rproc;
struct da8xx_rproc_mem *mem;
int num_mems;
struct clk *dsp_clk;
struct reset_control *dsp_reset;
struct irq_data *irq_data;
void __iomem *chipsig;
void __iomem *bootreg;
};
/**
* handle_event() - inbound virtqueue message workqueue function
*
* This function is registered as a kernel thread and is scheduled by the
* kernel handler.
*/
static irqreturn_t handle_event(int irq, void *p)
{
struct rproc *rproc = p;
/* Process incoming buffers on all our vrings */
rproc_vq_interrupt(rproc, 0);
rproc_vq_interrupt(rproc, 1);
return IRQ_HANDLED;
}
/**
* da8xx_rproc_callback() - inbound virtqueue message handler
*
* This handler is invoked directly by the kernel whenever the remote
* core (DSP) has modified the state of a virtqueue. There is no
* "payload" message indicating the virtqueue index as is the case with
* mailbox-based implementations on OMAP4. As such, this handler "polls"
* each known virtqueue index for every invocation.
*/
static irqreturn_t da8xx_rproc_callback(int irq, void *p)
{
struct rproc *rproc = p;
struct da8xx_rproc *drproc = rproc->priv;
u32 chipsig;
chipsig = readl(drproc->chipsig);
if (chipsig & SYSCFG_CHIPSIG0) {
/* Clear interrupt level source */
writel(SYSCFG_CHIPSIG0, drproc->chipsig + 4);
/*
* ACK intr to AINTC.
*
* It has already been ack'ed by the kernel before calling
* this function, but since the ARM<->DSP interrupts in the
* CHIPSIG register are "level" instead of "pulse" variety,
* we need to ack it after taking down the level else we'll
* be called again immediately after returning.
*/
drproc->irq_data->chip->irq_ack(drproc->irq_data);
return IRQ_WAKE_THREAD;
}
return IRQ_HANDLED;
}
static int da8xx_rproc_start(struct rproc *rproc)
{
struct device *dev = rproc->dev.parent;
struct da8xx_rproc *drproc = rproc->priv;
struct clk *dsp_clk = drproc->dsp_clk;
struct reset_control *dsp_reset = drproc->dsp_reset;
int ret;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/clk.h`, `linux/reset.h`, `linux/err.h`, `linux/interrupt.h`, `linux/io.h`, `linux/irq.h`, `linux/kernel.h`.
- Detected declarations: `struct da8xx_rproc_mem`, `struct da8xx_rproc`, `function handle_event`, `function da8xx_rproc_callback`, `function da8xx_rproc_start`, `function da8xx_rproc_stop`, `function da8xx_rproc_kick`, `function da8xx_rproc_get_internal_memories`, `function da8xx_rproc_mem_release`, `function da8xx_rproc_probe`.
- Atlas domain: Driver Families / drivers/remoteproc.
- Implementation status: source implementation candidate.
- 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.