summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2018-01-05 19:04:19 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-02-12 14:05:38 -0500
commit4dd27f544c84c4d079049dd716beee192fcc7e03 (patch)
treeb82e6bb9c5394d70e7d71e5273f0015e80099498 /drivers/soc
parentc1d35c1ab4242464a0e5953ae69de8aa78156c6c (diff)
soc: qcom: mdt-loader: Return relocation base
In order to implement support for grabbing core dumps in remoteproc it's necessary to know the relocated base of the image, as the offsets from the virtual memory base might not be based on the physical address. Return the adjusted physical base address to the caller. Acked-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/mdt_loader.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
index 08bd8549242a..17b314d9a148 100644
--- a/drivers/soc/qcom/mdt_loader.c
+++ b/drivers/soc/qcom/mdt_loader.c
@@ -83,12 +83,14 @@ EXPORT_SYMBOL_GPL(qcom_mdt_get_size);
83 * @mem_region: allocated memory region to load firmware into 83 * @mem_region: allocated memory region to load firmware into
84 * @mem_phys: physical address of allocated memory region 84 * @mem_phys: physical address of allocated memory region
85 * @mem_size: size of the allocated memory region 85 * @mem_size: size of the allocated memory region
86 * @reloc_base: adjusted physical address after relocation
86 * 87 *
87 * Returns 0 on success, negative errno otherwise. 88 * Returns 0 on success, negative errno otherwise.
88 */ 89 */
89int qcom_mdt_load(struct device *dev, const struct firmware *fw, 90int qcom_mdt_load(struct device *dev, const struct firmware *fw,
90 const char *firmware, int pas_id, void *mem_region, 91 const char *firmware, int pas_id, void *mem_region,
91 phys_addr_t mem_phys, size_t mem_size) 92 phys_addr_t mem_phys, size_t mem_size,
93 phys_addr_t *reloc_base)
92{ 94{
93 const struct elf32_phdr *phdrs; 95 const struct elf32_phdr *phdrs;
94 const struct elf32_phdr *phdr; 96 const struct elf32_phdr *phdr;
@@ -192,6 +194,9 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw,
192 memset(ptr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz); 194 memset(ptr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
193 } 195 }
194 196
197 if (reloc_base)
198 *reloc_base = mem_reloc;
199
195out: 200out:
196 kfree(fw_name); 201 kfree(fw_name);
197 202