bootstage: Convert progress numbers 20-41 to enums
authorSimon Glass <sjg@chromium.org>
Sat, 10 Dec 2011 11:07:58 +0000 (11:07 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 18 Mar 2012 20:16:22 +0000 (21:16 +0100)
Signed-off-by: Simon Glass <sjg@chromium.org>
arch/powerpc/lib/board.c
arch/sparc/lib/board.c
board/hermes/hermes.c
board/pcs440ep/pcs440ep.c
include/bootstage.h
post/post.c

index 36cfe7d832f1d29b6004739ed9f1bb313405b60a..dca3fd7d5a6f8a0ed9918240d095f544ab5f6570 100644 (file)
@@ -1064,7 +1064,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 void hang(void)
 {
        puts("### ERROR ### Please RESET the board ###\n");
-       show_boot_error(30);
+       show_boot_error(BOOTSTAGE_ID_NEED_RESET);
        for (;;)
                ;
 }
index fcbc666b49a75bd7e123267278ae03baa0427c67..770136b82a2fec9858e035fc9b41e50d389be6f0 100644 (file)
@@ -426,7 +426,7 @@ void hang(void)
 {
        puts("### ERROR ### Please RESET the board ###\n");
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
-       show_boot_error(30);
+       show_boot_error(BOOTSTAGE_ID_NEED_RESET);
 #endif
        for (;;) ;
 }
index 1b40ae8708520ec6b268465bbbd87ff381047b22..38bab03e382541c3e4676a70d0b072485d874c9e 100644 (file)
@@ -595,7 +595,9 @@ void show_boot_progress (int status)
 {
        volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
 
-       if (status < -32) status = -1;  /* let things compatible */
+       /* let things compatible */
+       if (status < -BOOTSTAGE_ID_POST_FAIL_R)
+               status = -1;
        status ^= 0x0F;
        status = (status & 0x0F) << 14;
        immr->im_cpm.cp_pbdat = (immr->im_cpm.cp_pbdat & ~PB_LED_ALL) | status;
index 118d81c7f29676fdfd2b4e8de786ce7b75c6cc09..f67eeddeb7d03c7568628419b7aa6c52650f5862 100644 (file)
@@ -97,7 +97,8 @@ static void status_led_blink (void)
 void show_boot_progress (int val)
 {
        /* find all valid Codes for val in README */
-       if (val == -30) return;
+       if (val == -BOOTSTAGE_ID_NEED_RESET)
+               return;
        if (val < 0) {
                /* smthing goes wrong */
                status_led_blink ();
index 29082eb01e21c1865bd043e30bdd6fb8c6e27e45..a828f5c83d4a6dec146316bb7deff4bb540e44d8 100644 (file)
@@ -66,6 +66,31 @@ enum bootstage_id {
        BOOTSTAGE_ID_NO_RAMDISK,        /* No ram disk found (not an error) */
 
        BOOTSTAGE_ID_RUN_OS     = 15,   /* Exiting U-Boot, entering OS */
+
+       BOOTSTAGE_ID_NEED_RESET = 30,
+       BOOTSTAGE_ID_POST_FAIL,         /* Post failure */
+       BOOTSTAGE_ID_POST_FAIL_R,       /* Post failure reported after reloc */
+
+       /*
+        * This set is reported ony by x86, and the meaning is different. In
+        * this case we are reporting completion of a particular stage.
+        * This should probably change in he x86 code (which doesn't report
+        * errors in any case), but discussion this can perhaps wait until we
+        * have a generic board implementation.
+        */
+       BOOTSTAGE_ID_BOARD_INIT_R,      /* We have relocated */
+       BOOTSTAGE_ID_BOARD_GLOBAL_DATA, /* Global data is set up */
+
+       BOOTSTAGE_ID_BOARD_INIT_SEQ,    /* We completed the init sequence */
+       BOOTSTAGE_ID_BOARD_FLASH,       /* We have configured flash banks */
+       BOOTSTAGE_ID_BOARD_FLASH_37,    /* In case you didn't hear... */
+       BOOTSTAGE_ID_BOARD_ENV,         /* Environment is relocated & ready */
+       BOOTSTAGE_ID_BOARD_PCI,         /* PCI is up */
+
+       BOOTSTAGE_ID_BOARD_INTERRUPTS,  /* Exceptions / interrupts ready */
+       BOOTSTAGE_ID_BOARD_DONE,        /* Board init done, off to main loop */
+       /* ^^^ here ends the x86 sequence */
+
 };
 
 /*
index f3830be678e161879b3c51d9bf01b50f4b3f487d..9579a94b9b15ac479731818c5f60b2549470c44f 100644 (file)
@@ -158,7 +158,7 @@ void post_output_backlog(void)
                                post_log("PASSED\n");
                        else {
                                post_log("FAILED\n");
-                               show_boot_error(31);
+                               show_boot_error(BOOTSTAGE_ID_POST_FAIL_R);
                        }
                }
        }
@@ -295,7 +295,7 @@ static int post_run_single(struct post_test *test,
                } else {
                        if ((*test->test)(flags) != 0) {
                                post_log("FAILED\n");
-                               show_boot_error(32);
+                               show_boot_error(BOOTSTAGE_ID_POST_FAIL_R);
                                show_post_progress(i, POST_AFTER, POST_FAILED);
                                if (test_flags & POST_CRITICAL)
                                        gd->flags |= GD_FLG_POSTFAIL;