summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/qcom_wcnss.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-01-27 13:17:23 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-02-06 19:57:24 +0300
commit7f0dd07a9b29cfadffcd2fa08902a844f5c94e86 (patch)
tree022b7fe0d968f61d2e2035a255e79f43fdb3da9e /drivers/remoteproc/qcom_wcnss.c
parent3e8b571a9a0881ba3381ca0915995696da145ab8 (diff)
downloadlinux-7f0dd07a9b29cfadffcd2fa08902a844f5c94e86.tar.xz
remoteproc: qcom: mdt_loader: Refactor MDT loader
Pushing the SCM calls into the MDT loader reduces duplication in the callers and allows for non-remoteproc clients to use the helper for parsing and loading MDT files. Cc: Andy Gross <andy.gross@linaro.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/qcom_wcnss.c')
-rw-r--r--drivers/remoteproc/qcom_wcnss.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index f158f8243b04..fbb25ea4ae8a 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -153,34 +153,9 @@ void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss,
static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
{
struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv;
- phys_addr_t fw_addr;
- size_t fw_size;
- bool relocate;
- int ret;
-
- ret = qcom_scm_pas_init_image(WCNSS_PAS_ID, fw->data, fw->size);
- if (ret) {
- dev_err(&rproc->dev, "invalid firmware metadata\n");
- return ret;
- }
-
- ret = qcom_mdt_parse(fw, &fw_addr, &fw_size, &relocate);
- if (ret) {
- dev_err(&rproc->dev, "failed to parse mdt header\n");
- return ret;
- }
-
- if (relocate) {
- wcnss->mem_reloc = fw_addr;
-
- ret = qcom_scm_pas_mem_setup(WCNSS_PAS_ID, wcnss->mem_phys, fw_size);
- if (ret) {
- dev_err(&rproc->dev, "unable to setup memory for image\n");
- return ret;
- }
- }
- return qcom_mdt_load(rproc, fw, rproc->firmware);
+ return qcom_mdt_load(wcnss->dev, fw, rproc->firmware, WCNSS_PAS_ID,
+ wcnss->mem_region, wcnss->mem_phys, wcnss->mem_size);
}
static const struct rproc_fw_ops wcnss_fw_ops = {