* 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>
/* 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 */
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());
}
* @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)
* 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)
{
}
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");