summaryrefslogtreecommitdiffstats
path: root/post/post.c
diff options
context:
space:
mode:
authorYuri Tikhonov <yur@pollux.denx.de>2008-02-04 14:11:03 +0100
committerWolfgang Denk <wd@denx.de>2008-03-18 21:59:23 +0100
commite262efe35742c1ad4b0966ff501efc26f34a0aec (patch)
treef6e992e8645c7acebcadb483cab9a7e84d4254c1 /post/post.c
parent65b20dcefc89618193fa51947968dada91e4c778 (diff)
downloadtalos-obmc-uboot-e262efe35742c1ad4b0966ff501efc26f34a0aec.tar.gz
talos-obmc-uboot-e262efe35742c1ad4b0966ff501efc26f34a0aec.zip
The patch introduces the CRITICAL feature of POST tests. If the test
marked as POST_CRITICAL fails then the alternative, post_critical, boot-command is used. If this command is not defined then U-Boot enters into interactive mode. Signed-off-by: Dmitry Rakhchev <rda@emcraft.com> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Diffstat (limited to 'post/post.c')
-rw-r--r--post/post.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/post/post.c b/post/post.c
index 4ff75ee4b1..1df0657d8b 100644
--- a/post/post.c
+++ b/post/post.c
@@ -157,8 +157,10 @@ static void post_bootmode_test_off (void)
static void post_get_flags (int *test_flags)
{
- int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST };
- char *var[] = { "post_poweron", "post_normal", "post_slowtest" };
+ int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST,
+ POST_CRITICAL };
+ char *var[] = { "post_poweron", "post_normal", "post_slowtest",
+ "post_critical" };
int varnum = sizeof (var) / sizeof (var[0]);
char list[128]; /* long enough for POST list */
char *name;
@@ -224,7 +226,9 @@ static int post_run_single (struct post_test *test,
if (!(flags & POST_REBOOT)) {
if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) {
- post_bootmode_test_on (i);
+ post_bootmode_test_on (
+ (gd->flags & GD_FLG_POSTFAIL) ?
+ POST_FAIL_SAVE | i : i);
}
if (test_flags & POST_PREREL)
@@ -236,10 +240,14 @@ 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->test) (flags) != 0) {
post_log ("FAILED\n");
show_boot_progress (-32);
+ if (test_flags & POST_CRITICAL)
+ gd->flags |= GD_FLG_POSTFAIL;
}
else
post_log ("PASSED\n");
@@ -266,6 +274,10 @@ int post_run (char *name, int flags)
unsigned int last;
if (post_bootmode_get (&last) & POST_POWERTEST) {
+ if (last & POST_FAIL_SAVE) {
+ last &= ~POST_FAIL_SAVE;
+ gd->flags |= GD_FLG_POSTFAIL;
+ }
if (last < post_list_size &&
(flags & test_flags[last] & POST_ALWAYS) &&
(flags & test_flags[last] & POST_MEM)) {
OpenPOWER on IntegriCloud