mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-13 20:36:02 +01:00
cmd: fpga: Convert to use fit_get_data_node
This converts the FIT loading process of the fpga command to use fit_get_data_node. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
bdbdaede67
commit
7b42bde075
24
cmd/fpga.c
24
cmd/fpga.c
@ -322,7 +322,7 @@ static int do_fpga_loadmk(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
case IMAGE_FORMAT_FIT:
|
case IMAGE_FORMAT_FIT:
|
||||||
{
|
{
|
||||||
const void *fit_hdr = (const void *)fpga_data;
|
const void *fit_hdr = (const void *)fpga_data;
|
||||||
int noffset;
|
int err;
|
||||||
const void *fit_data;
|
const void *fit_data;
|
||||||
|
|
||||||
if (!fit_uname) {
|
if (!fit_uname) {
|
||||||
@ -335,23 +335,11 @@ static int do_fpga_loadmk(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get fpga component image node offset */
|
err = fit_get_data_node(fit_hdr, fit_uname, &fit_data,
|
||||||
noffset = fit_image_get_node(fit_hdr, fit_uname);
|
&data_size);
|
||||||
if (noffset < 0) {
|
if (err) {
|
||||||
printf("Can't find '%s' FIT subimage\n", fit_uname);
|
printf("Could not load '%s' subimage (err %d)\n",
|
||||||
return CMD_RET_FAILURE;
|
fit_uname, err);
|
||||||
}
|
|
||||||
|
|
||||||
/* verify integrity */
|
|
||||||
if (!fit_image_verify(fit_hdr, noffset)) {
|
|
||||||
puts("Bad Data Hash\n");
|
|
||||||
return CMD_RET_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get fpga subimage/external data address and length */
|
|
||||||
if (fit_image_get_data_and_size(fit_hdr, noffset,
|
|
||||||
&fit_data, &data_size)) {
|
|
||||||
puts("Fpga subimage data not found\n");
|
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user