drivers/remoteproc/wkup_m3_rproc.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/wkup_m3_rproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/wkup_m3_rproc.c- Extension
.c- Size
- 6532 bytes
- Lines
- 250
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/of.hlinux/of_address.hlinux/platform_device.hlinux/pm_runtime.hlinux/remoteproc.hlinux/reset.hlinux/platform_data/wkup_m3.hremoteproc_internal.h
Detected Declarations
struct wkup_m3_memstruct wkup_m3_rprocfunction wkup_m3_rproc_startfunction wkup_m3_rproc_stopfunction wkup_m3_rproc_pm_runtime_putfunction wkup_m3_rproc_probefunction wkup_m3_rpm_suspendfunction wkup_m3_rpm_resume
Annotated Snippet
struct wkup_m3_mem {
void __iomem *cpu_addr;
phys_addr_t bus_addr;
u32 dev_addr;
size_t size;
};
/**
* struct wkup_m3_rproc - WkupM3 remote processor state
* @rproc: rproc handle
* @pdev: pointer to platform device
* @mem: WkupM3 memory information
* @rsts: reset control
*/
struct wkup_m3_rproc {
struct rproc *rproc;
struct platform_device *pdev;
struct wkup_m3_mem mem[WKUPM3_MEM_MAX];
struct reset_control *rsts;
};
static int wkup_m3_rproc_start(struct rproc *rproc)
{
struct wkup_m3_rproc *wkupm3 = rproc->priv;
struct platform_device *pdev = wkupm3->pdev;
struct device *dev = &pdev->dev;
struct wkup_m3_platform_data *pdata = dev_get_platdata(dev);
int error = 0;
error = reset_control_deassert(wkupm3->rsts);
if (!wkupm3->rsts && pdata->deassert_reset(pdev, pdata->reset_name)) {
dev_err(dev, "Unable to reset wkup_m3!\n");
error = -ENODEV;
}
return error;
}
static int wkup_m3_rproc_stop(struct rproc *rproc)
{
struct wkup_m3_rproc *wkupm3 = rproc->priv;
struct platform_device *pdev = wkupm3->pdev;
struct device *dev = &pdev->dev;
struct wkup_m3_platform_data *pdata = dev_get_platdata(dev);
int error = 0;
error = reset_control_assert(wkupm3->rsts);
if (!wkupm3->rsts && pdata->assert_reset(pdev, pdata->reset_name)) {
dev_err(dev, "Unable to assert reset of wkup_m3!\n");
error = -ENODEV;
}
return error;
}
static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem)
{
struct wkup_m3_rproc *wkupm3 = rproc->priv;
void *va = NULL;
int i;
u32 offset;
if (len == 0)
return NULL;
for (i = 0; i < WKUPM3_MEM_MAX; i++) {
if (da >= wkupm3->mem[i].dev_addr && da + len <=
wkupm3->mem[i].dev_addr + wkupm3->mem[i].size) {
offset = da - wkupm3->mem[i].dev_addr;
/* __force to make sparse happy with type conversion */
va = (__force void *)(wkupm3->mem[i].cpu_addr + offset);
break;
}
}
return va;
}
static const struct rproc_ops wkup_m3_rproc_ops = {
.start = wkup_m3_rproc_start,
.stop = wkup_m3_rproc_stop,
.da_to_va = wkup_m3_rproc_da_to_va,
};
static const struct of_device_id wkup_m3_rproc_of_match[] = {
{ .compatible = "ti,am3352-wkup-m3", },
{ .compatible = "ti,am4372-wkup-m3", },
{},
Annotation
- Immediate include surface: `linux/err.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/of_address.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct wkup_m3_mem`, `struct wkup_m3_rproc`, `function wkup_m3_rproc_start`, `function wkup_m3_rproc_stop`, `function wkup_m3_rproc_pm_runtime_put`, `function wkup_m3_rproc_probe`, `function wkup_m3_rpm_suspend`, `function wkup_m3_rpm_resume`.
- Atlas domain: Driver Families / drivers/remoteproc.
- Implementation status: source implementation candidate.
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.