Newer
Older
rd_data = rd_addr;
} else
#endif
{
puts("Wrong Ramdisk Image Format\n");
rd_data = rd_len = rd_load = 0;
return 1;
}
}
} else if (images->legacy_hdr_valid &&
image_check_type(&images->legacy_hdr_os_copy,
IH_TYPE_MULTI)) {
* Now check if we have a legacy mult-component image,
* get second entry data start address and len.
bootstage_mark(BOOTSTAGE_ID_RAMDISK);
printf("## Loading init Ramdisk from multi component "
"Legacy Image at %08lx ...\n",
(ulong)images->legacy_hdr_os);
image_multi_getimg(images->legacy_hdr_os, 1, &rd_data, &rd_len);
} else {
/*
* no initrd image
*/
bootstage_mark(BOOTSTAGE_ID_NO_RAMDISK);
rd_len = rd_data = 0;
}
if (!rd_data) {
} else {
*rd_start = rd_data;
*rd_end = rd_data + rd_len;
}
debug(" ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
*rd_start, *rd_end);
return 0;
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
* boot_ramdisk_high - relocate init ramdisk
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @rd_data: ramdisk data start address
* @rd_len: ramdisk data length
* @initrd_start: pointer to a ulong variable, will hold final init ramdisk
* start address (after possible relocation)
* @initrd_end: pointer to a ulong variable, will hold final init ramdisk
* end address (after possible relocation)
*
* boot_ramdisk_high() takes a relocation hint from "initrd_high" environement
* variable and if requested ramdisk data is moved to a specified location.
*
* Initrd_start and initrd_end are set to final (after relocation) ramdisk
* start/end addresses if ramdisk image start and len were provided,
* otherwise set initrd_start and initrd_end set to zeros.
*
* 0 - success
* -1 - failure
int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
ulong *initrd_start, ulong *initrd_end)
{
char *s;
ulong initrd_high;
int initrd_copy_to_ram = 1;
if ((s = getenv("initrd_high")) != NULL) {
/* a value of "no" or a similar string will act like 0,
* turning the "load high" feature off. This is intentional.
*/
initrd_high = simple_strtoul(s, NULL, 16);
if (initrd_high == ~0)
initrd_copy_to_ram = 0;
} else {
/* not set, no restrictions to load high */
initrd_high = ~0;
}
#ifdef CONFIG_LOGBUFFER
/* Prevent initrd from overwriting logbuffer */
lmb_reserve(lmb, logbuffer_base() - LOGBUFF_OVERHEAD, LOGBUFF_RESERVE);
#endif
debug("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
initrd_high, initrd_copy_to_ram);
if (rd_data) {
if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
*initrd_start = rd_data;
*initrd_end = rd_data + rd_len;
lmb_reserve(lmb, rd_data, rd_len);
*initrd_start = (ulong)lmb_alloc_base(lmb,
rd_len, 0x1000, initrd_high);
*initrd_start = (ulong)lmb_alloc(lmb, rd_len,
0x1000);
bootstage_mark(BOOTSTAGE_ID_COPY_RAMDISK);
*initrd_end = *initrd_start + rd_len;
printf(" Loading Ramdisk to %08lx, end %08lx ... ",
*initrd_start, *initrd_end);
(void *)rd_data, rd_len, CHUNKSZ);
#ifdef CONFIG_MP
/*
* Ensure the image is flushed to memory to handle
* AMP boot scenarios in which we might not be
* HW cache coherent
*/
flush_cache((unsigned long)*initrd_start, rd_len);
#endif
}
} else {
*initrd_start = 0;
*initrd_end = 0;
}
debug(" ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
*initrd_start, *initrd_end);
#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
puts("ERROR: ");
puts(msg);
puts(" - must RESET the board to recover.\n");
static const image_header_t *image_get_fdt(ulong fdt_addr)
const image_header_t *fdt_hdr = (const image_header_t *)fdt_addr;
puts(" Verifying Checksum ... ");
if (!image_check_hcrc(fdt_hdr)) {
fdt_error("fdt header checksum invalid");
if (!image_check_dcrc(fdt_hdr)) {
fdt_error("fdt checksum invalid");
if (!image_check_type(fdt_hdr, IH_TYPE_FLATDT)) {
fdt_error("uImage is not a fdt");
if (image_get_comp(fdt_hdr) != IH_COMP_NONE) {
fdt_error("uImage is compressed");
if (fdt_check_header((char *)image_get_data(fdt_hdr)) != 0) {
fdt_error("uImage data is not a fdt");
return NULL;
}
return fdt_hdr;
}
/**
* fit_check_fdt - verify FIT format FDT subimage
* @fit_hdr: pointer to the FIT header
* fdt_noffset: FDT subimage node offset within FIT image
* @verify: data CRC verification flag
*
* fit_check_fdt() verifies integrity of the FDT subimage and from
* specified FIT image.
*
* returns:
* 1, on success
* 0, on failure
*/
#if defined(CONFIG_FIT)
static int fit_check_fdt(const void *fit, int fdt_noffset, int verify)
fit_image_print(fit, fdt_noffset, " ");
puts(" Verifying Hash Integrity ... ");
if (!fit_image_check_hashes(fit, fdt_noffset)) {
fdt_error("Bad Data Hash");
if (!fit_image_check_type(fit, fdt_noffset, IH_TYPE_FLATDT)) {
fdt_error("Not a FDT image");
if (!fit_image_check_comp(fit, fdt_noffset, IH_COMP_NONE)) {
fdt_error("FDT image is compressed");
return 0;
}
return 1;
}
#endif /* CONFIG_FIT */
#ifndef CONFIG_SYS_FDT_PAD
#define CONFIG_SYS_FDT_PAD 0x3000
#if defined(CONFIG_OF_LIBFDT)
/**
* boot_fdt_add_mem_rsv_regions - Mark the memreserve sections as unusable
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @fdt_blob: pointer to fdt blob base address
*
* Adds the memreserve regions in the dtb to the lmb block. Adding the
* memreserve regions prevents u-boot from using them to store the initrd
* or the fdt blob.
*/
void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
{
uint64_t addr, size;
int i, total;
return;
total = fdt_num_mem_rsv(fdt_blob);
for (i = 0; i < total; i++) {
if (fdt_get_mem_rsv(fdt_blob, i, &addr, &size) != 0)
continue;
printf(" reserving fdt memory region: addr=%llx size=%llx\n",
(unsigned long long)addr, (unsigned long long)size);
lmb_reserve(lmb, addr, size);
}
}
/**
* boot_relocate_fdt - relocate flat device tree
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @of_flat_tree: pointer to a char* variable, will hold fdt start address
* @of_size: pointer to a ulong variable, will hold fdt length
*
* boot_relocate_fdt() allocates a region of memory within the bootmap and
* relocates the of_flat_tree into that region, even if the fdt is already in
* the bootmap. It also expands the size of the fdt by CONFIG_SYS_FDT_PAD
* bytes.
*
* of_flat_tree and of_size are set to final (after relocation) values
*
* returns:
* 0 - success
* 1 - failure
*/
int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
void *fdt_blob = *of_flat_tree;
void *of_start = 0;
/* nothing to do */
if (*of_size == 0)
return 0;
if (fdt_check_header(fdt_blob) != 0) {
fdt_error("image is not a fdt");
/* position on a 4K boundary before the alloc_current */
/* Pad the FDT by a specified amount */
of_len = *of_size + CONFIG_SYS_FDT_PAD;
/* If fdt_high is set use it to select the relocation address */
fdt_high = getenv("fdt_high");
if (fdt_high) {
void *desired_addr = (void *)simple_strtoul(fdt_high, NULL, 16);
if (((ulong) desired_addr) == ~0UL) {
/* All ones means use fdt in place */
of_start = fdt_blob;
lmb_reserve(lmb, (ulong)of_start, of_len);
} else if (desired_addr) {
of_start =
(void *)(ulong) lmb_alloc_base(lmb, of_len, 0x1000,
(ulong)desired_addr);
if (of_start == 0) {
puts("Failed using fdt_high value for Device Tree");
goto error;
}
} else {
of_start =
(void *)(ulong) lmb_alloc(lmb, of_len, 0x1000);
}
} else {
of_start =
(void *)(ulong) lmb_alloc_base(lmb, of_len, 0x1000,
getenv_bootm_mapsize()
+ getenv_bootm_low());
}
if (of_start == 0) {
puts("device tree - allocation error\n");
goto error;
}
if (disable_relocation) {
/* We assume there is space after the existing fdt to use for padding */
fdt_set_totalsize(of_start, of_len);
printf(" Using Device Tree in place at %p, end %p\n",
of_start, of_start + of_len - 1);
} else {
debug("## device tree at %p ... %p (len=%ld [0x%lX])\n",
fdt_blob, fdt_blob + *of_size - 1, of_len, of_len);
printf(" Loading Device Tree to %p, end %p ... ",
of_start, of_start + of_len - 1);
err = fdt_open_into(fdt_blob, of_start, of_len);
*of_flat_tree = of_start;
*of_size = of_len;
set_working_fdt_addr(*of_flat_tree);
return 0;
error:
return 1;
}
#endif /* CONFIG_OF_LIBFDT */
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
/**
* boot_get_fdt - main fdt handling routine
* @argc: command argument count
* @argv: command argument list
* @images: pointer to the bootm images structure
* @of_flat_tree: pointer to a char* variable, will hold fdt start address
* @of_size: pointer to a ulong variable, will hold fdt length
*
* boot_get_fdt() is responsible for finding a valid flat device tree image.
* Curently supported are the following ramdisk sources:
* - multicomponent kernel/ramdisk image,
* - commandline provided address of decicated ramdisk image.
*
* returns:
* 0, if fdt image was found and valid, or skipped
* of_flat_tree and of_size are set to fdt start address and length if
* fdt image is found and valid
*
* 1, if fdt image is found but corrupted
* of_flat_tree and of_size are set to 0 if no fdt exists
*/
int boot_get_fdt(int flag, int argc, char * const argv[],
bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
const image_header_t *fdt_hdr;
ulong fdt_addr;
char *fdt_blob = NULL;
ulong image_start, image_data, image_end;
ulong load_start, load_end;
#if defined(CONFIG_FIT)
void *fit_hdr;
const char *fit_uname_config = NULL;
const char *fit_uname_fdt = NULL;
ulong default_addr;
int cfg_noffset;
int fdt_noffset;
const void *data;
size_t size;
#endif
*of_flat_tree = NULL;
*of_size = 0;
if (argc > 3 || genimg_has_config(images)) {
#if defined(CONFIG_FIT)
if (argc > 3) {
/*
* If the FDT blob comes from the FIT image and the
* FIT image address is omitted in the command line
* argument, try to use ramdisk or os FIT image
* address or default load address.
*/
if (images->fit_uname_rd)
default_addr = (ulong)images->fit_hdr_rd;
else if (images->fit_uname_os)
default_addr = (ulong)images->fit_hdr_os;
else
default_addr = load_addr;
if (fit_parse_conf(argv[3], default_addr,
&fdt_addr, &fit_uname_config)) {
debug("* fdt: config '%s' from image at "
"0x%08lx\n",
fit_uname_config, fdt_addr);
} else if (fit_parse_subimage(argv[3], default_addr,
&fdt_addr, &fit_uname_fdt)) {
debug("* fdt: subimage '%s' from image at "
"0x%08lx\n",
fit_uname_fdt, fdt_addr);
} else
#endif
{
fdt_addr = simple_strtoul(argv[3], NULL, 16);
debug("* fdt: cmdline image address = "
"0x%08lx\n",
fdt_addr);
}
#if defined(CONFIG_FIT)
} else {
/* use FIT configuration provided in first bootm
* command argument
*/
fdt_addr = (ulong)images->fit_hdr_os;
fit_uname_config = images->fit_uname_cfg;
debug("* fdt: using config '%s' from image "
"at 0x%08lx\n",
fit_uname_config, fdt_addr);
/*
* Check whether configuration has FDT blob defined,
* if not quit silently.
*/
fit_hdr = (void *)fdt_addr;
cfg_noffset = fit_conf_get_node(fit_hdr,
fit_uname_config);
if (cfg_noffset < 0) {
fdt_noffset = fit_conf_get_fdt_node(fit_hdr,
cfg_noffset);
if (fdt_noffset < 0) {
return 0;
}
}
#endif
debug("## Checking for 'FDT'/'FDT Image' at %08lx\n",
fdt_addr);
/* copy from dataflash if needed */
/*
* Check if there is an FDT image at the
* address provided in the second bootm argument
* check image type, for FIT images get a FIT node.
*/
switch (genimg_get_format((void *)fdt_addr)) {
case IMAGE_FORMAT_LEGACY:
/* verify fdt_addr points to a valid image header */
printf("## Flattened Device Tree from Legacy Image "
"at %08lx\n",
if (!fdt_hdr)
goto error;
/*
* move image data to the load address,
* make sure we don't overwrite initial image
*/
image_start = (ulong)fdt_hdr;
image_data = (ulong)image_get_data(fdt_hdr);
image_end = image_get_image_end(fdt_hdr);
load_start = image_get_load(fdt_hdr);
load_end = load_start + image_get_data_size(fdt_hdr);
if (load_start == image_start ||
load_start == image_data) {
fdt_blob = (char *)image_data;
break;
}
if ((load_start < image_end) && (load_end > image_start)) {
debug(" Loading FDT from 0x%08lx to 0x%08lx\n",
image_data, load_start);
(void *)image_data,
fdt_blob = (char *)load_start;
break;
case IMAGE_FORMAT_FIT:
/*
* This case will catch both: new uImage format
* (libfdt based) and raw FDT blob (also libfdt
* based).
*/
#if defined(CONFIG_FIT)
/* check FDT blob vs FIT blob */
if (fit_check_format((const void *)fdt_addr)) {
/*
* FIT image
*/
fit_hdr = (void *)fdt_addr;
printf("## Flattened Device Tree from FIT "
"Image at %08lx\n",
fdt_addr);
if (!fit_uname_fdt) {
/*
* no FDT blob image node unit name,
* try to get config node first. If
* config unit node name is NULL
* fit_conf_get_node() will try to
* find default config node
*/
cfg_noffset = fit_conf_get_node(fit_hdr,
fit_uname_config);
if (cfg_noffset < 0) {
fdt_error("Could not find "
"configuration "
"node\n");
fit_uname_config = fdt_get_name(fit_hdr,
fdt_noffset = fit_conf_get_fdt_node(
fit_hdr,
fdt_noffset, NULL);
} else {
/* get FDT component image node offset */
fdt_noffset = fit_image_get_node(
fit_hdr,
fit_uname_fdt);
}
if (fdt_noffset < 0) {
fdt_error("Could not find subimage "
"node\n");
printf(" Trying '%s' FDT blob subimage\n",
if (!fit_check_fdt(fit_hdr, fdt_noffset,
images->verify))
goto error;
/* get ramdisk image data address and length */
if (fit_image_get_data(fit_hdr, fdt_noffset,
fdt_error("Could not find FDT "
"subimage data");
goto error;
}
/* verift that image data is a proper FDT blob */
if (fdt_check_header((char *)data) != 0) {
fdt_error("Subimage data is not a FTD");
goto error;
}
/*
* move image data to the load address,
* make sure we don't overwrite initial image
*/
image_start = (ulong)fit_hdr;
if (fit_image_get_load(fit_hdr, fdt_noffset,
&load_start) == 0) {
load_end = load_start + size;
if ((load_start < image_end) &&
(load_end > image_start)) {
printf(" Loading FDT from 0x%08lx "
"to 0x%08lx\n",
(ulong)data,
load_start);
(void *)data, size);
fdt_blob = (char *)load_start;
} else {
fdt_blob = (char *)data;
}
images->fit_hdr_fdt = fit_hdr;
images->fit_uname_fdt = fit_uname_fdt;
images->fit_noffset_fdt = fdt_noffset;
break;
} else
#endif
{
/*
* FDT blob
*/
fdt_blob = (char *)fdt_addr;
debug("* fdt: raw FDT blob\n");
printf("## Flattened Device Tree blob at "
"%08lx\n", (long)fdt_blob);
}
break;
default:
puts("ERROR: Did not find a cmdline Flattened Device "
"Tree\n");
printf(" Booting using the fdt blob at 0x%p\n", fdt_blob);
} else if (images->legacy_hdr_valid &&
image_check_type(&images->legacy_hdr_os_copy,
IH_TYPE_MULTI)) {
ulong fdt_data, fdt_len;
/*
* Now check if we have a legacy multi-component image,
* get second entry data start address and len.
*/
printf("## Flattened Device Tree from multi "
"component Image at %08lX\n",
(ulong)images->legacy_hdr_os);
image_multi_getimg(images->legacy_hdr_os, 2, &fdt_data,
&fdt_len);
if (fdt_len) {
fdt_blob = (char *)fdt_data;
printf(" Booting using the fdt at 0x%p\n", fdt_blob);
if (fdt_check_header(fdt_blob) != 0) {
fdt_error("image is not a fdt");
if (fdt_totalsize(fdt_blob) != fdt_len) {
goto error;
}
} else {
debug("## No Flattened Device Tree\n");
return 0;
}
} else {
debug("## No Flattened Device Tree\n");
return 0;
}
*of_flat_tree = fdt_blob;
*of_size = fdt_totalsize(fdt_blob);
debug(" of_flat_tree at 0x%08lx size 0x%08lx\n",
return 0;
error:
*of_flat_tree = 0;
*of_size = 0;
return 1;
}
#endif /* CONFIG_OF_LIBFDT */
#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
* boot_get_cmdline - allocate and initialize kernel cmdline
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @cmd_start: pointer to a ulong variable, will hold cmdline start
* @cmd_end: pointer to a ulong variable, will hold cmdline end
*
* boot_get_cmdline() allocates space for kernel command line below
* BOOTMAPSZ + getenv_bootm_low() address. If "bootargs" U-boot environemnt
* variable is present its contents is copied to allocated kernel
* command line.
*
* returns:
* 0 - success
* -1 - failure
int boot_get_cmdline(struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
{
char *cmdline;
char *s;
cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
getenv_bootm_mapsize() + getenv_bootm_low());
if (cmdline == NULL)
return -1;
if ((s = getenv("bootargs")) == NULL)
s = "";
strcpy(cmdline, s);
*cmd_start = (ulong) & cmdline[0];
*cmd_end = *cmd_start + strlen(cmdline);
debug("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
#endif /* CONFIG_SYS_BOOT_GET_CMDLINE */
#ifdef CONFIG_SYS_BOOT_GET_KBD
* boot_get_kbd - allocate and initialize kernel copy of board info
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @kbd: double pointer to board info data
*
* boot_get_kbd() allocates space for kernel copy of board info data below
* BOOTMAPSZ + getenv_bootm_low() address and kernel board info is initialized
* with the current u-boot board info data.
*
* returns:
* 0 - success
* -1 - failure
int boot_get_kbd(struct lmb *lmb, bd_t **kbd)
*kbd = (bd_t *)(ulong)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
getenv_bootm_mapsize() + getenv_bootm_low());
if (*kbd == NULL)
return -1;
**kbd = *(gd->bd);
debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
#if defined(DEBUG) && defined(CONFIG_CMD_BDI)
do_bdinfo(NULL, 0, 0, NULL);
#endif
#endif /* CONFIG_SYS_BOOT_GET_KBD */
#if defined(CONFIG_FIT)
/*****************************************************************************/
/* New uImage format routines */
/*****************************************************************************/
static int fit_parse_spec(const char *spec, char sepc, ulong addr_curr,
ulong *addr, const char **name)
{
const char *sep;
*addr = addr_curr;
*name = NULL;
if (sep) {
if (sep - spec > 0)
*addr = simple_strtoul(spec, NULL, 16);
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
*name = sep + 1;
return 1;
}
return 0;
}
/**
* fit_parse_conf - parse FIT configuration spec
* @spec: input string, containing configuration spec
* @add_curr: current image address (to be used as a possible default)
* @addr: pointer to a ulong variable, will hold FIT image address of a given
* configuration
* @conf_name double pointer to a char, will hold pointer to a configuration
* unit name
*
* fit_parse_conf() expects configuration spec in the for of [<addr>]#<conf>,
* where <addr> is a FIT image address that contains configuration
* with a <conf> unit name.
*
* Address part is optional, and if omitted default add_curr will
* be used instead.
*
* returns:
* 1 if spec is a valid configuration string,
* addr and conf_name are set accordingly
* 0 otherwise
*/
inline int fit_parse_conf(const char *spec, ulong addr_curr,
ulong *addr, const char **conf_name)
{
return fit_parse_spec(spec, '#', addr_curr, addr, conf_name);
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
}
/**
* fit_parse_subimage - parse FIT subimage spec
* @spec: input string, containing subimage spec
* @add_curr: current image address (to be used as a possible default)
* @addr: pointer to a ulong variable, will hold FIT image address of a given
* subimage
* @image_name: double pointer to a char, will hold pointer to a subimage name
*
* fit_parse_subimage() expects subimage spec in the for of
* [<addr>]:<subimage>, where <addr> is a FIT image address that contains
* subimage with a <subimg> unit name.
*
* Address part is optional, and if omitted default add_curr will
* be used instead.
*
* returns:
* 1 if spec is a valid subimage string,
* addr and image_name are set accordingly
* 0 otherwise
*/
inline int fit_parse_subimage(const char *spec, ulong addr_curr,
ulong *addr, const char **image_name)
{
return fit_parse_spec(spec, ':', addr_curr, addr, image_name);
}
#endif /* !USE_HOSTCC */
static void fit_get_debug(const void *fit, int noffset,
char *prop_name, int err)
{
debug("Can't get '%s' property from FIT 0x%08lx, "
"node: offset %d, name %s (%s)\n",
prop_name, (ulong)fit, noffset,
fit_get_name(fit, noffset, NULL),
fdt_strerror(err));
* fit_print_contents - prints out the contents of the FIT format image
* @fit: pointer to the FIT format image header
* @p: pointer to prefix string
*
* fit_print_contents() formats a multi line FIT image contents description.
* The routine prints out FIT image properties (root node level) follwed by
* the details of each component image.
*
* returns:
* no returned results
*/
void fit_print_contents(const void *fit)
{
char *desc;
char *uname;
int images_noffset;
int confs_noffset;
int noffset;
int ndepth;
int count = 0;
int ret;
#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
time_t timestamp;
#endif
#ifdef USE_HOSTCC
p = "";
#else
p = " ";
#endif
ret = fit_get_desc(fit, 0, &desc);
printf("%sFIT description: ", p);
#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
ret = fit_get_timestamp(fit, 0, ×tamp);
printf("%sCreated: ", p);
#endif
/* Find images parent node offset */
images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
printf("Can't find images parent node '%s' (%s)\n",
FIT_IMAGES_PATH, fdt_strerror(images_noffset));
return;
}
/* Process its subnodes, print out component images details */
for (ndepth = 0, count = 0,
noffset = fdt_next_node(fit, images_noffset, &ndepth);
(noffset >= 0) && (ndepth > 0);
noffset = fdt_next_node(fit, noffset, &ndepth)) {
if (ndepth == 1) {
/*
* Direct child node of the images parent node,
* i.e. component image node.
*/
printf("%s Image %u (%s)\n", p, count++,
fit_get_name(fit, noffset, NULL));
}
}
/* Find configurations parent node offset */
confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH);
debug("Can't get configurations parent node '%s' (%s)\n",
FIT_CONFS_PATH, fdt_strerror(confs_noffset));
return;
}
/* get default configuration unit name from default property */
uname = (char *)fdt_getprop(fit, noffset, FIT_DEFAULT_PROP, NULL);
printf("%s Default Configuration: '%s'\n", p, uname);
/* Process its subnodes, print out configurations details */
for (ndepth = 0, count = 0,
noffset = fdt_next_node(fit, confs_noffset, &ndepth);
(noffset >= 0) && (ndepth > 0);
noffset = fdt_next_node(fit, noffset, &ndepth)) {
if (ndepth == 1) {
/*
* Direct child node of the configurations parent node,
* i.e. configuration node.
*/
printf("%s Configuration %u (%s)\n", p, count++,
fit_get_name(fit, noffset, NULL));
}
}
}
/**
* fit_image_print - prints out the FIT component image details
* @fit: pointer to the FIT format image header
* @image_noffset: offset of the component image node
* @p: pointer to prefix string
*
* fit_image_print() lists all mandatory properies for the processed component
Bartlomiej Sieka
committed
* image. If present, hash nodes are printed out as well. Load
* address for images of type firmware is also printed out. Since the load
* address is not mandatory for firmware images, it will be output as
* "unavailable" when not present.
*
* returns:
* no returned results
*/
void fit_image_print(const void *fit, int image_noffset, const char *p)
{
char *desc;
uint8_t type, arch, os, comp;
size_t size;
ulong load, entry;
const void *data;