]> Git Repo - J-u-boot.git/blobdiff - common/bootstage.c
Merge commit 'ac30d240dbb520d0980f0687630feb702a14f51a' of https://source.denx.de...
[J-u-boot.git] / common / bootstage.c
index d2ed33663b7193b574722e5f3d0aa441dd571149..326c40f1561fd861dba22a50e082455bd008664e 100644 (file)
@@ -9,11 +9,16 @@
  * permits accurate timestamping of each.
  */
 
+#define LOG_CATEGORY   LOGC_BOOT
+
 #include <common.h>
+#include <bootstage.h>
 #include <hang.h>
+#include <log.h>
 #include <malloc.h>
 #include <sort.h>
 #include <spl.h>
+#include <asm/global_data.h>
 #include <linux/compiler.h>
 #include <linux/libfdt.h>
 
@@ -124,12 +129,16 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name,
 
        /* Only record the first event for each */
        rec = find_id(data, id);
-       if (!rec && data->rec_count < RECORD_COUNT) {
-               rec = &data->record[data->rec_count++];
-               rec->time_us = mark;
-               rec->name = name;
-               rec->flags = flags;
-               rec->id = id;
+       if (!rec) {
+               if (data->rec_count < RECORD_COUNT) {
+                       rec = &data->record[data->rec_count++];
+                       rec->time_us = mark;
+                       rec->name = name;
+                       rec->flags = flags;
+                       rec->id = id;
+               } else {
+                       log_warning("Bootstage space exhasuted\n");
+               }
        }
 
        /* Tell the board about this progress */
@@ -138,15 +147,9 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name,
        return mark;
 }
 
-
-ulong bootstage_mark(enum bootstage_id id)
-{
-       return bootstage_add_record(id, NULL, 0, timer_get_boot_us());
-}
-
-ulong bootstage_error(enum bootstage_id id)
+ulong bootstage_error_name(enum bootstage_id id, const char *name)
 {
-       return bootstage_add_record(id, NULL, BOOTSTAGEF_ERROR,
+       return bootstage_add_record(id, name, BOOTSTAGEF_ERROR,
                                    timer_get_boot_us());
 }
 
@@ -221,7 +224,7 @@ uint32_t bootstage_accum(enum bootstage_id id)
  * @param buf  Buffer to put name if needed
  * @param len  Length of buffer
  * @param rec  Boot stage record to get the name from
- * @return pointer to name, either from the record or pointing to buf.
+ * Return: pointer to name, either from the record or pointing to buf.
  */
 static const char *get_record_name(char *buf, int len,
                                   const struct bootstage_record *rec)
@@ -264,7 +267,7 @@ static int h_compare_record(const void *r1, const void *r2)
  * Add all bootstage timings to a device tree.
  *
  * @param blob Device tree blob
- * @return 0 on success, != 0 on failure.
+ * Return: 0 on success, != 0 on failure.
  */
 static int add_bootstages_devicetree(struct fdt_header *blob)
 {
@@ -346,7 +349,7 @@ void bootstage_report(void)
        }
        if (data->rec_count > RECORD_COUNT)
                printf("Overflowed internal boot id table by %d entries\n"
-                      "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n",
+                      "Please increase CONFIG_(SPL_TPL_)BOOTSTAGE_RECORD_COUNT\n",
                       data->rec_count - RECORD_COUNT);
 
        puts("\nAccumulated time:\n");
This page took 0.046267 seconds and 4 git commands to generate.