drivers/remoteproc/imx_dsp_rproc.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/imx_dsp_rproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/imx_dsp_rproc.c- Extension
.c- Size
- 38520 bytes
- Lines
- 1431
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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.hlinux/firmware/imx/sci.hlinux/interrupt.hlinux/kernel.hlinux/mailbox_client.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_reserved_mem.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_runtime.hlinux/regmap.hlinux/remoteproc.hlinux/reset.hlinux/slab.himx_rproc.hremoteproc_elf_helpers.hremoteproc_internal.h
Detected Declarations
struct imx_dsp_rprocstruct imx_dsp_rproc_dcfgstruct fw_rsc_imx_dspenum imx_dsp_rp_mbox_messagesfunction imx8mp_dsp_resetfunction imx8ulp_dsp_resetfunction imx_dsp_rproc_readyfunction imx_dsp_rproc_handle_rscfunction replyfunction imx_dsp_rproc_mmio_startfunction imx_dsp_rproc_reset_ctrl_startfunction imx_dsp_rproc_scu_api_startfunction imx_dsp_rproc_startfunction imx_dsp_rproc_mmio_stopfunction imx_dsp_rproc_reset_ctrl_stopfunction imx_dsp_rproc_scu_api_stopfunction imx_dsp_rproc_stopfunction imx_dsp_rproc_sys_to_dafunction notfunction imx_dsp_rproc_rx_tx_callbackfunction imx_dsp_rproc_rxdb_callbackfunction imx_dsp_rproc_mbox_allocfunction imx_dsp_rproc_mbox_no_allocfunction imx_dsp_rproc_free_mboxfunction imx_dsp_rproc_mem_allocfunction imx_dsp_rproc_mem_releasefunction imx_dsp_rproc_add_carveoutfunction imx_dsp_rproc_preparefunction imx_dsp_rproc_unpreparefunction imx_dsp_rproc_kickfunction imx_dsp_rproc_memcpyfunction imx_dsp_rproc_memsetfunction imx_dsp_rproc_elf_load_segmentsfunction imx_dsp_rproc_parse_fwfunction imx_dsp_rproc_loadfunction list_for_each_entryfunction imx_dsp_attach_pm_domainsfunction imx_dsp_rproc_mmio_detect_modefunction imx_dsp_rproc_reset_ctrl_detect_modefunction imx_dsp_rproc_scu_api_detect_modefunction imx_dsp_rproc_detect_modefunction imx_dsp_rproc_clk_getfunction imx_dsp_rproc_probefunction imx_dsp_runtime_resumefunction imx_dsp_runtime_suspendfunction imx_dsp_load_firmwarefunction imx_dsp_suspendfunction imx_dsp_resume
Annotated Snippet
struct imx_dsp_rproc {
struct regmap *regmap;
struct reset_control *run_stall;
struct rproc *rproc;
const struct imx_dsp_rproc_dcfg *dsp_dcfg;
struct clk_bulk_data clks[DSP_RPROC_CLK_MAX];
struct mbox_client cl;
struct mbox_client cl_rxdb;
struct mbox_chan *tx_ch;
struct mbox_chan *rx_ch;
struct mbox_chan *rxdb_ch;
struct dev_pm_domain_list *pd_list;
struct imx_sc_ipc *ipc_handle;
struct work_struct rproc_work;
struct completion pm_comp;
u32 flags;
};
/**
* struct imx_dsp_rproc_dcfg - DSP remote processor configuration
* @dcfg: imx_rproc_dcfg handler
* @reset: reset callback function
*/
struct imx_dsp_rproc_dcfg {
const struct imx_rproc_dcfg *dcfg;
int (*reset)(struct imx_dsp_rproc *priv);
};
/**
* struct fw_rsc_imx_dsp - i.MX DSP specific info
*
* @len: length of the resource entry
* @magic_num: 32-bit magic number
* @version: version of data structure
* @features: feature flags supported by the i.MX DSP firmware
*
* This represents a DSP-specific resource in the firmware's
* resource table, providing information on supported features.
*/
struct fw_rsc_imx_dsp {
uint32_t len;
uint32_t magic_num;
uint32_t version;
uint32_t features;
} __packed;
static const struct imx_rproc_att imx_dsp_rproc_att_imx8qm[] = {
/* dev addr , sys addr , size , flags */
{ 0x596e8000, 0x556e8000, 0x00008000, ATT_OWN },
{ 0x596f0000, 0x556f0000, 0x00008000, ATT_OWN },
{ 0x596f8000, 0x556f8000, 0x00000800, ATT_OWN | ATT_IRAM},
{ 0x55700000, 0x55700000, 0x00070000, ATT_OWN },
/* DDR (Data) */
{ 0x80000000, 0x80000000, 0x60000000, 0},
};
static const struct imx_rproc_att imx_dsp_rproc_att_imx8qxp[] = {
/* dev addr , sys addr , size , flags */
{ 0x596e8000, 0x596e8000, 0x00008000, ATT_OWN },
{ 0x596f0000, 0x596f0000, 0x00008000, ATT_OWN },
{ 0x596f8000, 0x596f8000, 0x00000800, ATT_OWN | ATT_IRAM},
{ 0x59700000, 0x59700000, 0x00070000, ATT_OWN },
/* DDR (Data) */
{ 0x80000000, 0x80000000, 0x60000000, 0},
};
static const struct imx_rproc_att imx_dsp_rproc_att_imx8mp[] = {
/* dev addr , sys addr , size , flags */
{ 0x3b6e8000, 0x3b6e8000, 0x00008000, ATT_OWN },
{ 0x3b6f0000, 0x3b6f0000, 0x00008000, ATT_OWN },
{ 0x3b6f8000, 0x3b6f8000, 0x00000800, ATT_OWN | ATT_IRAM},
{ 0x3b700000, 0x3b700000, 0x00040000, ATT_OWN },
/* DDR (Data) */
{ 0x40000000, 0x40000000, 0x80000000, 0},
};
static const struct imx_rproc_att imx_dsp_rproc_att_imx8ulp[] = {
/* dev addr , sys addr , size , flags */
{ 0x21170000, 0x21170000, 0x00010000, ATT_OWN | ATT_IRAM},
{ 0x21180000, 0x21180000, 0x00010000, ATT_OWN },
/* DDR (Data) */
{ 0x0c000000, 0x80000000, 0x10000000, 0},
{ 0x30000000, 0x90000000, 0x10000000, 0},
};
/* Initialize the mailboxes between cores, if exists */
static int (*imx_dsp_rproc_mbox_init)(struct imx_dsp_rproc *priv);
/* Reset function for DSP on i.MX8MP */
static int imx8mp_dsp_reset(struct imx_dsp_rproc *priv)
Annotation
- Immediate include surface: `dt-bindings/firmware/imx/rsrc.h`, `linux/arm-smccc.h`, `linux/clk.h`, `linux/err.h`, `linux/firmware.h`, `linux/firmware/imx/sci.h`, `linux/interrupt.h`, `linux/kernel.h`.
- Detected declarations: `struct imx_dsp_rproc`, `struct imx_dsp_rproc_dcfg`, `struct fw_rsc_imx_dsp`, `enum imx_dsp_rp_mbox_messages`, `function imx8mp_dsp_reset`, `function imx8ulp_dsp_reset`, `function imx_dsp_rproc_ready`, `function imx_dsp_rproc_handle_rsc`, `function reply`, `function imx_dsp_rproc_mmio_start`.
- Atlas domain: Driver Families / drivers/remoteproc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.