bootstage: Replace show_boot_progress/error() with bootstage_...()
These calls should not be made directly any more, since bootstage will call the show_boot_...() functions as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5ff55390ed
commit
770605e4f9
|
@ -113,7 +113,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
|
||||||
printf ("Using machid 0x%x from environment\n", machid);
|
printf ("Using machid 0x%x from environment\n", machid);
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
#ifdef CONFIG_OF_LIBFDT
|
#ifdef CONFIG_OF_LIBFDT
|
||||||
if (images->ft_len)
|
if (images->ft_len)
|
||||||
|
|
|
@ -192,7 +192,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
|
||||||
|
|
||||||
theKernel = (void *)images->ep;
|
theKernel = (void *)images->ep;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
params = params_start = (struct tag *)gd->bd->bi_boot_params;
|
params = params_start = (struct tag *)gd->bd->bi_boot_params;
|
||||||
params = setup_start_tag(params);
|
params = setup_start_tag(params);
|
||||||
|
|
|
@ -104,7 +104,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
|
||||||
debug("## Transferring control to Linux (at address %08lx) ...\n",
|
debug("## Transferring control to Linux (at address %08lx) ...\n",
|
||||||
(ulong) kernel);
|
(ulong) kernel);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Linux Kernel Parameters (passing board info data):
|
* Linux Kernel Parameters (passing board info data):
|
||||||
|
|
|
@ -59,7 +59,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
|
||||||
if (ret)
|
if (ret)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
if (!of_flat_tree && argc > 3)
|
if (!of_flat_tree && argc > 3)
|
||||||
of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
|
of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
|
||||||
|
|
|
@ -56,7 +56,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
|
||||||
/* find kernel entry point */
|
/* find kernel entry point */
|
||||||
theKernel = (void (*)(int, char **, char **, int *))images->ep;
|
theKernel = (void (*)(int, char **, char **, int *))images->ep;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf ("## Transferring control to Linux (at address %08lx) ...\n",
|
printf ("## Transferring control to Linux (at address %08lx) ...\n",
|
||||||
|
|
|
@ -39,7 +39,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
|
||||||
/* find kernel entry point */
|
/* find kernel entry point */
|
||||||
theKernel = (void (*)(int, char **, char **, int *))images->ep;
|
theKernel = (void (*)(int, char **, char **, int *))images->ep;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
debug ("## Transferring control to Linux (at address %08lx) ...\n",
|
debug ("## Transferring control to Linux (at address %08lx) ...\n",
|
||||||
(ulong) theKernel);
|
(ulong) theKernel);
|
||||||
|
|
|
@ -69,7 +69,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
|
||||||
printf("Using machid 0x%x from environment\n", machid);
|
printf("Using machid 0x%x from environment\n", machid);
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
debug("## Transferring control to Linux (at address %08lx) ...\n",
|
debug("## Transferring control to Linux (at address %08lx) ...\n",
|
||||||
(ulong)theKernel);
|
(ulong)theKernel);
|
||||||
|
|
|
@ -1064,7 +1064,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
|
||||||
void hang(void)
|
void hang(void)
|
||||||
{
|
{
|
||||||
puts("### ERROR ### Please RESET the board ###\n");
|
puts("### ERROR ### Please RESET the board ###\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_NEED_RESET);
|
bootstage_error(BOOTSTAGE_ID_NEED_RESET);
|
||||||
for (;;)
|
for (;;)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ static void boot_jump_linux(bootm_headers_t *images)
|
||||||
debug ("## Transferring control to Linux (at address %08lx) ...\n",
|
debug ("## Transferring control to Linux (at address %08lx) ...\n",
|
||||||
(ulong)kernel);
|
(ulong)kernel);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && !defined(CONFIG_E500)
|
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && !defined(CONFIG_E500)
|
||||||
unlock_ram_in_cache();
|
unlock_ram_in_cache();
|
||||||
|
|
|
@ -426,7 +426,7 @@ void hang(void)
|
||||||
{
|
{
|
||||||
puts("### ERROR ### Please RESET the board ###\n");
|
puts("### ERROR ### Please RESET the board ###\n");
|
||||||
#ifdef CONFIG_SHOW_BOOT_PROGRESS
|
#ifdef CONFIG_SHOW_BOOT_PROGRESS
|
||||||
show_boot_error(BOOTSTAGE_ID_NEED_RESET);
|
bootstage_error(BOOTSTAGE_ID_NEED_RESET);
|
||||||
#endif
|
#endif
|
||||||
for (;;) ;
|
for (;;) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#ifdef CONFIG_SHOW_BOOT_PROGRESS
|
#ifdef CONFIG_SHOW_BOOT_PROGRESS
|
||||||
# include <status_led.h>
|
# include <status_led.h>
|
||||||
# define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg)
|
# define SHOW_BOOT_PROGRESS(arg) bootstage_mark(arg)
|
||||||
#else
|
#else
|
||||||
# define SHOW_BOOT_PROGRESS(arg)
|
# define SHOW_BOOT_PROGRESS(arg)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -95,7 +95,7 @@ int mv_load_fpga(void)
|
||||||
|
|
||||||
result = fpga_load(0, fpga_data, data_size);
|
result = fpga_load(0, fpga_data, data_size);
|
||||||
if (!result)
|
if (!result)
|
||||||
show_boot_progress(BOOTSTAGE_ID_START);
|
bootstage_mark(BOOTSTAGE_ID_START);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,6 @@
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#ifdef CONFIG_SHOW_BOOT_PROGRESS
|
|
||||||
# define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg)
|
|
||||||
#else
|
|
||||||
# define SHOW_BOOT_PROGRESS(arg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init (void)
|
int board_init (void)
|
||||||
{
|
{
|
||||||
gd->bd->bi_arch_number = MACH_TYPE_SCB9328;
|
gd->bd->bi_arch_number = MACH_TYPE_SCB9328;
|
||||||
|
|
|
@ -222,21 +222,21 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
||||||
if (fit_image_get_type(images.fit_hdr_os,
|
if (fit_image_get_type(images.fit_hdr_os,
|
||||||
images.fit_noffset_os, &images.os.type)) {
|
images.fit_noffset_os, &images.os.type)) {
|
||||||
puts("Can't get image type!\n");
|
puts("Can't get image type!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_TYPE);
|
bootstage_error(BOOTSTAGE_ID_FIT_TYPE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fit_image_get_comp(images.fit_hdr_os,
|
if (fit_image_get_comp(images.fit_hdr_os,
|
||||||
images.fit_noffset_os, &images.os.comp)) {
|
images.fit_noffset_os, &images.os.comp)) {
|
||||||
puts("Can't get image compression!\n");
|
puts("Can't get image compression!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_COMPRESSION);
|
bootstage_error(BOOTSTAGE_ID_FIT_COMPRESSION);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fit_image_get_os(images.fit_hdr_os,
|
if (fit_image_get_os(images.fit_hdr_os,
|
||||||
images.fit_noffset_os, &images.os.os)) {
|
images.fit_noffset_os, &images.os.os)) {
|
||||||
puts("Can't get image OS!\n");
|
puts("Can't get image OS!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_OS);
|
bootstage_error(BOOTSTAGE_ID_FIT_OS);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
||||||
if (fit_image_get_load(images.fit_hdr_os, images.fit_noffset_os,
|
if (fit_image_get_load(images.fit_hdr_os, images.fit_noffset_os,
|
||||||
&images.os.load)) {
|
&images.os.load)) {
|
||||||
puts("Can't get image load address!\n");
|
puts("Can't get image load address!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_LOADADDR);
|
bootstage_error(BOOTSTAGE_ID_FIT_LOADADDR);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -348,7 +348,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||||
puts("GUNZIP: uncompress, out-of-mem or overwrite "
|
puts("GUNZIP: uncompress, out-of-mem or overwrite "
|
||||||
"error - must RESET board to recover\n");
|
"error - must RESET board to recover\n");
|
||||||
if (boot_progress)
|
if (boot_progress)
|
||||||
show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
||||||
return BOOTM_ERR_RESET;
|
return BOOTM_ERR_RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||||
printf("BUNZIP2: uncompress or overwrite error %d "
|
printf("BUNZIP2: uncompress or overwrite error %d "
|
||||||
"- must RESET board to recover\n", i);
|
"- must RESET board to recover\n", i);
|
||||||
if (boot_progress)
|
if (boot_progress)
|
||||||
show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
||||||
return BOOTM_ERR_RESET;
|
return BOOTM_ERR_RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||||
if (ret != SZ_OK) {
|
if (ret != SZ_OK) {
|
||||||
printf("LZMA: uncompress or overwrite error %d "
|
printf("LZMA: uncompress or overwrite error %d "
|
||||||
"- must RESET board to recover\n", ret);
|
"- must RESET board to recover\n", ret);
|
||||||
show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
||||||
return BOOTM_ERR_RESET;
|
return BOOTM_ERR_RESET;
|
||||||
}
|
}
|
||||||
*load_end = load + unc_len;
|
*load_end = load + unc_len;
|
||||||
|
@ -407,7 +407,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||||
printf("LZO: uncompress or overwrite error %d "
|
printf("LZO: uncompress or overwrite error %d "
|
||||||
"- must RESET board to recover\n", ret);
|
"- must RESET board to recover\n", ret);
|
||||||
if (boot_progress)
|
if (boot_progress)
|
||||||
show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
|
||||||
return BOOTM_ERR_RESET;
|
return BOOTM_ERR_RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
|
||||||
|
|
||||||
puts("OK\n");
|
puts("OK\n");
|
||||||
debug(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
|
debug(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
|
||||||
show_boot_progress(BOOTSTAGE_ID_KERNEL_LOADED);
|
bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);
|
||||||
|
|
||||||
if (!no_overlap && (load < blob_end) && (*load_end > blob_start)) {
|
if (!no_overlap && (load < blob_end) && (*load_end > blob_start)) {
|
||||||
debug("images.os.start = 0x%lX, images.os.end = 0x%lx\n",
|
debug("images.os.start = 0x%lX, images.os.end = 0x%lx\n",
|
||||||
|
@ -648,14 +648,14 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
} else {
|
} else {
|
||||||
puts("ERROR: new format image overwritten - "
|
puts("ERROR: new format image overwritten - "
|
||||||
"must RESET the board to recover\n");
|
"must RESET the board to recover\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_OVERWRITTEN);
|
bootstage_error(BOOTSTAGE_ID_OVERWRITTEN);
|
||||||
do_reset(cmdtp, flag, argc, argv);
|
do_reset(cmdtp, flag, argc, argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == BOOTM_ERR_UNIMPLEMENTED) {
|
if (ret == BOOTM_ERR_UNIMPLEMENTED) {
|
||||||
if (iflag)
|
if (iflag)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
show_boot_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
|
bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_BOOT_OS);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_BOOT_OS);
|
||||||
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
#ifdef CONFIG_SILENT_CONSOLE
|
||||||
if (images.os.os == IH_OS_LINUX)
|
if (images.os.os == IH_OS_LINUX)
|
||||||
|
@ -684,7 +684,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
printf("ERROR: booting os '%s' (%d) is not supported\n",
|
printf("ERROR: booting os '%s' (%d) is not supported\n",
|
||||||
genimg_get_os_name(images.os.os), images.os.os);
|
genimg_get_os_name(images.os.os), images.os.os);
|
||||||
show_boot_error(BOOTSTAGE_ID_CHECK_BOOT_OS);
|
bootstage_error(BOOTSTAGE_ID_CHECK_BOOT_OS);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
|
||||||
boot_fn(0, argc, argv, &images);
|
boot_fn(0, argc, argv, &images);
|
||||||
|
|
||||||
show_boot_error(BOOTSTAGE_ID_BOOT_OS_RETURNED);
|
bootstage_error(BOOTSTAGE_ID_BOOT_OS_RETURNED);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
puts("\n## Control returned to monitor - resetting...\n");
|
puts("\n## Control returned to monitor - resetting...\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -734,34 +734,34 @@ static image_header_t *image_get_kernel(ulong img_addr, int verify)
|
||||||
|
|
||||||
if (!image_check_magic(hdr)) {
|
if (!image_check_magic(hdr)) {
|
||||||
puts("Bad Magic Number\n");
|
puts("Bad Magic Number\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_CHECK_MAGIC);
|
bootstage_error(BOOTSTAGE_ID_CHECK_MAGIC);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_HEADER);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_HEADER);
|
||||||
|
|
||||||
if (!image_check_hcrc(hdr)) {
|
if (!image_check_hcrc(hdr)) {
|
||||||
puts("Bad Header Checksum\n");
|
puts("Bad Header Checksum\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_CHECK_HEADER);
|
bootstage_error(BOOTSTAGE_ID_CHECK_HEADER);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_CHECKSUM);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_CHECKSUM);
|
||||||
image_print_contents(hdr);
|
image_print_contents(hdr);
|
||||||
|
|
||||||
if (verify) {
|
if (verify) {
|
||||||
puts(" Verifying Checksum ... ");
|
puts(" Verifying Checksum ... ");
|
||||||
if (!image_check_dcrc(hdr)) {
|
if (!image_check_dcrc(hdr)) {
|
||||||
printf("Bad Data CRC\n");
|
printf("Bad Data CRC\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_CHECK_CHECKSUM);
|
bootstage_error(BOOTSTAGE_ID_CHECK_CHECKSUM);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
puts("OK\n");
|
puts("OK\n");
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_ARCH);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_ARCH);
|
||||||
|
|
||||||
if (!image_check_target_arch(hdr)) {
|
if (!image_check_target_arch(hdr)) {
|
||||||
printf("Unsupported Architecture 0x%x\n", image_get_arch(hdr));
|
printf("Unsupported Architecture 0x%x\n", image_get_arch(hdr));
|
||||||
show_boot_error(BOOTSTAGE_ID_CHECK_ARCH);
|
bootstage_error(BOOTSTAGE_ID_CHECK_ARCH);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return hdr;
|
return hdr;
|
||||||
|
@ -789,28 +789,28 @@ static int fit_check_kernel(const void *fit, int os_noffset, int verify)
|
||||||
puts(" Verifying Hash Integrity ... ");
|
puts(" Verifying Hash Integrity ... ");
|
||||||
if (!fit_image_check_hashes(fit, os_noffset)) {
|
if (!fit_image_check_hashes(fit, os_noffset)) {
|
||||||
puts("Bad Data Hash\n");
|
puts("Bad Data Hash\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_CHECK_HASH);
|
bootstage_error(BOOTSTAGE_ID_FIT_CHECK_HASH);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
puts("OK\n");
|
puts("OK\n");
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_CHECK_ARCH);
|
bootstage_mark(BOOTSTAGE_ID_FIT_CHECK_ARCH);
|
||||||
|
|
||||||
if (!fit_image_check_target_arch(fit, os_noffset)) {
|
if (!fit_image_check_target_arch(fit, os_noffset)) {
|
||||||
puts("Unsupported Architecture\n");
|
puts("Unsupported Architecture\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_CHECK_ARCH);
|
bootstage_error(BOOTSTAGE_ID_FIT_CHECK_ARCH);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_CHECK_KERNEL);
|
bootstage_mark(BOOTSTAGE_ID_FIT_CHECK_KERNEL);
|
||||||
if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL) &&
|
if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL) &&
|
||||||
!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL_NOLOAD)) {
|
!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL_NOLOAD)) {
|
||||||
puts("Not a kernel image\n");
|
puts("Not a kernel image\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_CHECK_KERNEL);
|
bootstage_error(BOOTSTAGE_ID_FIT_CHECK_KERNEL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_CHECKED);
|
bootstage_mark(BOOTSTAGE_ID_FIT_CHECKED);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_FIT */
|
#endif /* CONFIG_FIT */
|
||||||
|
@ -863,7 +863,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
debug("* kernel: cmdline image address = 0x%08lx\n", img_addr);
|
debug("* kernel: cmdline image address = 0x%08lx\n", img_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_MAGIC);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_MAGIC);
|
||||||
|
|
||||||
/* copy from dataflash if needed */
|
/* copy from dataflash if needed */
|
||||||
img_addr = genimg_get_image(img_addr);
|
img_addr = genimg_get_image(img_addr);
|
||||||
|
@ -877,7 +877,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
hdr = image_get_kernel(img_addr, images->verify);
|
hdr = image_get_kernel(img_addr, images->verify);
|
||||||
if (!hdr)
|
if (!hdr)
|
||||||
return NULL;
|
return NULL;
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_IMAGETYPE);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_IMAGETYPE);
|
||||||
|
|
||||||
/* get os_data and os_len */
|
/* get os_data and os_len */
|
||||||
switch (image_get_type(hdr)) {
|
switch (image_get_type(hdr)) {
|
||||||
|
@ -896,7 +896,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
default:
|
default:
|
||||||
printf("Wrong Image Type for %s command\n",
|
printf("Wrong Image Type for %s command\n",
|
||||||
cmdtp->name);
|
cmdtp->name);
|
||||||
show_boot_error(BOOTSTAGE_ID_CHECK_IMAGETYPE);
|
bootstage_error(BOOTSTAGE_ID_CHECK_IMAGETYPE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -911,7 +911,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
images->legacy_hdr_os = hdr;
|
images->legacy_hdr_os = hdr;
|
||||||
|
|
||||||
images->legacy_hdr_valid = 1;
|
images->legacy_hdr_valid = 1;
|
||||||
show_boot_progress(BOOTSTAGE_ID_DECOMP_IMAGE);
|
bootstage_mark(BOOTSTAGE_ID_DECOMP_IMAGE);
|
||||||
break;
|
break;
|
||||||
#if defined(CONFIG_FIT)
|
#if defined(CONFIG_FIT)
|
||||||
case IMAGE_FORMAT_FIT:
|
case IMAGE_FORMAT_FIT:
|
||||||
|
@ -921,10 +921,10 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
|
|
||||||
if (!fit_check_format(fit_hdr)) {
|
if (!fit_check_format(fit_hdr)) {
|
||||||
puts("Bad FIT kernel image format!\n");
|
puts("Bad FIT kernel image format!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_FORMAT);
|
bootstage_error(BOOTSTAGE_ID_FIT_FORMAT);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_FORMAT);
|
bootstage_mark(BOOTSTAGE_ID_FIT_FORMAT);
|
||||||
|
|
||||||
if (!fit_uname_kernel) {
|
if (!fit_uname_kernel) {
|
||||||
/*
|
/*
|
||||||
|
@ -933,11 +933,11 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
* fit_conf_get_node() will try to find default config
|
* fit_conf_get_node() will try to find default config
|
||||||
* node
|
* node
|
||||||
*/
|
*/
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_NO_UNIT_NAME);
|
bootstage_mark(BOOTSTAGE_ID_FIT_NO_UNIT_NAME);
|
||||||
cfg_noffset = fit_conf_get_node(fit_hdr,
|
cfg_noffset = fit_conf_get_node(fit_hdr,
|
||||||
fit_uname_config);
|
fit_uname_config);
|
||||||
if (cfg_noffset < 0) {
|
if (cfg_noffset < 0) {
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_NO_UNIT_NAME);
|
bootstage_error(BOOTSTAGE_ID_FIT_NO_UNIT_NAME);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* save configuration uname provided in the first
|
/* save configuration uname provided in the first
|
||||||
|
@ -948,7 +948,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
NULL);
|
NULL);
|
||||||
printf(" Using '%s' configuration\n",
|
printf(" Using '%s' configuration\n",
|
||||||
images->fit_uname_cfg);
|
images->fit_uname_cfg);
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_CONFIG);
|
bootstage_mark(BOOTSTAGE_ID_FIT_CONFIG);
|
||||||
|
|
||||||
os_noffset = fit_conf_get_kernel_node(fit_hdr,
|
os_noffset = fit_conf_get_kernel_node(fit_hdr,
|
||||||
cfg_noffset);
|
cfg_noffset);
|
||||||
|
@ -956,28 +956,28 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
NULL);
|
NULL);
|
||||||
} else {
|
} else {
|
||||||
/* get kernel component image node offset */
|
/* get kernel component image node offset */
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_UNIT_NAME);
|
bootstage_mark(BOOTSTAGE_ID_FIT_UNIT_NAME);
|
||||||
os_noffset = fit_image_get_node(fit_hdr,
|
os_noffset = fit_image_get_node(fit_hdr,
|
||||||
fit_uname_kernel);
|
fit_uname_kernel);
|
||||||
}
|
}
|
||||||
if (os_noffset < 0) {
|
if (os_noffset < 0) {
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_CONFIG);
|
bootstage_error(BOOTSTAGE_ID_FIT_CONFIG);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" Trying '%s' kernel subimage\n", fit_uname_kernel);
|
printf(" Trying '%s' kernel subimage\n", fit_uname_kernel);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_CHECK_SUBIMAGE);
|
bootstage_mark(BOOTSTAGE_ID_FIT_CHECK_SUBIMAGE);
|
||||||
if (!fit_check_kernel(fit_hdr, os_noffset, images->verify))
|
if (!fit_check_kernel(fit_hdr, os_noffset, images->verify))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* get kernel image data address and length */
|
/* get kernel image data address and length */
|
||||||
if (fit_image_get_data(fit_hdr, os_noffset, &data, &len)) {
|
if (fit_image_get_data(fit_hdr, os_noffset, &data, &len)) {
|
||||||
puts("Could not find kernel subimage data!\n");
|
puts("Could not find kernel subimage data!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_KERNEL_INFO_ERR);
|
bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO_ERR);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_KERNEL_INFO);
|
bootstage_mark(BOOTSTAGE_ID_FIT_KERNEL_INFO);
|
||||||
|
|
||||||
*os_len = len;
|
*os_len = len;
|
||||||
*os_data = (ulong)data;
|
*os_data = (ulong)data;
|
||||||
|
@ -988,7 +988,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
printf("Wrong Image Format for %s command\n", cmdtp->name);
|
printf("Wrong Image Format for %s command\n", cmdtp->name);
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_KERNEL_INFO);
|
bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1333,7 +1333,7 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],
|
||||||
"(at address %08lx) ...\n",
|
"(at address %08lx) ...\n",
|
||||||
(ulong)loader);
|
(ulong)loader);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NetBSD Stage-2 Loader Parameters:
|
* NetBSD Stage-2 Loader Parameters:
|
||||||
|
@ -1391,7 +1391,7 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[],
|
||||||
printf("## Transferring control to RTEMS (at address %08lx) ...\n",
|
printf("## Transferring control to RTEMS (at address %08lx) ...\n",
|
||||||
(ulong)entry_point);
|
(ulong)entry_point);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RTEMS Parameters:
|
* RTEMS Parameters:
|
||||||
|
@ -1424,7 +1424,7 @@ static int do_bootm_ose(int flag, int argc, char * const argv[],
|
||||||
printf("## Transferring control to OSE (at address %08lx) ...\n",
|
printf("## Transferring control to OSE (at address %08lx) ...\n",
|
||||||
(ulong)entry_point);
|
(ulong)entry_point);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OSE Parameters:
|
* OSE Parameters:
|
||||||
|
@ -1505,7 +1505,7 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[],
|
||||||
printf("## Transferring control to INTEGRITY (at address %08lx) ...\n",
|
printf("## Transferring control to INTEGRITY (at address %08lx) ...\n",
|
||||||
(ulong)entry_point);
|
(ulong)entry_point);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RUN_OS);
|
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* INTEGRITY Parameters:
|
* INTEGRITY Parameters:
|
||||||
|
|
|
@ -345,7 +345,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
const void *fit_hdr = NULL;
|
const void *fit_hdr = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_START);
|
bootstage_mark(BOOTSTAGE_ID_IDE_START);
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 1:
|
case 1:
|
||||||
addr = CONFIG_SYS_LOAD_ADDR;
|
addr = CONFIG_SYS_LOAD_ADDR;
|
||||||
|
@ -360,42 +360,42 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
boot_device = argv[2];
|
boot_device = argv[2];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_ADDR);
|
bootstage_error(BOOTSTAGE_ID_IDE_ADDR);
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_ADDR);
|
bootstage_mark(BOOTSTAGE_ID_IDE_ADDR);
|
||||||
|
|
||||||
if (!boot_device) {
|
if (!boot_device) {
|
||||||
puts("\n** No boot device **\n");
|
puts("\n** No boot device **\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
|
bootstage_error(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
|
bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
|
||||||
|
|
||||||
dev = simple_strtoul(boot_device, &ep, 16);
|
dev = simple_strtoul(boot_device, &ep, 16);
|
||||||
|
|
||||||
if (ide_dev_desc[dev].type == DEV_TYPE_UNKNOWN) {
|
if (ide_dev_desc[dev].type == DEV_TYPE_UNKNOWN) {
|
||||||
printf("\n** Device %d not available\n", dev);
|
printf("\n** Device %d not available\n", dev);
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_TYPE);
|
bootstage_error(BOOTSTAGE_ID_IDE_TYPE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_TYPE);
|
bootstage_mark(BOOTSTAGE_ID_IDE_TYPE);
|
||||||
|
|
||||||
if (*ep) {
|
if (*ep) {
|
||||||
if (*ep != ':') {
|
if (*ep != ':') {
|
||||||
puts("\n** Invalid boot device, use `dev[:part]' **\n");
|
puts("\n** Invalid boot device, use `dev[:part]' **\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_PART);
|
bootstage_error(BOOTSTAGE_ID_IDE_PART);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
part = simple_strtoul(++ep, NULL, 16);
|
part = simple_strtoul(++ep, NULL, 16);
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_PART);
|
bootstage_mark(BOOTSTAGE_ID_IDE_PART);
|
||||||
|
|
||||||
if (get_partition_info(&ide_dev_desc[dev], part, &info)) {
|
if (get_partition_info(&ide_dev_desc[dev], part, &info)) {
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_PART_INFO);
|
bootstage_error(BOOTSTAGE_ID_IDE_PART_INFO);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_PART_INFO);
|
bootstage_mark(BOOTSTAGE_ID_IDE_PART_INFO);
|
||||||
|
|
||||||
if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0)
|
if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0)
|
||||||
&&
|
&&
|
||||||
|
@ -404,10 +404,10 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
printf("\n** Invalid partition type \"%.32s\"" " (expect \""
|
printf("\n** Invalid partition type \"%.32s\"" " (expect \""
|
||||||
BOOT_PART_TYPE "\")\n",
|
BOOT_PART_TYPE "\")\n",
|
||||||
info.type);
|
info.type);
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_PART_TYPE);
|
bootstage_error(BOOTSTAGE_ID_IDE_PART_TYPE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_PART_TYPE);
|
bootstage_mark(BOOTSTAGE_ID_IDE_PART_TYPE);
|
||||||
|
|
||||||
printf("\nLoading from IDE device %d, partition %d: "
|
printf("\nLoading from IDE device %d, partition %d: "
|
||||||
"Name: %.32s Type: %.32s\n", dev, part, info.name, info.type);
|
"Name: %.32s Type: %.32s\n", dev, part, info.name, info.type);
|
||||||
|
@ -418,23 +418,23 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
if (ide_dev_desc[dev].
|
if (ide_dev_desc[dev].
|
||||||
block_read(dev, info.start, 1, (ulong *) addr) != 1) {
|
block_read(dev, info.start, 1, (ulong *) addr) != 1) {
|
||||||
printf("** Read error on %d:%d\n", dev, part);
|
printf("** Read error on %d:%d\n", dev, part);
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_PART_READ);
|
bootstage_error(BOOTSTAGE_ID_IDE_PART_READ);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_PART_READ);
|
bootstage_mark(BOOTSTAGE_ID_IDE_PART_READ);
|
||||||
|
|
||||||
switch (genimg_get_format((void *) addr)) {
|
switch (genimg_get_format((void *) addr)) {
|
||||||
case IMAGE_FORMAT_LEGACY:
|
case IMAGE_FORMAT_LEGACY:
|
||||||
hdr = (image_header_t *) addr;
|
hdr = (image_header_t *) addr;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_FORMAT);
|
bootstage_mark(BOOTSTAGE_ID_IDE_FORMAT);
|
||||||
|
|
||||||
if (!image_check_hcrc(hdr)) {
|
if (!image_check_hcrc(hdr)) {
|
||||||
puts("\n** Bad Header Checksum **\n");
|
puts("\n** Bad Header Checksum **\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_CHECKSUM);
|
bootstage_error(BOOTSTAGE_ID_IDE_CHECKSUM);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_CHECKSUM);
|
bootstage_mark(BOOTSTAGE_ID_IDE_CHECKSUM);
|
||||||
|
|
||||||
image_print_contents(hdr);
|
image_print_contents(hdr);
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_FORMAT);
|
bootstage_error(BOOTSTAGE_ID_IDE_FORMAT);
|
||||||
puts("** Unknown image type\n");
|
puts("** Unknown image type\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -461,20 +461,20 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
if (ide_dev_desc[dev].block_read(dev, info.start + 1, cnt,
|
if (ide_dev_desc[dev].block_read(dev, info.start + 1, cnt,
|
||||||
(ulong *)(addr + info.blksz)) != cnt) {
|
(ulong *)(addr + info.blksz)) != cnt) {
|
||||||
printf("** Read error on %d:%d\n", dev, part);
|
printf("** Read error on %d:%d\n", dev, part);
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_READ);
|
bootstage_error(BOOTSTAGE_ID_IDE_READ);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_READ);
|
bootstage_mark(BOOTSTAGE_ID_IDE_READ);
|
||||||
|
|
||||||
#if defined(CONFIG_FIT)
|
#if defined(CONFIG_FIT)
|
||||||
/* This cannot be done earlier, we need complete FIT image in RAM first */
|
/* This cannot be done earlier, we need complete FIT image in RAM first */
|
||||||
if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) {
|
if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) {
|
||||||
if (!fit_check_format(fit_hdr)) {
|
if (!fit_check_format(fit_hdr)) {
|
||||||
show_boot_error(BOOTSTAGE_ID_IDE_FIT_READ);
|
bootstage_error(BOOTSTAGE_ID_IDE_FIT_READ);
|
||||||
puts("** Bad FIT image format\n");
|
puts("** Bad FIT image format\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_IDE_FIT_READ_OK);
|
bootstage_mark(BOOTSTAGE_ID_IDE_FIT_READ_OK);
|
||||||
fit_print_contents(fit_hdr);
|
fit_print_contents(fit_hdr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -788,7 +788,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
|
||||||
if (s != NULL &&
|
if (s != NULL &&
|
||||||
(strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
|
(strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
|
||||||
printf("Unknown nand load suffix '%s'\n", s);
|
printf("Unknown nand load suffix '%s'\n", s);
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_SUFFIX);
|
bootstage_error(BOOTSTAGE_ID_NAND_SUFFIX);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,16 +798,16 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
|
||||||
r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
|
r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
|
||||||
if (r) {
|
if (r) {
|
||||||
puts("** Read error\n");
|
puts("** Read error\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_HDR_READ);
|
bootstage_error(BOOTSTAGE_ID_NAND_HDR_READ);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_HDR_READ);
|
bootstage_mark(BOOTSTAGE_ID_NAND_HDR_READ);
|
||||||
|
|
||||||
switch (genimg_get_format ((void *)addr)) {
|
switch (genimg_get_format ((void *)addr)) {
|
||||||
case IMAGE_FORMAT_LEGACY:
|
case IMAGE_FORMAT_LEGACY:
|
||||||
hdr = (image_header_t *)addr;
|
hdr = (image_header_t *)addr;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_TYPE);
|
bootstage_mark(BOOTSTAGE_ID_NAND_TYPE);
|
||||||
image_print_contents (hdr);
|
image_print_contents (hdr);
|
||||||
|
|
||||||
cnt = image_get_image_size (hdr);
|
cnt = image_get_image_size (hdr);
|
||||||
|
@ -821,29 +821,29 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_TYPE);
|
bootstage_error(BOOTSTAGE_ID_NAND_TYPE);
|
||||||
puts ("** Unknown image type\n");
|
puts ("** Unknown image type\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_TYPE);
|
bootstage_mark(BOOTSTAGE_ID_NAND_TYPE);
|
||||||
|
|
||||||
r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
|
r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
|
||||||
if (r) {
|
if (r) {
|
||||||
puts("** Read error\n");
|
puts("** Read error\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_READ);
|
bootstage_error(BOOTSTAGE_ID_NAND_READ);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_READ);
|
bootstage_mark(BOOTSTAGE_ID_NAND_READ);
|
||||||
|
|
||||||
#if defined(CONFIG_FIT)
|
#if defined(CONFIG_FIT)
|
||||||
/* This cannot be done earlier, we need complete FIT image in RAM first */
|
/* This cannot be done earlier, we need complete FIT image in RAM first */
|
||||||
if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
|
if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
|
||||||
if (!fit_check_format (fit_hdr)) {
|
if (!fit_check_format (fit_hdr)) {
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_FIT_READ);
|
bootstage_error(BOOTSTAGE_ID_NAND_FIT_READ);
|
||||||
puts ("** Bad FIT image format\n");
|
puts ("** Bad FIT image format\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_FIT_READ_OK);
|
bootstage_mark(BOOTSTAGE_ID_NAND_FIT_READ_OK);
|
||||||
fit_print_contents (fit_hdr);
|
fit_print_contents (fit_hdr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -885,7 +885,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_PART);
|
bootstage_mark(BOOTSTAGE_ID_NAND_PART);
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 1:
|
case 1:
|
||||||
addr = CONFIG_SYS_LOAD_ADDR;
|
addr = CONFIG_SYS_LOAD_ADDR;
|
||||||
|
@ -908,26 +908,26 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
||||||
#if defined(CONFIG_CMD_MTDPARTS)
|
#if defined(CONFIG_CMD_MTDPARTS)
|
||||||
usage:
|
usage:
|
||||||
#endif
|
#endif
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_SUFFIX);
|
bootstage_error(BOOTSTAGE_ID_NAND_SUFFIX);
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_SUFFIX);
|
bootstage_mark(BOOTSTAGE_ID_NAND_SUFFIX);
|
||||||
|
|
||||||
if (!boot_device) {
|
if (!boot_device) {
|
||||||
puts("\n** No boot device **\n");
|
puts("\n** No boot device **\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_BOOT_DEVICE);
|
bootstage_error(BOOTSTAGE_ID_NAND_BOOT_DEVICE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_BOOT_DEVICE);
|
bootstage_mark(BOOTSTAGE_ID_NAND_BOOT_DEVICE);
|
||||||
|
|
||||||
idx = simple_strtoul(boot_device, NULL, 16);
|
idx = simple_strtoul(boot_device, NULL, 16);
|
||||||
|
|
||||||
if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) {
|
if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) {
|
||||||
printf("\n** Device %d not available\n", idx);
|
printf("\n** Device %d not available\n", idx);
|
||||||
show_boot_error(BOOTSTAGE_ID_NAND_AVAILABLE);
|
bootstage_error(BOOTSTAGE_ID_NAND_AVAILABLE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NAND_AVAILABLE);
|
bootstage_mark(BOOTSTAGE_ID_NAND_AVAILABLE);
|
||||||
|
|
||||||
return nand_load_image(cmdtp, &nand_info[idx], offset, addr, argv[0]);
|
return nand_load_image(cmdtp, &nand_info[idx], offset, addr, argv[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,37 +230,37 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
show_boot_error(BOOTSTAGE_ID_NET_START);
|
bootstage_error(BOOTSTAGE_ID_NET_START);
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NET_START);
|
bootstage_mark(BOOTSTAGE_ID_NET_START);
|
||||||
|
|
||||||
if ((size = NetLoop(proto)) < 0) {
|
if ((size = NetLoop(proto)) < 0) {
|
||||||
show_boot_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
|
bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_NET_NETLOOP_OK);
|
bootstage_mark(BOOTSTAGE_ID_NET_NETLOOP_OK);
|
||||||
|
|
||||||
/* NetLoop ok, update environment */
|
/* NetLoop ok, update environment */
|
||||||
netboot_update_env();
|
netboot_update_env();
|
||||||
|
|
||||||
/* done if no file was loaded (no errors though) */
|
/* done if no file was loaded (no errors though) */
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
show_boot_error(BOOTSTAGE_ID_NET_LOADED);
|
bootstage_error(BOOTSTAGE_ID_NET_LOADED);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flush cache */
|
/* flush cache */
|
||||||
flush_cache(load_addr, size);
|
flush_cache(load_addr, size);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_NET_LOADED);
|
bootstage_mark(BOOTSTAGE_ID_NET_LOADED);
|
||||||
|
|
||||||
rcode = bootm_maybe_autostart(cmdtp, argv[0]);
|
rcode = bootm_maybe_autostart(cmdtp, argv[0]);
|
||||||
|
|
||||||
if (rcode < 0)
|
if (rcode < 0)
|
||||||
show_boot_error(BOOTSTAGE_ID_NET_DONE_ERR);
|
bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR);
|
||||||
else
|
else
|
||||||
show_boot_progress(BOOTSTAGE_ID_NET_DONE);
|
bootstage_mark(BOOTSTAGE_ID_NET_DONE);
|
||||||
return rcode;
|
return rcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ void env_relocate(void)
|
||||||
#if defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */
|
#if defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */
|
||||||
set_default_env(NULL);
|
set_default_env(NULL);
|
||||||
#else
|
#else
|
||||||
show_boot_error(BOOTSTAGE_ID_NET_CHECKSUM);
|
bootstage_error(BOOTSTAGE_ID_NET_CHECKSUM);
|
||||||
set_default_env("!bad CRC");
|
set_default_env("!bad CRC");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -373,37 +373,37 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch,
|
||||||
|
|
||||||
if (!image_check_magic(rd_hdr)) {
|
if (!image_check_magic(rd_hdr)) {
|
||||||
puts("Bad Magic Number\n");
|
puts("Bad Magic Number\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_RD_MAGIC);
|
bootstage_error(BOOTSTAGE_ID_RD_MAGIC);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!image_check_hcrc(rd_hdr)) {
|
if (!image_check_hcrc(rd_hdr)) {
|
||||||
puts("Bad Header Checksum\n");
|
puts("Bad Header Checksum\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
|
bootstage_error(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RD_MAGIC);
|
bootstage_mark(BOOTSTAGE_ID_RD_MAGIC);
|
||||||
image_print_contents(rd_hdr);
|
image_print_contents(rd_hdr);
|
||||||
|
|
||||||
if (verify) {
|
if (verify) {
|
||||||
puts(" Verifying Checksum ... ");
|
puts(" Verifying Checksum ... ");
|
||||||
if (!image_check_dcrc(rd_hdr)) {
|
if (!image_check_dcrc(rd_hdr)) {
|
||||||
puts("Bad Data CRC\n");
|
puts("Bad Data CRC\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_RD_CHECKSUM);
|
bootstage_error(BOOTSTAGE_ID_RD_CHECKSUM);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
puts("OK\n");
|
puts("OK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
|
bootstage_mark(BOOTSTAGE_ID_RD_HDR_CHECKSUM);
|
||||||
|
|
||||||
if (!image_check_os(rd_hdr, IH_OS_LINUX) ||
|
if (!image_check_os(rd_hdr, IH_OS_LINUX) ||
|
||||||
!image_check_arch(rd_hdr, arch) ||
|
!image_check_arch(rd_hdr, arch) ||
|
||||||
!image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
|
!image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
|
||||||
printf("No Linux %s Ramdisk Image\n",
|
printf("No Linux %s Ramdisk Image\n",
|
||||||
genimg_get_arch_name(arch));
|
genimg_get_arch_name(arch));
|
||||||
show_boot_error(BOOTSTAGE_ID_RAMDISK);
|
bootstage_error(BOOTSTAGE_ID_RAMDISK);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -895,7 +895,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
printf("## Loading init Ramdisk from Legacy "
|
printf("## Loading init Ramdisk from Legacy "
|
||||||
"Image at %08lx ...\n", rd_addr);
|
"Image at %08lx ...\n", rd_addr);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_CHECK_RAMDISK);
|
bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK);
|
||||||
rd_hdr = image_get_ramdisk(rd_addr, arch,
|
rd_hdr = image_get_ramdisk(rd_addr, arch,
|
||||||
images->verify);
|
images->verify);
|
||||||
|
|
||||||
|
@ -912,14 +912,14 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
printf("## Loading init Ramdisk from FIT "
|
printf("## Loading init Ramdisk from FIT "
|
||||||
"Image at %08lx ...\n", rd_addr);
|
"Image at %08lx ...\n", rd_addr);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_FORMAT);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_FORMAT);
|
||||||
if (!fit_check_format(fit_hdr)) {
|
if (!fit_check_format(fit_hdr)) {
|
||||||
puts("Bad FIT ramdisk image format!\n");
|
puts("Bad FIT ramdisk image format!\n");
|
||||||
show_boot_error(
|
bootstage_error(
|
||||||
BOOTSTAGE_ID_FIT_RD_FORMAT);
|
BOOTSTAGE_ID_FIT_RD_FORMAT);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_FORMAT_OK);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_FORMAT_OK);
|
||||||
|
|
||||||
if (!fit_uname_ramdisk) {
|
if (!fit_uname_ramdisk) {
|
||||||
/*
|
/*
|
||||||
|
@ -927,14 +927,14 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
* node first. If config unit node name is NULL
|
* 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(
|
bootstage_mark(
|
||||||
BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME);
|
BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME);
|
||||||
cfg_noffset = fit_conf_get_node(fit_hdr,
|
cfg_noffset = fit_conf_get_node(fit_hdr,
|
||||||
fit_uname_config);
|
fit_uname_config);
|
||||||
if (cfg_noffset < 0) {
|
if (cfg_noffset < 0) {
|
||||||
puts("Could not find configuration "
|
puts("Could not find configuration "
|
||||||
"node\n");
|
"node\n");
|
||||||
show_boot_error(
|
bootstage_error(
|
||||||
BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME);
|
BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -949,21 +949,21 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
rd_noffset, NULL);
|
rd_noffset, NULL);
|
||||||
} else {
|
} else {
|
||||||
/* get ramdisk component image node offset */
|
/* get ramdisk component image node offset */
|
||||||
show_boot_progress(
|
bootstage_mark(
|
||||||
BOOTSTAGE_ID_FIT_RD_UNIT_NAME);
|
BOOTSTAGE_ID_FIT_RD_UNIT_NAME);
|
||||||
rd_noffset = fit_image_get_node(fit_hdr,
|
rd_noffset = fit_image_get_node(fit_hdr,
|
||||||
fit_uname_ramdisk);
|
fit_uname_ramdisk);
|
||||||
}
|
}
|
||||||
if (rd_noffset < 0) {
|
if (rd_noffset < 0) {
|
||||||
puts("Could not find subimage node\n");
|
puts("Could not find subimage node\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_RD_SUBNODE);
|
bootstage_error(BOOTSTAGE_ID_FIT_RD_SUBNODE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" Trying '%s' ramdisk subimage\n",
|
printf(" Trying '%s' ramdisk subimage\n",
|
||||||
fit_uname_ramdisk);
|
fit_uname_ramdisk);
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_CHECK);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_CHECK);
|
||||||
if (!fit_check_ramdisk(fit_hdr, rd_noffset, arch,
|
if (!fit_check_ramdisk(fit_hdr, rd_noffset, arch,
|
||||||
images->verify))
|
images->verify))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -972,10 +972,10 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
if (fit_image_get_data(fit_hdr, rd_noffset, &data,
|
if (fit_image_get_data(fit_hdr, rd_noffset, &data,
|
||||||
&size)) {
|
&size)) {
|
||||||
puts("Could not find ramdisk subimage data!\n");
|
puts("Could not find ramdisk subimage data!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_RD_GET_DATA);
|
bootstage_error(BOOTSTAGE_ID_FIT_RD_GET_DATA);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_GET_DATA_OK);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_GET_DATA_OK);
|
||||||
|
|
||||||
rd_data = (ulong)data;
|
rd_data = (ulong)data;
|
||||||
rd_len = size;
|
rd_len = size;
|
||||||
|
@ -983,10 +983,10 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
if (fit_image_get_load(fit_hdr, rd_noffset, &rd_load)) {
|
if (fit_image_get_load(fit_hdr, rd_noffset, &rd_load)) {
|
||||||
puts("Can't get ramdisk subimage load "
|
puts("Can't get ramdisk subimage load "
|
||||||
"address!\n");
|
"address!\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_RD_LOAD);
|
bootstage_error(BOOTSTAGE_ID_FIT_RD_LOAD);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_LOAD);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_LOAD);
|
||||||
|
|
||||||
images->fit_hdr_rd = fit_hdr;
|
images->fit_hdr_rd = fit_hdr;
|
||||||
images->fit_uname_rd = fit_uname_ramdisk;
|
images->fit_uname_rd = fit_uname_ramdisk;
|
||||||
|
@ -1006,7 +1006,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
* Now check if we have a legacy mult-component image,
|
* Now check if we have a legacy mult-component image,
|
||||||
* get second entry data start address and len.
|
* get second entry data start address and len.
|
||||||
*/
|
*/
|
||||||
show_boot_progress(BOOTSTAGE_ID_RAMDISK);
|
bootstage_mark(BOOTSTAGE_ID_RAMDISK);
|
||||||
printf("## Loading init Ramdisk from multi component "
|
printf("## Loading init Ramdisk from multi component "
|
||||||
"Legacy Image at %08lx ...\n",
|
"Legacy Image at %08lx ...\n",
|
||||||
(ulong)images->legacy_hdr_os);
|
(ulong)images->legacy_hdr_os);
|
||||||
|
@ -1016,7 +1016,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
|
||||||
/*
|
/*
|
||||||
* no initrd image
|
* no initrd image
|
||||||
*/
|
*/
|
||||||
show_boot_progress(BOOTSTAGE_ID_NO_RAMDISK);
|
bootstage_mark(BOOTSTAGE_ID_NO_RAMDISK);
|
||||||
rd_len = rd_data = 0;
|
rd_len = rd_data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1100,7 +1100,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
|
||||||
puts("ramdisk - allocation error\n");
|
puts("ramdisk - allocation error\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
show_boot_progress(BOOTSTAGE_ID_COPY_RAMDISK);
|
bootstage_mark(BOOTSTAGE_ID_COPY_RAMDISK);
|
||||||
|
|
||||||
*initrd_end = *initrd_start + rd_len;
|
*initrd_end = *initrd_start + rd_len;
|
||||||
printf(" Loading Ramdisk to %08lx, end %08lx ... ",
|
printf(" Loading Ramdisk to %08lx, end %08lx ... ",
|
||||||
|
@ -3180,23 +3180,23 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
|
||||||
puts(" Verifying Hash Integrity ... ");
|
puts(" Verifying Hash Integrity ... ");
|
||||||
if (!fit_image_check_hashes(fit, rd_noffset)) {
|
if (!fit_image_check_hashes(fit, rd_noffset)) {
|
||||||
puts("Bad Data Hash\n");
|
puts("Bad Data Hash\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_RD_HASH);
|
bootstage_error(BOOTSTAGE_ID_FIT_RD_HASH);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
puts("OK\n");
|
puts("OK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_CHECK_ALL);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_CHECK_ALL);
|
||||||
if (!fit_image_check_os(fit, rd_noffset, IH_OS_LINUX) ||
|
if (!fit_image_check_os(fit, rd_noffset, IH_OS_LINUX) ||
|
||||||
!fit_image_check_arch(fit, rd_noffset, arch) ||
|
!fit_image_check_arch(fit, rd_noffset, arch) ||
|
||||||
!fit_image_check_type(fit, rd_noffset, IH_TYPE_RAMDISK)) {
|
!fit_image_check_type(fit, rd_noffset, IH_TYPE_RAMDISK)) {
|
||||||
printf("No Linux %s Ramdisk Image\n",
|
printf("No Linux %s Ramdisk Image\n",
|
||||||
genimg_get_arch_name(arch));
|
genimg_get_arch_name(arch));
|
||||||
show_boot_error(BOOTSTAGE_ID_FIT_RD_CHECK_ALL);
|
bootstage_error(BOOTSTAGE_ID_FIT_RD_CHECK_ALL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_FIT_RD_CHECK_ALL_OK);
|
bootstage_mark(BOOTSTAGE_ID_FIT_RD_CHECK_ALL_OK);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* USE_HOSTCC */
|
#endif /* USE_HOSTCC */
|
||||||
|
|
|
@ -178,9 +178,35 @@ enum bootstage_id {
|
||||||
* has occurred.
|
* has occurred.
|
||||||
*/
|
*/
|
||||||
void show_boot_progress(int val);
|
void show_boot_progress(int val);
|
||||||
static inline void show_boot_error(int val)
|
|
||||||
|
#ifdef CONFIG_BOOTSTAGE
|
||||||
|
/* This is the full bootstage implementation */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mark a time stamp for the current boot stage.
|
||||||
|
*/
|
||||||
|
ulong bootstage_mark(enum bootstage_id id);
|
||||||
|
|
||||||
|
ulong bootstage_error(enum bootstage_id id);
|
||||||
|
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* This is a dummy implementation which just calls show_boot_progress(),
|
||||||
|
* and won't even do that unless CONFIG_SHOW_BOOT_PROGRESS is defined
|
||||||
|
*/
|
||||||
|
|
||||||
|
static inline ulong bootstage_mark(enum bootstage_id id)
|
||||||
{
|
{
|
||||||
show_boot_progress(-val);
|
show_boot_progress(id);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline ulong bootstage_error(enum bootstage_id id)
|
||||||
|
{
|
||||||
|
show_boot_progress(-id);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_BOOTSTAGE */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -256,7 +256,7 @@ int eth_initialize(bd_t *bis)
|
||||||
eth_devices = NULL;
|
eth_devices = NULL;
|
||||||
eth_current = NULL;
|
eth_current = NULL;
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_NET_ETH_START);
|
bootstage_mark(BOOTSTAGE_ID_NET_ETH_START);
|
||||||
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
|
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
|
||||||
miiphy_init();
|
miiphy_init();
|
||||||
#endif
|
#endif
|
||||||
|
@ -280,12 +280,12 @@ int eth_initialize(bd_t *bis)
|
||||||
|
|
||||||
if (!eth_devices) {
|
if (!eth_devices) {
|
||||||
puts ("No ethernet found.\n");
|
puts ("No ethernet found.\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_NET_ETH_START);
|
bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
|
||||||
} else {
|
} else {
|
||||||
struct eth_device *dev = eth_devices;
|
struct eth_device *dev = eth_devices;
|
||||||
char *ethprime = getenv ("ethprime");
|
char *ethprime = getenv ("ethprime");
|
||||||
|
|
||||||
show_boot_progress(BOOTSTAGE_ID_NET_ETH_INIT);
|
bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT);
|
||||||
do {
|
do {
|
||||||
if (dev->index)
|
if (dev->index)
|
||||||
puts (", ");
|
puts (", ");
|
||||||
|
|
|
@ -158,7 +158,7 @@ void post_output_backlog(void)
|
||||||
post_log("PASSED\n");
|
post_log("PASSED\n");
|
||||||
else {
|
else {
|
||||||
post_log("FAILED\n");
|
post_log("FAILED\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_POST_FAIL_R);
|
bootstage_error(BOOTSTAGE_ID_POST_FAIL_R);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ static int post_run_single(struct post_test *test,
|
||||||
} else {
|
} else {
|
||||||
if ((*test->test)(flags) != 0) {
|
if ((*test->test)(flags) != 0) {
|
||||||
post_log("FAILED\n");
|
post_log("FAILED\n");
|
||||||
show_boot_error(BOOTSTAGE_ID_POST_FAIL_R);
|
bootstage_error(BOOTSTAGE_ID_POST_FAIL_R);
|
||||||
show_post_progress(i, POST_AFTER, POST_FAILED);
|
show_post_progress(i, POST_AFTER, POST_FAILED);
|
||||||
if (test_flags & POST_CRITICAL)
|
if (test_flags & POST_CRITICAL)
|
||||||
gd->flags |= GD_FLG_POSTFAIL;
|
gd->flags |= GD_FLG_POSTFAIL;
|
||||||
|
|
Loading…
Reference in New Issue