Skip to content

Commit c1d35c1

Browse files
committed
remoteproc: Rename "load_rsc_table" to "parse_fw"
The resource table is just one possible source of information that can be extracted from the firmware file. Generalize this interface to allow drivers to override this with parsers of other types of information. Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 2666ca9 commit c1d35c1

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

drivers/remoteproc/remoteproc_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
944944

945945
rproc->bootaddr = rproc_get_boot_addr(rproc, fw);
946946

947-
/* load resource table */
948-
ret = rproc_load_rsc_table(rproc, fw);
947+
/* Load resource table, core dump segment list etc from the firmware */
948+
ret = rproc_parse_fw(rproc, fw);
949949
if (ret)
950950
goto disable_iommu;
951951

@@ -1555,7 +1555,7 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
15551555
/* Default to ELF loader if no load function is specified */
15561556
if (!rproc->ops->load) {
15571557
rproc->ops->load = rproc_elf_load_segments;
1558-
rproc->ops->load_rsc_table = rproc_elf_load_rsc_table;
1558+
rproc->ops->parse_fw = rproc_elf_load_rsc_table;
15591559
rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table;
15601560
rproc->ops->sanity_check = rproc_elf_sanity_check;
15611561
rproc->ops->get_boot_addr = rproc_elf_get_boot_addr;

drivers/remoteproc/remoteproc_internal.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ int rproc_load_segments(struct rproc *rproc, const struct firmware *fw)
8888
return -EINVAL;
8989
}
9090

91-
static inline int rproc_load_rsc_table(struct rproc *rproc,
92-
const struct firmware *fw)
91+
static inline int rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
9392
{
94-
if (rproc->ops->load_rsc_table)
95-
return rproc->ops->load_rsc_table(rproc, fw);
93+
if (rproc->ops->parse_fw)
94+
return rproc->ops->parse_fw(rproc, fw);
9695

9796
return 0;
9897
}

include/linux/remoteproc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ struct rproc_ops {
344344
int (*stop)(struct rproc *rproc);
345345
void (*kick)(struct rproc *rproc, int vqid);
346346
void * (*da_to_va)(struct rproc *rproc, u64 da, int len);
347-
int (*load_rsc_table)(struct rproc *rproc, const struct firmware *fw);
347+
int (*parse_fw)(struct rproc *rproc, const struct firmware *fw);
348348
struct resource_table *(*find_loaded_rsc_table)(
349349
struct rproc *rproc, const struct firmware *fw);
350350
int (*load)(struct rproc *rproc, const struct firmware *fw);

0 commit comments

Comments
 (0)