drivers/remoteproc/qcom_q6v5_wcss.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/qcom_q6v5_wcss.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/qcom_q6v5_wcss.c- Extension
.c- Size
- 28420 bytes
- Lines
- 1089
- 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/clk.hlinux/delay.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/mfd/syscon.hlinux/module.hlinux/of_address.hlinux/of_reserved_mem.hlinux/platform_device.hlinux/regmap.hlinux/regulator/consumer.hlinux/reset.hlinux/soc/qcom/mdt_loader.hqcom_common.hqcom_pil_info.hqcom_q6v5.h
Detected Declarations
struct wcss_datastruct q6v5_wcssfunction q6v5_wcss_resetfunction q6v5_wcss_startfunction q6v5_wcss_qcs404_power_onfunction q6v5_wcss_qcs404_resetfunction q6v5_qcs404_wcss_startfunction q6v5_wcss_halt_axi_portfunction q6v5_qcs404_wcss_shutdownfunction q6v5_wcss_powerdownfunction q6v5_q6_powerdownfunction q6v5_wcss_stopfunction q6v5_wcss_loadfunction q6v5_wcss_init_resetfunction q6v5_wcss_init_mmiofunction q6v5_alloc_memory_regionfunction q6v5_wcss_init_clockfunction q6v5_wcss_init_regulatorfunction q6v5_wcss_probefunction q6v5_wcss_remove
Annotated Snippet
struct wcss_data {
const char *firmware_name;
unsigned int crash_reason_smem;
u32 version;
bool aon_reset_required;
const char *ssr_name;
const char *sysmon_name;
int ssctl_id;
const struct rproc_ops *ops;
bool requires_force_stop;
};
struct q6v5_wcss {
struct device *dev;
void __iomem *reg_base;
void __iomem *rmb_base;
struct regmap *halt_map;
u32 halt_q6;
u32 halt_wcss;
u32 halt_nc;
struct clk *xo;
struct clk *ahbfabric_cbcr_clk;
struct clk *gcc_abhs_cbcr;
struct clk *gcc_axim_cbcr;
struct clk *lcc_csr_cbcr;
struct clk *ahbs_cbcr;
struct clk *tcm_slave_cbcr;
struct clk *qdsp6ss_abhm_cbcr;
struct clk *qdsp6ss_sleep_cbcr;
struct clk *qdsp6ss_axim_cbcr;
struct clk *qdsp6ss_xo_cbcr;
struct clk *qdsp6ss_core_gfmux;
struct clk *lcc_bcr_sleep;
struct regulator *cx_supply;
struct qcom_sysmon *sysmon;
struct reset_control *wcss_aon_reset;
struct reset_control *wcss_reset;
struct reset_control *wcss_q6_reset;
struct qcom_q6v5 q6v5;
phys_addr_t mem_phys;
phys_addr_t mem_reloc;
void *mem_region;
size_t mem_size;
unsigned int crash_reason_smem;
u32 version;
bool requires_force_stop;
struct qcom_rproc_glink glink_subdev;
struct qcom_rproc_pdm pdm_subdev;
struct qcom_rproc_ssr ssr_subdev;
};
static int q6v5_wcss_reset(struct q6v5_wcss *wcss)
{
int ret;
u32 val;
int i;
/* Assert resets, stop core */
val = readl(wcss->reg_base + Q6SS_RESET_REG);
val |= Q6SS_CORE_ARES | Q6SS_BUS_ARES_ENABLE | Q6SS_STOP_CORE;
writel(val, wcss->reg_base + Q6SS_RESET_REG);
/* BHS require xo cbcr to be enabled */
val = readl(wcss->reg_base + Q6SS_XO_CBCR);
val |= 0x1;
writel(val, wcss->reg_base + Q6SS_XO_CBCR);
/* Read CLKOFF bit to go low indicating CLK is enabled */
ret = readl_poll_timeout(wcss->reg_base + Q6SS_XO_CBCR,
val, !(val & BIT(31)), 1,
HALT_CHECK_MAX_LOOPS);
if (ret) {
dev_err(wcss->dev,
"xo cbcr enabling timed out (rc:%d)\n", ret);
return ret;
}
/* Enable power block headswitch and wait for it to stabilize */
val = readl(wcss->reg_base + Q6SS_PWR_CTL_REG);
val |= Q6SS_BHS_ON;
writel(val, wcss->reg_base + Q6SS_PWR_CTL_REG);
udelay(1);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/io.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/of_address.h`.
- Detected declarations: `struct wcss_data`, `struct q6v5_wcss`, `function q6v5_wcss_reset`, `function q6v5_wcss_start`, `function q6v5_wcss_qcs404_power_on`, `function q6v5_wcss_qcs404_reset`, `function q6v5_qcs404_wcss_start`, `function q6v5_wcss_halt_axi_port`, `function q6v5_qcs404_wcss_shutdown`, `function q6v5_wcss_powerdown`.
- 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.