Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1693586
| From | Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v7 2/4] remoteproc: qcom: refactor mss fw image loading sequence |
| Date | 2017-07-21 13:00 +0200 |
| Message-ID | <u5DP3-3Lj-1@gated-at.bofh.it> (permalink) |
| References | <u5DFp-3I1-37@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This patch refactor code to first load all firmware blobs
and then update modem proc to authenticate and boot fw.
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
---
drivers/remoteproc/qcom_q6v5_pil.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index 8fd697a..f5f8850 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -503,7 +503,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
bool relocate = false;
char seg_name[10];
ssize_t offset;
- size_t size;
+ size_t size = 0;
void *ptr;
int ret;
int i;
@@ -541,7 +541,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
}
mpss_reloc = relocate ? min_addr : qproc->mpss_phys;
-
+ /* Load firmware segments */
for (i = 0; i < ehdr->e_phnum; i++) {
phdr = &phdrs[i];
@@ -574,18 +574,15 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
memset(ptr + phdr->p_filesz, 0,
phdr->p_memsz - phdr->p_filesz);
}
-
- size = readl(qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
- if (!size) {
- boot_addr = relocate ? qproc->mpss_phys : min_addr;
- writel(boot_addr, qproc->rmb_base + RMB_PMI_CODE_START_REG);
- writel(RMB_CMD_LOAD_READY, qproc->rmb_base + RMB_MBA_COMMAND_REG);
- }
-
size += phdr->p_memsz;
- writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
}
+ /* Transfer ownership of modem ddr region with q6*/
+ boot_addr = relocate ? qproc->mpss_phys : min_addr;
+ writel(boot_addr, qproc->rmb_base + RMB_PMI_CODE_START_REG);
+ writel(RMB_CMD_LOAD_READY, qproc->rmb_base + RMB_MBA_COMMAND_REG);
+ writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
+
ret = q6v5_rmb_mba_wait(qproc, RMB_MBA_AUTH_COMPLETE, 10000);
if (ret == -ETIMEDOUT)
dev_err(qproc->dev, "MPSS authentication timed out\n");
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v7 0/4] Add memory ownership switch support and enable mss rproc on msm8996 Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-07-21 12:50 +0200 [PATCH v7 2/4] remoteproc: qcom: refactor mss fw image loading sequence Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-07-21 13:00 +0200 [PATCH v7 3/4] remoteproc: qcom: Make secure world call for mem ownership switch Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-07-21 13:00 +0200 [PATCH v7 1/4] firmware: scm: Add new SCM call API for switching memory ownership Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-07-21 13:00 +0200 [PATCH v7 4/4] remoteproc: qcom: Add support for mss remoteproc on msm8996 Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-07-21 13:00 +0200
csiph-web