CBMEM: Replace cbmem_initialize() with cbmem_recovery()

The replacement function confirms CBMEM TOC is wiped clean on power
cycles and resets. It also introduces compatibility interface to ease
up transition to DYNAMIC_CBMEM.

Change-Id: Ic5445c5bff4aff22a43821f3064f2df458b9f250
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/4668
Reviewed-by: Aaron Durbin <adurbin@google.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Kyösti Mälkki
2014-01-06 17:20:31 +02:00
parent 97e1b11f41
commit 2d8520b275
25 changed files with 70 additions and 43 deletions

View File

@ -90,6 +90,9 @@ struct cbmem_entry;
#define DYN_CBMEM_ALIGN_SIZE (4096)
/* 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);
/* Initialize cbmem to be empty. */
void cbmem_initialize_empty(void);
@ -153,9 +156,9 @@ struct cbmem_entry *get_cbmem_toc(void);
unsigned long get_top_of_ram(void);
/* 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);
/* Returns 0 if old cbmem was recovered. Recovery is only attempted if
* s3resume is non-zero. */
int cbmem_recovery(int s3resume);
/* Add a cbmem entry of a given size and id. These return NULL on failure. The
* add function performs a find first and do not check against the original
* size. */