Merge tag 'next-20220328' of https://source.denx.de/u-boot/custodians/u-boot-video...
[platform/kernel/u-boot.git] / post / post.c
index 8c2c822..d67c43e 100644 (file)
@@ -1,24 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <bootstage.h>
+#include <env.h>
+#include <log.h>
+#include <malloc.h>
 #include <stdio_dev.h>
+#include <time.h>
 #include <watchdog.h>
 #include <div64.h>
 #include <post.h>
+#include <asm/global_data.h>
 
 #ifdef CONFIG_SYS_POST_HOTKEYS_GPIO
 #include <asm/gpio.h>
 #endif
 
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #define POST_MAX_NUMBER                32
@@ -128,7 +129,7 @@ static void post_log_mark_succ(unsigned long testid)
 }
 
 /* ... and the messages are output once we are relocated */
-void post_output_backlog(void)
+int post_output_backlog(void)
 {
        int j;
 
@@ -143,6 +144,8 @@ void post_output_backlog(void)
                        }
                }
        }
+
+       return 0;
 }
 
 static void post_bootmode_test_on(unsigned int last_test)
@@ -180,7 +183,7 @@ static void post_get_env_flags(int *test_flags)
        int i, j;
 
        for (i = 0; i < varnum; i++) {
-               if (getenv_f(var[i], list, sizeof(list)) <= 0)
+               if (env_get_f(var[i], list, sizeof(list)) <= 0)
                        continue;
 
                for (j = 0; j < post_list_size; j++)
@@ -189,7 +192,7 @@ static void post_get_env_flags(int *test_flags)
                last = 0;
                name = list;
                while (!last) {
-                       while (*name && *name == ' ')
+                       while (*name == ' ')
                                name++;
                        if (*name == 0)
                                break;
@@ -407,13 +410,8 @@ int post_log(char *format, ...)
        vsprintf(printbuffer, format, args);
        va_end(args);
 
-#ifdef CONFIG_LOGBUFFER
-       /* Send to the logbuffer */
-       logbuff_log(printbuffer);
-#else
        /* Send to the stdout file */
        puts(printbuffer);
-#endif
 
        return 0;
 }