void post_bootmode_init(void) { int bootmode = post_bootmode_get(0); int newword; if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) { newword = BOOTMODE_MAGIC | POST_SLOWTEST; } else if (bootmode == 0) { newword = BOOTMODE_MAGIC | POST_POWERON; } else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) { newword = BOOTMODE_MAGIC | POST_NORMAL; } else { /* Use old value */ newword = post_word_load() & ~POST_COLDBOOT; } if (bootmode == 0) { /* We are booting after power-on */ newword |= POST_COLDBOOT; } post_word_store(newword); /* Reset activity record */ gd->post_log_word = 0; }
/* * command km_checktestboot * if the testpin of the board is asserted, return 1 * * else return 0 */ int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { int testpin = 0; char *s = NULL; int testboot = 0; int verbose = argc > 1 && *argv[1] == 'v'; #if defined(CONFIG_POST) testpin = post_hotkeys_pressed(); s = getenv("test_bank"); #endif /* when test_bank is not set, act as if testpin is not asserted */ testboot = (testpin != 0) && (s); if (verbose) { printf("testpin = %d\n", testpin); printf("test_bank = %s\n", s ? s : "not set"); printf("boot test app : %s\n", (testboot) ? "yes" : "no"); } /* return 0 means: testboot, therefore we need the inversion */ return !testboot; }