1 // SPDX-License-Identifier: GPL-2.0+
3 * Image code used by boards (and not host tools)
5 * (C) Copyright 2008 Semihalf
7 * (C) Copyright 2000-2006
8 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
12 #include <bootstage.h>
21 #include <asm/cache.h>
22 #include <asm/global_data.h>
24 #ifndef CONFIG_SYS_BARGSIZE
25 #define CONFIG_SYS_BARGSIZE 512
28 DECLARE_GLOBAL_DATA_PTR;
31 * image_get_ramdisk - get and verify ramdisk image
32 * @rd_addr: ramdisk image start address
33 * @arch: expected ramdisk architecture
34 * @verify: checksum verification flag
36 * image_get_ramdisk() returns a pointer to the verified ramdisk image
37 * header. Routine receives image start address and expected architecture
38 * flag. Verification done covers data and header integrity and os/type/arch
42 * pointer to a ramdisk image header, if image was found and valid
43 * otherwise, return NULL
45 static const image_header_t *image_get_ramdisk(ulong rd_addr, u8 arch,
48 const image_header_t *rd_hdr = (const image_header_t *)rd_addr;
50 if (!image_check_magic(rd_hdr)) {
51 puts("Bad Magic Number\n");
52 bootstage_error(BOOTSTAGE_ID_RD_MAGIC);
56 if (!image_check_hcrc(rd_hdr)) {
57 puts("Bad Header Checksum\n");
58 bootstage_error(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
62 bootstage_mark(BOOTSTAGE_ID_RD_MAGIC);
63 image_print_contents(rd_hdr);
66 puts(" Verifying Checksum ... ");
67 if (!image_check_dcrc(rd_hdr)) {
68 puts("Bad Data CRC\n");
69 bootstage_error(BOOTSTAGE_ID_RD_CHECKSUM);
75 bootstage_mark(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
77 if (!image_check_os(rd_hdr, IH_OS_LINUX) ||
78 !image_check_arch(rd_hdr, arch) ||
79 !image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
80 printf("No Linux %s Ramdisk Image\n",
81 genimg_get_arch_name(arch));
82 bootstage_error(BOOTSTAGE_ID_RAMDISK);
89 /*****************************************************************************/
90 /* Shared dual-format routines */
91 /*****************************************************************************/
92 ulong image_load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */
93 ulong image_save_addr; /* Default Save Address */
94 ulong image_save_size; /* Default Save Size (in bytes) */
96 static int on_loadaddr(const char *name, const char *value, enum env_op op,
101 case env_op_overwrite:
102 image_load_addr = hextoul(value, NULL);
110 U_BOOT_ENV_CALLBACK(loadaddr, on_loadaddr);
112 ulong env_get_bootm_low(void)
114 char *s = env_get("bootm_low");
117 ulong tmp = hextoul(s, NULL);
121 #if defined(CONFIG_SYS_SDRAM_BASE)
122 return CONFIG_SYS_SDRAM_BASE;
123 #elif defined(CONFIG_ARM) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_RISCV)
124 return gd->bd->bi_dram[0].start;
130 phys_size_t env_get_bootm_size(void)
132 phys_size_t tmp, size;
134 char *s = env_get("bootm_size");
137 tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
141 start = gd->ram_base;
144 if (start + size > gd->ram_top)
145 size = gd->ram_top - start;
147 s = env_get("bootm_low");
149 tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
153 return size - (tmp - start);
156 phys_size_t env_get_bootm_mapsize(void)
159 char *s = env_get("bootm_mapsize");
162 tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
166 #if defined(CONFIG_SYS_BOOTMAPSZ)
167 return CONFIG_SYS_BOOTMAPSZ;
169 return env_get_bootm_size();
173 void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
178 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
184 size_t tail = (len > chunksz) ? chunksz : len;
191 memmove(to, from, tail);
198 #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
199 memmove(to, from, len);
200 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
204 * genimg_get_kernel_addr_fit - get the real kernel address and return 2
206 * @img_addr: a string might contain real image address
207 * @fit_uname_config: double pointer to a char, will hold pointer to a
208 * configuration unit name
209 * @fit_uname_kernel: double pointer to a char, will hold pointer to a subimage
212 * genimg_get_kernel_addr_fit get the real kernel start address from a string
213 * which is normally the first argv of bootm/bootz
216 * kernel start address
218 ulong genimg_get_kernel_addr_fit(char * const img_addr,
219 const char **fit_uname_config,
220 const char **fit_uname_kernel)
224 /* find out kernel image address */
226 kernel_addr = image_load_addr;
227 debug("* kernel: default image load address = 0x%08lx\n",
229 } else if (CONFIG_IS_ENABLED(FIT) &&
230 fit_parse_conf(img_addr, image_load_addr, &kernel_addr,
232 debug("* kernel: config '%s' from image at 0x%08lx\n",
233 *fit_uname_config, kernel_addr);
234 } else if (CONFIG_IS_ENABLED(FIT) &&
235 fit_parse_subimage(img_addr, image_load_addr, &kernel_addr,
237 debug("* kernel: subimage '%s' from image at 0x%08lx\n",
238 *fit_uname_kernel, kernel_addr);
240 kernel_addr = hextoul(img_addr, NULL);
241 debug("* kernel: cmdline image address = 0x%08lx\n",
249 * genimg_get_kernel_addr() is the simple version of
250 * genimg_get_kernel_addr_fit(). It ignores those return FIT strings
252 ulong genimg_get_kernel_addr(char * const img_addr)
254 const char *fit_uname_config = NULL;
255 const char *fit_uname_kernel = NULL;
257 return genimg_get_kernel_addr_fit(img_addr, &fit_uname_config,
262 * genimg_get_format - get image format type
263 * @img_addr: image start address
265 * genimg_get_format() checks whether provided address points to a valid
266 * legacy or FIT image.
268 * New uImage format and FDT blob are based on a libfdt. FDT blob
269 * may be passed directly or embedded in a FIT image. In both situations
270 * genimg_get_format() must be able to dectect libfdt header.
273 * image format type or IMAGE_FORMAT_INVALID if no image is present
275 int genimg_get_format(const void *img_addr)
277 if (CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)) {
278 const image_header_t *hdr;
280 hdr = (const image_header_t *)img_addr;
281 if (image_check_magic(hdr))
282 return IMAGE_FORMAT_LEGACY;
284 if (CONFIG_IS_ENABLED(FIT) || CONFIG_IS_ENABLED(OF_LIBFDT)) {
285 if (!fdt_check_header(img_addr))
286 return IMAGE_FORMAT_FIT;
288 if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE) &&
289 !android_image_check_header(img_addr))
290 return IMAGE_FORMAT_ANDROID;
292 return IMAGE_FORMAT_INVALID;
296 * fit_has_config - check if there is a valid FIT configuration
297 * @images: pointer to the bootm command headers structure
299 * fit_has_config() checks if there is a FIT configuration in use
300 * (if FTI support is present).
303 * 0, no FIT support or no configuration found
304 * 1, configuration found
306 int genimg_has_config(bootm_headers_t *images)
308 if (CONFIG_IS_ENABLED(FIT) && images->fit_uname_cfg)
315 * select_ramdisk() - Select and locate the ramdisk to use
317 * @images: pointer to the bootm images structure
318 * @select: name of ramdisk to select, or NULL for any
319 * @arch: expected ramdisk architecture
320 * @rd_datap: pointer to a ulong variable, will hold ramdisk pointer
321 * @rd_lenp: pointer to a ulong variable, will hold ramdisk length
322 * @return 0 if OK, -ENOPKG if no ramdisk (but an error should not be reported),
323 * other -ve value on other error
325 static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
326 ulong *rd_datap, ulong *rd_lenp)
330 const char *fit_uname_config = images->fit_uname_cfg;
331 const char *fit_uname_ramdisk = NULL;
339 if (CONFIG_IS_ENABLED(FIT)) {
341 * If the init ramdisk comes from the FIT image and
342 * the FIT image address is omitted in the command
343 * line argument, try to use os FIT image address or
344 * default load address.
346 if (images->fit_uname_os)
347 default_addr = (ulong)images->fit_hdr_os;
349 default_addr = image_load_addr;
351 if (fit_parse_conf(select, default_addr, &rd_addr,
352 &fit_uname_config)) {
353 debug("* ramdisk: config '%s' from image at 0x%08lx\n",
354 fit_uname_config, rd_addr);
355 } else if (fit_parse_subimage(select, default_addr,
357 &fit_uname_ramdisk)) {
358 debug("* ramdisk: subimage '%s' from image at 0x%08lx\n",
359 fit_uname_ramdisk, rd_addr);
365 rd_addr = hextoul(select, NULL);
366 debug("* ramdisk: cmdline image address = 0x%08lx\n",
369 } else if (CONFIG_IS_ENABLED(FIT)) {
370 /* use FIT configuration provided in first bootm
371 * command argument. If the property is not defined,
372 * quit silently (with -ENOPKG )
374 rd_addr = map_to_sysmem(images->fit_hdr_os);
375 rd_noffset = fit_get_node_from_config(images, FIT_RAMDISK_PROP,
377 if (rd_noffset == -ENOENT)
379 else if (rd_noffset < 0)
384 * Check if there is an initrd image at the
385 * address provided in the second bootm argument
386 * check image type, for FIT images get FIT node.
388 buf = map_sysmem(rd_addr, 0);
390 switch (genimg_get_format(buf)) {
391 case IMAGE_FORMAT_LEGACY:
392 if (CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)) {
393 const image_header_t *rd_hdr;
395 printf("## Loading init Ramdisk from Legacy Image at %08lx ...\n",
398 bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK);
399 rd_hdr = image_get_ramdisk(rd_addr, arch, images->verify);
403 *rd_datap = image_get_data(rd_hdr);
404 *rd_lenp = image_get_data_size(rd_hdr);
408 case IMAGE_FORMAT_FIT:
409 if (CONFIG_IS_ENABLED(FIT)) {
410 rd_noffset = fit_image_load(images, rd_addr,
412 &fit_uname_config, arch,
414 BOOTSTAGE_ID_FIT_RD_START,
415 FIT_LOAD_OPTIONAL_NON_ZERO,
420 images->fit_hdr_rd = map_sysmem(rd_addr, 0);
421 images->fit_uname_rd = fit_uname_ramdisk;
422 images->fit_noffset_rd = rd_noffset;
426 case IMAGE_FORMAT_ANDROID:
427 if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) {
428 android_image_get_ramdisk((void *)images->os.start,
436 if (IS_ENABLED(CONFIG_SUPPORT_RAW_INITRD)) {
440 end = strchr(select, ':');
442 *rd_lenp = hextoul(++end, NULL);
449 puts("Wrong Ramdisk Image Format\n");
458 * boot_get_ramdisk - main ramdisk handling routine
459 * @argc: command argument count
460 * @argv: command argument list
461 * @images: pointer to the bootm images structure
462 * @arch: expected ramdisk architecture
463 * @rd_start: pointer to a ulong variable, will hold ramdisk start address
464 * @rd_end: pointer to a ulong variable, will hold ramdisk end
466 * boot_get_ramdisk() is responsible for finding a valid ramdisk image.
467 * Currently supported are the following ramdisk sources:
468 * - multicomponent kernel/ramdisk image,
469 * - commandline provided address of decicated ramdisk image.
472 * 0, if ramdisk image was found and valid, or skiped
473 * rd_start and rd_end are set to ramdisk start/end addresses if
474 * ramdisk image is found and valid
476 * 1, if ramdisk image is found but corrupted, or invalid
477 * rd_start and rd_end are set to 0 if no ramdisk exists
479 int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
480 u8 arch, ulong *rd_start, ulong *rd_end)
482 ulong rd_data, rd_len;
483 const char *select = NULL;
488 if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) {
491 /* Look for an Android boot image */
492 buf = map_sysmem(images->os.start, 0);
493 if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
494 select = (argc == 0) ? env_get("loadaddr") : argv[0];
501 * Look for a '-' which indicates to ignore the
504 if (select && strcmp(select, "-") == 0) {
505 debug("## Skipping init Ramdisk\n");
508 } else if (select || genimg_has_config(images)) {
511 ret = select_ramdisk(images, select, arch, &rd_data, &rd_len);
516 } else if (images->legacy_hdr_valid &&
517 image_check_type(&images->legacy_hdr_os_copy,
520 * Now check if we have a legacy mult-component image,
521 * get second entry data start address and len.
523 bootstage_mark(BOOTSTAGE_ID_RAMDISK);
524 printf("## Loading init Ramdisk from multi component Legacy Image at %08lx ...\n",
525 (ulong)images->legacy_hdr_os);
527 image_multi_getimg(images->legacy_hdr_os, 1, &rd_data, &rd_len);
532 bootstage_mark(BOOTSTAGE_ID_NO_RAMDISK);
538 debug("## No init Ramdisk\n");
541 *rd_end = rd_data + rd_len;
543 debug(" ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
550 * boot_ramdisk_high - relocate init ramdisk
551 * @lmb: pointer to lmb handle, will be used for memory mgmt
552 * @rd_data: ramdisk data start address
553 * @rd_len: ramdisk data length
554 * @initrd_start: pointer to a ulong variable, will hold final init ramdisk
555 * start address (after possible relocation)
556 * @initrd_end: pointer to a ulong variable, will hold final init ramdisk
557 * end address (after possible relocation)
559 * boot_ramdisk_high() takes a relocation hint from "initrd_high" environment
560 * variable and if requested ramdisk data is moved to a specified location.
562 * Initrd_start and initrd_end are set to final (after relocation) ramdisk
563 * start/end addresses if ramdisk image start and len were provided,
564 * otherwise set initrd_start and initrd_end set to zeros.
570 int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
571 ulong *initrd_start, ulong *initrd_end)
575 int initrd_copy_to_ram = 1;
577 s = env_get("initrd_high");
579 /* a value of "no" or a similar string will act like 0,
580 * turning the "load high" feature off. This is intentional.
582 initrd_high = hextoul(s, NULL);
583 if (initrd_high == ~0)
584 initrd_copy_to_ram = 0;
586 initrd_high = env_get_bootm_mapsize() + env_get_bootm_low();
589 debug("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
590 initrd_high, initrd_copy_to_ram);
593 if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
594 debug(" in-place initrd\n");
595 *initrd_start = rd_data;
596 *initrd_end = rd_data + rd_len;
597 lmb_reserve(lmb, rd_data, rd_len);
600 *initrd_start = (ulong)lmb_alloc_base(lmb,
601 rd_len, 0x1000, initrd_high);
603 *initrd_start = (ulong)lmb_alloc(lmb, rd_len,
606 if (*initrd_start == 0) {
607 puts("ramdisk - allocation error\n");
610 bootstage_mark(BOOTSTAGE_ID_COPY_RAMDISK);
612 *initrd_end = *initrd_start + rd_len;
613 printf(" Loading Ramdisk to %08lx, end %08lx ... ",
614 *initrd_start, *initrd_end);
616 memmove_wd((void *)*initrd_start,
617 (void *)rd_data, rd_len, CHUNKSZ);
620 * Ensure the image is flushed to memory to handle
621 * AMP boot scenarios in which we might not be
624 if (IS_ENABLED(CONFIG_MP)) {
625 flush_cache((unsigned long)*initrd_start,
626 ALIGN(rd_len, ARCH_DMA_MINALIGN));
634 debug(" ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
635 *initrd_start, *initrd_end);
643 int boot_get_setup(bootm_headers_t *images, u8 arch,
644 ulong *setup_start, ulong *setup_len)
646 if (!CONFIG_IS_ENABLED(FIT))
649 return boot_get_setup_fit(images, arch, setup_start, setup_len);
652 int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images,
653 u8 arch, const ulong *ld_start, ulong * const ld_len)
655 ulong tmp_img_addr, img_data, img_len;
659 const char *uname, *name;
661 int devnum = 0; /* TODO support multi fpga platforms */
663 if (!IS_ENABLED(CONFIG_FPGA))
666 /* Check to see if the images struct has a FIT configuration */
667 if (!genimg_has_config(images)) {
668 debug("## FIT configuration was not specified\n");
673 * Obtain the os FIT header from the images struct
675 tmp_img_addr = map_to_sysmem(images->fit_hdr_os);
676 buf = map_sysmem(tmp_img_addr, 0);
678 * Check image type. For FIT images get FIT node
679 * and attempt to locate a generic binary.
681 switch (genimg_get_format(buf)) {
682 case IMAGE_FORMAT_FIT:
683 conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg);
685 uname = fdt_stringlist_get(buf, conf_noffset, FIT_FPGA_PROP, 0,
688 debug("## FPGA image is not specified\n");
691 fit_img_result = fit_image_load(images,
693 (const char **)&uname,
694 &images->fit_uname_cfg,
697 BOOTSTAGE_ID_FPGA_INIT,
698 FIT_LOAD_OPTIONAL_NON_ZERO,
699 &img_data, &img_len);
701 debug("FPGA image (%s) loaded to 0x%lx/size 0x%lx\n",
702 uname, img_data, img_len);
704 if (fit_img_result < 0) {
705 /* Something went wrong! */
706 return fit_img_result;
709 if (!fpga_is_partial_data(devnum, img_len)) {
711 err = fpga_loadbitstream(devnum, (char *)img_data,
714 err = fpga_load(devnum, (const void *)img_data,
718 err = fpga_loadbitstream(devnum, (char *)img_data,
719 img_len, BIT_PARTIAL);
721 err = fpga_load(devnum, (const void *)img_data,
722 img_len, BIT_PARTIAL);
728 printf(" Programming %s bitstream... OK\n", name);
731 printf("The given image format is not supported (corrupt?)\n");
738 static void fit_loadable_process(u8 img_type,
743 const unsigned int count =
744 ll_entry_count(struct fit_loadable_tbl, fit_loadable);
745 struct fit_loadable_tbl *fit_loadable_handler =
746 ll_entry_start(struct fit_loadable_tbl, fit_loadable);
747 /* For each loadable handler */
748 for (i = 0; i < count; i++, fit_loadable_handler++)
749 /* matching this type */
750 if (fit_loadable_handler->type == img_type)
751 /* call that handler with this image data */
752 fit_loadable_handler->handler(img_data, img_len);
755 int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
756 u8 arch, const ulong *ld_start, ulong * const ld_len)
759 * These variables are used to hold the current image location
764 * These two variables are requirements for fit_image_load, but
765 * their values are not used
767 ulong img_data, img_len;
775 /* Check to see if the images struct has a FIT configuration */
776 if (!genimg_has_config(images)) {
777 debug("## FIT configuration was not specified\n");
782 * Obtain the os FIT header from the images struct
784 tmp_img_addr = map_to_sysmem(images->fit_hdr_os);
785 buf = map_sysmem(tmp_img_addr, 0);
787 * Check image type. For FIT images get FIT node
788 * and attempt to locate a generic binary.
790 switch (genimg_get_format(buf)) {
791 case IMAGE_FORMAT_FIT:
792 conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg);
794 for (loadables_index = 0;
795 uname = fdt_stringlist_get(buf, conf_noffset,
797 loadables_index, NULL), uname;
799 fit_img_result = fit_image_load(images, tmp_img_addr,
801 &images->fit_uname_cfg,
802 arch, IH_TYPE_LOADABLE,
803 BOOTSTAGE_ID_FIT_LOADABLE_START,
804 FIT_LOAD_OPTIONAL_NON_ZERO,
805 &img_data, &img_len);
806 if (fit_img_result < 0) {
807 /* Something went wrong! */
808 return fit_img_result;
811 fit_img_result = fit_image_get_node(buf, uname);
812 if (fit_img_result < 0) {
813 /* Something went wrong! */
814 return fit_img_result;
816 fit_img_result = fit_image_get_type(buf,
819 if (fit_img_result < 0) {
820 /* Something went wrong! */
821 return fit_img_result;
824 fit_loadable_process(img_type, img_data, img_len);
828 printf("The given image format is not supported (corrupt?)\n");
836 * boot_get_cmdline - allocate and initialize kernel cmdline
837 * @lmb: pointer to lmb handle, will be used for memory mgmt
838 * @cmd_start: pointer to a ulong variable, will hold cmdline start
839 * @cmd_end: pointer to a ulong variable, will hold cmdline end
841 * boot_get_cmdline() allocates space for kernel command line below
842 * BOOTMAPSZ + env_get_bootm_low() address. If "bootargs" U-Boot environment
843 * variable is present its contents is copied to allocated kernel
850 int boot_get_cmdline(struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
855 cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
856 env_get_bootm_mapsize() + env_get_bootm_low());
860 s = env_get("bootargs");
866 *cmd_start = (ulong)cmdline;
867 *cmd_end = *cmd_start + strlen(cmdline);
869 debug("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
875 * boot_get_kbd - allocate and initialize kernel copy of board info
876 * @lmb: pointer to lmb handle, will be used for memory mgmt
877 * @kbd: double pointer to board info data
879 * boot_get_kbd() allocates space for kernel copy of board info data below
880 * BOOTMAPSZ + env_get_bootm_low() address and kernel board info is initialized
881 * with the current u-boot board info data.
887 int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd)
889 *kbd = (struct bd_info *)(ulong)lmb_alloc_base(lmb,
890 sizeof(struct bd_info),
892 env_get_bootm_mapsize() +
893 env_get_bootm_low());
899 debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
902 if (IS_ENABLED(CONFIG_CMD_BDI))
903 do_bdinfo(NULL, 0, 0, NULL);
909 int image_setup_linux(bootm_headers_t *images)
911 ulong of_size = images->ft_len;
912 char **of_flat_tree = &images->ft_addr;
913 struct lmb *lmb = &images->lmb;
916 if (CONFIG_IS_ENABLED(OF_LIBFDT))
917 boot_fdt_add_mem_rsv_regions(lmb, *of_flat_tree);
919 if (IS_ENABLED(CONFIG_SYS_BOOT_GET_CMDLINE)) {
920 ret = boot_get_cmdline(lmb, &images->cmdline_start,
921 &images->cmdline_end);
923 puts("ERROR with allocation of cmdline\n");
928 if (CONFIG_IS_ENABLED(OF_LIBFDT)) {
929 ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
934 if (CONFIG_IS_ENABLED(OF_LIBFDT) && of_size) {
935 ret = image_setup_libfdt(images, *of_flat_tree, of_size, lmb);
943 void genimg_print_size(uint32_t size)
945 printf("%d Bytes = ", size);
946 print_size(size, "\n");
949 void genimg_print_time(time_t timestamp)
953 rtc_to_tm(timestamp, &tm);
954 printf("%4d-%02d-%02d %2d:%02d:%02d UTC\n",
955 tm.tm_year, tm.tm_mon, tm.tm_mday,
956 tm.tm_hour, tm.tm_min, tm.tm_sec);