summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/vpd/vpd.c2
-rw-r--r--src/include/cbmem.h18
-rw-r--r--src/lib/cbfs.c2
-rw-r--r--src/security/tpm/tspi/crtm.c3
-rw-r--r--src/security/tpm/tspi/log-tpm1.c2
-rw-r--r--src/security/tpm/tspi/log-tpm2.c2
-rw-r--r--src/security/tpm/tspi/log.c2
-rw-r--r--src/security/vboot/common.c2
-rw-r--r--src/soc/intel/common/block/pmc/pmclib.c2
9 files changed, 9 insertions, 26 deletions
diff --git a/src/drivers/vpd/vpd.c b/src/drivers/vpd/vpd.c
index 31464157fc..9e12967cf3 100644
--- a/src/drivers/vpd/vpd.c
+++ b/src/drivers/vpd/vpd.c
@@ -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);
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index 5e2128e5f9..7af011010b 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -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;
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 1663517921..e5f232ca21 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -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);
diff --git a/src/security/tpm/tspi/crtm.c b/src/security/tpm/tspi/crtm.c
index 4a89d7f262..3c2760a0b8 100644
--- a/src/security/tpm/tspi/crtm.c
+++ b/src/security/tpm/tspi/crtm.c
@@ -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)) {
diff --git a/src/security/tpm/tspi/log-tpm1.c b/src/security/tpm/tspi/log-tpm1.c
index 3b192d7069..481b569cd5 100644
--- a/src/security/tpm/tspi/log-tpm1.c
+++ b/src/security/tpm/tspi/log-tpm1.c
@@ -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;
diff --git a/src/security/tpm/tspi/log-tpm2.c b/src/security/tpm/tspi/log-tpm2.c
index c7bbc9e42b..56799a7e94 100644
--- a/src/security/tpm/tspi/log-tpm2.c
+++ b/src/security/tpm/tspi/log-tpm2.c
@@ -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;
diff --git a/src/security/tpm/tspi/log.c b/src/security/tpm/tspi/log.c
index 9798eabd45..ea4e9197a2 100644
--- a/src/security/tpm/tspi/log.c
+++ b/src/security/tpm/tspi/log.c
@@ -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) +
diff --git a/src/security/vboot/common.c b/src/security/vboot/common.c
index 17039330a6..4cf45b74b3 100644
--- a/src/security/vboot/common.c
+++ b/src/security/vboot/common.c
@@ -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())
diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c
index 5a8cd3b7b7..84fc5cafe5 100644
--- a/src/soc/intel/common/block/pmc/pmclib.c
+++ b/src/soc/intel/common/block/pmc/pmclib.c
@@ -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 */