[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK=WgbaOZn8K4FberD8gt5+eB1=EwjPhngArwif8u3L5Qqw=3A@mail.gmail.com>
Date: Sun, 3 Jun 2012 16:36:46 +0300
From: Ohad Ben-Cohen <ohad@...ery.com>
To: sjur.brandeland@...ricsson.com
Cc: Loic PALLARDY <loic.pallardy@...ricsson.com>,
Ludovic BARRE <ludovic.barre@...ricsson.com>,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Linus Walleij <linus.walleij@...aro.org>,
Sjur Brændeland <sjurbren@...il.com>
Subject: Re: [RFC 5/6] remoteproc: Support custom firmware handlers
On Tue, May 22, 2012 at 4:26 PM, <sjur.brandeland@...ricsson.com> wrote:
> From: Sjur Brændeland <sjur.brandeland@...ricsson.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@...ricsson.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists