summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivasa Rao Mandadapu <quic_srivasam@quicinc.com>2022-09-28 15:27:50 +0300
committerBjorn Andersson <andersson@kernel.org>2022-12-28 19:29:34 +0300
commit48ab209c6f5f84a5adcd68e150dc0f614c8bfba7 (patch)
tree293a9d6fb8aee5a0b281a52d04fdfaa25a744bb1
parent66cab0c5c3f9dae0213b9d02af03791b75565986 (diff)
downloadlinux-48ab209c6f5f84a5adcd68e150dc0f614c8bfba7.tar.xz
remoteproc: qcom: Update rproc parse firmware callback
Change parse_fw callback in rproc ops from qcom_register_dump_segments to local function such that, it can perform coredump segments registration and it can parse section header in memory sandboxing required platforms. Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/1664368073-13659-5-git-send-email-quic_srivasam@quicinc.com
-rw-r--r--drivers/remoteproc/qcom_q6v5_adsp.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 14a38649be71..b8cbbf7370c0 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -439,6 +439,27 @@ static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iom
return adsp->mem_region + offset;
}
+static int adsp_parse_firmware(struct rproc *rproc, const struct firmware *fw)
+{
+ struct qcom_adsp *adsp = rproc->priv;
+ int ret;
+
+ ret = qcom_register_dump_segments(rproc, fw);
+ if (ret) {
+ dev_err(&rproc->dev, "Error in registering dump segments\n");
+ return ret;
+ }
+
+ if (adsp->has_iommu) {
+ ret = rproc_elf_load_rsc_table(rproc, fw);
+ if (ret) {
+ dev_err(&rproc->dev, "Error in loading resource table\n");
+ return ret;
+ }
+ }
+ return 0;
+}
+
static unsigned long adsp_panic(struct rproc *rproc)
{
struct qcom_adsp *adsp = rproc->priv;
@@ -450,7 +471,7 @@ static const struct rproc_ops adsp_ops = {
.start = adsp_start,
.stop = adsp_stop,
.da_to_va = adsp_da_to_va,
- .parse_fw = qcom_register_dump_segments,
+ .parse_fw = adsp_parse_firmware,
.load = adsp_load,
.panic = adsp_panic,
};