2 * (C) Copyright 2008 Semihalf
4 * (C) Copyright 2000-2006
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 #ifdef CONFIG_SHOW_BOOT_PROGRESS
33 #include <status_led.h>
36 #ifdef CONFIG_HAS_DATAFLASH
37 #include <dataflash.h>
40 #ifdef CONFIG_LOGBUFFER
44 #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
48 #if defined(CONFIG_FIT)
51 #include <fdt_support.h>
54 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
57 extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
60 DECLARE_GLOBAL_DATA_PTR;
63 #endif /* USE_HOSTCC*/
67 unsigned long crc32 (unsigned long, const unsigned char *, unsigned int);
69 int image_check_hcrc (image_header_t *hdr)
72 ulong len = image_get_header_size ();
73 image_header_t header;
75 /* Copy header so we can blank CRC field for re-calculation */
76 memmove (&header, (char *)hdr, image_get_header_size ());
77 image_set_hcrc (&header, 0);
79 hcrc = crc32 (0, (unsigned char *)&header, len);
81 return (hcrc == image_get_hcrc (hdr));
84 int image_check_dcrc (image_header_t *hdr)
86 ulong data = image_get_data (hdr);
87 ulong len = image_get_data_size (hdr);
88 ulong dcrc = crc32 (0, (unsigned char *)data, len);
90 return (dcrc == image_get_dcrc (hdr));
94 int image_check_dcrc_wd (image_header_t *hdr, ulong chunksz)
97 ulong len = image_get_data_size (hdr);
98 ulong data = image_get_data (hdr);
100 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
102 ulong edata = cdata + len;
104 while (cdata < edata) {
105 ulong chunk = edata - cdata;
109 dcrc = crc32 (dcrc, (unsigned char *)cdata, chunk);
115 dcrc = crc32 (0, (unsigned char *)data, len);
118 return (dcrc == image_get_dcrc (hdr));
121 int getenv_verify (void)
123 char *s = getenv ("verify");
124 return (s && (*s == 'n')) ? 0 : 1;
127 void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
129 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
131 size_t tail = (len > chunksz) ? chunksz : len;
133 memmove (to, from, tail);
138 #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
139 memmove (to, from, len);
140 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
142 #endif /* USE_HOSTCC */
145 * image_multi_count - get component (sub-image) count
146 * @hdr: pointer to the header of the multi component image
148 * image_multi_count() returns number of components in a multi
151 * Note: no checking of the image type is done, caller must pass
152 * a valid multi component image.
155 * number of components
157 ulong image_multi_count (image_header_t *hdr)
162 /* get start of the image payload, which in case of multi
163 * component images that points to a table of component sizes */
164 size = (ulong *)image_get_data (hdr);
166 /* count non empty slots */
167 for (i = 0; size[i]; ++i)
174 * image_multi_getimg - get component data address and size
175 * @hdr: pointer to the header of the multi component image
176 * @idx: index of the requested component
177 * @data: pointer to a ulong variable, will hold component data address
178 * @len: pointer to a ulong variable, will hold component size
180 * image_multi_getimg() returns size and data address for the requested
181 * component in a multi component image.
183 * Note: no checking of the image type is done, caller must pass
184 * a valid multi component image.
187 * data address and size of the component, if idx is valid
188 * 0 in data and len, if idx is out of range
190 void image_multi_getimg (image_header_t *hdr, ulong idx,
191 ulong *data, ulong *len)
195 ulong offset, tail, count, img_data;
197 /* get number of component */
198 count = image_multi_count (hdr);
200 /* get start of the image payload, which in case of multi
201 * component images that points to a table of component sizes */
202 size = (ulong *)image_get_data (hdr);
204 /* get address of the proper component data start, which means
205 * skipping sizes table (add 1 for last, null entry) */
206 img_data = image_get_data (hdr) + (count + 1) * sizeof (ulong);
213 /* go over all indices preceding requested component idx */
214 for (i = 0; i < idx; i++) {
215 /* add up i-th component size */
218 /* add up alignment for i-th component */
219 tail += (4 - size[i] % 4);
222 /* calculate idx-th component data address */
223 *data = img_data + offset + tail;
231 const char* image_get_os_name (uint8_t os)
236 case IH_OS_INVALID: name = "Invalid OS"; break;
237 case IH_OS_NETBSD: name = "NetBSD"; break;
238 case IH_OS_LINUX: name = "Linux"; break;
239 case IH_OS_VXWORKS: name = "VxWorks"; break;
240 case IH_OS_QNX: name = "QNX"; break;
241 case IH_OS_U_BOOT: name = "U-Boot"; break;
242 case IH_OS_RTEMS: name = "RTEMS"; break;
244 case IH_OS_ARTOS: name = "ARTOS"; break;
246 #ifdef CONFIG_LYNXKDI
247 case IH_OS_LYNXOS: name = "LynxOS"; break;
249 default: name = "Unknown OS"; break;
255 const char* image_get_arch_name (uint8_t arch)
260 case IH_ARCH_INVALID: name = "Invalid Architecture"; break;
261 case IH_ARCH_ALPHA: name = "Alpha"; break;
262 case IH_ARCH_ARM: name = "ARM"; break;
263 case IH_ARCH_AVR32: name = "AVR32"; break;
264 case IH_ARCH_BLACKFIN: name = "Blackfin"; break;
265 case IH_ARCH_I386: name = "Intel x86"; break;
266 case IH_ARCH_IA64: name = "IA64"; break;
267 case IH_ARCH_M68K: name = "M68K"; break;
268 case IH_ARCH_MICROBLAZE:name = "Microblaze"; break;
269 case IH_ARCH_MIPS64: name = "MIPS 64 Bit"; break;
270 case IH_ARCH_MIPS: name = "MIPS"; break;
271 case IH_ARCH_NIOS2: name = "Nios-II"; break;
272 case IH_ARCH_NIOS: name = "Nios"; break;
273 case IH_ARCH_PPC: name = "PowerPC"; break;
274 case IH_ARCH_S390: name = "IBM S390"; break;
275 case IH_ARCH_SH: name = "SuperH"; break;
276 case IH_ARCH_SPARC64: name = "SPARC 64 Bit"; break;
277 case IH_ARCH_SPARC: name = "SPARC"; break;
278 default: name = "Unknown Architecture"; break;
284 const char* image_get_type_name (uint8_t type)
289 case IH_TYPE_INVALID: name = "Invalid Image"; break;
290 case IH_TYPE_STANDALONE:name = "Standalone Program"; break;
291 case IH_TYPE_KERNEL: name = "Kernel Image"; break;
292 case IH_TYPE_RAMDISK: name = "RAMDisk Image"; break;
293 case IH_TYPE_MULTI: name = "Multi-File Image"; break;
294 case IH_TYPE_FIRMWARE: name = "Firmware"; break;
295 case IH_TYPE_SCRIPT: name = "Script"; break;
296 case IH_TYPE_FLATDT: name = "Flat Device Tree"; break;
297 default: name = "Unknown Image"; break;
303 const char* image_get_comp_name (uint8_t comp)
308 case IH_COMP_NONE: name = "uncompressed"; break;
309 case IH_COMP_GZIP: name = "gzip compressed"; break;
310 case IH_COMP_BZIP2: name = "bzip2 compressed"; break;
311 default: name = "unknown compression"; break;
317 static void image_print_type (image_header_t *hdr)
319 const char *os, *arch, *type, *comp;
321 os = image_get_os_name (image_get_os (hdr));
322 arch = image_get_arch_name (image_get_arch (hdr));
323 type = image_get_type_name (image_get_type (hdr));
324 comp = image_get_comp_name (image_get_comp (hdr));
326 printf ("%s %s %s (%s)", arch, os, type, comp);
329 void image_print_contents (image_header_t *hdr)
331 #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
332 time_t timestamp = (time_t)image_get_time (hdr);
336 printf (" Image Name: %.*s\n", IH_NMLEN, image_get_name (hdr));
338 #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
339 to_tm (timestamp, &tm);
340 printf (" Created: %4d-%02d-%02d %2d:%02d:%02d UTC\n",
341 tm.tm_year, tm.tm_mon, tm.tm_mday,
342 tm.tm_hour, tm.tm_min, tm.tm_sec);
344 puts (" Image Type: ");
345 image_print_type (hdr);
347 printf ("\n Data Size: %d Bytes = ", image_get_data_size (hdr));
348 print_size (image_get_data_size (hdr), "\n");
349 printf (" Load Address: %08x\n"
350 " Entry Point: %08x\n",
351 image_get_load (hdr), image_get_ep (hdr));
353 if (image_check_type (hdr, IH_TYPE_MULTI)) {
356 ulong count = image_multi_count (hdr);
358 puts (" Contents:\n");
359 for (i = 0; i < count; i++) {
360 image_multi_getimg (hdr, i, &data, &len);
361 printf (" Image %d: %8ld Bytes = ", i, len);
362 print_size (len, "\n");
368 * gen_image_get_format - get image format type
369 * @img_addr: image start address
371 * gen_image_get_format() checks whether provided address points to a valid
372 * legacy or FIT image.
375 * image format type or IMAGE_FORMAT_INVALID if no image is present
377 int gen_image_get_format (void *img_addr)
379 ulong format = IMAGE_FORMAT_INVALID;
381 #if defined(CONFIG_FIT)
385 hdr = (image_header_t *)img_addr;
386 if (image_check_magic(hdr))
387 format = IMAGE_FORMAT_LEGACY;
388 #if defined(CONFIG_FIT)
390 fit_hdr = (char *)img_addr;
391 if (fdt_check_header (fit_hdr) == 0)
392 format = IMAGE_FORMAT_FIT;
400 * gen_get_image - get image from special storage (if necessary)
401 * @img_addr: image start address
403 * gen_get_image() checks if provided image start adddress is located
404 * in a dataflash storage. If so, image is moved to a system RAM memory.
407 * image start address after possible relocation from special storage
409 ulong gen_get_image (ulong img_addr)
411 ulong ram_addr, h_size, d_size;
413 h_size = image_get_header_size ();
414 #if defined(CONFIG_FIT)
415 if (sizeof(struct fdt_header) > h_size)
416 h_size = sizeof(struct fdt_header);
419 #ifdef CONFIG_HAS_DATAFLASH
420 if (addr_dataflash (img_addr)){
421 ram_addr = CFG_LOAD_ADDR;
422 debug (" Reading image header from dataflash address "
423 "%08lx to RAM address %08lx\n", img_addr, ram_addr);
424 read_dataflash (img_addr, h_size, (char *)ram_addr);
431 switch (gen_image_get_format ((void *)ram_addr)) {
432 case IMAGE_FORMAT_LEGACY:
433 d_size = image_get_data_size ((image_header_t *)ram_addr);
434 debug (" Legacy format image found at 0x%08lx, size 0x%08lx\n",
437 #if defined(CONFIG_FIT)
438 case IMAGE_FORMAT_FIT:
439 d_size = fdt_totalsize((void *)ram_addr) - h_size;
440 debug (" FIT/FDT format image found at 0x%08lx, size 0x%08lx\n",
446 printf (" No valid image found at 0x%08lx\n", img_addr);
450 #ifdef CONFIG_HAS_DATAFLASH
451 if (addr_dataflash (img_addr)) {
452 debug (" Reading image remaining data from dataflash address "
453 "%08lx to RAM address %08lx\n", img_addr + h_size,
456 read_dataflash (img_addr + h_size, d_size,
457 (char *)(ram_addr + h_size));
465 * image_get_ramdisk - get and verify ramdisk image
466 * @cmdtp: command table pointer
467 * @flag: command flag
468 * @argc: command argument count
469 * @argv: command argument list
470 * @rd_addr: ramdisk image start address
471 * @arch: expected ramdisk architecture
472 * @verify: checksum verification flag
474 * image_get_ramdisk() returns a pointer to the verified ramdisk image
475 * header. Routine receives image start address and expected architecture
476 * flag. Verification done covers data and header integrity and os/type/arch
479 * If dataflash support is enabled routine checks for dataflash addresses
480 * and handles required dataflash reads.
483 * pointer to a ramdisk image header, if image was found and valid
484 * otherwise, board is reset
486 image_header_t* image_get_ramdisk (cmd_tbl_t *cmdtp, int flag,
487 int argc, char *argv[],
488 ulong rd_addr, uint8_t arch, int verify)
490 image_header_t *rd_hdr;
492 show_boot_progress (9);
494 /* copy from dataflash if needed */
495 rd_addr = gen_get_image (rd_addr);
496 rd_hdr = (image_header_t *)rd_addr;
498 if (!image_check_magic (rd_hdr)) {
499 puts ("Bad Magic Number\n");
500 show_boot_progress (-10);
501 do_reset (cmdtp, flag, argc, argv);
504 if (!image_check_hcrc (rd_hdr)) {
505 puts ("Bad Header Checksum\n");
506 show_boot_progress (-11);
507 do_reset (cmdtp, flag, argc, argv);
510 show_boot_progress (10);
511 image_print_contents (rd_hdr);
514 puts(" Verifying Checksum ... ");
515 if (!image_check_dcrc_wd (rd_hdr, CHUNKSZ)) {
516 puts ("Bad Data CRC\n");
517 show_boot_progress (-12);
518 do_reset (cmdtp, flag, argc, argv);
523 show_boot_progress (11);
525 if (!image_check_os (rd_hdr, IH_OS_LINUX) ||
526 !image_check_arch (rd_hdr, arch) ||
527 !image_check_type (rd_hdr, IH_TYPE_RAMDISK)) {
528 printf ("No Linux %s Ramdisk Image\n",
529 image_get_arch_name(arch));
530 show_boot_progress (-13);
531 do_reset (cmdtp, flag, argc, argv);
538 * get_ramdisk - main ramdisk handling routine
539 * @cmdtp: command table pointer
540 * @flag: command flag
541 * @argc: command argument count
542 * @argv: command argument list
543 * @hdr: pointer to the posiibly multi componet kernel image
544 * @verify: checksum verification flag
545 * @arch: expected ramdisk architecture
546 * @rd_start: pointer to a ulong variable, will hold ramdisk start address
547 * @rd_end: pointer to a ulong variable, will hold ramdisk end
549 * get_ramdisk() is responsible for finding a valid ramdisk image.
550 * Curently supported are the following ramdisk sources:
551 * - multicomponent kernel/ramdisk image,
552 * - commandline provided address of decicated ramdisk image.
555 * rd_start and rd_end are set to ramdisk start/end addresses if
556 * ramdisk image is found and valid
557 * rd_start and rd_end are set to 0 if no ramdisk exists
558 * board is reset if ramdisk image is found but corrupted
560 void get_ramdisk (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
561 image_header_t *hdr, int verify, uint8_t arch,
562 ulong *rd_start, ulong *rd_end)
565 ulong rd_data, rd_len;
566 image_header_t *rd_hdr;
570 * Look for a '-' which indicates to ignore the
573 if (strcmp(argv[2], "-") == 0) {
574 debug ("## Skipping init Ramdisk\n");
575 rd_len = rd_data = 0;
578 * Check if there is an initrd image at the
579 * address provided in the second bootm argument
581 rd_addr = simple_strtoul (argv[2], NULL, 16);
582 printf ("## Loading init Ramdisk Image at %08lx ...\n",
585 rd_hdr = image_get_ramdisk (cmdtp, flag, argc, argv,
586 rd_addr, arch, verify);
588 rd_data = image_get_data (rd_hdr);
589 rd_len = image_get_data_size (rd_hdr);
591 #if defined(CONFIG_B2) || defined(CONFIG_EVB4510) || defined(CONFIG_ARMADILLO)
593 *we need to copy the ramdisk to SRAM to let Linux boot
595 memmove ((void *)image_get_load (rd_hdr),
596 (uchar *)rd_data, rd_len);
598 rd_data = image_get_load (rd_hdr);
599 #endif /* CONFIG_B2 || CONFIG_EVB4510 || CONFIG_ARMADILLO */
602 } else if (image_check_type (hdr, IH_TYPE_MULTI)) {
604 * Now check if we have a multifile image
605 * Get second entry data start address and len
607 show_boot_progress (13);
608 printf ("## Loading init Ramdisk from multi component "
609 "Image at %08lx ...\n", (ulong)hdr);
610 image_multi_getimg (hdr, 1, &rd_data, &rd_len);
615 show_boot_progress (14);
616 rd_len = rd_data = 0;
620 debug ("## No init Ramdisk\n");
625 *rd_end = rd_data + rd_len;
627 debug (" ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
631 #if defined(CONFIG_PPC) || defined(CONFIG_M68K)
633 * ramdisk_high - relocate init ramdisk
634 * @rd_data: ramdisk data start address
635 * @rd_len: ramdisk data length
636 * @kbd: kernel board info copy (within BOOTMAPSZ boundary)
637 * @sp_limit: stack pointer limit (including BOOTMAPSZ)
638 * @sp: current stack pointer
639 * @initrd_start: pointer to a ulong variable, will hold final init ramdisk
640 * start address (after possible relocation)
641 * @initrd_end: pointer to a ulong variable, will hold final init ramdisk
642 * end address (after possible relocation)
644 * ramdisk_high() takes a relocation hint from "initrd_high" environement
645 * variable and if requested ramdisk data is moved to a specified location.
648 * - initrd_start and initrd_end are set to final (after relocation) ramdisk
649 * start/end addresses if ramdisk image start and len were provided
650 * otherwise set initrd_start and initrd_end set to zeros
651 * - returns new allc_current, next free address below BOOTMAPSZ
653 ulong ramdisk_high (ulong alloc_current, ulong rd_data, ulong rd_len,
654 bd_t *kbd, ulong sp_limit, ulong sp,
655 ulong *initrd_start, ulong *initrd_end)
659 int initrd_copy_to_ram = 1;
660 ulong new_alloc_current = alloc_current;
662 if ((s = getenv ("initrd_high")) != NULL) {
663 /* a value of "no" or a similar string will act like 0,
664 * turning the "load high" feature off. This is intentional.
666 initrd_high = simple_strtoul (s, NULL, 16);
667 if (initrd_high == ~0)
668 initrd_copy_to_ram = 0;
670 /* not set, no restrictions to load high */
674 #ifdef CONFIG_LOGBUFFER
675 /* Prevent initrd from overwriting logbuffer */
676 if (initrd_high < (kbd->bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD))
677 initrd_high = kbd->bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD;
678 debug ("## Logbuffer at 0x%08lx ", kbd->bi_memsize - LOGBUFF_LEN);
680 debug ("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
681 initrd_high, initrd_copy_to_ram);
684 if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
685 debug (" in-place initrd\n");
686 *initrd_start = rd_data;
687 *initrd_end = rd_data + rd_len;
689 new_alloc_current = alloc_current - rd_len;
690 *initrd_start = new_alloc_current;
691 *initrd_start &= ~(4096 - 1); /* align on page */
697 * the inital ramdisk does not need to be within
698 * CFG_BOOTMAPSZ as it is not accessed until after
699 * the mm system is initialised.
701 * do the stack bottom calculation again and see if
702 * the initrd will fit just below the monitor stack
703 * bottom without overwriting the area allocated
704 * for command line args and board info.
707 nsp -= 2048; /* just to be sure */
710 if (nsp > initrd_high) /* limit as specified */
714 nsp &= ~(4096 - 1); /* align on page */
716 if (nsp >= sp_limit) {
718 new_alloc_current = alloc_current;
722 show_boot_progress (12);
724 *initrd_end = *initrd_start + rd_len;
725 printf (" Loading Ramdisk to %08lx, end %08lx ... ",
726 *initrd_start, *initrd_end);
728 memmove_wd((void *)*initrd_start,
729 (void *)rd_data, rd_len, CHUNKSZ);
737 debug (" ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
738 *initrd_start, *initrd_end);
740 return new_alloc_current;
744 * get_boot_sp_limit - calculate stack pointer limit
745 * @sp: current stack pointer
747 * get_boot_sp_limit() takes current stack pointer adrress and calculates
748 * stack pointer limit, below which kernel boot data (cmdline, board info,
749 * etc.) will be allocated.
752 * stack pointer limit
754 ulong get_boot_sp_limit(ulong sp)
758 sp_limit -= 2048; /* just to be sure */
760 /* make sure sp_limit is within kernel mapped space */
761 if (sp_limit > CFG_BOOTMAPSZ)
762 sp_limit = CFG_BOOTMAPSZ;
769 * get_boot_cmdline - allocate and initialize kernel cmdline
770 * @alloc_current: current boot allocation address (counting down
772 * @cmd_start: pointer to a ulong variable, will hold cmdline start
773 * @cmd_end: pointer to a ulong variable, will hold cmdline end
775 * get_boot_cmdline() allocates space for kernel command line below
776 * provided alloc_current address. If "bootargs" U-boot environemnt
777 * variable is present its contents is copied to allocated kernel
781 * alloc_current after cmdline allocation
783 ulong get_boot_cmdline (ulong alloc_current, ulong *cmd_start, ulong *cmd_end)
788 cmdline = (char *)((alloc_current - CFG_BARGSIZE) & ~0xF);
790 if ((s = getenv("bootargs")) == NULL)
795 *cmd_start = (ulong) & cmdline[0];
796 *cmd_end = *cmd_start + strlen(cmdline);
798 debug ("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
800 return (ulong)cmdline;
804 * get_boot_kbd - allocate and initialize kernel copy of board info
805 * @alloc_current: current boot allocation address (counting down
807 * @kbd: double pointer to board info data
809 * get_boot_kbd() - allocates space for kernel copy of board info data.
810 * Space is allocated below provided alloc_current address and kernel
811 * board info is initialized with the current u-boot board info data.
814 * alloc_current after kbd allocation
816 ulong get_boot_kbd (ulong alloc_current, bd_t **kbd)
818 *kbd = (bd_t *) (((ulong)alloc_current - sizeof(bd_t)) & ~0xF);
821 debug ("## kernel board info at 0x%08lx\n", (ulong)*kbd);
823 #if defined(DEBUG) && defined(CONFIG_CMD_BDI)
824 do_bdinfo(NULL, 0, 0, NULL);
829 #endif /* CONFIG_PPC || CONFIG_M68K */
831 #if defined(CONFIG_FIT)
832 /*****************************************************************************/
833 /* New uImage format routines */
834 /*****************************************************************************/
835 static int fit_parse_spec (const char *spec, char sepc, ulong addr_curr,
836 ulong *addr, const char **name)
843 sep = strchr (spec, sepc);
846 *addr = simple_strtoul (spec, NULL, 16);
856 * fit_parse_conf - parse FIT configuration spec
857 * @spec: input string, containing configuration spec
858 * @add_curr: current image address (to be used as a possible default)
859 * @addr: pointer to a ulong variable, will hold FIT image address of a given
861 * @conf_name double pointer to a char, will hold pointer to a configuration
864 * fit_parse_conf() expects configuration spec in the for of [<addr>]#<conf>,
865 * where <addr> is a FIT image address that contains configuration
866 * with a <conf> unit name.
868 * Address part is optional, and if omitted default add_curr will
872 * 1 if spec is a valid configuration string,
873 * addr and conf_name are set accordingly
876 inline int fit_parse_conf (const char *spec, ulong addr_curr,
877 ulong *addr, const char **conf_name)
879 return fit_parse_spec (spec, '#', addr_curr, addr, conf_name);
883 * fit_parse_subimage - parse FIT subimage spec
884 * @spec: input string, containing subimage spec
885 * @add_curr: current image address (to be used as a possible default)
886 * @addr: pointer to a ulong variable, will hold FIT image address of a given
888 * @image_name: double pointer to a char, will hold pointer to a subimage name
890 * fit_parse_subimage() expects subimage spec in the for of
891 * [<addr>]:<subimage>, where <addr> is a FIT image address that contains
892 * subimage with a <subimg> unit name.
894 * Address part is optional, and if omitted default add_curr will
898 * 1 if spec is a valid subimage string,
899 * addr and image_name are set accordingly
902 inline int fit_parse_subimage (const char *spec, ulong addr_curr,
903 ulong *addr, const char **image_name)
905 return fit_parse_spec (spec, ':', addr_curr, addr, image_name);
907 #endif /* CONFIG_FIT */
909 #endif /* USE_HOSTCC */