[coreboot-gerrit] New patch to review for coreboot: 9bfef4f DO NOT MERGE: FSP 1.1 support "workarounds"

Leroy P Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Fri May 1 22:35:58 CEST 2015


Leroy P Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10054

-gerrit

commit 9bfef4fe565342f142759365608adf85826a378d
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Fri May 1 10:11:25 2015 -0700

    DO NOT MERGE: FSP 1.1 support "workarounds"
    
    Update header files and add empty routines for missing references to get
    things to build for Braswell.
    
    BRANCH=none
    BUG=None
    TEST=Build and run on Braswell
    
    Change-Id: Iec322cc888658ca56cf0abb29e92a2af7168a934
    Signed-off-by: Lee Leahy <leroy.p.leahy at intel.com>
---
 src/include/bootstate.h     |  3 +++
 src/include/cbmem.h         | 19 ++++++++++++++++++-
 src/include/timestamp.h     | 19 +++++++++++++++++++
 src/soc/intel/common/junk.c |  5 +++++
 4 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/src/include/bootstate.h b/src/include/bootstate.h
index 8b5e4be..59809eb 100644
--- a/src/include/bootstate.h
+++ b/src/include/bootstate.h
@@ -187,6 +187,9 @@ struct boot_state_init_entry {
 
 #define BOOT_STATE_INIT_ATTR  __attribute__ ((used,section (".bs_init")))
 
+#define BOOT_STATE_INIT_ENTRIES(name_) \
+	static struct boot_state_init_entry name_[] BOOT_STATE_INIT_ATTR
+
 #define BOOT_STATE_INIT_ENTRY(state_, when_, func_, arg_)		\
 	static struct boot_state_init_entry func_ ##_## state_ ##_## when_ = \
 	{								\
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index c5cd52a..ac4fca4 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -144,12 +144,16 @@ struct cbmem_entry;
  */
 
 #define DYN_CBMEM_ALIGN_SIZE (4096)
+#define CBMEM_ROOT_SIZE      DYN_CBMEM_ALIGN_SIZE
 
 /* By default cbmem is attempted to be recovered. Returns 0 if cbmem was
  * recovered or 1 if cbmem had to be reinitialized. */
 int cbmem_initialize(void);
+int cbmem_initialize_id_size(u32 id, u64 size);
+
 /* Initialize cbmem to be empty. */
 void cbmem_initialize_empty(void);
+void cbmem_initialize_empty_id_size(u32 id, u64 size);
 
 /* Return the top address for dynamic cbmem. The address returned needs to
  * be consistent across romstage and ramstage, and it is required to be
@@ -186,6 +190,7 @@ void *cbmem_add(u32 id, u64 size);
 /* Find a cbmem entry of a given id. These return NULL on failure. */
 void *cbmem_find(u32 id);
 
+typedef void (* const cbmem_init_hook_t)(void);
 void cbmem_run_init_hooks(void);
 void cbmem_fail_resume(void);
 
@@ -194,7 +199,19 @@ void cbmem_fail_resume(void);
 /* Add the cbmem memory used to the memory map at boot. */
 void cbmem_add_bootmem(void);
 void cbmem_list(void);
-#endif /* __PRE_RAM__ */
+void cbmem_print_entry(int n, u32 id, u64 start, u64 size);
+#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \
+	init_fn_ ## _unused_ __attribute__((unused)) = init_fn_;
+#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) \
+	static cbmem_init_hook_t init_fn_ ## _ptr_ __attribute__((used, \
+	section(".rodata.cbmem_init_hooks"))) = init_fn_;
+#else /* __PRE_RAM__ */
+#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) \
+	static cbmem_init_hook_t init_fn_ ## _ptr_ __attribute__((used, \
+	section(".rodata.cbmem_init_hooks"))) = init_fn_;
+#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \
+	init_fn_ ## _unused_ __attribute__((unused)) = init_fn_;
+#endif /* !__PRE_RAM__ */
 
 /* These are for compatibility with old boards only. Any new chipset and board
  * must implement cbmem_top() for both romstage and ramstage to support
diff --git a/src/include/timestamp.h b/src/include/timestamp.h
index a6bfced..1e3f74b 100644
--- a/src/include/timestamp.h
+++ b/src/include/timestamp.h
@@ -89,6 +89,25 @@ enum timestamp_id {
 };
 
 #if CONFIG_COLLECT_TIMESTAMPS && (CONFIG_EARLY_CBMEM_INIT || !defined(__PRE_RAM__))
+/*
+ * Order of usage of timestamp library is:
+ * Call timestamp_early_init / timestamp_init to set base time before any
+ * timestamp_add function is called. timestamp_early_init also ensures that the
+ * cache is valid in _timestamp region.
+ * After this, timestamp_add / timestamp_add_now can be used to record
+ * timestamps. Sync will be automatically taken care of by cbmem_initialize
+ */
+/*
+ * Initialize the cache to a valid state and set the base time.
+ * This function is used before DRAM is setup so that the timestamp cache can
+ * be initialized in _timestamp region.
+ * Both, timestamp_init and timestamp_early_init reset the cbmem state to
+ * timestamp table reset required. Thus, whenever a timestamp_add or
+ * timestamp_sync is done to add new entries into the cbmem timestamp table, it
+ * first resets the table to 0 entries.
+ */
+void timestamp_early_init(uint64_t base);
+/* Initialize the base time for timestamps and mark cache as valid */
 void timestamp_init(uint64_t base);
 void timestamp_add(enum timestamp_id id, uint64_t ts_time);
 void timestamp_add_now(enum timestamp_id id);
diff --git a/src/soc/intel/common/junk.c b/src/soc/intel/common/junk.c
index e90c6e8..e4e563d 100644
--- a/src/soc/intel/common/junk.c
+++ b/src/soc/intel/common/junk.c
@@ -1,5 +1,6 @@
 #include <cbmem.h>
 #include <reg_script.h>
+#include <stage_cache.h>
 #include <timestamp.h>
 
 int cbmem_initialize_id_size(u32 id, u64 size)
@@ -15,6 +16,10 @@ void reg_script_run_on_dev(device_t dev, const struct reg_script *step)
 {
 }
 
+void stage_cache_external_region(void **base, size_t *size)
+{
+}
+
 void timestamp_early_init(uint64_t base)
 {
 }



More information about the coreboot-gerrit mailing list