summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-02-08 19:48:11 -0800
committerJulius Werner <jwerner@chromium.org>2016-02-11 22:05:19 +0100
commit69d20c45ecd8d224f1e9cf785f4fa441feb6e0a3 (patch)
treecbda89308ef2b14ec10e80604fe6f3cffdea054a
parent87fb1a6cdbb58d5031f0dcf9b8ddf200df70a068 (diff)
downloadcoreboot-69d20c45ecd8d224f1e9cf785f4fa441feb6e0a3.tar.xz
timestamp: Bump CBMEM timestamp count, make full use of pre-RAM regions
Since we're reaching the timestamp limit on certain platforms (both for the pre-RAM cache and the final CBMEM region), this patch increases the amount of space for both. In the pre-RAM case, it achieves this by always utilizing the full size of the TIMESTAMP() region allocated in memlayout.ld, rather than arbitrarily limiting it to some constant. BRANCH=None BUG=None TEST=Booted Oak and confirmed that I can once again see all pre-RAM timestamps after picking in the LZ4 patch series. Change-Id: Iabb075a48d8d1e3e1811afeaad5ab47e7846c972 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/13651 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/lib/timestamp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 03d9b8abdf..2850fb7509 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -25,17 +25,17 @@
#include <rules.h>
#include <smp/node.h>
-#define MAX_TIMESTAMPS 60
+#define MAX_TIMESTAMPS 84
-#define MAX_TIMESTAMP_CACHE 16
+#define MAX_BSS_TIMESTAMP_CACHE 16
struct __attribute__((__packed__)) timestamp_cache {
uint32_t cache_state;
struct timestamp_table table;
/* The struct timestamp_table has a 0 length array as its last field.
* The following 'entries' array serves as the storage space for the
- * cache. */
- struct timestamp_entry entries[MAX_TIMESTAMP_CACHE];
+ * cache when allocated in the BSS. */
+ struct timestamp_entry entries[MAX_BSS_TIMESTAMP_CACHE];
};
#if (IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION) && defined(__PRE_RAM__))
@@ -62,9 +62,14 @@ static void timestamp_cache_init(struct timestamp_cache *ts_cache,
uint64_t base)
{
ts_cache->table.num_entries = 0;
- ts_cache->table.max_entries = MAX_TIMESTAMP_CACHE;
+ ts_cache->table.max_entries = MAX_BSS_TIMESTAMP_CACHE;
ts_cache->table.base_time = base;
ts_cache->cache_state = TIMESTAMP_CACHE_INITIALIZED;
+
+ if (USE_TIMESTAMP_REGION)
+ ts_cache->table.max_entries = (_timestamp_size -
+ offsetof(struct timestamp_cache, entries))
+ / sizeof(struct timestamp_entry);
}
static struct timestamp_cache *timestamp_cache_get(void)