Messages in this thread | | | From | Ohad Ben-Cohen <> | Date | Sun, 3 Jun 2012 16:36:46 +0300 | Subject | Re: [RFC 5/6] remoteproc: Support custom firmware handlers |
| |
On Tue, May 22, 2012 at 4:26 PM, <sjur.brandeland@stericsson.com> wrote: > From: Sjur Brændeland <sjur.brandeland@stericsson.com> > > Make the firmware handling customizable by creating > a rproc_fw_ops structure. Expose the existing > Elf firmware handling in rproc_elf_fw_ops. > > Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> .. > @@ -171,6 +171,7 @@ static struct rproc_ops omap_rproc_ops = { > .start = omap_rproc_start, > .stop = omap_rproc_stop, > .kick = omap_rproc_kick, > + .fw = &rproc_elf_fw_ops > };
Can we instead make these ops dynamically assigned, without mandating them in the low level driver ?
E.g. with ELF it's easy (first four bytes of the binary), but I'm not sure how feasible it is with proprietary binary formats (such as yours).
> @@ -781,12 +780,13 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) > { > struct device *dev = rproc->dev; > const char *name = rproc->firmware; > - struct elf32_hdr *ehdr; > struct resource_table *table; > int ret, tablesz; > > - ehdr = (struct elf32_hdr *)fw->data; > - > + if (!rproc->ops->fw_ops || !try_module_get(rproc->ops->fw_ops->owner)) {
I'm not sure we need loaders' ops to be full-fledged modules of their own. For simplicity, we might just have them statically linked with the remoteproc module.
> /* look for the resource table */ > - table = rproc_find_rsc_table(rproc, fw, &tablesz); > + table = rproc->ops->fw_ops->find_rsc_table(rproc, fw, &tablesz);
Might be easier on the eyes if we turn rproc_find_rsc_table() (and friends) into static inline "macros" which does all this de-referencing.
Thanks, Ohad. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |