void show_boot_progress(int status)
{
switch (status) {
- case 1:
+ case BOOTSTAGE_ID_CHECK_MAGIC:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_ON);
break;
- case 2:
+ case BOOTSTAGE_ID_CHECK_HEADER:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_OFF);
break;
- case 3:
+ case BOOTSTAGE_ID_CHECK_CHECKSUM:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_ON);
break;
- case 4:
+ case BOOTSTAGE_ID_CHECK_ARCH:
stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_OFF);
break;
- case 5:
- case 6:
+ case BOOTSTAGE_ID_CHECK_IMAGETYPE:
+ case BOOTSTAGE_ID_DECOMP_IMAGE:
stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_ON);
break;
- case 7:
- case 8:
+ case BOOTSTAGE_ID_KERNEL_LOADED:
+ case BOOTSTAGE_ID_CHECK_BOOT_OS:
stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_OFF);
break;
- case 9:
+ case BOOTSTAGE_ID_BOOT_OS_RETURNED:
case 10:
case 11:
case 12:
immr->im_ioport.iop_pcdat |= PC_REP_RES;
}
}
- SHOW_BOOT_PROGRESS (0x00);
+ SHOW_BOOT_PROGRESS(BOOTSTAGE_ID_CHECK_MAGIC);
return ((revision << 16) | (speed & 0xFFFF));
}
(status < 0) ? STATUS_LED_ON : STATUS_LED_OFF);
# endif /* STATUS_LED_YELLOW */
# if defined(STATUS_LED_BOOT)
- if (status == 6)
+ if (status == BOOTSTAGE_ID_DECOMP_IMAGE)
status_led_set (STATUS_LED_BOOT, STATUS_LED_OFF);
# endif /* STATUS_LED_BOOT */
#endif /* CONFIG_STATUS_LED */
result = fpga_load(0, fpga_data, data_size);
if (!result)
- show_boot_progress(0);
+ show_boot_progress(BOOTSTAGE_ID_START);
return result;
}
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
switch(val) {
- case 0: /* FPGA ok */
+ case BOOTSTAGE_ID_START: /* FPGA ok */
setbits_be32(&gpio->simple_dvo, LED_G0);
break;
case 65:
return;
}
switch (val) {
- case 1:
- /* validating Image */
- status_led_set (0, STATUS_LED_OFF);
- status_led_set (1, STATUS_LED_ON);
- status_led_set (2, STATUS_LED_ON);
- break;
- case BOOTSTAGE_ID_RUN_OS:
- status_led_set (0, STATUS_LED_ON);
- status_led_set (1, STATUS_LED_ON);
- status_led_set (2, STATUS_LED_ON);
- break;
+ case BOOTSTAGE_ID_CHECK_MAGIC:
+ /* validating Image */
+ status_led_set(0, STATUS_LED_OFF);
+ status_led_set(1, STATUS_LED_ON);
+ status_led_set(2, STATUS_LED_ON);
+ break;
+ case BOOTSTAGE_ID_RUN_OS:
+ status_led_set(0, STATUS_LED_ON);
+ status_led_set(1, STATUS_LED_ON);
+ status_led_set(2, STATUS_LED_ON);
+ break;
#if 0
case 64:
/* starting Ethernet configuration */
puts("GUNZIP: uncompress, out-of-mem or overwrite "
"error - must RESET board to recover\n");
if (boot_progress)
- show_boot_error(6);
+ show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
return BOOTM_ERR_RESET;
}
printf("BUNZIP2: uncompress or overwrite error %d "
"- must RESET board to recover\n", i);
if (boot_progress)
- show_boot_error(6);
+ show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
return BOOTM_ERR_RESET;
}
if (ret != SZ_OK) {
printf("LZMA: uncompress or overwrite error %d "
"- must RESET board to recover\n", ret);
- show_boot_error(6);
+ show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
return BOOTM_ERR_RESET;
}
*load_end = load + unc_len;
printf("LZO: uncompress or overwrite error %d "
"- must RESET board to recover\n", ret);
if (boot_progress)
- show_boot_error(6);
+ show_boot_error(BOOTSTAGE_ID_DECOMP_IMAGE);
return BOOTM_ERR_RESET;
}
puts("OK\n");
debug(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
- if (boot_progress)
- show_boot_progress(7);
+ show_boot_progress(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",
if (ret == BOOTM_ERR_UNIMPLEMENTED) {
if (iflag)
enable_interrupts();
- show_boot_error(7);
+ show_boot_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
return 1;
}
}
return 0;
}
- show_boot_progress(8);
+ show_boot_progress(BOOTSTAGE_ID_CHECK_BOOT_OS);
#ifdef CONFIG_SILENT_CONSOLE
if (images.os.os == IH_OS_LINUX)
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(8);
+ show_boot_error(BOOTSTAGE_ID_CHECK_BOOT_OS);
return 1;
}
boot_fn(0, argc, argv, &images);
- show_boot_error(9);
+ show_boot_error(BOOTSTAGE_ID_BOOT_OS_RETURNED);
#ifdef DEBUG
puts("\n## Control returned to monitor - resetting...\n");
#endif
if (!image_check_magic(hdr)) {
puts("Bad Magic Number\n");
- show_boot_error(1);
+ show_boot_error(BOOTSTAGE_ID_CHECK_MAGIC);
return NULL;
}
- show_boot_progress(2);
+ show_boot_progress(BOOTSTAGE_ID_CHECK_HEADER);
if (!image_check_hcrc(hdr)) {
puts("Bad Header Checksum\n");
- show_boot_error(2);
+ show_boot_error(BOOTSTAGE_ID_CHECK_HEADER);
return NULL;
}
- show_boot_progress(3);
+ show_boot_progress(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(3);
+ show_boot_error(BOOTSTAGE_ID_CHECK_CHECKSUM);
return NULL;
}
puts("OK\n");
}
- show_boot_progress(4);
+ show_boot_progress(BOOTSTAGE_ID_CHECK_ARCH);
if (!image_check_target_arch(hdr)) {
printf("Unsupported Architecture 0x%x\n", image_get_arch(hdr));
- show_boot_error(4);
+ show_boot_error(BOOTSTAGE_ID_CHECK_ARCH);
return NULL;
}
return hdr;
debug("* kernel: cmdline image address = 0x%08lx\n", img_addr);
}
- show_boot_progress(1);
+ show_boot_progress(BOOTSTAGE_ID_CHECK_MAGIC);
/* copy from dataflash if needed */
img_addr = genimg_get_image(img_addr);
hdr = image_get_kernel(img_addr, images->verify);
if (!hdr)
return NULL;
- show_boot_progress(5);
+ show_boot_progress(BOOTSTAGE_ID_CHECK_IMAGETYPE);
/* get os_data and os_len */
switch (image_get_type(hdr)) {
default:
printf("Wrong Image Type for %s command\n",
cmdtp->name);
- show_boot_error(5);
+ show_boot_error(BOOTSTAGE_ID_CHECK_IMAGETYPE);
return NULL;
}
images->legacy_hdr_os = hdr;
images->legacy_hdr_valid = 1;
- show_boot_progress(6);
+ show_boot_progress(BOOTSTAGE_ID_DECOMP_IMAGE);
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
printf("## Loading init Ramdisk from Legacy "
"Image at %08lx ...\n", rd_addr);
- show_boot_progress(9);
+ show_boot_progress(BOOTSTAGE_ID_LOAD_RAMDISK);
rd_hdr = image_get_ramdisk(rd_addr, arch,
images->verify);
* error on action3
*/
enum bootstage_id {
+ BOOTSTAGE_ID_START = 0,
+ BOOTSTAGE_ID_CHECK_MAGIC, /* Checking image magic */
+ BOOTSTAGE_ID_CHECK_HEADER, /* Checking image header */
+ BOOTSTAGE_ID_CHECK_CHECKSUM, /* Checking image checksum */
+ BOOTSTAGE_ID_CHECK_ARCH, /* Checking architecture */
+
+ BOOTSTAGE_ID_CHECK_IMAGETYPE = 5,/* Checking image type */
+ BOOTSTAGE_ID_DECOMP_IMAGE, /* Decompressing image */
+ BOOTSTAGE_ID_KERNEL_LOADED, /* Kernel has been loaded */
+ BOOTSTAGE_ID_DECOMP_UNIMPL = 7, /* Odd decompression algorithm */
+ BOOTSTAGE_ID_CHECK_BOOT_OS, /* Calling OS-specific boot function */
+ BOOTSTAGE_ID_BOOT_OS_RETURNED, /* Tried to boot OS, but it returned */
+ BOOTSTAGE_ID_CHECK_RAMDISK = 9, /* Checking ram disk */
+
BOOTSTAGE_ID_RUN_OS = 15, /* Exiting U-Boot, entering OS */
};