summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/remoteproc_core.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2018-01-05 15:58:01 -0800
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-01-15 09:29:40 -0800
commit0f21f9cc9d868784c7564edc0cfeddd25ca9621a (patch)
tree4529534ba2c028abd340bf7f47ba9646eb838091 /drivers/remoteproc/remoteproc_core.c
parentfb98e2bdbd5f5949459dcfe9976bdafdb0ed1948 (diff)
remoteproc: Merge rproc_ops and rproc_fw_ops
There are currently a few different schemes used for overriding fw_ops or parts of fw_ops. Merge fw_ops into rproc_ops and expose the default ELF-loader symbols so that they can be assigned by the drivers. To keep backwards compatibility with the "default" case, a driver not specifying the "load" operation is assumed to want the full ELF-loader suit of functions. Reviewed-By: Loic Pallardy <loic.pallardy@st.com> Tested-By: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/remoteproc_core.c')
-rw-r--r--drivers/remoteproc/remoteproc_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index dbf685dbafcf..2c669a73e77d 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1437,8 +1437,14 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
atomic_set(&rproc->power, 0);
- /* Set ELF as the default fw_ops handler */
- rproc->fw_ops = &rproc_elf_fw_ops;
+ /* Default to ELF loader if no load function is specified */
+ if (!rproc->ops->load) {
+ rproc->ops->load = rproc_elf_load_segments;
+ rproc->ops->find_rsc_table = rproc_elf_find_rsc_table;
+ rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table;
+ rproc->ops->sanity_check = rproc_elf_sanity_check;
+ rproc->ops->get_boot_addr = rproc_elf_get_boot_addr;
+ }
mutex_init(&rproc->lock);