From 770605e4f9874230728f5a592820c619b1565ebc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 13 Feb 2012 13:51:18 +0000 Subject: 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 --- common/cmd_bootm.c | 92 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'common/cmd_bootm.c') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 86f1ffb..fd9f3e9 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -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, images.fit_noffset_os, &images.os.type)) { puts("Can't get image type!\n"); - show_boot_error(BOOTSTAGE_ID_FIT_TYPE); + bootstage_error(BOOTSTAGE_ID_FIT_TYPE); return 1; } if (fit_image_get_comp(images.fit_hdr_os, images.fit_noffset_os, &images.os.comp)) { puts("Can't get image compression!\n"); - show_boot_error(BOOTSTAGE_ID_FIT_COMPRESSION); + bootstage_error(BOOTSTAGE_ID_FIT_COMPRESSION); return 1; } if (fit_image_get_os(images.fit_hdr_os, images.fit_noffset_os, &images.os.os)) { puts("Can't get image OS!\n"); - show_boot_error(BOOTSTAGE_ID_FIT_OS); + bootstage_error(BOOTSTAGE_ID_FIT_OS); 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, &images.os.load)) { puts("Can't get image load address!\n"); - show_boot_error(BOOTSTAGE_ID_FIT_LOADADDR); + bootstage_error(BOOTSTAGE_ID_FIT_LOADADDR); return 1; } 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 " "error - must RESET board to recover\n"); if (boot_progress) - show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE); + bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); 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 " "- must RESET board to recover\n", i); if (boot_progress) - show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE); + bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); 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) { printf("LZMA: uncompress or overwrite error %d " "- must RESET board to recover\n", ret); - show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE); + bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); return BOOTM_ERR_RESET; } *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 " "- must RESET board to recover\n", ret); if (boot_progress) - show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE); + bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); 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"); 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)) { 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 { puts("ERROR: new format image overwritten - " "must RESET the board to recover\n"); - show_boot_error(BOOTSTAGE_ID_OVERWRITTEN); + bootstage_error(BOOTSTAGE_ID_OVERWRITTEN); do_reset(cmdtp, flag, argc, argv); } } if (ret == BOOTM_ERR_UNIMPLEMENTED) { if (iflag) enable_interrupts(); - show_boot_error(BOOTSTAGE_ID_DECOMP_UNIMPL); + bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL); return 1; } } @@ -670,7 +670,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } - show_boot_progress(BOOTSTAGE_ID_CHECK_BOOT_OS); + bootstage_mark(BOOTSTAGE_ID_CHECK_BOOT_OS); #ifdef CONFIG_SILENT_CONSOLE 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(); printf("ERROR: booting os '%s' (%d) is not supported\n", 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; } @@ -692,7 +692,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) boot_fn(0, argc, argv, &images); - show_boot_error(BOOTSTAGE_ID_BOOT_OS_RETURNED); + bootstage_error(BOOTSTAGE_ID_BOOT_OS_RETURNED); #ifdef DEBUG puts("\n## Control returned to monitor - resetting...\n"); #endif @@ -734,34 +734,34 @@ static image_header_t *image_get_kernel(ulong img_addr, int verify) if (!image_check_magic(hdr)) { puts("Bad Magic Number\n"); - show_boot_error(BOOTSTAGE_ID_CHECK_MAGIC); + bootstage_error(BOOTSTAGE_ID_CHECK_MAGIC); return NULL; } - show_boot_progress(BOOTSTAGE_ID_CHECK_HEADER); + bootstage_mark(BOOTSTAGE_ID_CHECK_HEADER); if (!image_check_hcrc(hdr)) { puts("Bad Header Checksum\n"); - show_boot_error(BOOTSTAGE_ID_CHECK_HEADER); + bootstage_error(BOOTSTAGE_ID_CHECK_HEADER); return NULL; } - show_boot_progress(BOOTSTAGE_ID_CHECK_CHECKSUM); + bootstage_mark(BOOTSTAGE_ID_CHECK_CHECKSUM); image_print_contents(hdr); if (verify) { puts(" Verifying Checksum ... "); if (!image_check_dcrc(hdr)) { printf("Bad Data CRC\n"); - show_boot_error(BOOTSTAGE_ID_CHECK_CHECKSUM); + bootstage_error(BOOTSTAGE_ID_CHECK_CHECKSUM); return NULL; } puts("OK\n"); } - show_boot_progress(BOOTSTAGE_ID_CHECK_ARCH); + bootstage_mark(BOOTSTAGE_ID_CHECK_ARCH); if (!image_check_target_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 hdr; @@ -789,28 +789,28 @@ static int fit_check_kernel(const void *fit, int os_noffset, int verify) puts(" Verifying Hash Integrity ... "); if (!fit_image_check_hashes(fit, os_noffset)) { puts("Bad Data Hash\n"); - show_boot_error(BOOTSTAGE_ID_FIT_CHECK_HASH); + bootstage_error(BOOTSTAGE_ID_FIT_CHECK_HASH); return 0; } 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)) { puts("Unsupported Architecture\n"); - show_boot_error(BOOTSTAGE_ID_FIT_CHECK_ARCH); + bootstage_error(BOOTSTAGE_ID_FIT_CHECK_ARCH); 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) && !fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL_NOLOAD)) { puts("Not a kernel image\n"); - show_boot_error(BOOTSTAGE_ID_FIT_CHECK_KERNEL); + bootstage_error(BOOTSTAGE_ID_FIT_CHECK_KERNEL); return 0; } - show_boot_progress(BOOTSTAGE_ID_FIT_CHECKED); + bootstage_mark(BOOTSTAGE_ID_FIT_CHECKED); return 1; } #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); } - show_boot_progress(BOOTSTAGE_ID_CHECK_MAGIC); + bootstage_mark(BOOTSTAGE_ID_CHECK_MAGIC); /* copy from dataflash if needed */ 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); if (!hdr) return NULL; - show_boot_progress(BOOTSTAGE_ID_CHECK_IMAGETYPE); + bootstage_mark(BOOTSTAGE_ID_CHECK_IMAGETYPE); /* get os_data and os_len */ switch (image_get_type(hdr)) { @@ -896,7 +896,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, default: printf("Wrong Image Type for %s command\n", cmdtp->name); - show_boot_error(BOOTSTAGE_ID_CHECK_IMAGETYPE); + bootstage_error(BOOTSTAGE_ID_CHECK_IMAGETYPE); 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_valid = 1; - show_boot_progress(BOOTSTAGE_ID_DECOMP_IMAGE); + bootstage_mark(BOOTSTAGE_ID_DECOMP_IMAGE); break; #if defined(CONFIG_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)) { puts("Bad FIT kernel image format!\n"); - show_boot_error(BOOTSTAGE_ID_FIT_FORMAT); + bootstage_error(BOOTSTAGE_ID_FIT_FORMAT); return NULL; } - show_boot_progress(BOOTSTAGE_ID_FIT_FORMAT); + bootstage_mark(BOOTSTAGE_ID_FIT_FORMAT); 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 * 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, fit_uname_config); if (cfg_noffset < 0) { - show_boot_error(BOOTSTAGE_ID_FIT_NO_UNIT_NAME); + bootstage_error(BOOTSTAGE_ID_FIT_NO_UNIT_NAME); return NULL; } /* 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); printf(" Using '%s' configuration\n", 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, cfg_noffset); @@ -956,28 +956,28 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, NULL); } else { /* 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, fit_uname_kernel); } if (os_noffset < 0) { - show_boot_error(BOOTSTAGE_ID_FIT_CONFIG); + bootstage_error(BOOTSTAGE_ID_FIT_CONFIG); return NULL; } 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)) return NULL; /* get kernel image data address and length */ if (fit_image_get_data(fit_hdr, os_noffset, &data, &len)) { 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; } - show_boot_progress(BOOTSTAGE_ID_FIT_KERNEL_INFO); + bootstage_mark(BOOTSTAGE_ID_FIT_KERNEL_INFO); *os_len = len; *os_data = (ulong)data; @@ -988,7 +988,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, #endif default: 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; } @@ -1333,7 +1333,7 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[], "(at address %08lx) ...\n", (ulong)loader); - show_boot_progress(BOOTSTAGE_ID_RUN_OS); + bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* * 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", (ulong)entry_point); - show_boot_progress(BOOTSTAGE_ID_RUN_OS); + bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* * 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", (ulong)entry_point); - show_boot_progress(BOOTSTAGE_ID_RUN_OS); + bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* * 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", (ulong)entry_point); - show_boot_progress(BOOTSTAGE_ID_RUN_OS); + bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* * INTEGRITY Parameters: -- cgit v1.1