summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/st_slim_rproc.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/st_slim_rproc.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/st_slim_rproc.c')
-rw-r--r--drivers/remoteproc/st_slim_rproc.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c
index 6cfd862f945b..1bce63a06424 100644
--- a/drivers/remoteproc/st_slim_rproc.c
+++ b/drivers/remoteproc/st_slim_rproc.c
@@ -200,12 +200,6 @@ static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, int len)
return va;
}
-static const struct rproc_ops slim_rproc_ops = {
- .start = slim_rproc_start,
- .stop = slim_rproc_stop,
- .da_to_va = slim_rproc_da_to_va,
-};
-
/*
* Firmware handler operations: sanity, boot address, load ...
*/
@@ -223,8 +217,14 @@ static struct resource_table *slim_rproc_find_rsc_table(struct rproc *rproc,
return &empty_rsc_tbl;
}
-static struct rproc_fw_ops slim_rproc_fw_ops = {
+static const struct rproc_ops slim_rproc_ops = {
+ .start = slim_rproc_start,
+ .stop = slim_rproc_stop,
+ .da_to_va = slim_rproc_da_to_va,
.find_rsc_table = slim_rproc_find_rsc_table,
+ .get_boot_addr = rproc_elf_get_boot_addr,
+ .load = rproc_elf_load_segments,
+ .sanity_check = rproc_elf_sanity_check,
};
/**
@@ -249,7 +249,6 @@ struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,
struct rproc *rproc;
struct resource *res;
int err, i;
- const struct rproc_fw_ops *elf_ops;
if (!fw_name)
return ERR_PTR(-EINVAL);
@@ -267,13 +266,6 @@ struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,
slim_rproc = rproc->priv;
slim_rproc->rproc = rproc;
- elf_ops = rproc->fw_ops;
- /* Use some generic elf ops */
- slim_rproc_fw_ops.load = elf_ops->load;
- slim_rproc_fw_ops.sanity_check = elf_ops->sanity_check;
-
- rproc->fw_ops = &slim_rproc_fw_ops;
-
/* get imem and dmem */
for (i = 0; i < ARRAY_SIZE(mem_names); i++) {
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,