Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318905
b: refs/heads/master
c: 3e5f9eb
h: refs/heads/master
i:
  318903: 59de528
v: v3
  • Loading branch information
Sjur Brændeland authored and Ohad Ben-Cohen committed Jul 15, 2012
1 parent 6703e16 commit 258beea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd48498487735a01abc68edb76e3d86393e096e1
refs/heads/master: 3e5f9eb5d91e430ca908a61615f9a89c189a0d4e
28 changes: 19 additions & 9 deletions trunk/drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,23 +998,38 @@ static int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw)
return 0;
}

/**
* rproc_get_boot_addr() - Get rproc's boot address.
* @rproc: the remote processor handle
* @fw: the ELF firmware image
*
* This function returns the entry point address of the ELF
* image.
*
* Note that the boot address is not a configurable property of all remote
* processors. Some will always boot at a specific hard-coded address.
*/
u32 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
{
struct elf32_hdr *ehdr = (struct elf32_hdr *)fw->data;

return ehdr->e_entry;
}

/*
* take a firmware and boot a remote processor with it.
*/
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;

ret = rproc_fw_sanity_check(rproc, fw);
if (ret)
return ret;

ehdr = (struct elf32_hdr *)fw->data;

dev_info(dev, "Booting fw image %s, size %d\n", name, fw->size);

/*
Expand All @@ -1027,12 +1042,7 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
return ret;
}

/*
* The ELF entry point is the rproc's boot addr (though this is not
* a configurable property of all remote processors: some will always
* boot at a specific hardcoded address).
*/
rproc->bootaddr = ehdr->e_entry;
rproc->bootaddr = rproc_get_boot_addr(rproc, fw);

/* look for the resource table */
table = rproc_find_rsc_table(rproc, fw, &tablesz);
Expand Down

0 comments on commit 258beea

Please sign in to comment.