drivers/remoteproc/keystone_remoteproc.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/keystone_remoteproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/keystone_remoteproc.c- Extension
.c- Size
- 13556 bytes
- Lines
- 476
- 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/module.hlinux/slab.hlinux/io.hlinux/interrupt.hlinux/platform_device.hlinux/pm_runtime.hlinux/workqueue.hlinux/of_address.hlinux/of_reserved_mem.hlinux/gpio/consumer.hlinux/regmap.hlinux/mfd/syscon.hlinux/remoteproc.hlinux/reset.hremoteproc_internal.h
Detected Declarations
struct keystone_rproc_memstruct keystone_rprocfunction keystone_rproc_dsp_resetfunction keystone_rproc_dsp_bootfunction keystone_rproc_exception_interruptfunction notfunction keystone_rproc_vring_interruptfunction keystone_rproc_startfunction keystone_rproc_stopfunction GPIOfunction addressfunction keystone_rproc_of_get_memoriesfunction keystone_rproc_of_get_dev_sysconfunction keystone_rproc_mem_releasefunction keystone_rproc_pm_runtime_putfunction keystone_rproc_probe
Annotated Snippet
struct keystone_rproc_mem {
void __iomem *cpu_addr;
phys_addr_t bus_addr;
u32 dev_addr;
size_t size;
};
/**
* struct keystone_rproc - keystone remote processor driver structure
* @dev: cached device pointer
* @rproc: remoteproc device handle
* @mem: internal memory regions data
* @num_mems: number of internal memory regions
* @dev_ctrl: device control regmap handle
* @reset: reset control handle
* @boot_offset: boot register offset in @dev_ctrl regmap
* @irq_ring: irq entry for vring
* @irq_fault: irq entry for exception
* @kick_gpio: gpio used for virtio kicks
* @workqueue: workqueue for processing virtio interrupts
*/
struct keystone_rproc {
struct device *dev;
struct rproc *rproc;
struct keystone_rproc_mem *mem;
int num_mems;
struct regmap *dev_ctrl;
struct reset_control *reset;
struct gpio_desc *kick_gpio;
u32 boot_offset;
int irq_ring;
int irq_fault;
struct work_struct workqueue;
};
/* Put the DSP processor into reset */
static void keystone_rproc_dsp_reset(struct keystone_rproc *ksproc)
{
reset_control_assert(ksproc->reset);
}
/* Configure the boot address and boot the DSP processor */
static int keystone_rproc_dsp_boot(struct keystone_rproc *ksproc, u32 boot_addr)
{
int ret;
if (boot_addr & (SZ_1K - 1)) {
dev_err(ksproc->dev, "invalid boot address 0x%x, must be aligned on a 1KB boundary\n",
boot_addr);
return -EINVAL;
}
ret = regmap_write(ksproc->dev_ctrl, ksproc->boot_offset, boot_addr);
if (ret) {
dev_err(ksproc->dev, "regmap_write of boot address failed, status = %d\n",
ret);
return ret;
}
reset_control_deassert(ksproc->reset);
return 0;
}
/*
* Process the remoteproc exceptions
*
* The exception reporting on Keystone DSP remote processors is very simple
* compared to the equivalent processors on the OMAP family, it is notified
* through a software-designed specific interrupt source in the IPC interrupt
* generation register.
*
* This function just invokes the rproc_report_crash to report the exception
* to the remoteproc driver core, to trigger a recovery.
*/
static irqreturn_t keystone_rproc_exception_interrupt(int irq, void *dev_id)
{
struct keystone_rproc *ksproc = dev_id;
rproc_report_crash(ksproc->rproc, RPROC_FATAL_ERROR);
return IRQ_HANDLED;
}
/*
* Main virtqueue message workqueue function
*
* This function is executed upon scheduling of the keystone remoteproc
* driver's workqueue. The workqueue is scheduled by the vring ISR handler.
*
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/io.h`, `linux/interrupt.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/workqueue.h`, `linux/of_address.h`.
- Detected declarations: `struct keystone_rproc_mem`, `struct keystone_rproc`, `function keystone_rproc_dsp_reset`, `function keystone_rproc_dsp_boot`, `function keystone_rproc_exception_interrupt`, `function not`, `function keystone_rproc_vring_interrupt`, `function keystone_rproc_start`, `function keystone_rproc_stop`, `function GPIO`.
- 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.