Commit 28a385065882d6cb6ac5f443311ff87887ed7c13

Authored by Yuri Tikhonov
Committed by Wolfgang Denk
1 parent a525145d81

POST: add POST_STOP flag

Don't run futher tests in case of a test fails that is marked as
POST_STOP.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>

Showing 14 changed files with 29 additions and 2 deletions Side-by-side Diff

include/asm-arm/global_data.h
... ... @@ -61,6 +61,7 @@
61 61 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
62 62 #define GD_FLG_SILENT 0x00004 /* Silent mode */
63 63 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  64 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
64 65  
65 66 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
66 67  
include/asm-avr32/global_data.h
... ... @@ -52,6 +52,7 @@
52 52 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
53 53 #define GD_FLG_SILENT 0x00004 /* Silent mode */
54 54 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  55 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
55 56  
56 57 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
57 58  
include/asm-blackfin/global_data.h
... ... @@ -62,6 +62,7 @@
62 62 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
63 63 #define GD_FLG_SILENT 0x00004 /* Silent mode */
64 64 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  65 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
65 66  
66 67 #define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P5")
67 68  
include/asm-i386/global_data.h
... ... @@ -55,6 +55,7 @@
55 55 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
56 56 #define GD_FLG_SILENT 0x00004 /* Silent mode */
57 57 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  58 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
58 59  
59 60 extern gd_t *global_data;
60 61  
include/asm-m68k/global_data.h
... ... @@ -73,6 +73,7 @@
73 73 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
74 74 #define GD_FLG_SILENT 0x00004 /* Silent mode */
75 75 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  76 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
76 77  
77 78 #if 0
78 79 extern gd_t *global_data;
include/asm-microblaze/global_data.h
... ... @@ -53,6 +53,7 @@
53 53 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
54 54 #define GD_FLG_SILENT 0x00004 /* Silent mode */
55 55 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  56 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
56 57  
57 58 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r31")
58 59  
include/asm-mips/global_data.h
... ... @@ -55,6 +55,7 @@
55 55 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
56 56 #define GD_FLG_SILENT 0x00004 /* Silent mode */
57 57 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  58 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
58 59  
59 60 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0")
60 61  
include/asm-nios/global_data.h
... ... @@ -46,6 +46,7 @@
46 46 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
47 47 #define GD_FLG_SILENT 0x00004 /* Silent mode */
48 48 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  49 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
49 50  
50 51 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("%g7")
51 52  
include/asm-nios2/global_data.h
... ... @@ -45,6 +45,7 @@
45 45 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
46 46 #define GD_FLG_SILENT 0x00004 /* Silent mode */
47 47 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  48 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
48 49  
49 50 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r15")
50 51  
include/asm-ppc/global_data.h
... ... @@ -168,6 +168,7 @@
168 168 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
169 169 #define GD_FLG_SILENT 0x00004 /* Silent mode */
170 170 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  171 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
171 172  
172 173 #if 1
173 174 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2")
include/asm-sh/global_data.h
... ... @@ -45,6 +45,7 @@
45 45 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
46 46 #define GD_FLG_SILENT 0x00004 /* Silent mode */
47 47 #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  48 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
48 49  
49 50 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r13")
50 51  
include/asm-sparc/global_data.h
... ... @@ -79,6 +79,8 @@
79 79 #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
80 80 #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
81 81 #define GD_FLG_SILENT 0x00004 /* Silent mode */
  82 +#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  83 +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
82 84  
83 85 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("%g7")
84 86  
... ... @@ -43,6 +43,7 @@
43 43 #define POST_PREREL 0x1000 /* test runs before relocation */
44 44  
45 45 #define POST_CRITICAL 0x2000 /* Use failbootcmd if test failed */
  46 +#define POST_STOP 0x4000 /* Interrupt POST sequence on fail */
46 47  
47 48 #define POST_MEM (POST_RAM | POST_ROM)
48 49 #define POST_ALWAYS (POST_NORMAL | \
... ... @@ -238,14 +238,20 @@
238 238 if (test_flags & POST_PREREL) {
239 239 if ((*test->test) (flags) == 0)
240 240 post_log_mark_succ ( test->testid );
241   - else if (test_flags & POST_CRITICAL)
242   - gd->flags |= GD_FLG_POSTFAIL;
  241 + else {
  242 + if (test_flags & POST_CRITICAL)
  243 + gd->flags |= GD_FLG_POSTFAIL;
  244 + if (test_flags & POST_STOP)
  245 + gd->flags |= GD_FLG_POSTSTOP;
  246 + }
243 247 } else {
244 248 if ((*test->test) (flags) != 0) {
245 249 post_log ("FAILED\n");
246 250 show_boot_progress (-32);
247 251 if (test_flags & POST_CRITICAL)
248 252 gd->flags |= GD_FLG_POSTFAIL;
  253 + if (test_flags & POST_STOP)
  254 + gd->flags |= GD_FLG_POSTSTOP;
249 255 }
250 256 else
251 257 post_log ("PASSED\n");
... ... @@ -271,6 +277,9 @@
271 277 if (name == NULL) {
272 278 unsigned int last;
273 279  
  280 + if (gd->flags & GD_FLG_POSTSTOP)
  281 + return 0;
  282 +
274 283 if (post_bootmode_get (&last) & POST_POWERTEST) {
275 284 if (last & POST_FAIL_SAVE) {
276 285 last &= ~POST_FAIL_SAVE;
... ... @@ -285,6 +294,8 @@
285 294 flags | POST_REBOOT, last);
286 295  
287 296 for (i = last + 1; i < post_list_size; i++) {
  297 + if (gd->flags & GD_FLG_POSTSTOP)
  298 + break;
288 299 post_run_single (post_list + i,
289 300 test_flags[i],
290 301 flags, i);
... ... @@ -292,6 +303,8 @@
292 303 }
293 304 } else {
294 305 for (i = 0; i < post_list_size; i++) {
  306 + if (gd->flags & GD_FLG_POSTSTOP)
  307 + break;
295 308 post_run_single (post_list + i,
296 309 test_flags[i],
297 310 flags, i);