Tidy up the warnings.
Signed-off-by: Simon Glass <sjg@chromium.org>
* pointer to a ramdisk image header, if image was found and valid
* otherwise, return NULL
*/
* pointer to a ramdisk image header, if image was found and valid
* otherwise, return NULL
*/
-static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch,
- int verify)
+static const image_header_t *image_get_ramdisk(ulong rd_addr, u8 arch,
+ int verify)
{
const image_header_t *rd_hdr = (const image_header_t *)rd_addr;
{
const image_header_t *rd_hdr = (const image_header_t *)rd_addr;
!image_check_arch(rd_hdr, arch) ||
!image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
printf("No Linux %s Ramdisk Image\n",
!image_check_arch(rd_hdr, arch) ||
!image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
printf("No Linux %s Ramdisk Image\n",
- genimg_get_arch_name(arch));
+ genimg_get_arch_name(arch));
bootstage_error(BOOTSTAGE_ID_RAMDISK);
return NULL;
}
bootstage_error(BOOTSTAGE_ID_RAMDISK);
return NULL;
}
ulong image_save_size; /* Default Save Size (in bytes) */
static int on_loadaddr(const char *name, const char *value, enum env_op op,
ulong image_save_size; /* Default Save Size (in bytes) */
static int on_loadaddr(const char *name, const char *value, enum env_op op,
{
switch (op) {
case env_op_create:
{
switch (op) {
case env_op_create:
ulong env_get_bootm_low(void)
{
char *s = env_get("bootm_low");
ulong env_get_bootm_low(void)
{
char *s = env_get("bootm_low");
if (s) {
ulong tmp = hextoul(s, NULL);
return tmp;
if (s) {
ulong tmp = hextoul(s, NULL);
return tmp;
phys_size_t tmp, size;
phys_addr_t start;
char *s = env_get("bootm_size");
phys_size_t tmp, size;
phys_addr_t start;
char *s = env_get("bootm_size");
if (s) {
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
return tmp;
if (s) {
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
return tmp;
{
phys_size_t tmp;
char *s = env_get("bootm_mapsize");
{
phys_size_t tmp;
char *s = env_get("bootm_mapsize");
if (s) {
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
return tmp;
if (s) {
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
return tmp;
}
while (len > 0) {
size_t tail = (len > chunksz) ? chunksz : len;
}
while (len > 0) {
size_t tail = (len > chunksz) ? chunksz : len;
WATCHDOG_RESET();
if (to > from) {
to -= tail;
WATCHDOG_RESET();
if (to > from) {
to -= tail;
* kernel start address
*/
ulong genimg_get_kernel_addr_fit(char * const img_addr,
* kernel start address
*/
ulong genimg_get_kernel_addr_fit(char * const img_addr,
- const char **fit_uname_config,
- const char **fit_uname_kernel)
+ const char **fit_uname_config,
+ const char **fit_uname_kernel)
* @rd_end: pointer to a ulong variable, will hold ramdisk end
*
* boot_get_ramdisk() is responsible for finding a valid ramdisk image.
* @rd_end: pointer to a ulong variable, will hold ramdisk end
*
* boot_get_ramdisk() is responsible for finding a valid ramdisk image.
- * Curently supported are the following ramdisk sources:
+ * Currently supported are the following ramdisk sources:
* - multicomponent kernel/ramdisk image,
* - commandline provided address of decicated ramdisk image.
*
* - multicomponent kernel/ramdisk image,
* - commandline provided address of decicated ramdisk image.
*
* rd_start and rd_end are set to 0 if no ramdisk exists
*/
int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
* rd_start and rd_end are set to 0 if no ramdisk exists
*/
int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
- uint8_t arch, ulong *rd_start, ulong *rd_end)
+ u8 arch, ulong *rd_start, ulong *rd_end)
{
ulong rd_addr, rd_load;
ulong rd_data, rd_len;
{
ulong rd_addr, rd_load;
ulong rd_data, rd_len;
*/
if (select && strcmp(select, "-") == 0) {
debug("## Skipping init Ramdisk\n");
*/
if (select && strcmp(select, "-") == 0) {
debug("## Skipping init Ramdisk\n");
+ rd_len = 0;
+ rd_data = 0;
} else if (select || genimg_has_config(images)) {
#if IMAGE_ENABLE_FIT
if (select) {
} else if (select || genimg_has_config(images)) {
#if IMAGE_ENABLE_FIT
if (select) {
if (fit_parse_conf(select, default_addr,
&rd_addr, &fit_uname_config)) {
if (fit_parse_conf(select, default_addr,
&rd_addr, &fit_uname_config)) {
- debug("* ramdisk: config '%s' from image at "
- "0x%08lx\n",
- fit_uname_config, rd_addr);
+ debug("* ramdisk: config '%s' from image at 0x%08lx\n",
+ fit_uname_config, rd_addr);
} else if (fit_parse_subimage(select, default_addr,
} else if (fit_parse_subimage(select, default_addr,
- &rd_addr, &fit_uname_ramdisk)) {
- debug("* ramdisk: subimage '%s' from image at "
- "0x%08lx\n",
- fit_uname_ramdisk, rd_addr);
+ &rd_addr,
+ &fit_uname_ramdisk)) {
+ debug("* ramdisk: subimage '%s' from image at 0x%08lx\n",
+ fit_uname_ramdisk, rd_addr);
} else
#endif
{
rd_addr = hextoul(select, NULL);
} else
#endif
{
rd_addr = hextoul(select, NULL);
- debug("* ramdisk: cmdline image address = "
- "0x%08lx\n",
- rd_addr);
+ debug("* ramdisk: cmdline image address = 0x%08lx\n",
+ rd_addr);
}
#if IMAGE_ENABLE_FIT
} else {
}
#if IMAGE_ENABLE_FIT
} else {
*/
rd_addr = map_to_sysmem(images->fit_hdr_os);
rd_noffset = fit_get_node_from_config(images,
*/
rd_addr = map_to_sysmem(images->fit_hdr_os);
rd_noffset = fit_get_node_from_config(images,
- FIT_RAMDISK_PROP, rd_addr);
+ FIT_RAMDISK_PROP,
+ rd_addr);
if (rd_noffset == -ENOENT)
return 0;
else if (rd_noffset < 0)
if (rd_noffset == -ENOENT)
return 0;
else if (rd_noffset < 0)
switch (genimg_get_format(buf)) {
#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
switch (genimg_get_format(buf)) {
#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
- printf("## Loading init Ramdisk from Legacy "
- "Image at %08lx ...\n", rd_addr);
+ printf("## Loading init Ramdisk from Legacy Image at %08lx ...\n",
+ rd_addr);
bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK);
rd_hdr = image_get_ramdisk(rd_addr, arch,
bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK);
rd_hdr = image_get_ramdisk(rd_addr, arch,
return 1;
rd_data = image_get_data(rd_hdr);
return 1;
rd_data = image_get_data(rd_hdr);
#if IMAGE_ENABLE_FIT
case IMAGE_FORMAT_FIT:
rd_noffset = fit_image_load(images,
#if IMAGE_ENABLE_FIT
case IMAGE_FORMAT_FIT:
rd_noffset = fit_image_load(images,
- rd_addr, &fit_uname_ramdisk,
- &fit_uname_config, arch,
- IH_TYPE_RAMDISK,
- BOOTSTAGE_ID_FIT_RD_START,
- FIT_LOAD_OPTIONAL_NON_ZERO,
- &rd_data, &rd_len);
+ rd_addr, &fit_uname_ramdisk,
+ &fit_uname_config, arch,
+ IH_TYPE_RAMDISK,
+ BOOTSTAGE_ID_FIT_RD_START,
+ FIT_LOAD_OPTIONAL_NON_ZERO,
+ &rd_data, &rd_len);
if (rd_noffset < 0)
return 1;
if (rd_noffset < 0)
return 1;
#ifdef CONFIG_ANDROID_BOOT_IMAGE
case IMAGE_FORMAT_ANDROID:
android_image_get_ramdisk((void *)images->os.start,
#ifdef CONFIG_ANDROID_BOOT_IMAGE
case IMAGE_FORMAT_ANDROID:
android_image_get_ramdisk((void *)images->os.start,
#endif
{
puts("Wrong Ramdisk Image Format\n");
#endif
{
puts("Wrong Ramdisk Image Format\n");
- rd_data = rd_len = rd_load = 0;
+ rd_data = 0;
+ rd_len = 0;
+ rd_load = 0;
return 1;
}
}
} else if (images->legacy_hdr_valid &&
image_check_type(&images->legacy_hdr_os_copy,
return 1;
}
}
} else if (images->legacy_hdr_valid &&
image_check_type(&images->legacy_hdr_os_copy,
/*
* Now check if we have a legacy mult-component image,
* get second entry data start address and len.
*/
bootstage_mark(BOOTSTAGE_ID_RAMDISK);
/*
* 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);
+ 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 {
image_multi_getimg(images->legacy_hdr_os, 1, &rd_data, &rd_len);
} else {
* no initrd image
*/
bootstage_mark(BOOTSTAGE_ID_NO_RAMDISK);
* no initrd image
*/
bootstage_mark(BOOTSTAGE_ID_NO_RAMDISK);
+ rd_len = 0;
+ rd_data = 0;
*rd_end = rd_data + rd_len;
}
debug(" ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
*rd_end = rd_data + rd_len;
}
debug(" ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
* -1 - failure
*/
int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
* -1 - failure
*/
int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
- ulong *initrd_start, ulong *initrd_end)
+ ulong *initrd_start, ulong *initrd_end)
{
char *s;
ulong initrd_high;
{
char *s;
ulong initrd_high;
initrd_high = env_get_bootm_mapsize() + env_get_bootm_low();
}
initrd_high = env_get_bootm_mapsize() + env_get_bootm_low();
}
debug("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
debug("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
- initrd_high, initrd_copy_to_ram);
+ initrd_high, initrd_copy_to_ram);
if (rd_data) {
if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
if (rd_data) {
if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
*initrd_end = *initrd_start + rd_len;
printf(" Loading Ramdisk to %08lx, end %08lx ... ",
*initrd_end = *initrd_start + rd_len;
printf(" Loading Ramdisk to %08lx, end %08lx ... ",
- *initrd_start, *initrd_end);
+ *initrd_start, *initrd_end);
memmove_wd((void *)*initrd_start,
memmove_wd((void *)*initrd_start,
- (void *)rd_data, rd_len, CHUNKSZ);
+ (void *)rd_data, rd_len, CHUNKSZ);
*initrd_end = 0;
}
debug(" ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
*initrd_end = 0;
}
debug(" ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
- *initrd_start, *initrd_end);
+ *initrd_start, *initrd_end);
}
#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
}
#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
-int boot_get_setup(bootm_headers_t *images, uint8_t arch,
+int boot_get_setup(bootm_headers_t *images, u8 arch,
ulong *setup_start, ulong *setup_len)
{
#if IMAGE_ENABLE_FIT
ulong *setup_start, ulong *setup_len)
{
#if IMAGE_ENABLE_FIT
#if IMAGE_ENABLE_FIT
#if defined(CONFIG_FPGA)
int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images,
#if IMAGE_ENABLE_FIT
#if defined(CONFIG_FPGA)
int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images,
- uint8_t arch, const ulong *ld_start, ulong * const ld_len)
+ u8 arch, const ulong *ld_start, ulong * const ld_len)
{
ulong tmp_img_addr, img_data, img_len;
void *buf;
{
ulong tmp_img_addr, img_data, img_len;
void *buf;
fit_img_result = fit_image_load(images,
tmp_img_addr,
(const char **)&uname,
fit_img_result = fit_image_load(images,
tmp_img_addr,
(const char **)&uname,
- &(images->fit_uname_cfg),
+ &images->fit_uname_cfg,
arch,
IH_TYPE_FPGA,
BOOTSTAGE_ID_FPGA_INIT,
arch,
IH_TYPE_FPGA,
BOOTSTAGE_ID_FPGA_INIT,
-static void fit_loadable_process(uint8_t img_type,
+static void fit_loadable_process(u8 img_type,
ulong img_data,
ulong img_len)
{
ulong img_data,
ulong img_len)
{
}
int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
}
int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
- uint8_t arch, const ulong *ld_start, ulong * const ld_len)
+ u8 arch, const ulong *ld_start, ulong * const ld_len)
{
/*
* These variables are used to hold the current image location
{
/*
* These variables are used to hold the current image location
int conf_noffset;
int fit_img_result;
const char *uname;
int conf_noffset;
int fit_img_result;
const char *uname;
/* Check to see if the images struct has a FIT configuration */
if (!genimg_has_config(images)) {
/* Check to see if the images struct has a FIT configuration */
if (!genimg_has_config(images)) {
for (loadables_index = 0;
uname = fdt_stringlist_get(buf, conf_noffset,
for (loadables_index = 0;
uname = fdt_stringlist_get(buf, conf_noffset,
- FIT_LOADABLE_PROP, loadables_index,
- NULL), uname;
- loadables_index++)
- {
- fit_img_result = fit_image_load(images,
- tmp_img_addr,
- &uname,
- &(images->fit_uname_cfg), arch,
- IH_TYPE_LOADABLE,
- BOOTSTAGE_ID_FIT_LOADABLE_START,
- FIT_LOAD_OPTIONAL_NON_ZERO,
- &img_data, &img_len);
+ FIT_LOADABLE_PROP,
+ loadables_index, NULL), uname;
+ loadables_index++) {
+ fit_img_result = fit_image_load(images, tmp_img_addr,
+ &uname,
+ &images->fit_uname_cfg,
+ arch, IH_TYPE_LOADABLE,
+ BOOTSTAGE_ID_FIT_LOADABLE_START,
+ FIT_LOAD_OPTIONAL_NON_ZERO,
+ &img_data, &img_len);
if (fit_img_result < 0) {
/* Something went wrong! */
return fit_img_result;
if (fit_img_result < 0) {
/* Something went wrong! */
return fit_img_result;
cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
env_get_bootm_mapsize() + env_get_bootm_low());
cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
env_get_bootm_mapsize() + env_get_bootm_low());
return -1;
s = env_get("bootargs");
return -1;
s = env_get("bootargs");
- *cmd_start = (ulong) & cmdline[0];
+ *cmd_start = (ulong)cmdline;
*cmd_end = *cmd_start + strlen(cmdline);
debug("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
*cmd_end = *cmd_start + strlen(cmdline);
debug("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
*kbd = (struct bd_info *)(ulong)lmb_alloc_base(lmb,
sizeof(struct bd_info),
0xf,
*kbd = (struct bd_info *)(ulong)lmb_alloc_base(lmb,
sizeof(struct bd_info),
0xf,
- env_get_bootm_mapsize() + env_get_bootm_low());
- if (*kbd == NULL)
+ env_get_bootm_mapsize() +
+ env_get_bootm_low());
+ if (!*kbd)
debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
if (IMAGE_BOOT_GET_CMDLINE) {
ret = boot_get_cmdline(lmb, &images->cmdline_start,
if (IMAGE_BOOT_GET_CMDLINE) {
ret = boot_get_cmdline(lmb, &images->cmdline_start,
if (ret) {
puts("ERROR with allocation of cmdline\n");
return ret;
if (ret) {
puts("ERROR with allocation of cmdline\n");
return ret;