mirror of
https://xff.cz/git/u-boot/
synced 2025-09-04 02:02:08 +02:00
checkpatch whitespace cleanups
This avoids the following checkpatch warning in later patches: ERROR: "(foo*)" should be "(foo *)" ERROR: space required before the open brace '{' ERROR: space prohibited before that close parenthesis ')' ERROR: spaces required around that '||' (ctx:WxV) WARNING: space prohibited between function name and open parenthesis '(' WARNING: line over 80 characters This fixes all the white-space warnings/errors in my subsequent patch, and within this current patch. A number of other checkpatch warnings and errors are still present in this patch itself, but are beyond simple whitespace fixes, so are not solved by this patch. v2: New patch Signed-off-by: Stephen Warren <swarren@nvidia.com> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Wolfgang Denk
parent
83c484d7ec
commit
712fbcf384
@@ -91,8 +91,9 @@ static image_header_t *image_get_kernel (ulong img_addr, int verify);
|
||||
static int fit_check_kernel(const void *fit, int os_noffset, int verify);
|
||||
#endif
|
||||
|
||||
static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char * const argv[],
|
||||
bootm_headers_t *images, ulong *os_data, ulong *os_len);
|
||||
static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[], bootm_headers_t *images,
|
||||
ulong *os_data, ulong *os_len);
|
||||
|
||||
/*
|
||||
* Continue booting an OS image; caller already has:
|
||||
@@ -335,8 +336,8 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||
printf(" Uncompressing %s ... ", type_name);
|
||||
if (gunzip((void *)load, unc_len,
|
||||
(uchar *)image_start, &image_len) != 0) {
|
||||
puts ("GUNZIP: uncompress, out-of-mem or overwrite error "
|
||||
"- must RESET board to recover\n");
|
||||
puts("GUNZIP: uncompress, out-of-mem or overwrite "
|
||||
"error - must RESET board to recover\n");
|
||||
if (boot_progress)
|
||||
show_boot_progress(-6);
|
||||
return BOOTM_ERR_RESET;
|
||||
@@ -417,8 +418,10 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||
show_boot_progress(7);
|
||||
|
||||
if ((load < blob_end) && (*load_end > blob_start)) {
|
||||
debug ("images.os.start = 0x%lX, images.os.end = 0x%lx\n", blob_start, blob_end);
|
||||
debug ("images.os.load = 0x%lx, load_end = 0x%lx\n", load, *load_end);
|
||||
debug("images.os.start = 0x%lX, images.os.end = 0x%lx\n",
|
||||
blob_start, blob_end);
|
||||
debug("images.os.load = 0x%lx, load_end = 0x%lx\n", load,
|
||||
*load_end);
|
||||
|
||||
return BOOTM_ERR_OVERLAP;
|
||||
}
|
||||
@@ -460,7 +463,8 @@ static cmd_tbl_t cmd_bootm_sub[] = {
|
||||
U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""),
|
||||
};
|
||||
|
||||
int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
long state;
|
||||
@@ -627,9 +631,12 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
do_reset(cmdtp, flag, argc, argv);
|
||||
if (ret == BOOTM_ERR_OVERLAP) {
|
||||
if (images.legacy_hdr_valid) {
|
||||
if (image_get_type (&images.legacy_hdr_os_copy) == IH_TYPE_MULTI)
|
||||
puts ("WARNING: legacy format multi component "
|
||||
"image overwritten\n");
|
||||
image_header_t *hdr;
|
||||
hdr = &images.legacy_hdr_os_copy;
|
||||
if (image_get_type(hdr) == IH_TYPE_MULTI)
|
||||
puts("WARNING: legacy format multi "
|
||||
"component image "
|
||||
"overwritten\n");
|
||||
} else {
|
||||
puts("ERROR: new format image overwritten - "
|
||||
"must RESET the board to recover\n");
|
||||
@@ -811,8 +818,9 @@ static int fit_check_kernel (const void *fit, int os_noffset, int verify)
|
||||
* pointer to image header if valid image was found, plus kernel start
|
||||
* address and length, otherwise NULL
|
||||
*/
|
||||
static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
|
||||
bootm_headers_t *images, ulong *os_data, ulong *os_len)
|
||||
static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[], bootm_headers_t *images, ulong *os_data,
|
||||
ulong *os_len)
|
||||
{
|
||||
image_header_t *hdr;
|
||||
ulong img_addr;
|
||||
@@ -876,16 +884,18 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const
|
||||
*os_len = image_get_data_size(hdr);
|
||||
break;
|
||||
default:
|
||||
printf ("Wrong Image Type for %s command\n", cmdtp->name);
|
||||
printf("Wrong Image Type for %s command\n",
|
||||
cmdtp->name);
|
||||
show_boot_progress(-5);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* copy image header to allow for image overwrites during kernel
|
||||
* decompression.
|
||||
* copy image header to allow for image overwrites during
|
||||
* kernel decompression.
|
||||
*/
|
||||
memmove (&images->legacy_hdr_os_copy, hdr, sizeof(image_header_t));
|
||||
memmove(&images->legacy_hdr_os_copy, hdr,
|
||||
sizeof(image_header_t));
|
||||
|
||||
/* save pointer to image header */
|
||||
images->legacy_hdr_os = hdr;
|
||||
@@ -910,10 +920,12 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const
|
||||
/*
|
||||
* no kernel 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
|
||||
* fit_conf_get_node() will try to find default config
|
||||
* node
|
||||
*/
|
||||
show_boot_progress(101);
|
||||
cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
|
||||
cfg_noffset = fit_conf_get_node(fit_hdr,
|
||||
fit_uname_config);
|
||||
if (cfg_noffset < 0) {
|
||||
show_boot_progress(-101);
|
||||
return NULL;
|
||||
@@ -921,16 +933,22 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const
|
||||
/* save configuration uname provided in the first
|
||||
* bootm argument
|
||||
*/
|
||||
images->fit_uname_cfg = fdt_get_name (fit_hdr, cfg_noffset, NULL);
|
||||
printf (" Using '%s' configuration\n", images->fit_uname_cfg);
|
||||
images->fit_uname_cfg = fdt_get_name(fit_hdr,
|
||||
cfg_noffset,
|
||||
NULL);
|
||||
printf(" Using '%s' configuration\n",
|
||||
images->fit_uname_cfg);
|
||||
show_boot_progress(103);
|
||||
|
||||
os_noffset = fit_conf_get_kernel_node (fit_hdr, cfg_noffset);
|
||||
fit_uname_kernel = fit_get_name (fit_hdr, os_noffset, NULL);
|
||||
os_noffset = fit_conf_get_kernel_node(fit_hdr,
|
||||
cfg_noffset);
|
||||
fit_uname_kernel = fit_get_name(fit_hdr, os_noffset,
|
||||
NULL);
|
||||
} else {
|
||||
/* get kernel component image node offset */
|
||||
show_boot_progress(102);
|
||||
os_noffset = fit_image_get_node (fit_hdr, fit_uname_kernel);
|
||||
os_noffset = fit_image_get_node(fit_hdr,
|
||||
fit_uname_kernel);
|
||||
}
|
||||
if (os_noffset < 0) {
|
||||
show_boot_progress(-103);
|
||||
@@ -1307,7 +1325,8 @@ static int do_bootm_netbsd (int flag, int argc, char * const argv[],
|
||||
|
||||
loader = (void (*)(bd_t *, image_header_t *, char *, char *))images->ep;
|
||||
|
||||
printf ("## Transferring control to NetBSD stage-2 loader (at address %08lx) ...\n",
|
||||
printf("## Transferring control to NetBSD stage-2 loader "
|
||||
"(at address %08lx) ...\n",
|
||||
(ulong)loader);
|
||||
|
||||
show_boot_progress(15);
|
||||
|
165
common/image.c
165
common/image.c
@@ -555,7 +555,8 @@ const char *genimg_get_os_name (uint8_t os)
|
||||
|
||||
const char *genimg_get_arch_name(uint8_t arch)
|
||||
{
|
||||
return (get_table_entry_name (uimage_arch, "Unknown Architecture", arch));
|
||||
return (get_table_entry_name(uimage_arch, "Unknown Architecture",
|
||||
arch));
|
||||
}
|
||||
|
||||
const char *genimg_get_type_name(uint8_t type)
|
||||
@@ -565,7 +566,8 @@ const char *genimg_get_type_name (uint8_t type)
|
||||
|
||||
const char *genimg_get_comp_name(uint8_t comp)
|
||||
{
|
||||
return (get_table_entry_name (uimage_comp, "Unknown Compression", comp));
|
||||
return (get_table_entry_name(uimage_comp, "Unknown Compression",
|
||||
comp));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -710,19 +712,23 @@ ulong genimg_get_image (ulong img_addr)
|
||||
/* get data size */
|
||||
switch (genimg_get_format((void *)ram_addr)) {
|
||||
case IMAGE_FORMAT_LEGACY:
|
||||
d_size = image_get_data_size ((const image_header_t *)ram_addr);
|
||||
debug (" Legacy format image found at 0x%08lx, size 0x%08lx\n",
|
||||
d_size = image_get_data_size(
|
||||
(const image_header_t *)ram_addr);
|
||||
debug(" Legacy format image found at 0x%08lx, "
|
||||
"size 0x%08lx\n",
|
||||
ram_addr, d_size);
|
||||
break;
|
||||
#if defined(CONFIG_FIT)
|
||||
case IMAGE_FORMAT_FIT:
|
||||
d_size = fit_get_size((const void *)ram_addr) - h_size;
|
||||
debug (" FIT/FDT format image found at 0x%08lx, size 0x%08lx\n",
|
||||
debug(" FIT/FDT format image found at 0x%08lx, "
|
||||
"size 0x%08lx\n",
|
||||
ram_addr, d_size);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf (" No valid image found at 0x%08lx\n", img_addr);
|
||||
printf(" No valid image found at 0x%08lx\n",
|
||||
img_addr);
|
||||
return ram_addr;
|
||||
}
|
||||
|
||||
@@ -825,17 +831,20 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
|
||||
if (fit_parse_conf(argv[2], default_addr,
|
||||
&rd_addr, &fit_uname_config)) {
|
||||
debug ("* ramdisk: config '%s' from image at 0x%08lx\n",
|
||||
debug("* ramdisk: config '%s' from image at "
|
||||
"0x%08lx\n",
|
||||
fit_uname_config, rd_addr);
|
||||
} else if (fit_parse_subimage(argv[2], default_addr,
|
||||
&rd_addr, &fit_uname_ramdisk)) {
|
||||
debug ("* ramdisk: subimage '%s' from image at 0x%08lx\n",
|
||||
debug("* ramdisk: subimage '%s' from image at "
|
||||
"0x%08lx\n",
|
||||
fit_uname_ramdisk, rd_addr);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
rd_addr = simple_strtoul(argv[2], NULL, 16);
|
||||
debug ("* ramdisk: cmdline image address = 0x%08lx\n",
|
||||
debug("* ramdisk: cmdline image address = "
|
||||
"0x%08lx\n",
|
||||
rd_addr);
|
||||
}
|
||||
#if defined(CONFIG_FIT)
|
||||
@@ -845,7 +854,8 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
*/
|
||||
rd_addr = (ulong)images->fit_hdr_os;
|
||||
fit_uname_config = images->fit_uname_cfg;
|
||||
debug ("* ramdisk: using config '%s' from image at 0x%08lx\n",
|
||||
debug("* ramdisk: using config '%s' from image "
|
||||
"at 0x%08lx\n",
|
||||
fit_uname_config, rd_addr);
|
||||
|
||||
/*
|
||||
@@ -853,13 +863,15 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
* if not, don't try to use it, quit silently.
|
||||
*/
|
||||
fit_hdr = (void *)rd_addr;
|
||||
cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
|
||||
cfg_noffset = fit_conf_get_node(fit_hdr,
|
||||
fit_uname_config);
|
||||
if (cfg_noffset < 0) {
|
||||
debug("* ramdisk: no such config\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
|
||||
rd_noffset = fit_conf_get_ramdisk_node(fit_hdr,
|
||||
cfg_noffset);
|
||||
if (rd_noffset < 0) {
|
||||
debug("* ramdisk: no ramdisk in config\n");
|
||||
return 0;
|
||||
@@ -912,21 +924,28 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
* fit_conf_get_node() will try to find default config node
|
||||
*/
|
||||
show_boot_progress(122);
|
||||
cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
|
||||
cfg_noffset = fit_conf_get_node(fit_hdr,
|
||||
fit_uname_config);
|
||||
if (cfg_noffset < 0) {
|
||||
puts ("Could not find configuration node\n");
|
||||
puts("Could not find configuration "
|
||||
"node\n");
|
||||
show_boot_progress(-122);
|
||||
return 1;
|
||||
}
|
||||
fit_uname_config = fdt_get_name (fit_hdr, cfg_noffset, NULL);
|
||||
printf (" Using '%s' configuration\n", fit_uname_config);
|
||||
fit_uname_config = fdt_get_name(fit_hdr,
|
||||
cfg_noffset, NULL);
|
||||
printf(" Using '%s' configuration\n",
|
||||
fit_uname_config);
|
||||
|
||||
rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
|
||||
fit_uname_ramdisk = fit_get_name (fit_hdr, rd_noffset, NULL);
|
||||
rd_noffset = fit_conf_get_ramdisk_node(fit_hdr,
|
||||
cfg_noffset);
|
||||
fit_uname_ramdisk = fit_get_name(fit_hdr,
|
||||
rd_noffset, NULL);
|
||||
} else {
|
||||
/* get ramdisk component image node offset */
|
||||
show_boot_progress(123);
|
||||
rd_noffset = fit_image_get_node (fit_hdr, fit_uname_ramdisk);
|
||||
rd_noffset = fit_image_get_node(fit_hdr,
|
||||
fit_uname_ramdisk);
|
||||
}
|
||||
if (rd_noffset < 0) {
|
||||
puts("Could not find subimage node\n");
|
||||
@@ -934,14 +953,17 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf (" Trying '%s' ramdisk subimage\n", fit_uname_ramdisk);
|
||||
printf(" Trying '%s' ramdisk subimage\n",
|
||||
fit_uname_ramdisk);
|
||||
|
||||
show_boot_progress(125);
|
||||
if (!fit_check_ramdisk (fit_hdr, rd_noffset, arch, images->verify))
|
||||
if (!fit_check_ramdisk(fit_hdr, rd_noffset, arch,
|
||||
images->verify))
|
||||
return 1;
|
||||
|
||||
/* get ramdisk image data address and length */
|
||||
if (fit_image_get_data (fit_hdr, rd_noffset, &data, &size)) {
|
||||
if (fit_image_get_data(fit_hdr, rd_noffset, &data,
|
||||
&size)) {
|
||||
puts("Could not find ramdisk subimage data!\n");
|
||||
show_boot_progress(-127);
|
||||
return 1;
|
||||
@@ -952,7 +974,8 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
rd_len = size;
|
||||
|
||||
if (fit_image_get_load(fit_hdr, rd_noffset, &rd_load)) {
|
||||
puts ("Can't get ramdisk subimage load address!\n");
|
||||
puts("Can't get ramdisk subimage load "
|
||||
"address!\n");
|
||||
show_boot_progress(-129);
|
||||
return 1;
|
||||
}
|
||||
@@ -969,7 +992,9 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
return 1;
|
||||
}
|
||||
} else if (images->legacy_hdr_valid &&
|
||||
image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) {
|
||||
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.
|
||||
@@ -1058,9 +1083,11 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
|
||||
lmb_reserve(lmb, rd_data, rd_len);
|
||||
} else {
|
||||
if (initrd_high)
|
||||
*initrd_start = (ulong)lmb_alloc_base (lmb, rd_len, 0x1000, initrd_high);
|
||||
*initrd_start = (ulong)lmb_alloc_base(lmb,
|
||||
rd_len, 0x1000, initrd_high);
|
||||
else
|
||||
*initrd_start = (ulong)lmb_alloc (lmb, rd_len, 0x1000);
|
||||
*initrd_start = (ulong)lmb_alloc(lmb, rd_len,
|
||||
0x1000);
|
||||
|
||||
if (*initrd_start == 0) {
|
||||
puts("ramdisk - allocation error\n");
|
||||
@@ -1332,8 +1359,8 @@ error:
|
||||
* 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)
|
||||
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;
|
||||
@@ -1372,17 +1399,20 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
|
||||
if (fit_parse_conf(argv[3], default_addr,
|
||||
&fdt_addr, &fit_uname_config)) {
|
||||
debug ("* fdt: config '%s' from image at 0x%08lx\n",
|
||||
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",
|
||||
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",
|
||||
debug("* fdt: cmdline image address = "
|
||||
"0x%08lx\n",
|
||||
fdt_addr);
|
||||
}
|
||||
#if defined(CONFIG_FIT)
|
||||
@@ -1392,7 +1422,8 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
*/
|
||||
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",
|
||||
debug("* fdt: using config '%s' from image "
|
||||
"at 0x%08lx\n",
|
||||
fit_uname_config, fdt_addr);
|
||||
|
||||
/*
|
||||
@@ -1430,7 +1461,8 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
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",
|
||||
printf("## Flattened Device Tree from Legacy Image "
|
||||
"at %08lx\n",
|
||||
fdt_addr);
|
||||
fdt_hdr = image_get_fdt(fdt_addr);
|
||||
if (!fdt_hdr)
|
||||
@@ -1473,7 +1505,8 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
* FIT image
|
||||
*/
|
||||
fit_hdr = (void *)fdt_addr;
|
||||
printf ("## Flattened Device Tree from FIT Image at %08lx\n",
|
||||
printf("## Flattened Device Tree from FIT "
|
||||
"Image at %08lx\n",
|
||||
fdt_addr);
|
||||
|
||||
if (!fit_uname_fdt) {
|
||||
@@ -1488,7 +1521,9 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
fit_uname_config);
|
||||
|
||||
if (cfg_noffset < 0) {
|
||||
fdt_error ("Could not find configuration node\n");
|
||||
fdt_error("Could not find "
|
||||
"configuration "
|
||||
"node\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -1497,17 +1532,20 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
printf(" Using '%s' configuration\n",
|
||||
fit_uname_config);
|
||||
|
||||
fdt_noffset = fit_conf_get_fdt_node (fit_hdr,
|
||||
fdt_noffset = fit_conf_get_fdt_node(
|
||||
fit_hdr,
|
||||
cfg_noffset);
|
||||
fit_uname_fdt = fit_get_name(fit_hdr,
|
||||
fdt_noffset, NULL);
|
||||
} else {
|
||||
/* get FDT component image node offset */
|
||||
fdt_noffset = fit_image_get_node (fit_hdr,
|
||||
fdt_noffset = fit_image_get_node(
|
||||
fit_hdr,
|
||||
fit_uname_fdt);
|
||||
}
|
||||
if (fdt_noffset < 0) {
|
||||
fdt_error ("Could not find subimage node\n");
|
||||
fdt_error("Could not find subimage "
|
||||
"node\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -1521,7 +1559,8 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
/* get ramdisk image data address and length */
|
||||
if (fit_image_get_data(fit_hdr, fdt_noffset,
|
||||
&data, &size)) {
|
||||
fdt_error ("Could not find FDT subimage data");
|
||||
fdt_error("Could not find FDT "
|
||||
"subimage data");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -1548,8 +1587,10 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
goto error;
|
||||
}
|
||||
|
||||
printf (" Loading FDT from 0x%08lx to 0x%08lx\n",
|
||||
(ulong)data, load_start);
|
||||
printf(" Loading FDT from 0x%08lx "
|
||||
"to 0x%08lx\n",
|
||||
(ulong)data,
|
||||
load_start);
|
||||
|
||||
memmove((void *)load_start,
|
||||
(void *)data, size);
|
||||
@@ -1571,18 +1612,21 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
*/
|
||||
fdt_blob = (char *)fdt_addr;
|
||||
debug("* fdt: raw FDT blob\n");
|
||||
printf ("## Flattened Device Tree blob at %08lx\n", (long)fdt_blob);
|
||||
printf("## Flattened Device Tree blob at "
|
||||
"%08lx\n", (long)fdt_blob);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
puts ("ERROR: Did not find a cmdline Flattened Device Tree\n");
|
||||
puts("ERROR: Did not find a cmdline Flattened Device "
|
||||
"Tree\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
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)) {
|
||||
image_check_type(&images->legacy_hdr_os_copy,
|
||||
IH_TYPE_MULTI)) {
|
||||
|
||||
ulong fdt_data, fdt_len;
|
||||
|
||||
@@ -1594,7 +1638,8 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag
|
||||
"component Image at %08lX\n",
|
||||
(ulong)images->legacy_hdr_os);
|
||||
|
||||
image_multi_getimg (images->legacy_hdr_os, 2, &fdt_data, &fdt_len);
|
||||
image_multi_getimg(images->legacy_hdr_os, 2, &fdt_data,
|
||||
&fdt_len);
|
||||
if (fdt_len) {
|
||||
|
||||
fdt_blob = (char *)fdt_data;
|
||||
@@ -1855,7 +1900,8 @@ void fit_print_contents (const void *fit)
|
||||
}
|
||||
|
||||
/* Process its subnodes, print out component images details */
|
||||
for (ndepth = 0, count = 0, noffset = fdt_next_node (fit, images_noffset, &ndepth);
|
||||
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) {
|
||||
@@ -1884,7 +1930,8 @@ void fit_print_contents (const void *fit)
|
||||
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);
|
||||
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) {
|
||||
@@ -2604,11 +2651,13 @@ int fit_image_set_hashes (void *fit, int image_noffset)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (calculate_hash (data, size, algo, value, &value_len)) {
|
||||
if (calculate_hash(data, size, algo, value,
|
||||
&value_len)) {
|
||||
printf("Unsupported hash algorithm (%s) for "
|
||||
"'%s' hash node in '%s' image node\n",
|
||||
algo, fit_get_name(fit, noffset, NULL),
|
||||
fit_get_name (fit, image_noffset, NULL));
|
||||
fit_get_name(fit, image_noffset,
|
||||
NULL));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2720,8 +2769,10 @@ int fit_image_check_hashes (const void *fit, int image_noffset)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (calculate_hash (data, size, algo, value, &value_len)) {
|
||||
err_msg = " error!\nUnsupported hash algorithm";
|
||||
if (calculate_hash(data, size, algo, value,
|
||||
&value_len)) {
|
||||
err_msg = " error!\n"
|
||||
"Unsupported hash algorithm";
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -2951,9 +3002,11 @@ int fit_conf_get_node (const void *fit, const char *conf_uname)
|
||||
if (conf_uname == NULL) {
|
||||
/* get configuration unit name from the default property */
|
||||
debug("No configuration specified, trying default...\n");
|
||||
conf_uname = (char *)fdt_getprop (fit, confs_noffset, FIT_DEFAULT_PROP, &len);
|
||||
conf_uname = (char *)fdt_getprop(fit, confs_noffset,
|
||||
FIT_DEFAULT_PROP, &len);
|
||||
if (conf_uname == NULL) {
|
||||
fit_get_debug (fit, confs_noffset, FIT_DEFAULT_PROP, len);
|
||||
fit_get_debug(fit, confs_noffset, FIT_DEFAULT_PROP,
|
||||
len);
|
||||
return len;
|
||||
}
|
||||
debug("Found default configuration: '%s'\n", conf_uname);
|
||||
@@ -2961,7 +3014,8 @@ int fit_conf_get_node (const void *fit, const char *conf_uname)
|
||||
|
||||
noffset = fdt_subnode_offset(fit, confs_noffset, conf_uname);
|
||||
if (noffset < 0) {
|
||||
debug ("Can't get node offset for configuration unit name: '%s' (%s)\n",
|
||||
debug("Can't get node offset for configuration unit name: "
|
||||
"'%s' (%s)\n",
|
||||
conf_uname, fdt_strerror(noffset));
|
||||
}
|
||||
|
||||
@@ -3097,7 +3151,8 @@ void fit_conf_print (const void *fit, int noffset, const char *p)
|
||||
* 0, on failure
|
||||
*/
|
||||
#ifndef USE_HOSTCC
|
||||
static int fit_check_ramdisk (const void *fit, int rd_noffset, uint8_t arch, int verify)
|
||||
static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
|
||||
int verify)
|
||||
{
|
||||
fit_image_print(fit, rd_noffset, " ");
|
||||
|
||||
|
@@ -40,7 +40,8 @@ void lynxkdi_boot (image_header_t *hdr)
|
||||
/* Do a simple check for Bluecat so we can pass the
|
||||
* kernel command line parameters.
|
||||
*/
|
||||
if (le32_to_cpu (*psz) == image_get_data_size (hdr)) { /* FIXME: NOT SURE HERE ! */
|
||||
/* FIXME: NOT SURE HERE ! */
|
||||
if (le32_to_cpu(*psz) == image_get_data_size(hdr)) {
|
||||
char *args;
|
||||
char *cmdline = (char *)(image_get_load(hdr) + 0x020c);
|
||||
int len;
|
||||
@@ -52,7 +53,8 @@ void lynxkdi_boot (image_header_t *hdr)
|
||||
/* Prepend the cmdline */
|
||||
len = strlen(args);
|
||||
if (len && (len + strlen(cmdline) + 2 < (0x0400 - 0x020c))) {
|
||||
memmove (cmdline + strlen (args) + 1, cmdline, strlen (cmdline));
|
||||
memmove(cmdline + strlen(args) + 1, cmdline,
|
||||
strlen(cmdline));
|
||||
strcpy(cmdline, args);
|
||||
cmdline[len] = ' ';
|
||||
}
|
||||
|
@@ -338,8 +338,8 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
|
||||
|
||||
|
||||
#ifdef CONFIG_OF_LIBFDT
|
||||
int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images,
|
||||
char **of_flat_tree, ulong *of_size);
|
||||
int boot_get_fdt(int flag, int argc, char * const argv[],
|
||||
bootm_headers_t *images, char **of_flat_tree, ulong *of_size);
|
||||
void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob);
|
||||
int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user