mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
cosmetic, post: Codingstyle cleanup
Signed-off-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
ee4014b005
commit
e92372c8a7
1 changed files with 59 additions and 68 deletions
39
post/post.c
39
post/post.c
|
@ -55,9 +55,7 @@ int post_init_f (void)
|
||||||
|
|
||||||
gd->post_init_f_time = post_time_ms(0);
|
gd->post_init_f_time = post_time_ms(0);
|
||||||
if (!gd->post_init_f_time)
|
if (!gd->post_init_f_time)
|
||||||
{
|
printf("%s: post_time_ms not implemented\n", __FILE__);
|
||||||
printf("post/post.c: post_time_ms seems not to be implemented\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -100,22 +98,19 @@ void post_bootmode_init (void)
|
||||||
int bootmode = post_bootmode_get(0);
|
int bootmode = post_bootmode_get(0);
|
||||||
int newword;
|
int newword;
|
||||||
|
|
||||||
if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) {
|
if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST))
|
||||||
newword = BOOTMODE_MAGIC | POST_SLOWTEST;
|
newword = BOOTMODE_MAGIC | POST_SLOWTEST;
|
||||||
} else if (bootmode == 0) {
|
else if (bootmode == 0)
|
||||||
newword = BOOTMODE_MAGIC | POST_POWERON;
|
newword = BOOTMODE_MAGIC | POST_POWERON;
|
||||||
} else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) {
|
else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST)
|
||||||
newword = BOOTMODE_MAGIC | POST_NORMAL;
|
newword = BOOTMODE_MAGIC | POST_NORMAL;
|
||||||
} else {
|
else
|
||||||
/* Use old value */
|
/* Use old value */
|
||||||
newword = post_word_load () & ~POST_COLDBOOT;
|
newword = post_word_load () & ~POST_COLDBOOT;
|
||||||
}
|
|
||||||
|
|
||||||
if (bootmode == 0)
|
if (bootmode == 0)
|
||||||
{
|
|
||||||
/* We are booting after power-on */
|
/* We are booting after power-on */
|
||||||
newword |= POST_COLDBOOT;
|
newword |= POST_COLDBOOT;
|
||||||
}
|
|
||||||
|
|
||||||
post_word_store(newword);
|
post_word_store(newword);
|
||||||
|
|
||||||
|
@ -129,15 +124,13 @@ int post_bootmode_get (unsigned int *last_test)
|
||||||
unsigned long word = post_word_load();
|
unsigned long word = post_word_load();
|
||||||
int bootmode;
|
int bootmode;
|
||||||
|
|
||||||
if ((word & 0xFFFF0000) != BOOTMODE_MAGIC) {
|
if ((word & 0xFFFF0000) != BOOTMODE_MAGIC)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
bootmode = word & 0x7F;
|
bootmode = word & 0x7F;
|
||||||
|
|
||||||
if (last_test && (bootmode & POST_POWERTEST)) {
|
if (last_test && (bootmode & POST_POWERTEST))
|
||||||
*last_test = (word >> 8) & 0xFF;
|
*last_test = (word >> 8) & 0xFF;
|
||||||
}
|
|
||||||
|
|
||||||
return bootmode;
|
return bootmode;
|
||||||
}
|
}
|
||||||
|
@ -235,9 +228,8 @@ static void post_get_env_flags(int *test_flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == post_list_size) {
|
if (j == post_list_size)
|
||||||
printf ("No such test: %s\n", name);
|
printf ("No such test: %s\n", name);
|
||||||
}
|
|
||||||
|
|
||||||
name = s + 1;
|
name = s + 1;
|
||||||
}
|
}
|
||||||
|
@ -256,12 +248,10 @@ static void post_get_flags(int *test_flags)
|
||||||
post_get_env_flags(test_flags);
|
post_get_env_flags(test_flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (j = 0; j < post_list_size; j++) {
|
for (j = 0; j < post_list_size; j++)
|
||||||
if (test_flags[j] & POST_POWERON) {
|
if (test_flags[j] & POST_POWERON)
|
||||||
test_flags[j] |= POST_SLOWTEST;
|
test_flags[j] |= POST_SLOWTEST;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void __show_post_progress(unsigned int test_num, int before, int result)
|
void __show_post_progress(unsigned int test_num, int before, int result)
|
||||||
{
|
{
|
||||||
|
@ -277,7 +267,8 @@ static int post_run_single (struct post_test *test,
|
||||||
WATCHDOG_RESET ();
|
WATCHDOG_RESET ();
|
||||||
|
|
||||||
if (!(flags & POST_REBOOT)) {
|
if (!(flags & POST_REBOOT)) {
|
||||||
if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) {
|
if ((test_flags & POST_REBOOT) &&
|
||||||
|
!(flags & POST_MANUAL)) {
|
||||||
post_bootmode_test_on(
|
post_bootmode_test_on(
|
||||||
(gd->flags & GD_FLG_POSTFAIL) ?
|
(gd->flags & GD_FLG_POSTFAIL) ?
|
||||||
POST_FAIL_SAVE | i : i);
|
POST_FAIL_SAVE | i : i);
|
||||||
|
@ -410,9 +401,8 @@ int post_info (char *name)
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
for (i = 0; i < post_list_size; i++) {
|
for (i = 0; i < post_list_size; i++)
|
||||||
post_info_single(post_list + i, 0);
|
post_info_single(post_list + i, 0);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -511,7 +501,8 @@ void post_reloc (void)
|
||||||
unsigned long post_time_ms(unsigned long base)
|
unsigned long post_time_ms(unsigned long base)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PPC
|
#ifdef CONFIG_PPC
|
||||||
return (unsigned long)(get_ticks () / (get_tbclk () / CONFIG_SYS_HZ)) - base;
|
return (unsigned long)(get_ticks() / (get_tbclk() / CONFIG_SYS_HZ))
|
||||||
|
- base;
|
||||||
#else
|
#else
|
||||||
#warning "Not implemented yet"
|
#warning "Not implemented yet"
|
||||||
return 0; /* Not implemented yet */
|
return 0; /* Not implemented yet */
|
||||||
|
|
Loading…
Add table
Reference in a new issue