From b97a2a0a21f279d66de8a9bdbfe21920968bcb1c Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Tue, 8 Jan 2008 18:14:09 +0100 Subject: [new uImage] Define a API for image handling operations - Add inline helper macros for basic header processing - Move common non inline code common/image.c - Replace direct header access with the API routines - Rename IH_CPU_* to IH_ARCH_* Signed-off-by: Marian Balakowicz --- common/cmd_fpga.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/cmd_fpga.c') diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index f55447ab1..4030d04f8 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -221,13 +221,13 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) image_header_t *hdr = &header; ulong data; - memmove (&header, (char *)fpga_data, sizeof(image_header_t)); - if (ntohl(hdr->ih_magic) != IH_MAGIC) { + memmove (&header, (char *)fpga_data, image_get_header_size ()); + if (!image_check_magic (hdr)) { puts ("Bad Magic Number\n"); return 1; } - data = ((ulong)fpga_data + sizeof(image_header_t)); - data_size = ntohl(hdr->ih_size); + data = ((ulong)fpga_data + image_get_header_size ()); + data_size = image_get_data_size (hdr); rc = fpga_load (dev, (void *)data, data_size); } break; -- cgit v1.2.3