]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
[new uImage] Rename and move print_image_hdr() routine
authorMarian Balakowicz <m8@semihalf.com>
Thu, 21 Feb 2008 16:27:41 +0000 (17:27 +0100)
committerMarian Balakowicz <m8@semihalf.com>
Thu, 21 Feb 2008 16:27:41 +0000 (17:27 +0100)
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
13 files changed:
board/mpl/common/common_util.c
common/cmd_bootm.c
common/cmd_doc.c
common/cmd_fdc.c
common/cmd_ide.c
common/cmd_nand.c
common/cmd_scsi.c
common/cmd_usb.c
common/cmd_ximg.c
common/image.c
include/common.h
include/image.h
lib_ppc/bootm.c

index 30c6ca9e30084bde6a8bb68a197ba7c1866534e7..b171ca51736b427f5102dcca68b7dd62da3081f9 100644 (file)
@@ -185,7 +185,7 @@ mpl_prg_image(uchar *ld_addr)
                puts("Bad Magic Number\n");
                return 1;
        }
-       print_image_hdr(hdr);
+       image_print_contents (hdr);
        if (!image_check_os (hdr, IH_OS_U_BOOT)) {
                puts("No U-Boot Image\n");
                return 1;
index ebb6b69f4d11c84e8af56959eeacd80a55addb78..bb60a840ecf83f75bc44a37f6b73f9fc48e33a64 100644 (file)
 #include <environment.h>
 #include <asm/byteorder.h>
 
-#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
-#include <rtc.h>
-#endif
-
 #ifdef CFG_HUSH_PARSER
 #include <hush.h>
 #endif
@@ -69,7 +65,6 @@ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 static void fixup_silent_linux (void);
 #endif
 
-static void print_type (image_header_t *hdr);
 static image_header_t *get_kernel (cmd_tbl_t *cmdtp, int flag,
                int argc, char *argv[], int verify,
                ulong *os_data, ulong *os_len);
@@ -318,7 +313,7 @@ static image_header_t *get_kernel (cmd_tbl_t *cmdtp, int flag,
        }
 
        show_boot_progress (3);
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 
        if (verify) {
                puts ("   Verifying Checksum ... ");
@@ -445,7 +440,7 @@ static int image_info (ulong addr)
                return 1;
        }
 
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 
        puts ("   Verifying Checksum ... ");
        if (!image_check_dcrc (hdr)) {
@@ -493,7 +488,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                goto next_sector;
 
                        printf ("Image at %08lX:\n", (ulong)hdr);
-                       print_image_hdr (hdr);
+                       image_print_contents (hdr);
 
                        puts ("   Verifying Checksum ... ");
                        if (!image_check_dcrc (hdr)) {
@@ -521,56 +516,6 @@ U_BOOT_CMD(
 /*******************************************************************/
 /* helper routines */
 /*******************************************************************/
-void print_image_hdr (image_header_t *hdr)
-{
-#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
-       time_t timestamp = (time_t)image_get_time (hdr);
-       struct rtc_time tm;
-#endif
-
-       printf ("   Image Name:   %.*s\n", IH_NMLEN, image_get_name (hdr));
-
-#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
-       to_tm (timestamp, &tm);
-       printf ("   Created:      %4d-%02d-%02d  %2d:%02d:%02d UTC\n",
-               tm.tm_year, tm.tm_mon, tm.tm_mday,
-               tm.tm_hour, tm.tm_min, tm.tm_sec);
-#endif
-       puts ("   Image Type:   ");
-       print_type (hdr);
-
-       printf ("\n   Data Size:    %d Bytes = ", image_get_data_size (hdr));
-       print_size (image_get_data_size (hdr), "\n");
-       printf ("   Load Address: %08x\n"
-               "   Entry Point:  %08x\n",
-                image_get_load (hdr), image_get_ep (hdr));
-
-       if (image_check_type (hdr, IH_TYPE_MULTI)) {
-               int i;
-               ulong data, len;
-               ulong count = image_multi_count (hdr);
-
-               puts ("   Contents:\n");
-               for (i = 0; i < count; i++) {
-                       image_multi_getimg (hdr, i, &data, &len);
-                       printf ("   Image %d: %8ld Bytes = ", i, len);
-                       print_size (len, "\n");
-               }
-       }
-}
-
-static void print_type (image_header_t *hdr)
-{
-       const char *os, *arch, *type, *comp;
-
-       os = image_get_os_name (image_get_os (hdr));
-       arch = image_get_arch_name (image_get_arch (hdr));
-       type = image_get_type_name (image_get_type (hdr));
-       comp = image_get_comp_name (image_get_comp (hdr));
-
-       printf ("%s %s %s (%s)", arch, os, type, comp);
-}
-
 #ifdef CONFIG_SILENT_CONSOLE
 static void fixup_silent_linux ()
 {
index b20a2e1d9dfc60a3a269e40922c4063f9d6e9b40..70bbd31ddee29ab2e4a5b20ca4ee7a9a84c2ae4b 100644 (file)
@@ -265,7 +265,7 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if (image_check_magic (hdr)) {
 
-               print_image_hdr (hdr);
+               image_print_contents (hdr);
 
                cnt = image_get_image_size (hdr);
                cnt -= SECTORSIZE;
index 3b8f80b64da2049b9e0ba8f94491a8d7c42482e8..c97abfb58ec7a23cb7d136f88498d943cde8d997 100644 (file)
@@ -840,7 +840,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                printf ("Bad Magic Number\n");
                return 1;
        }
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 
        imsize= image_get_image_size (hdr);
        nrofblk=imsize/512;
index bcd132554629acb7f601e06835cf3cf0a6535460..a3966435d65f07ed51667533e416ba42e405ee1c 100644 (file)
@@ -462,7 +462,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (50);
 
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 
        cnt = image_get_image_size (hdr);
        cnt += info.blksz - 1;
index bfa39d7ccee3f6bcdca4c4c4a3ce7961551c1c52..7fd6667a7eba891327ec82c9a84aec077b0ecf50 100644 (file)
@@ -521,7 +521,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
        }
        show_boot_progress (57);
 
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 
        cnt = image_get_image_size (hdr);
        if (jffs2) {
@@ -984,7 +984,7 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if (image_check_magic (hdr)) {
 
-               print_image_hdr (hdr);
+               image_print_contents (hdr);
 
                cnt = image_get_image_size (hdr);
                cnt -= SECTORSIZE;
index c2b27a5457f84993d397ebb721010dc2242f271d..5aae7ece5ebfe6c649c7f9abf949579f1e215383 100644 (file)
@@ -285,7 +285,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
        cnt = image_get_image_size (hdr);
        cnt += info.blksz - 1;
        cnt /= info.blksz;
index db2e75466b9097ac870fc55b5423f83f471d2eab..2d7a85a0848173ec28e418aab92fbbfb8472c3ad 100644 (file)
@@ -398,7 +398,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 
        cnt = image_get_image_size (hdr);
        cnt += info.blksz - 1;
index ab579cd2c831ce35353087644caceb9945881824..7d83dc35bc89afd48712509ea928a26a74f08021 100644 (file)
@@ -70,7 +70,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 #ifdef DEBUG
-       print_image_hdr (hdr);
+       image_print_contents (hdr);
 #endif
 
        if (!image_check_type (hdr, IH_TYPE_MULTI)) {
index 736232867165d8d8578d2456066b1e7f4b5b76ed..690e0af6cb83dc95a474600628b58453ba6be092 100644 (file)
 #include <logbuff.h>
 #endif
 
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
+#include <rtc.h>
+#endif
+
 #if defined(CONFIG_FIT)
 #include <fdt.h>
 #include <libfdt.h>
@@ -310,6 +314,56 @@ const char* image_get_comp_name (uint8_t comp)
        return name;
 }
 
+static void image_print_type (image_header_t *hdr)
+{
+       const char *os, *arch, *type, *comp;
+
+       os = image_get_os_name (image_get_os (hdr));
+       arch = image_get_arch_name (image_get_arch (hdr));
+       type = image_get_type_name (image_get_type (hdr));
+       comp = image_get_comp_name (image_get_comp (hdr));
+
+       printf ("%s %s %s (%s)", arch, os, type, comp);
+}
+
+void image_print_contents (image_header_t *hdr)
+{
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
+       time_t timestamp = (time_t)image_get_time (hdr);
+       struct rtc_time tm;
+#endif
+
+       printf ("   Image Name:   %.*s\n", IH_NMLEN, image_get_name (hdr));
+
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
+       to_tm (timestamp, &tm);
+       printf ("   Created:      %4d-%02d-%02d  %2d:%02d:%02d UTC\n",
+               tm.tm_year, tm.tm_mon, tm.tm_mday,
+               tm.tm_hour, tm.tm_min, tm.tm_sec);
+#endif
+       puts ("   Image Type:   ");
+       image_print_type (hdr);
+
+       printf ("\n   Data Size:    %d Bytes = ", image_get_data_size (hdr));
+       print_size (image_get_data_size (hdr), "\n");
+       printf ("   Load Address: %08x\n"
+               "   Entry Point:  %08x\n",
+                image_get_load (hdr), image_get_ep (hdr));
+
+       if (image_check_type (hdr, IH_TYPE_MULTI)) {
+               int i;
+               ulong data, len;
+               ulong count = image_multi_count (hdr);
+
+               puts ("   Contents:\n");
+               for (i = 0; i < count; i++) {
+                       image_multi_getimg (hdr, i, &data, &len);
+                       printf ("   Image %d: %8ld Bytes = ", i, len);
+                       print_size (len, "\n");
+               }
+       }
+}
+
 /**
  * gen_image_get_format - get image format type
  * @img_addr: image start address
@@ -454,7 +508,7 @@ image_header_t* image_get_ramdisk (cmd_tbl_t *cmdtp, int flag,
        }
 
        show_boot_progress (10);
-       print_image_hdr (rd_hdr);
+       image_print_contents (rd_hdr);
 
        if (verify) {
                puts("   Verifying Checksum ... ");
index cd8aad090c7c80a0f548c1ad691aa04173662a88..3f05b5e4669d216c1a5698f21d33b1317bbf9ae8 100644 (file)
@@ -224,9 +224,6 @@ void flash_perror (int);
 /* common/cmd_autoscript.c */
 int    autoscript (ulong addr);
 
-/* common/cmd_bootm.c */
-void   print_image_hdr (image_header_t *hdr);
-
 extern ulong load_addr;                /* Default Load Address */
 
 /* common/cmd_nvedit.c */
index 49236124c3d0b3a1209bf371895388518aecaae8..502d35a3ef2afc3958af4ac27c619c8a884519ba 100644 (file)
@@ -342,6 +342,7 @@ const char* image_get_os_name (uint8_t os);
 const char* image_get_arch_name (uint8_t arch);
 const char* image_get_type_name (uint8_t type);
 const char* image_get_comp_name (uint8_t comp);
+void image_print_contents (image_header_t *hdr);
 
 #define IMAGE_FORMAT_INVALID   0x00
 #define IMAGE_FORMAT_LEGACY    0x01
index 04a9665a9ac053f34cc697baf6239cc81493901a..d2ee3dc5cca207f0296c11e30a130d972e32fdd1 100644 (file)
@@ -254,7 +254,7 @@ static ulong get_fdt (ulong alloc_current,
                        printf ("## Flattened Device Tree Image at %08lx\n",
                                        fdt_hdr);
 
-                       print_image_hdr (fdt_hdr);
+                       image_print_contents (fdt_hdr);
 
                        image_start = (ulong)fdt_hdr;
                        image_end = image_get_image_end (fdt_hdr);