POST: add post_log_res field for post results in global data
authorValentin Longchamp <valentin.longchamp@keymile.com>
Wed, 3 Aug 2011 02:37:01 +0000 (02:37 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 5 Oct 2011 20:03:10 +0000 (22:03 +0200)
The current post_log_word in global data is currently split into 2x
16 bits: half for the test start, half for the test success.
Since we alredy have more than 16 POST tests defined and more could
be defined, this may result in an overflow and the post_output_backlog
would not work for the tests defined further of these 16 positions.

An additional field is added to global data so that we can now support up
to 32 (depending of architecture) tests. The post_log_word is only used
to record the start of the test and the new field post_log_res for the
test success (or failure). The post_output_backlog is for this change
also adapted.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
arch/arm/include/asm/global_data.h
arch/blackfin/include/asm/global_data.h
arch/nios2/include/asm/global_data.h
arch/powerpc/include/asm/global_data.h
arch/sparc/include/asm/global_data.h
post/post.c

index 1264d3028f166aecc7a3ba81311105b9444d9a61..fac98d559a4b40758439fe4ab7235f3831b1d1ec 100644 (file)
@@ -80,6 +80,7 @@ typedef       struct  global_data {
        char            env_buf[32];    /* buffer for getenv() before reloc. */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
        unsigned long   post_log_word; /* Record POST activities */
+       unsigned long   post_log_res; /* success of POST test */
        unsigned long   post_init_f_time; /* When post_init_f started */
 #endif
 } gd_t;
index f7aa71113de0b2765660a766ab33599d33d4649f..67aa30f04c4c811cc5055de2f2c4958906668fd7 100644 (file)
@@ -53,6 +53,7 @@ typedef struct global_data {
        unsigned long env_valid;        /* Checksum of Environment valid? */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
        unsigned long post_log_word;    /* Record POST activities */
+       unsigned long post_log_res;     /* success of POST test */
        unsigned long post_init_f_time; /* When post_init_f started */
 #endif
 
index d9f06645a3ae2aa70d59cda9d894d3319badf0ad..4b86fbdacfabac7aeaf6991b079fb0178dc6784a 100644 (file)
@@ -37,6 +37,7 @@ typedef       struct  global_data {
        unsigned long   env_valid;      /* Checksum of Environment valid */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
        unsigned long   post_log_word;  /* Record POST activities */
+       unsigned long   post_log_res; /* success of POST test */
        unsigned long   post_init_f_time; /* When post_init_f started */
 #endif
        void            **jt;           /* Standalone app jump table */
index 7fcaf384ed766668fe20152a2256b2c25108d36b..01f1d4acba3f1168f191712a28ce49d4e03cc6f9 100644 (file)
@@ -163,6 +163,7 @@ typedef     struct  global_data {
 #endif
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
        unsigned long   post_log_word;  /* Record POST activities */
+       unsigned long   post_log_res; /* success of POST test */
        unsigned long   post_init_f_time;  /* When post_init_f started */
 #endif
 #ifdef CONFIG_BOARD_TYPES
index a1e4b44aac8973d94e256f1b9aea1c01cc231b8d..613e2d8e0cb68423d04fd9fcf6f972c36c5945af 100644 (file)
@@ -61,6 +61,7 @@ typedef struct global_data {
 #endif
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
        unsigned long post_log_word;    /* Record POST activities */
+       unsigned long post_log_res;     /* success of POST test */
        unsigned long post_init_f_time; /* When post_init_f started */
 #endif
 #ifdef CONFIG_BOARD_TYPES
index 852d6a5dab51ca84623487658c7d0b36abcf13be..61acf8d5bbc4b35a7468a4eae5dd2ed31988080b 100644 (file)
@@ -121,6 +121,7 @@ void post_bootmode_init (void)
 
        /* Reset activity record */
        gd->post_log_word = 0;
+       gd->post_log_res = 0;
 }
 
 int post_bootmode_get (unsigned int *last_test)
@@ -144,12 +145,12 @@ int post_bootmode_get (unsigned int *last_test)
 /* POST tests run before relocation only mark status bits .... */
 static void post_log_mark_start ( unsigned long testid )
 {
-       gd->post_log_word |= (testid)<<16;
+       gd->post_log_word |= testid;
 }
 
 static void post_log_mark_succ ( unsigned long testid )
 {
-       gd->post_log_word |= testid;
+       gd->post_log_res |= testid;
 }
 
 /* ... and the messages are output once we are relocated */
@@ -158,9 +159,9 @@ void post_output_backlog ( void )
        int j;
 
        for (j = 0; j < post_list_size; j++) {
-               if (gd->post_log_word & (post_list[j].testid<<16)) {
+               if (gd->post_log_word & (post_list[j].testid)) {
                        post_log ("POST %s ", post_list[j].cmd);
-                       if (gd->post_log_word & post_list[j].testid)
+                       if (gd->post_log_res & post_list[j].testid)
                                post_log ("PASSED\n");
                        else {
                                post_log ("FAILED\n");