[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJK669a-O-Ee9ex4fiZ14Q18eJB_MM408yDnjNArtF_PN9aQ2A@mail.gmail.com>
Date: Mon, 11 Jun 2012 11:55:45 +0200
From: Sjur Brændeland <sjur.brandeland@...ricsson.com>
To: Ohad Ben-Cohen <ohad@...ery.com>
Cc: Loic PALLARDY <loic.pallardy@...ricsson.com>,
Ludovic BARRE <ludovic.barre@...ricsson.com>,
linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH 7/7] remoteproc: Add custom STE-modem firmware loader.
Hi Ohad,
>> +struct rproc_fw_ops rproc_ste_modem_fw_ops = {
>> + .load = ste_load_segments,
>> + .find_rsc_table = ste_find_rsc_table
>> +};
>> +EXPORT_SYMBOL(rproc_ste_modem_fw_ops);
...
> I'm just still not sure we want to publicly export those fw_ops
> symbols throughout the kernel.
>
>
> Alternatively, we can do something like how i2c algos are determined:
> expose a rproc_set_ste_modem_fw() function, which takes an rproc
> struct, and then sets the fw_ops to rproc_ste_modem_fw_ops. Then call
> it from your driver after rproc_alloc() but before rproc_register().
>
> This way only statically-format-imposing drivers will call those
> functions, and all others, who use generic and detectable formats,
> will just follow the current registration scheme (so no extra param
> needed to rproc_alloc either). In the long term those generic formats
> will be dynamically detected, but meanwhile, we can just set ELF as
> the default.
>
> What do you think?
How about this:
In rproc_alloc, we set the rproc_elf_fw_ops as default, and we add a function:
void rproc_set_fw_ops(struct rproc *rproc, const struct rproc_fw_ops *fw_ops)
{
rproc->fw_ops = fw_ops;
}
EXPORT_SYMBOL(rproc_set_fw_ops);
allowing the ste_modem_driver to override the default ELF-firmware handler.
Then the file remoteproc_elf_loader.c containing rproc_elf_fw_ops is
default fw_ops
and is contained remoteproc.ko.
The ste_modem_fw_ops will be linked together with the ste_modem_rproc module,
and none of the fw_ops needs to be exported as symbols globally.
Regards,
Sjur
--
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