diff options
author | Marian Balakowicz <m8@semihalf.com> | 2008-01-08 18:14:09 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-02-07 01:12:53 +0100 |
commit | b97a2a0a21f279d66de8a9bdbfe21920968bcb1c (patch) | |
tree | 7746eae37d3a468f3471cd303156920637445350 /common/cmd_nand.c | |
parent | ed29bc4e8142b46b626f67524207b36e43d9aad6 (diff) | |
download | u-boot-imx-b97a2a0a21f279d66de8a9bdbfe21920968bcb1c.zip u-boot-imx-b97a2a0a21f279d66de8a9bdbfe21920968bcb1c.tar.gz u-boot-imx-b97a2a0a21f279d66de8a9bdbfe21920968bcb1c.tar.bz2 |
[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 <m8@semihalf.com>
Diffstat (limited to 'common/cmd_nand.c')
-rw-r--r-- | common/cmd_nand.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 8d6c959..bfa39d7 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -514,16 +514,16 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, hdr = (image_header_t *) addr; - if (ntohl(hdr->ih_magic) != IH_MAGIC) { - printf("\n** Bad Magic Number 0x%x **\n", hdr->ih_magic); + if (!image_check_magic (hdr)) { + printf("\n** Bad Magic Number 0x%x **\n", image_get_magic (hdr)); show_boot_progress (-57); return 1; } show_boot_progress (57); - print_image_hdr(hdr); + print_image_hdr (hdr); - cnt = (ntohl(hdr->ih_size) + sizeof (image_header_t)); + cnt = image_get_image_size (hdr); if (jffs2) { nand_read_options_t opts; memset(&opts, 0, sizeof(opts)); @@ -982,14 +982,14 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) hdr = (image_header_t *)addr; - if (ntohl(hdr->ih_magic) == IH_MAGIC) { + if (image_check_magic (hdr)) { print_image_hdr (hdr); - cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t)); + cnt = image_get_image_size (hdr); cnt -= SECTORSIZE; } else { - printf ("\n** Bad Magic Number 0x%x **\n", ntohl(hdr->ih_magic)); + printf ("\n** Bad Magic Number 0x%x **\n", image_get_magic (hdr)); show_boot_progress (-57); return 1; } |