drivers/remoteproc/imx_rproc.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/imx_rproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/imx_rproc.c- Extension
.c- Size
- 43642 bytes
- Lines
- 1587
- 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
dt-bindings/firmware/imx/rsrc.hlinux/arm-smccc.hlinux/clk.hlinux/err.hlinux/firmware/imx/sci.hlinux/firmware/imx/sm.hlinux/interrupt.hlinux/kernel.hlinux/mailbox_client.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_address.hlinux/of_reserved_mem.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_runtime.hlinux/reboot.hlinux/regmap.hlinux/remoteproc.hlinux/scmi_imx_protocol.hlinux/workqueue.himx_rproc.hremoteproc_internal.h
Detected Declarations
struct imx_rproc_memstruct imx_rprocfunction imx_rproc_arm_smc_startfunction imx_rproc_mmio_startfunction imx_rproc_scu_api_startfunction imx_rproc_sm_get_reset_vectorfunction imx_rproc_sm_cpu_startfunction imx_rproc_sm_lmm_startfunction imx_rproc_startfunction imx_rproc_arm_smc_stopfunction imx_rproc_mmio_stopfunction imx_rproc_scu_api_stopfunction imx_rproc_sm_cpu_stopfunction imx_rproc_sm_lmm_stopfunction imx_rproc_stopfunction imx_rproc_da_to_sysfunction imx_rproc_mem_allocfunction imx_rproc_mem_releasefunction imx_rproc_sm_lmm_preparefunction imx_rproc_preparefunction imx_rproc_parse_fwfunction imx_rproc_kickfunction imx_rproc_attachfunction imx_rproc_scu_api_detachfunction imx_rproc_detachfunction imx_rproc_elf_find_loaded_rsc_tablefunction imx_rproc_addr_initfunction imx_rproc_notified_idr_cbfunction imx_rproc_vq_workfunction imx_rproc_rx_callbackfunction imx_rproc_xtr_mbox_initfunction imx_rproc_free_mboxfunction imx_rproc_put_scufunction imx_rproc_partition_notifyfunction imx_rproc_attach_pdfunction imx_rproc_arm_smc_detect_modefunction imx_rproc_mmio_detect_modefunction imx_rproc_scu_api_detect_modefunction imx_rproc_sm_lmm_checkfunction imx_rproc_sm_detect_modefunction corefunction imx_rproc_detect_modefunction imx_rproc_sys_off_handlerfunction imx_rproc_destroy_workqueuefunction imx_rproc_probefunction imx_rproc_remove
Annotated Snippet
struct imx_rproc_mem {
void __iomem *cpu_addr;
phys_addr_t sys_addr;
size_t size;
};
/* att flags: lower 16 bits specifying core, higher 16 bits for flags */
/* M4 own area. Can be mapped at probe */
#define ATT_OWN BIT(31)
#define ATT_IOMEM BIT(30)
#define ATT_CORE_MASK 0xffff
#define ATT_CORE(I) BIT((I))
/* Linux has permission to handle the Logical Machine of remote cores */
#define IMX_RPROC_FLAGS_SM_LMM_CTRL BIT(0)
static int imx_rproc_xtr_mbox_init(struct rproc *rproc, bool tx_block);
static void imx_rproc_free_mbox(void *data);
/* Forward declarations for platform operations */
static const struct imx_rproc_plat_ops imx_rproc_ops_sm_lmm;
static const struct imx_rproc_plat_ops imx_rproc_ops_sm_cpu;
struct imx_rproc {
struct device *dev;
struct regmap *regmap;
struct regmap *gpr;
struct rproc *rproc;
const struct imx_rproc_dcfg *dcfg;
struct imx_rproc_mem mem[IMX_RPROC_MEM_MAX];
struct clk *clk;
struct mbox_client cl;
struct mbox_chan *tx_ch;
struct mbox_chan *rx_ch;
struct work_struct rproc_work;
struct workqueue_struct *workqueue;
void __iomem *rsc_table;
struct imx_sc_ipc *ipc_handle;
struct notifier_block rproc_nb;
u32 rproc_pt; /* partition id */
u32 rsrc_id; /* resource id */
u32 entry; /* cpu start address */
u32 core_index;
struct dev_pm_domain_list *pd_list;
const struct imx_rproc_plat_ops *ops;
/*
* For i.MX System Manager based systems
* BIT 0: IMX_RPROC_FLAGS_SM_LMM_CTRL(RPROC LM is under Linux control )
*/
u32 flags;
};
static const struct imx_rproc_att imx_rproc_att_imx95_m7[] = {
/* dev addr , sys addr , size , flags */
/* TCM CODE NON-SECURE */
{ 0x00000000, 0x203C0000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* TCM SYS NON-SECURE*/
{ 0x20000000, 0x20400000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* DDR */
{ 0x80000000, 0x80000000, 0x50000000, 0 },
};
static const struct imx_rproc_att imx_rproc_att_imx94_m70[] = {
/* dev addr , sys addr , size , flags */
/* TCM CODE NON-SECURE */
{ 0x00000000, 0x203C0000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* TCM SYS NON-SECURE*/
{ 0x20000000, 0x20400000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* DDR */
{ 0x80000000, 0x80000000, 0x10000000, 0 },
};
static const struct imx_rproc_att imx_rproc_att_imx94_m71[] = {
/* dev addr , sys addr , size , flags */
/* TCM CODE NON-SECURE */
{ 0x00000000, 0x202C0000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* TCM SYS NON-SECURE*/
{ 0x20000000, 0x20300000, 0x00040000, ATT_OWN | ATT_IOMEM },
/* DDR */
{ 0x80000000, 0x80000000, 0x10000000, 0 },
};
static const struct imx_rproc_att imx_rproc_att_imx94_m33s[] = {
/* dev addr , sys addr , size , flags */
/* TCM CODE NON-SECURE */
Annotation
- Immediate include surface: `dt-bindings/firmware/imx/rsrc.h`, `linux/arm-smccc.h`, `linux/clk.h`, `linux/err.h`, `linux/firmware/imx/sci.h`, `linux/firmware/imx/sm.h`, `linux/interrupt.h`, `linux/kernel.h`.
- Detected declarations: `struct imx_rproc_mem`, `struct imx_rproc`, `function imx_rproc_arm_smc_start`, `function imx_rproc_mmio_start`, `function imx_rproc_scu_api_start`, `function imx_rproc_sm_get_reset_vector`, `function imx_rproc_sm_cpu_start`, `function imx_rproc_sm_lmm_start`, `function imx_rproc_start`, `function imx_rproc_arm_smc_stop`.
- 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.