]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - post/post.c
ppc4xx: Fix misspelled CONFIG_440SPE/440EPX/GRX config options
[karo-tx-uboot.git] / post / post.c
index 1df0657d8b6130d27dce75bab46e63071d27aecb..d31829ba162b41c30d5e0672cf5104cd725e3dfc 100644 (file)
@@ -30,8 +30,6 @@
 #include <logbuff.h>
 #endif
 
-#ifdef CONFIG_POST
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #define POST_MAX_NUMBER                32
@@ -240,14 +238,20 @@ static int post_run_single (struct post_test *test,
                if (test_flags & POST_PREREL) {
                        if ((*test->test) (flags) == 0)
                                post_log_mark_succ ( test->testid );
-                       else if (test_flags & POST_CRITICAL)
-                               gd->flags |= GD_FLG_POSTFAIL;
+                       else {
+                               if (test_flags & POST_CRITICAL)
+                                       gd->flags |= GD_FLG_POSTFAIL;
+                               if (test_flags & POST_STOP)
+                                       gd->flags |= GD_FLG_POSTSTOP;
+                       }
                } else {
                if ((*test->test) (flags) != 0) {
                        post_log ("FAILED\n");
                        show_boot_progress (-32);
                        if (test_flags & POST_CRITICAL)
                                gd->flags |= GD_FLG_POSTFAIL;
+                       if (test_flags & POST_STOP)
+                               gd->flags |= GD_FLG_POSTSTOP;
                }
                else
                        post_log ("PASSED\n");
@@ -273,6 +277,9 @@ int post_run (char *name, int flags)
        if (name == NULL) {
                unsigned int last;
 
+               if (gd->flags & GD_FLG_POSTSTOP)
+                       return 0;
+
                if (post_bootmode_get (&last) & POST_POWERTEST) {
                        if (last & POST_FAIL_SAVE) {
                                last &= ~POST_FAIL_SAVE;
@@ -287,6 +294,8 @@ int post_run (char *name, int flags)
                                                 flags | POST_REBOOT, last);
 
                                for (i = last + 1; i < post_list_size; i++) {
+                                       if (gd->flags & GD_FLG_POSTSTOP)
+                                               break;
                                        post_run_single (post_list + i,
                                                         test_flags[i],
                                                         flags, i);
@@ -294,6 +303,8 @@ int post_run (char *name, int flags)
                        }
                } else {
                        for (i = 0; i < post_list_size; i++) {
+                               if (gd->flags & GD_FLG_POSTSTOP)
+                                       break;
                                post_run_single (post_list + i,
                                                 test_flags[i],
                                                 flags, i);
@@ -442,5 +453,3 @@ unsigned long post_time_ms (unsigned long base)
        return 0; /* Not implemented yet */
 #endif
 }
-
-#endif /* CONFIG_POST */