Re: [PATCHv2 04/10] remoteproc: Parse ELF file to find resourcetable address

From: Ido Yariv
Date: Sun Feb 24 2013 - 11:21:43 EST


Hi Sjur,

On Thu, Feb 21, 2013 at 06:15:34PM +0100, sjur.brandeland@xxxxxxxxxxxxxx wrote:
> From: Sjur Brændeland <sjur.brandeland@xxxxxxxxxxxxxx>
>
> Add function find_rsc_table_va to firmware ops. This function
> returns the location of the resource table in shared memory
> after loading.
>
> Signed-off-by: Sjur Brændeland <sjur.brandeland@xxxxxxxxxxxxxx>
> ---
> drivers/remoteproc/remoteproc_elf_loader.c | 17 ++++++++++++++++-
> drivers/remoteproc/remoteproc_internal.h | 13 +++++++++++++
> 2 files changed, 29 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c
> index ed12c16..3d6ec76 100644
> --- a/drivers/remoteproc/remoteproc_elf_loader.c
> +++ b/drivers/remoteproc/remoteproc_elf_loader.c
> @@ -304,9 +304,24 @@ rproc_elf_find_rsc_table(struct rproc *rproc, const struct firmware *fw,
> return table;
> }
>
> +static struct resource_table *rproc_elf_get_rsctab_va(struct rproc *rproc,
> + const struct firmware *fw)
> +{
> + struct elf32_shdr *shdr;
> +
> + shdr = find_rsc_shdr(&rproc->dev, (struct elf32_hdr *)fw->data,
> + fw->size);
> + if (!shdr)
> + return NULL;
> +
> + /* Find resource table in loaded segments */
> + return rproc_da_to_va(rproc, shdr->sh_addr, shdr->sh_size);
> +}
> +
> const struct rproc_fw_ops rproc_elf_fw_ops = {
> .load = rproc_elf_load_segments,
> .find_rsc_table = rproc_elf_find_rsc_table,
> .sanity_check = rproc_elf_sanity_check,
> - .get_boot_addr = rproc_elf_get_boot_addr
> + .get_boot_addr = rproc_elf_get_boot_addr,
> + .get_rsctab_va = rproc_elf_get_rsctab_addr

There's a typo here, fixed in the next patch instead of this one, which
will break bisect.

Other than that this patch set looks good. This issue can be fixed when
the patches are merged, so I don't think there's a need to resend
another revision.

Thanks,
Ido.
--
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/