]> Git Repo - u-boot.git/blobdiff - post/post.c
* Implement new mechanism to export U-Boot's functions to standalone
[u-boot.git] / post / post.c
index 0474f1f75b11e735f6aa6607e0525207583323c6..28dd5f79a5968ea774acd83e95c63e384b38fb6d 100644 (file)
@@ -64,18 +64,27 @@ void post_bootmode_init (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
        int bootmode = post_bootmode_get (0);
 {
        DECLARE_GLOBAL_DATA_PTR;
        int bootmode = post_bootmode_get (0);
-
-       if (post_hotkeys_pressed(gd) && !(bootmode & POST_POWERTEST)) {
-               bootmode = POST_SLOWTEST;
+       int newword;
+       
+       if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) {
+               newword = BOOTMODE_MAGIC | POST_SLOWTEST;
        } else if (bootmode == 0) {
        } else if (bootmode == 0) {
-               bootmode = POST_POWERON;
+               newword = BOOTMODE_MAGIC | POST_POWERON;
        } else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) {
        } else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) {
-               bootmode = POST_NORMAL;
+               newword = BOOTMODE_MAGIC | POST_NORMAL;
        } else {
        } else {
-               return;
+               /* Use old value */
+               newword = post_word_load () & ~POST_COLDBOOT;
        }
 
        }
 
-       post_word_store (BOOTMODE_MAGIC | bootmode);
+       if (bootmode == 0)
+       {
+               /* We are booting after power-on */
+               newword |= POST_COLDBOOT;
+       }
+
+       post_word_store (newword);
+
        /* Reset activity record */
        gd->post_log_word = 0;
 }
        /* Reset activity record */
        gd->post_log_word = 0;
 }
@@ -89,7 +98,7 @@ int post_bootmode_get (unsigned int *last_test)
                return 0;
        }
 
                return 0;
        }
 
-       bootmode = word & 0xFF;
+       bootmode = word & 0x7F;
 
        if (last_test && (bootmode & POST_POWERTEST)) {
                *last_test = (word >> 8) & 0xFF;
 
        if (last_test && (bootmode & POST_POWERTEST)) {
                *last_test = (word >> 8) & 0xFF;
This page took 0.02524 seconds and 4 git commands to generate.