mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
remoteproc: qcom_q6v5_mss: Add modem debug policy support
Add modem debug policy support which will enable coredumps and live debug support when the msadp firmware is present on secure devices. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200722201047.12975-4-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
135b9e8d1c
commit
fe6a5dc4b0
@ -190,6 +190,7 @@ struct q6v5 {
|
|||||||
phys_addr_t mba_phys;
|
phys_addr_t mba_phys;
|
||||||
void *mba_region;
|
void *mba_region;
|
||||||
size_t mba_size;
|
size_t mba_size;
|
||||||
|
size_t dp_size;
|
||||||
|
|
||||||
phys_addr_t mpss_phys;
|
phys_addr_t mpss_phys;
|
||||||
phys_addr_t mpss_reloc;
|
phys_addr_t mpss_reloc;
|
||||||
@ -407,6 +408,21 @@ static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm,
|
|||||||
current_perm, next, perms);
|
current_perm, next, perms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void q6v5_debug_policy_load(struct q6v5 *qproc)
|
||||||
|
{
|
||||||
|
const struct firmware *dp_fw;
|
||||||
|
|
||||||
|
if (request_firmware_direct(&dp_fw, "msadp", qproc->dev))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (SZ_1M + dp_fw->size <= qproc->mba_size) {
|
||||||
|
memcpy(qproc->mba_region + SZ_1M, dp_fw->data, dp_fw->size);
|
||||||
|
qproc->dp_size = dp_fw->size;
|
||||||
|
}
|
||||||
|
|
||||||
|
release_firmware(dp_fw);
|
||||||
|
}
|
||||||
|
|
||||||
static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
|
static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
|
||||||
{
|
{
|
||||||
struct q6v5 *qproc = rproc->priv;
|
struct q6v5 *qproc = rproc->priv;
|
||||||
@ -418,6 +434,7 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memcpy(qproc->mba_region, fw->data, fw->size);
|
memcpy(qproc->mba_region, fw->data, fw->size);
|
||||||
|
q6v5_debug_policy_load(qproc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -927,6 +944,10 @@ static int q6v5_mba_load(struct q6v5 *qproc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
|
writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
|
||||||
|
if (qproc->dp_size) {
|
||||||
|
writel(qproc->mba_phys + SZ_1M, qproc->rmb_base + RMB_PMI_CODE_START_REG);
|
||||||
|
writel(qproc->dp_size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
|
||||||
|
}
|
||||||
|
|
||||||
ret = q6v5proc_reset(qproc);
|
ret = q6v5proc_reset(qproc);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -995,6 +1016,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
|
|||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
qproc->dump_mba_loaded = false;
|
qproc->dump_mba_loaded = false;
|
||||||
|
qproc->dp_size = 0;
|
||||||
|
|
||||||
q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
|
q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
|
||||||
q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
|
q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
|
||||||
@ -1289,7 +1311,8 @@ static int q6v5_start(struct rproc *rproc)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
dev_info(qproc->dev, "MBA booted, loading mpss\n");
|
dev_info(qproc->dev, "MBA booted with%s debug policy, loading mpss\n",
|
||||||
|
qproc->dp_size ? "" : "out");
|
||||||
|
|
||||||
ret = q6v5_mpss_load(qproc);
|
ret = q6v5_mpss_load(qproc);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user