From: Yuri Tikhonov <[EMAIL PROTECTED]>

If test test marked as POST_STOP, don't run futher tests in case of test
failure.

Signed-off-by: Ilya Yanok <[EMAIL PROTECTED]>
Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
---
 include/asm-arm/global_data.h        |    1 +
 include/asm-avr32/global_data.h      |    1 +
 include/asm-blackfin/global_data.h   |    1 +
 include/asm-i386/global_data.h       |    1 +
 include/asm-m68k/global_data.h       |    1 +
 include/asm-microblaze/global_data.h |    1 +
 include/asm-mips/global_data.h       |    1 +
 include/asm-nios/global_data.h       |    1 +
 include/asm-nios2/global_data.h      |    1 +
 include/asm-ppc/global_data.h        |    1 +
 include/asm-sh/global_data.h         |    1 +
 include/asm-sparc/global_data.h      |    2 ++
 include/post.h                       |    1 +
 post/post.c                          |   18 ++++++++++++++++--
 14 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/include/asm-arm/global_data.h b/include/asm-arm/global_data.h
index 0410b5e..b470d04 100644
--- a/include/asm-arm/global_data.h
+++ b/include/asm-arm/global_data.h
@@ -61,6 +61,7 @@ typedef       struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")
 
diff --git a/include/asm-avr32/global_data.h b/include/asm-avr32/global_data.h
index daf64bc..1863b6a 100644
--- a/include/asm-avr32/global_data.h
+++ b/include/asm-avr32/global_data.h
@@ -52,6 +52,7 @@ typedef       struct  global_data {
 #define GD_FLG_DEVINIT 0x00002         /* Devices have been initialized */
 #define GD_FLG_SILENT  0x00004         /* Silent mode                   */
 #define GD_FLG_POSTFAIL        0x00008         /* Critical POST test failed    
 */
+#define GD_FLG_POSTSTOP        0x00010         /* POST seqeunce aborted        
 */
 
 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
 
diff --git a/include/asm-blackfin/global_data.h 
b/include/asm-blackfin/global_data.h
index 6debfc7..8d283cf 100644
--- a/include/asm-blackfin/global_data.h
+++ b/include/asm-blackfin/global_data.h
@@ -62,6 +62,7 @@ typedef struct global_data {
 #define        GD_FLG_DEVINIT  0x00002 /* Devices have been initialized */
 #define        GD_FLG_SILENT   0x00004 /* Silent mode                   */
 #define        GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed     */
+#define        GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted         */
 
 #define DECLARE_GLOBAL_DATA_PTR     register gd_t * volatile gd asm ("P5")
 
diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h
index 68a9ad6..be41b13 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -55,6 +55,7 @@ typedef       struct {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 extern gd_t *global_data;
 
diff --git a/include/asm-m68k/global_data.h b/include/asm-m68k/global_data.h
index c897f2b..05191c7 100644
--- a/include/asm-m68k/global_data.h
+++ b/include/asm-m68k/global_data.h
@@ -73,6 +73,7 @@ typedef       struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #if 0
 extern gd_t *global_data;
diff --git a/include/asm-microblaze/global_data.h 
b/include/asm-microblaze/global_data.h
index 91243b2..e7a8c20 100644
--- a/include/asm-microblaze/global_data.h
+++ b/include/asm-microblaze/global_data.h
@@ -53,6 +53,7 @@ typedef       struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r31")
 
diff --git a/include/asm-mips/global_data.h b/include/asm-mips/global_data.h
index bd9e4dd..e7b2853 100644
--- a/include/asm-mips/global_data.h
+++ b/include/asm-mips/global_data.h
@@ -55,6 +55,7 @@ typedef       struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
 */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
 */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
 */
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("k0")
 
diff --git a/include/asm-nios/global_data.h b/include/asm-nios/global_data.h
index ddd66cf..bceb417 100644
--- a/include/asm-nios/global_data.h
+++ b/include/asm-nios/global_data.h
@@ -46,6 +46,7 @@ typedef       struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #define DECLARE_GLOBAL_DATA_PTR     register gd_t *gd asm ("%g7")
 
diff --git a/include/asm-nios2/global_data.h b/include/asm-nios2/global_data.h
index ae5f617..0e72359 100644
--- a/include/asm-nios2/global_data.h
+++ b/include/asm-nios2/global_data.h
@@ -45,6 +45,7 @@ typedef       struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #define DECLARE_GLOBAL_DATA_PTR     register gd_t *gd asm ("r15")
 
diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h
index 202c844..341a3bd 100644
--- a/include/asm-ppc/global_data.h
+++ b/include/asm-ppc/global_data.h
@@ -168,6 +168,7 @@ typedef     struct  global_data {
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #if 1
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r2")
diff --git a/include/asm-sh/global_data.h b/include/asm-sh/global_data.h
index 521a66f..3bfbdb0 100644
--- a/include/asm-sh/global_data.h
+++ b/include/asm-sh/global_data.h
@@ -45,6 +45,7 @@ typedef       struct global_data
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been 
initialized        */
 #define        GD_FLG_SILENT   0x00004         /* Silent mode                  
        */
 #define        GD_FLG_POSTFAIL 0x00008         /* Critical POST test failed    
        */
+#define        GD_FLG_POSTSTOP 0x00010         /* POST seqeunce aborted        
        */
 
 #define DECLARE_GLOBAL_DATA_PTR        register gd_t *gd asm ("r13")
 
diff --git a/include/asm-sparc/global_data.h b/include/asm-sparc/global_data.h
index 7c29fc6..e3ef679 100644
--- a/include/asm-sparc/global_data.h
+++ b/include/asm-sparc/global_data.h
@@ -79,6 +79,8 @@ typedef struct global_data {
 #define        GD_FLG_RELOC    0x00001 /* Code was relocated to RAM            
*/
 #define        GD_FLG_DEVINIT  0x00002 /* Devices have been initialized        
*/
 #define        GD_FLG_SILENT   0x00004 /* Silent mode                          
*/
+#define        GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed            
*/
+#define        GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted                
*/
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("%g7")
 
diff --git a/include/post.h b/include/post.h
index dfed24b..123623f 100644
--- a/include/post.h
+++ b/include/post.h
@@ -43,6 +43,7 @@
 #define POST_PREREL             0x1000  /* test runs before relocation */
 
 #define POST_CRITICAL          0x2000  /* Use failbootcmd if test failed */
+#define POST_STOP              0x4000  /* Interrupt POST sequence on fail */
 
 #define POST_MEM               (POST_RAM | POST_ROM)
 #define POST_ALWAYS            (POST_NORMAL    | \
diff --git a/post/post.c b/post/post.c
index c016c3a..d14ed26 100644
--- a/post/post.c
+++ b/post/post.c
@@ -238,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");
@@ -271,6 +278,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;
@@ -285,6 +295,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);
@@ -292,6 +304,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);
-- 
1.5.4.2


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to