drivers/remoteproc/mtk_common.h
Source file repositories/reference/linux-study-clean/drivers/remoteproc/mtk_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/mtk_common.h- Extension
.h- Size
- 4719 bytes
- Lines
- 178
- 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/interrupt.hlinux/kernel.hlinux/platform_device.hlinux/remoteproc.hlinux/remoteproc/mtk_scp.h
Detected Declarations
struct scp_runstruct scp_ipi_descstruct mtk_scpstruct mtk_scp_sizes_datastruct mtk_scp_of_datastruct mtk_scp_of_clusterstruct mtk_scpstruct mtk_share_obj
Annotated Snippet
struct scp_run {
u32 signaled;
s8 fw_ver[SCP_FW_VER_LEN];
u32 dec_capability;
u32 enc_capability;
wait_queue_head_t wq;
};
struct scp_ipi_desc {
/* For protecting handler. */
struct mutex lock;
scp_ipi_handler_t handler;
void *priv;
};
struct mtk_scp;
struct mtk_scp_sizes_data {
size_t max_dram_size;
size_t ipi_share_buffer_size;
};
struct mtk_scp_of_data {
int (*scp_clk_get)(struct mtk_scp *scp);
int (*scp_before_load)(struct mtk_scp *scp);
void (*scp_irq_handler)(struct mtk_scp *scp);
void (*scp_reset_assert)(struct mtk_scp *scp);
void (*scp_reset_deassert)(struct mtk_scp *scp);
void (*scp_stop)(struct mtk_scp *scp);
void *(*scp_da_to_va)(struct mtk_scp *scp, u64 da, size_t len);
u32 host_to_scp_reg;
u32 host_to_scp_int_bit;
size_t ipi_buf_offset;
const struct mtk_scp_sizes_data *scp_sizes;
};
struct mtk_scp_of_cluster {
void __iomem *reg_base;
void __iomem *l1tcm_base;
size_t l1tcm_size;
phys_addr_t l1tcm_phys;
struct list_head mtk_scp_list;
/* Prevent concurrent operations of this structure and L2TCM power control. */
struct mutex cluster_lock;
u32 l2tcm_refcnt;
};
struct mtk_scp {
struct device *dev;
struct rproc *rproc;
struct clk *clk;
void __iomem *sram_base;
size_t sram_size;
phys_addr_t sram_phys;
const struct mtk_scp_of_data *data;
struct mtk_share_obj __iomem *recv_buf;
struct mtk_share_obj __iomem *send_buf;
struct scp_run run;
/* To prevent multiple ipi_send run concurrently. */
struct mutex send_lock;
struct scp_ipi_desc ipi_desc[SCP_IPI_MAX];
bool ipi_id_ack[SCP_IPI_MAX];
wait_queue_head_t ack_wq;
u8 *share_buf;
void *cpu_addr;
dma_addr_t dma_addr;
struct rproc_subdev *rpmsg_subdev;
struct list_head elem;
struct mtk_scp_of_cluster *cluster;
};
/**
* struct mtk_share_obj - SRAM buffer shared with AP and SCP
*
* @id: IPI id
* @len: share buffer length
* @share_buf: share buffer data
*/
struct mtk_share_obj {
u32 id;
u32 len;
u8 *share_buf;
};
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/kernel.h`, `linux/platform_device.h`, `linux/remoteproc.h`, `linux/remoteproc/mtk_scp.h`.
- Detected declarations: `struct scp_run`, `struct scp_ipi_desc`, `struct mtk_scp`, `struct mtk_scp_sizes_data`, `struct mtk_scp_of_data`, `struct mtk_scp_of_cluster`, `struct mtk_scp`, `struct mtk_share_obj`.
- 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.