lib/imd_cbmem.c: Add a helper function to indicate that cbmem is ready
This can be used in romstage in particular to know if dram is ready. Change-Id: I0231ab9c0b78a69faa762e0a97378bf0b50eebaf Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38736 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
committed by
Patrick Georgi
parent
a6a2f9372c
commit
54a4f172d8
@ -30,6 +30,8 @@ void *cbmem_top(void)
|
||||
dead_code();
|
||||
}
|
||||
|
||||
int cbmem_initialized;
|
||||
|
||||
static inline const struct cbmem_entry *imd_to_cbmem(const struct imd_entry *e)
|
||||
{
|
||||
return (const struct cbmem_entry *)e;
|
||||
@ -79,6 +81,8 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size)
|
||||
|
||||
/* Complete migration to CBMEM. */
|
||||
cbmem_run_init_hooks(no_recovery);
|
||||
|
||||
cbmem_initialized = 1;
|
||||
}
|
||||
|
||||
int cbmem_initialize(void)
|
||||
@ -112,6 +116,8 @@ int cbmem_initialize_id_size(u32 id, u64 size)
|
||||
/* Complete migration to CBMEM. */
|
||||
cbmem_run_init_hooks(recovery);
|
||||
|
||||
cbmem_initialized = 1;
|
||||
|
||||
/* Recovery successful. */
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user