Leroy P Leahy (leroy.p.leahy@intel.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10148
-gerrit
commit 8b326dcf7a2a62ca0f9f1b7f18510264754a0c38 Author: Lee Leahy leroy.p.leahy@intel.com Date: Fri May 8 11:33:55 2015 -0700
cbmem: Add initial allocation support
Add support to allocate a region just below CBMEM root. This region is reserved for FSP 1.1 to use for its stack and variables.
BRANCH=none BUG=None TEST=Build and run on Braswell
Change-Id: I1d4b36ab366e6f8e036335c56c1756f2dfaab3f5 Signed-off-by: Lee Leahy leroy.p.leahy@intel.com --- src/include/cbmem.h | 4 ++++ src/lib/imd_cbmem.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+)
diff --git a/src/include/cbmem.h b/src/include/cbmem.h index c5cd52a..8c6b096 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 diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index 0649bf3..bdef9d6 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -116,6 +116,11 @@ static struct imd *imd_init_backing_with_recover(struct imd *backing)
void cbmem_initialize_empty(void) { + cbmem_initialize_empty_id_size(0, 0); +} + +void cbmem_initialize_empty_id_size(u32 id, u64 size) +{ struct imd *imd; struct imd imd_backing;
@@ -133,6 +138,10 @@ void cbmem_initialize_empty(void) return; }
+ /* Add the specified range first */ + if (size) + cbmem_add(id, size); + /* Complete migration to CBMEM. */ cbmem_run_init_hooks(); } @@ -146,6 +155,11 @@ static inline int cbmem_fail_recovery(void)
int cbmem_initialize(void) { + return cbmem_initialize_id_size(0, 0); +} + +int cbmem_initialize_id_size(u32 id, u64 size) +{ struct imd *imd; struct imd imd_backing;
@@ -167,6 +181,10 @@ int cbmem_initialize(void) imd_lockdown(imd); #endif
+ /* Add the specified range first */ + if (size) + cbmem_add(id, size); + /* Complete migration to CBMEM. */ cbmem_run_init_hooks();