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;
30 #if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
32 * image_get_ramdisk - get and verify ramdisk image
33 * @rd_addr: ramdisk image start address
34 * @arch: expected ramdisk architecture
35 * @verify: checksum verification flag
37 * image_get_ramdisk() returns a pointer to the verified ramdisk image
38 * header. Routine receives image start address and expected architecture
39 * flag. Verification done covers data and header integrity and os/type/arch
43 * pointer to a ramdisk image header, if image was found and valid
44 * otherwise, return NULL
46 static const image_header_t *image_get_ramdisk(ulong rd_addr, u8 arch,
49 const image_header_t *rd_hdr = (const image_header_t *)rd_addr;
51 if (!image_check_magic(rd_hdr)) {
52 puts("Bad Magic Number\n");
53 bootstage_error(BOOTSTAGE_ID_RD_MAGIC);
57 if (!image_check_hcrc(rd_hdr)) {
58 puts("Bad Header Checksum\n");
59 bootstage_error(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
63 bootstage_mark(BOOTSTAGE_ID_RD_MAGIC);
64 image_print_contents(rd_hdr);
67 puts(" Verifying Checksum ... ");
68 if (!image_check_dcrc(rd_hdr)) {
69 puts("Bad Data CRC\n");
70 bootstage_error(BOOTSTAGE_ID_RD_CHECKSUM);
76 bootstage_mark(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
78 if (!image_check_os(rd_hdr, IH_OS_LINUX) ||
79 !image_check_arch(rd_hdr, arch) ||
80 !image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
81 printf("No Linux %s Ramdisk Image\n",
82 genimg_get_arch_name(arch));
83 bootstage_error(BOOTSTAGE_ID_RAMDISK);
91 /*****************************************************************************/
92 /* Shared dual-format routines */
93 /*****************************************************************************/
94 ulong image_load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */
95 ulong image_save_addr; /* Default Save Address */
96 ulong image_save_size; /* Default Save Size (in bytes) */
98 static int on_loadaddr(const char *name, const char *value, enum env_op op,
103 case env_op_overwrite:
104 image_load_addr = hextoul(value, NULL);
112 U_BOOT_ENV_CALLBACK(loadaddr, on_loadaddr);
114 ulong env_get_bootm_low(void)
116 char *s = env_get("bootm_low");
119 ulong tmp = hextoul(s, NULL);
123 #if defined(CONFIG_SYS_SDRAM_BASE)
124 return CONFIG_SYS_SDRAM_BASE;
125 #elif defined(CONFIG_ARM) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_RISCV)
126 return gd->bd->bi_dram[0].start;
132 phys_size_t env_get_bootm_size(void)
134 phys_size_t tmp, size;
136 char *s = env_get("bootm_size");
139 tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
143 start = gd->ram_base;
146 if (start + size > gd->ram_top)
147 size = gd->ram_top - start;
149 s = env_get("bootm_low");
151 tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
155 return size - (tmp - start);
158 phys_size_t env_get_bootm_mapsize(void)
161 char *s = env_get("bootm_mapsize");
164 tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
168 #if defined(CONFIG_SYS_BOOTMAPSZ)
169 return CONFIG_SYS_BOOTMAPSZ;
171 return env_get_bootm_size();
175 void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
180 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
186 size_t tail = (len > chunksz) ? chunksz : len;
193 memmove(to, from, tail);
200 #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
201 memmove(to, from, len);
202 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
206 * genimg_get_kernel_addr_fit - get the real kernel address and return 2
208 * @img_addr: a string might contain real image address
209 * @fit_uname_config: double pointer to a char, will hold pointer to a
210 * configuration unit name
211 * @fit_uname_kernel: double pointer to a char, will hold pointer to a subimage
214 * genimg_get_kernel_addr_fit get the real kernel start address from a string
215 * which is normally the first argv of bootm/bootz
218 * kernel start address
220 ulong genimg_get_kernel_addr_fit(char * const img_addr,
221 const char **fit_uname_config,
222 const char **fit_uname_kernel)
226 /* find out kernel image address */
228 kernel_addr = image_load_addr;
229 debug("* kernel: default image load address = 0x%08lx\n",
231 } else if (CONFIG_IS_ENABLED(FIT) &&
232 fit_parse_conf(img_addr, image_load_addr, &kernel_addr,
234 debug("* kernel: config '%s' from image at 0x%08lx\n",
235 *fit_uname_config, kernel_addr);
236 } else if (CONFIG_IS_ENABLED(FIT) &&
237 fit_parse_subimage(img_addr, image_load_addr, &kernel_addr,
239 debug("* kernel: subimage '%s' from image at 0x%08lx\n",
240 *fit_uname_kernel, kernel_addr);
242 kernel_addr = hextoul(img_addr, NULL);
243 debug("* kernel: cmdline image address = 0x%08lx\n",
251 * genimg_get_kernel_addr() is the simple version of
252 * genimg_get_kernel_addr_fit(). It ignores those return FIT strings
254 ulong genimg_get_kernel_addr(char * const img_addr)
256 const char *fit_uname_config = NULL;
257 const char *fit_uname_kernel = NULL;
259 return genimg_get_kernel_addr_fit(img_addr, &fit_uname_config,
264 * genimg_get_format - get image format type
265 * @img_addr: image start address
267 * genimg_get_format() checks whether provided address points to a valid
268 * legacy or FIT image.
270 * New uImage format and FDT blob are based on a libfdt. FDT blob
271 * may be passed directly or embedded in a FIT image. In both situations
272 * genimg_get_format() must be able to dectect libfdt header.
275 * image format type or IMAGE_FORMAT_INVALID if no image is present
277 int genimg_get_format(const void *img_addr)
279 if (CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)) {
280 const image_header_t *hdr;
282 hdr = (const image_header_t *)img_addr;
283 if (image_check_magic(hdr))
284 return IMAGE_FORMAT_LEGACY;
286 if (CONFIG_IS_ENABLED(FIT) || CONFIG_IS_ENABLED(OF_LIBFDT)) {
287 if (!fdt_check_header(img_addr))
288 return IMAGE_FORMAT_FIT;
290 if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE) &&
291 !android_image_check_header(img_addr))
292 return IMAGE_FORMAT_ANDROID;
294 return IMAGE_FORMAT_INVALID;
298 * fit_has_config - check if there is a valid FIT configuration
299 * @images: pointer to the bootm command headers structure
301 * fit_has_config() checks if there is a FIT configuration in use
302 * (if FTI support is present).
305 * 0, no FIT support or no configuration found
306 * 1, configuration found
308 int genimg_has_config(bootm_headers_t *images)
310 if (CONFIG_IS_ENABLED(FIT) && images->fit_uname_cfg)
317 * select_ramdisk() - Select and locate the ramdisk to use
319 * @images: pointer to the bootm images structure
320 * @select: name of ramdisk to select, or NULL for any
321 * @arch: expected ramdisk architecture
322 * @rd_datap: pointer to a ulong variable, will hold ramdisk pointer
323 * @rd_lenp: pointer to a ulong variable, will hold ramdisk length
324 * Return: 0 if OK, -ENOPKG if no ramdisk (but an error should not be reported),
325 * other -ve value on other error
327 static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
328 ulong *rd_datap, ulong *rd_lenp)
333 #if CONFIG_IS_ENABLED(FIT)
334 const char *fit_uname_config = images->fit_uname_cfg;
335 const char *fit_uname_ramdisk = NULL;
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,
352 &rd_addr, &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);
363 rd_addr = hextoul(select, NULL);
364 debug("* ramdisk: cmdline image address = 0x%08lx\n",
367 #if CONFIG_IS_ENABLED(FIT)
369 /* use FIT configuration provided in first bootm
370 * command argument. If the property is not defined,
371 * quit silently (with -ENOPKG)
373 rd_addr = map_to_sysmem(images->fit_hdr_os);
374 rd_noffset = fit_get_node_from_config(images,
377 if (rd_noffset == -ENOENT)
379 else if (rd_noffset < 0)
385 * Check if there is an initrd image at the
386 * address provided in the second bootm argument
387 * check image type, for FIT images get FIT node.
389 buf = map_sysmem(rd_addr, 0);
390 switch (genimg_get_format(buf)) {
391 #if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
392 case IMAGE_FORMAT_LEGACY: {
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,
405 *rd_datap = image_get_data(rd_hdr);
406 *rd_lenp = image_get_data_size(rd_hdr);
410 #if CONFIG_IS_ENABLED(FIT)
411 case IMAGE_FORMAT_FIT:
412 rd_noffset = fit_image_load(images,
413 rd_addr, &fit_uname_ramdisk,
414 &fit_uname_config, arch,
416 BOOTSTAGE_ID_FIT_RD_START,
417 FIT_LOAD_OPTIONAL_NON_ZERO,
422 images->fit_hdr_rd = map_sysmem(rd_addr, 0);
423 images->fit_uname_rd = fit_uname_ramdisk;
424 images->fit_noffset_rd = rd_noffset;
427 #ifdef CONFIG_ANDROID_BOOT_IMAGE
428 case IMAGE_FORMAT_ANDROID:
429 android_image_get_ramdisk((void *)images->os.start,
434 if (IS_ENABLED(CONFIG_SUPPORT_RAW_INITRD)) {
438 end = strchr(select, ':');
440 *rd_lenp = hextoul(++end, NULL);
445 puts("Wrong Ramdisk Image Format\n");
453 * boot_get_ramdisk - main ramdisk handling routine
454 * @argc: command argument count
455 * @argv: command argument list
456 * @images: pointer to the bootm images structure
457 * @arch: expected ramdisk architecture
458 * @rd_start: pointer to a ulong variable, will hold ramdisk start address
459 * @rd_end: pointer to a ulong variable, will hold ramdisk end
461 * boot_get_ramdisk() is responsible for finding a valid ramdisk image.
462 * Currently supported are the following ramdisk sources:
463 * - multicomponent kernel/ramdisk image,
464 * - commandline provided address of decicated ramdisk image.
467 * 0, if ramdisk image was found and valid, or skiped
468 * rd_start and rd_end are set to ramdisk start/end addresses if
469 * ramdisk image is found and valid
471 * 1, if ramdisk image is found but corrupted, or invalid
472 * rd_start and rd_end are set to 0 if no ramdisk exists
474 int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
475 u8 arch, ulong *rd_start, ulong *rd_end)
477 ulong rd_data, rd_len;
478 const char *select = NULL;
483 if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) {
486 /* Look for an Android boot image */
487 buf = map_sysmem(images->os.start, 0);
488 if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
489 select = (argc == 0) ? env_get("loadaddr") : argv[0];
496 * Look for a '-' which indicates to ignore the
499 if (select && strcmp(select, "-") == 0) {
500 debug("## Skipping init Ramdisk\n");
503 } else if (select || genimg_has_config(images)) {
506 ret = select_ramdisk(images, select, arch, &rd_data, &rd_len);
511 } else if (images->legacy_hdr_valid &&
512 image_check_type(&images->legacy_hdr_os_copy,
515 * Now check if we have a legacy mult-component image,
516 * get second entry data start address and len.
518 bootstage_mark(BOOTSTAGE_ID_RAMDISK);
519 printf("## Loading init Ramdisk from multi component Legacy Image at %08lx ...\n",
520 (ulong)images->legacy_hdr_os);
522 image_multi_getimg(images->legacy_hdr_os, 1, &rd_data, &rd_len);
527 bootstage_mark(BOOTSTAGE_ID_NO_RAMDISK);
533 debug("## No init Ramdisk\n");
536 *rd_end = rd_data + rd_len;
538 debug(" ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
545 * boot_ramdisk_high - relocate init ramdisk
546 * @lmb: pointer to lmb handle, will be used for memory mgmt
547 * @rd_data: ramdisk data start address
548 * @rd_len: ramdisk data length
549 * @initrd_start: pointer to a ulong variable, will hold final init ramdisk
550 * start address (after possible relocation)
551 * @initrd_end: pointer to a ulong variable, will hold final init ramdisk
552 * end address (after possible relocation)
554 * boot_ramdisk_high() takes a relocation hint from "initrd_high" environment
555 * variable and if requested ramdisk data is moved to a specified location.
557 * Initrd_start and initrd_end are set to final (after relocation) ramdisk
558 * start/end addresses if ramdisk image start and len were provided,
559 * otherwise set initrd_start and initrd_end set to zeros.
565 int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
566 ulong *initrd_start, ulong *initrd_end)
570 int initrd_copy_to_ram = 1;
572 s = env_get("initrd_high");
574 /* a value of "no" or a similar string will act like 0,
575 * turning the "load high" feature off. This is intentional.
577 initrd_high = hextoul(s, NULL);
578 if (initrd_high == ~0)
579 initrd_copy_to_ram = 0;
581 initrd_high = env_get_bootm_mapsize() + env_get_bootm_low();
584 debug("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
585 initrd_high, initrd_copy_to_ram);
588 if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
589 debug(" in-place initrd\n");
590 *initrd_start = rd_data;
591 *initrd_end = rd_data + rd_len;
592 lmb_reserve(lmb, rd_data, rd_len);
595 *initrd_start = (ulong)lmb_alloc_base(lmb,
596 rd_len, 0x1000, initrd_high);
598 *initrd_start = (ulong)lmb_alloc(lmb, rd_len,
601 if (*initrd_start == 0) {
602 puts("ramdisk - allocation error\n");
605 bootstage_mark(BOOTSTAGE_ID_COPY_RAMDISK);
607 *initrd_end = *initrd_start + rd_len;
608 printf(" Loading Ramdisk to %08lx, end %08lx ... ",
609 *initrd_start, *initrd_end);
611 memmove_wd((void *)*initrd_start,
612 (void *)rd_data, rd_len, CHUNKSZ);
615 * Ensure the image is flushed to memory to handle
616 * AMP boot scenarios in which we might not be
619 if (IS_ENABLED(CONFIG_MP)) {
620 flush_cache((unsigned long)*initrd_start,
621 ALIGN(rd_len, ARCH_DMA_MINALIGN));
629 debug(" ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
630 *initrd_start, *initrd_end);
638 int boot_get_setup(bootm_headers_t *images, u8 arch,
639 ulong *setup_start, ulong *setup_len)
641 if (!CONFIG_IS_ENABLED(FIT))
644 return boot_get_setup_fit(images, arch, setup_start, setup_len);
647 int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images,
648 u8 arch, const ulong *ld_start, ulong * const ld_len)
650 ulong tmp_img_addr, img_data, img_len;
654 const char *uname, *name;
656 int devnum = 0; /* TODO support multi fpga platforms */
658 if (!IS_ENABLED(CONFIG_FPGA))
661 /* Check to see if the images struct has a FIT configuration */
662 if (!genimg_has_config(images)) {
663 debug("## FIT configuration was not specified\n");
668 * Obtain the os FIT header from the images struct
670 tmp_img_addr = map_to_sysmem(images->fit_hdr_os);
671 buf = map_sysmem(tmp_img_addr, 0);
673 * Check image type. For FIT images get FIT node
674 * and attempt to locate a generic binary.
676 switch (genimg_get_format(buf)) {
677 case IMAGE_FORMAT_FIT:
678 conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg);
680 uname = fdt_stringlist_get(buf, conf_noffset, FIT_FPGA_PROP, 0,
683 debug("## FPGA image is not specified\n");
686 fit_img_result = fit_image_load(images,
688 (const char **)&uname,
689 &images->fit_uname_cfg,
692 BOOTSTAGE_ID_FPGA_INIT,
693 FIT_LOAD_OPTIONAL_NON_ZERO,
694 &img_data, &img_len);
696 debug("FPGA image (%s) loaded to 0x%lx/size 0x%lx\n",
697 uname, img_data, img_len);
699 if (fit_img_result < 0) {
700 /* Something went wrong! */
701 return fit_img_result;
704 if (!fpga_is_partial_data(devnum, img_len)) {
706 err = fpga_loadbitstream(devnum, (char *)img_data,
709 err = fpga_load(devnum, (const void *)img_data,
713 err = fpga_loadbitstream(devnum, (char *)img_data,
714 img_len, BIT_PARTIAL);
716 err = fpga_load(devnum, (const void *)img_data,
717 img_len, BIT_PARTIAL);
723 printf(" Programming %s bitstream... OK\n", name);
726 printf("The given image format is not supported (corrupt?)\n");
733 static void fit_loadable_process(u8 img_type,
738 const unsigned int count =
739 ll_entry_count(struct fit_loadable_tbl, fit_loadable);
740 struct fit_loadable_tbl *fit_loadable_handler =
741 ll_entry_start(struct fit_loadable_tbl, fit_loadable);
742 /* For each loadable handler */
743 for (i = 0; i < count; i++, fit_loadable_handler++)
744 /* matching this type */
745 if (fit_loadable_handler->type == img_type)
746 /* call that handler with this image data */
747 fit_loadable_handler->handler(img_data, img_len);
750 int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
751 u8 arch, const ulong *ld_start, ulong * const ld_len)
754 * These variables are used to hold the current image location
759 * These two variables are requirements for fit_image_load, but
760 * their values are not used
762 ulong img_data, img_len;
770 /* Check to see if the images struct has a FIT configuration */
771 if (!genimg_has_config(images)) {
772 debug("## FIT configuration was not specified\n");
777 * Obtain the os FIT header from the images struct
779 tmp_img_addr = map_to_sysmem(images->fit_hdr_os);
780 buf = map_sysmem(tmp_img_addr, 0);
782 * Check image type. For FIT images get FIT node
783 * and attempt to locate a generic binary.
785 switch (genimg_get_format(buf)) {
786 case IMAGE_FORMAT_FIT:
787 conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg);
789 for (loadables_index = 0;
790 uname = fdt_stringlist_get(buf, conf_noffset,
792 loadables_index, NULL), uname;
794 fit_img_result = fit_image_load(images, tmp_img_addr,
796 &images->fit_uname_cfg,
797 arch, IH_TYPE_LOADABLE,
798 BOOTSTAGE_ID_FIT_LOADABLE_START,
799 FIT_LOAD_OPTIONAL_NON_ZERO,
800 &img_data, &img_len);
801 if (fit_img_result < 0) {
802 /* Something went wrong! */
803 return fit_img_result;
806 fit_img_result = fit_image_get_node(buf, uname);
807 if (fit_img_result < 0) {
808 /* Something went wrong! */
809 return fit_img_result;
811 fit_img_result = fit_image_get_type(buf,
814 if (fit_img_result < 0) {
815 /* Something went wrong! */
816 return fit_img_result;
819 fit_loadable_process(img_type, img_data, img_len);
823 printf("The given image format is not supported (corrupt?)\n");
831 * boot_get_cmdline - allocate and initialize kernel cmdline
832 * @lmb: pointer to lmb handle, will be used for memory mgmt
833 * @cmd_start: pointer to a ulong variable, will hold cmdline start
834 * @cmd_end: pointer to a ulong variable, will hold cmdline end
836 * boot_get_cmdline() allocates space for kernel command line below
837 * BOOTMAPSZ + env_get_bootm_low() address. If "bootargs" U-Boot environment
838 * variable is present its contents is copied to allocated kernel
845 int boot_get_cmdline(struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
850 cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
851 env_get_bootm_mapsize() + env_get_bootm_low());
855 s = env_get("bootargs");
861 *cmd_start = (ulong)cmdline;
862 *cmd_end = *cmd_start + strlen(cmdline);
864 debug("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
870 * boot_get_kbd - allocate and initialize kernel copy of board info
871 * @lmb: pointer to lmb handle, will be used for memory mgmt
872 * @kbd: double pointer to board info data
874 * boot_get_kbd() allocates space for kernel copy of board info data below
875 * BOOTMAPSZ + env_get_bootm_low() address and kernel board info is initialized
876 * with the current u-boot board info data.
882 int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd)
884 *kbd = (struct bd_info *)(ulong)lmb_alloc_base(lmb,
885 sizeof(struct bd_info),
887 env_get_bootm_mapsize() +
888 env_get_bootm_low());
894 debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
897 if (IS_ENABLED(CONFIG_CMD_BDI))
898 do_bdinfo(NULL, 0, 0, NULL);
904 int image_setup_linux(bootm_headers_t *images)
906 ulong of_size = images->ft_len;
907 char **of_flat_tree = &images->ft_addr;
908 struct lmb *lmb = &images->lmb;
911 if (CONFIG_IS_ENABLED(OF_LIBFDT))
912 boot_fdt_add_mem_rsv_regions(lmb, *of_flat_tree);
914 if (IS_ENABLED(CONFIG_SYS_BOOT_GET_CMDLINE)) {
915 ret = boot_get_cmdline(lmb, &images->cmdline_start,
916 &images->cmdline_end);
918 puts("ERROR with allocation of cmdline\n");
923 if (CONFIG_IS_ENABLED(OF_LIBFDT)) {
924 ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
929 if (CONFIG_IS_ENABLED(OF_LIBFDT) && of_size) {
930 ret = image_setup_libfdt(images, *of_flat_tree, of_size, lmb);
938 void genimg_print_size(uint32_t size)
940 printf("%d Bytes = ", size);
941 print_size(size, "\n");
944 void genimg_print_time(time_t timestamp)
948 rtc_to_tm(timestamp, &tm);
949 printf("%4d-%02d-%02d %2d:%02d:%02d UTC\n",
950 tm.tm_year, tm.tm_mon, tm.tm_mday,
951 tm.tm_hour, tm.tm_min, tm.tm_sec);