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;
#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
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);
}
show_boot_progress (3);
- print_image_hdr (hdr);
+ image_print_contents (hdr);
if (verify) {
puts (" Verifying Checksum ... ");
return 1;
}
- print_image_hdr (hdr);
+ image_print_contents (hdr);
puts (" Verifying Checksum ... ");
if (!image_check_dcrc (hdr)) {
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)) {
/*******************************************************************/
/* 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 ()
{
if (image_check_magic (hdr)) {
- print_image_hdr (hdr);
+ image_print_contents (hdr);
cnt = image_get_image_size (hdr);
cnt -= SECTORSIZE;
printf ("Bad Magic Number\n");
return 1;
}
- print_image_hdr (hdr);
+ image_print_contents (hdr);
imsize= image_get_image_size (hdr);
nrofblk=imsize/512;
}
show_boot_progress (50);
- print_image_hdr (hdr);
+ image_print_contents (hdr);
cnt = image_get_image_size (hdr);
cnt += info.blksz - 1;
}
show_boot_progress (57);
- print_image_hdr (hdr);
+ image_print_contents (hdr);
cnt = image_get_image_size (hdr);
if (jffs2) {
if (image_check_magic (hdr)) {
- print_image_hdr (hdr);
+ image_print_contents (hdr);
cnt = image_get_image_size (hdr);
cnt -= SECTORSIZE;
return 1;
}
- print_image_hdr (hdr);
+ image_print_contents (hdr);
cnt = image_get_image_size (hdr);
cnt += info.blksz - 1;
cnt /= info.blksz;
return 1;
}
- print_image_hdr (hdr);
+ image_print_contents (hdr);
cnt = image_get_image_size (hdr);
cnt += info.blksz - 1;
return 1;
}
#ifdef DEBUG
- print_image_hdr (hdr);
+ image_print_contents (hdr);
#endif
if (!image_check_type (hdr, IH_TYPE_MULTI)) {
#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>
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
}
show_boot_progress (10);
- print_image_hdr (rd_hdr);
+ image_print_contents (rd_hdr);
if (verify) {
puts(" Verifying Checksum ... ");
/* 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 */
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
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);