cbmem.h: Drop cbmem_possible_online in favor of ENV_HAS_CBMEM
The macro ENV_HAS_CBMEM achieves the same as this inline function. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: I6d65ca51c863abe2106f794398ddd7d7d9ac4b5e Reviewed-on: https://review.coreboot.org/c/coreboot/+/77166 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jakub Czapiga <czapiga@google.com>
This commit is contained in:
parent
bfadc78bd7
commit
b7cbb7c431
|
@ -94,7 +94,7 @@ fail:
|
|||
|
||||
static int init_vpd_rdevs_from_cbmem(void)
|
||||
{
|
||||
if (!cbmem_possibly_online())
|
||||
if (!ENV_HAS_CBMEM)
|
||||
return -1;
|
||||
|
||||
struct vpd_cbmem *cbmem = cbmem_find(CBMEM_ID_VPD);
|
||||
|
|
|
@ -136,28 +136,12 @@ void cbmem_add_records_to_cbtable(struct lb_header *header);
|
|||
#define CBMEM_READY_HOOK_EARLY(x) _CBMEM_INIT_HOOK_UNUSED(x)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns 0 for the stages where we know that cbmem does not come online.
|
||||
* Even if this function returns 1 for romstage, depending upon the point in
|
||||
* bootup, cbmem might not actually be online.
|
||||
*/
|
||||
static inline int cbmem_possibly_online(void)
|
||||
{
|
||||
if (ENV_BOOTBLOCK)
|
||||
return 0;
|
||||
|
||||
if (ENV_SEPARATE_VERSTAGE && !CONFIG(VBOOT_STARTS_IN_ROMSTAGE))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Returns 1 after running cbmem init hooks, 0 otherwise. */
|
||||
static inline int cbmem_online(void)
|
||||
{
|
||||
extern int cbmem_initialized;
|
||||
|
||||
if (!cbmem_possibly_online())
|
||||
if (!ENV_HAS_CBMEM)
|
||||
return 0;
|
||||
|
||||
return cbmem_initialized;
|
||||
|
|
|
@ -618,7 +618,7 @@ void cbfs_boot_device_find_mcache(struct cbfs_boot_device *cbd, uint32_t id)
|
|||
return;
|
||||
|
||||
const struct cbmem_entry *entry;
|
||||
if (cbmem_possibly_online() &&
|
||||
if (ENV_HAS_CBMEM &&
|
||||
(entry = cbmem_entry_find(id))) {
|
||||
cbd->mcache = cbmem_entry_start(entry);
|
||||
cbd->mcache_size = cbmem_entry_size(entry);
|
||||
|
|
|
@ -161,8 +161,7 @@ void *tpm_log_init(void)
|
|||
|
||||
/* We are dealing here with pre CBMEM environment.
|
||||
* If cbmem isn't available use CAR or SRAM */
|
||||
if (!cbmem_possibly_online() &&
|
||||
!CONFIG(VBOOT_RETURN_FROM_VERSTAGE))
|
||||
if (!ENV_HAS_CBMEM && !CONFIG(VBOOT_RETURN_FROM_VERSTAGE))
|
||||
return _tpm_log;
|
||||
else if (ENV_CREATES_CBMEM
|
||||
&& !CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) {
|
||||
|
|
|
@ -20,7 +20,7 @@ void *tpm1_log_cbmem_init(void)
|
|||
if (tclt)
|
||||
return tclt;
|
||||
|
||||
if (cbmem_possibly_online()) {
|
||||
if (ENV_HAS_CBMEM) {
|
||||
size_t tpm_log_len;
|
||||
struct spec_id_event_data *hdr;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ void *tpm2_log_cbmem_init(void)
|
|||
if (tclt)
|
||||
return tclt;
|
||||
|
||||
if (cbmem_possibly_online()) {
|
||||
if (ENV_HAS_CBMEM) {
|
||||
size_t tpm_log_len;
|
||||
struct tcg_efi_spec_id_event *hdr;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ void *tpm_cb_log_cbmem_init(void)
|
|||
if (tclt)
|
||||
return tclt;
|
||||
|
||||
if (cbmem_possibly_online()) {
|
||||
if (ENV_HAS_CBMEM) {
|
||||
tclt = cbmem_find(CBMEM_ID_TPM_CB_LOG);
|
||||
if (!tclt) {
|
||||
size_t tpm_log_len = sizeof(struct tpm_cb_log_table) +
|
||||
|
|
|
@ -14,7 +14,7 @@ static void *vboot_get_workbuf(void)
|
|||
{
|
||||
void *wb = NULL;
|
||||
|
||||
if (cbmem_possibly_online())
|
||||
if (ENV_HAS_CBMEM)
|
||||
wb = cbmem_find(CBMEM_ID_VBOOT_WORKBUF);
|
||||
|
||||
if (!wb && !CONFIG(VBOOT_STARTS_IN_ROMSTAGE) && preram_symbols_available())
|
||||
|
|
|
@ -64,7 +64,7 @@ struct chipset_power_state *pmc_get_power_state(void)
|
|||
{
|
||||
struct chipset_power_state *ptr = NULL;
|
||||
|
||||
if (cbmem_possibly_online())
|
||||
if (ENV_HAS_CBMEM)
|
||||
ptr = acpi_get_pm_state();
|
||||
|
||||
/* cbmem is online but ptr is not populated yet */
|
||||
|
|
Loading…
Reference in New Issue