summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/memlayout.h3
-rw-r--r--src/include/symbols.h4
-rw-r--r--src/include/timestamp.h13
3 files changed, 20 insertions, 0 deletions
diff --git a/src/include/memlayout.h b/src/include/memlayout.h
index 2771f2fe14..a5296286b2 100644
--- a/src/include/memlayout.h
+++ b/src/include/memlayout.h
@@ -47,6 +47,9 @@
#define DRAM_START(addr) SYMBOL(dram, addr)
+#define TIMESTAMP(addr, size) \
+ REGION(timestamp, addr, size, 8)
+
#define PRERAM_CBMEM_CONSOLE(addr, size) \
REGION(preram_cbmem_console, addr, size, 4)
diff --git a/src/include/symbols.h b/src/include/symbols.h
index 9102e82952..3fbf819902 100644
--- a/src/include/symbols.h
+++ b/src/include/symbols.h
@@ -28,6 +28,10 @@ extern u8 _esram[];
extern u8 _dram[];
+extern u8 _timestamp[];
+extern u8 _etimestamp[];
+#define _timestamp_size (_etimestamp - _timestamp)
+
extern u8 _preram_cbmem_console[];
extern u8 _epreram_cbmem_console[];
#define _preram_cbmem_console_size \
diff --git a/src/include/timestamp.h b/src/include/timestamp.h
index a248ea45cd..54d69ce132 100644
--- a/src/include/timestamp.h
+++ b/src/include/timestamp.h
@@ -89,8 +89,21 @@ enum timestamp_id {
};
#if CONFIG_COLLECT_TIMESTAMPS && (CONFIG_EARLY_CBMEM_INIT || !defined(__PRE_RAM__))
+/*
+ * timestamp_init() needs to be called once for each of these cases:
+ * 1. __PRE_RAM__ (bootblock, romstage, verstage, etc) and
+ * 2. !__PRE_RAM__ (ramstage)
+ * The latter is taken care of by the generic coreboot infrastructure so
+ * it's up to the chipset/arch to call timestamp_init() in *one* of
+ * the __PRE_RAM__ stages. If multiple calls are made timestamps will be lost.
+ */
void timestamp_init(uint64_t base);
+/*
+ * Add a new timestamp. Depending on cbmem is available or not, this timestamp
+ * will be stored to cbmem / timestamp cache.
+ */
void timestamp_add(enum timestamp_id id, uint64_t ts_time);
+/* Calls timestamp_add with current timestamp. */
void timestamp_add_now(enum timestamp_id id);
#else
#define timestamp_init(base)