Julius Werner (jwerner@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13651
-gerrit
commit e23e51d4e708e01a94b396229d0cb932a7dff6d3 Author: Julius Werner jwerner@chromium.org Date: Mon Feb 8 19:48:11 2016 -0800
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 --- src/lib/timestamp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c index 03d9b8a..2850fb7 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)