Re: [PATCH 7/7] remoteproc: Add custom STE-modem firmware loader.

From: Sjur BrÃndeland
Date: Mon Jun 11 2012 - 05:55:42 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/