cbmem: Add comment for cbmem_top returning NULL if backing store is not ready

Board or chipset needs to ensure that cbmem backing store is ready
when returning the cbmem top address. cbmem infrastructure has no
support for checking the validity of the backing store/address.

E.g.: If romstage handles cbmem coming online, chipset or board need
to ensure that call to cbmem_top in romstage returns NULL if the
backing store is not yet initialized.

Add a comment to ensure that developers know this requirement while
implementing cbmem_top for future chipsets/boards.

Change-Id: I0086b8e528f65190b764a84365cf9bf970b69c3f
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14181
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Furquan Shaikh 2016-03-28 13:23:13 -07:00
parent 169956db9d
commit 6f009dc485
1 changed files with 4 additions and 1 deletions

View File

@ -80,7 +80,10 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size);
/* Return the top address for dynamic cbmem. The address returned needs to /* Return the top address for dynamic cbmem. The address returned needs to
* be consistent across romstage and ramstage, and it is required to be * be consistent across romstage and ramstage, and it is required to be
* below 4GiB. */ * below 4GiB.
* Board or chipset should return NULL if any interface that might rely on cbmem
* (e.g. cbfs, vboot) is used before the cbmem backing store has been
* initialized. */
void *cbmem_top(void); void *cbmem_top(void);
/* Add a cbmem entry of a given size and id. These return NULL on failure. The /* Add a cbmem entry of a given size and id. These return NULL on failure. The