summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-04-07 07:16:48 +0300
committerFelix Held <felix-coreboot@felixheld.de>2022-06-07 12:53:19 +0000
commit11cac784ff788b4f0495758d7f5992e457ea552c (patch)
tree15439643f00444d5b3a3d9415475f208faec0ba4
parent0310d34c2f682b00431a052e770ad44656d1d6f6 (diff)
Replace some ENV_ROMSTAGE with ENV_RAMINIT
With a combined bootblock+romstage ENV_ROMSTAGE might no longer evaluate true. Change-Id: I733cf4e4ab177e35cd260318556ece1e73d082dc Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63376 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Raul Rangel <rrangel@chromium.org>
-rw-r--r--src/drivers/amd/agesa/def_callouts.c4
-rw-r--r--src/drivers/amd/agesa/state_machine.c4
-rw-r--r--src/drivers/intel/fsp2_0/hand_off_block.c2
-rw-r--r--src/drivers/intel/fsp2_0/util.c4
-rw-r--r--src/include/rules.h1
-rw-r--r--src/lib/cbfs.c2
-rw-r--r--src/mainboard/bap/ode_e20XX/BiosCallOuts.c2
-rw-r--r--src/mainboard/lippert/frontrunner-af/sema.c2
-rw-r--r--src/mainboard/pcengines/apu1/BiosCallOuts.c2
-rw-r--r--src/mainboard/pcengines/apu2/BiosCallOuts.c2
-rw-r--r--src/soc/amd/common/pi/agesawrapper.c4
-rw-r--r--src/soc/amd/common/pi/def_callouts.c2
-rw-r--r--src/soc/amd/stoneyridge/BiosCallOuts.c2
-rw-r--r--src/soc/cavium/cn81xx/sdram.c2
-rw-r--r--src/soc/mediatek/mt8186/emi.c2
-rw-r--r--src/soc/sifive/fu540/clock.c4
-rw-r--r--src/southbridge/intel/bd82x6x/early_pch.c2
-rw-r--r--src/southbridge/intel/i82801gx/early_init.c2
-rw-r--r--src/southbridge/intel/i82801ix/early_init.c2
-rw-r--r--src/southbridge/intel/i82801jx/early_init.c2
-rw-r--r--src/vendorcode/amd/agesa/common/agesa-entry-cfg.h2
21 files changed, 26 insertions, 25 deletions
diff --git a/src/drivers/amd/agesa/def_callouts.c b/src/drivers/amd/agesa/def_callouts.c
index 5f52ca0904..97345d97a0 100644
--- a/src/drivers/amd/agesa/def_callouts.c
+++ b/src/drivers/amd/agesa/def_callouts.c
@@ -129,7 +129,7 @@ AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData, VOID *ConfigPrt)
AGESA_STATUS agesa_ReadSpd (UINT32 Func, UINTN Data, VOID *ConfigPtr)
{
- if (!ENV_ROMSTAGE)
+ if (!ENV_RAMINIT)
return AGESA_UNSUPPORTED;
return AmdMemoryReadSPD (Func, Data, ConfigPtr);
@@ -139,7 +139,7 @@ AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr)
{
AGESA_READ_SPD_PARAMS *info = ConfigPtr;
- if (!ENV_ROMSTAGE)
+ if (!ENV_RAMINIT)
return AGESA_UNSUPPORTED;
if (info->MemChannelId > 0)
diff --git a/src/drivers/amd/agesa/state_machine.c b/src/drivers/amd/agesa/state_machine.c
index 31db0b6b4c..db53a3ca12 100644
--- a/src/drivers/amd/agesa/state_machine.c
+++ b/src/drivers/amd/agesa/state_machine.c
@@ -18,7 +18,7 @@
#include "Dispatcher.h"
#endif
-#if ENV_ROMSTAGE
+#if ENV_RAMINIT
#include <PlatformMemoryConfiguration.h>
CONST PSO_ENTRY ROMDATA DefaultPlatformMemoryConfiguration[] = {PSO_END};
#endif
@@ -262,7 +262,7 @@ int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func)
if (CONFIG(AGESA_EXTRA_TIMESTAMPS) && task.ts_entry_id)
timestamp_add_now(task.ts_entry_id);
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
final = romstage_dispatch(cb, func, StdHeader);
if (ENV_RAMSTAGE)
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index e166cf7150..6ea3aa3406 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -115,7 +115,7 @@ const void *fsp_get_hob_list(void)
{
uint32_t *list_loc;
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
return fsp_hob_list_ptr;
list_loc = cbmem_find(CBMEM_ID_FSP_RUNTIME);
return (list_loc) ? (void *)(uintptr_t)(*list_loc) : NULL;
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index 2537b383ab..629f331f29 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -77,7 +77,7 @@ enum cb_err fsp_validate_component(struct fsp_header *hdr, void *fsp_file, size_
return CB_ERR;
}
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
soc_validate_fspm_header(hdr);
return CB_SUCCESS;
@@ -118,7 +118,7 @@ void fsp_handle_reset(uint32_t status)
static inline bool fspm_env(void)
{
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
return true;
return false;
}
diff --git a/src/include/rules.h b/src/include/rules.h
index 4bcd8ea17a..b2f21427d2 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -294,6 +294,7 @@
#define ENV_CREATES_CBMEM ENV_ROMSTAGE
#define ENV_HAS_CBMEM (ENV_ROMSTAGE | ENV_POSTCAR | ENV_RAMSTAGE)
+#define ENV_RAMINIT ENV_ROMSTAGE
#if ENV_X86
#define ENV_HAS_SPINLOCKS !ENV_ROMSTAGE_OR_BEFORE
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index f8112d6cc1..e1334f4152 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -106,7 +106,7 @@ static inline bool fsps_env(void)
static inline bool fspm_env(void)
{
/* FSP-M is assumed to be loaded in romstage. */
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
return true;
return false;
}
diff --git a/src/mainboard/bap/ode_e20XX/BiosCallOuts.c b/src/mainboard/bap/ode_e20XX/BiosCallOuts.c
index 518bc9579c..432f104bfe 100644
--- a/src/mainboard/bap/ode_e20XX/BiosCallOuts.c
+++ b/src/mainboard/bap/ode_e20XX/BiosCallOuts.c
@@ -180,7 +180,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
AGESA_READ_SPD_PARAMS *info = ConfigPtr;
u8 index;
- if (!ENV_ROMSTAGE)
+ if (!ENV_RAMINIT)
return AGESA_UNSUPPORTED;
if (CONFIG(BAP_E20_DDR3_1066))
diff --git a/src/mainboard/lippert/frontrunner-af/sema.c b/src/mainboard/lippert/frontrunner-af/sema.c
index e80cc1221f..b06b2cfb33 100644
--- a/src/mainboard/lippert/frontrunner-af/sema.c
+++ b/src/mainboard/lippert/frontrunner-af/sema.c
@@ -53,7 +53,7 @@ int sema_send_alive(void)
char one_spd_byte;
/* Fake read just to setup SMBUS controller. */
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
smbus_readSpd(0xa0, &one_spd_byte, 1);
/* Notify the SMC we're alive and kicking, or after a while it will
diff --git a/src/mainboard/pcengines/apu1/BiosCallOuts.c b/src/mainboard/pcengines/apu1/BiosCallOuts.c
index 4944a8561c..aff72ca0cd 100644
--- a/src/mainboard/pcengines/apu1/BiosCallOuts.c
+++ b/src/mainboard/pcengines/apu1/BiosCallOuts.c
@@ -38,7 +38,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
{
AGESA_READ_SPD_PARAMS *info = ConfigPtr;
- if (!ENV_ROMSTAGE)
+ if (!ENV_RAMINIT)
return AGESA_UNSUPPORTED;
u8 index = get_spd_offset();
diff --git a/src/mainboard/pcengines/apu2/BiosCallOuts.c b/src/mainboard/pcengines/apu2/BiosCallOuts.c
index d17dc36617..efd88d8c12 100644
--- a/src/mainboard/pcengines/apu2/BiosCallOuts.c
+++ b/src/mainboard/pcengines/apu2/BiosCallOuts.c
@@ -107,7 +107,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *Confi
{
AGESA_READ_SPD_PARAMS *info = ConfigPtr;
- if (!ENV_ROMSTAGE)
+ if (!ENV_RAMINIT)
return AGESA_UNSUPPORTED;
u8 index = get_spd_offset();
diff --git a/src/soc/amd/common/pi/agesawrapper.c b/src/soc/amd/common/pi/agesawrapper.c
index c5e6cac465..40858553df 100644
--- a/src/soc/amd/common/pi/agesawrapper.c
+++ b/src/soc/amd/common/pi/agesawrapper.c
@@ -68,7 +68,7 @@ static AGESA_STATUS amd_create_struct(AMD_INTERFACE_PARAMS *aip,
aip->NewStructPtr = buf;
aip->NewStructSize = len;
} else {
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
aip->AllocationMethod = PreMemHeap;
if (ENV_RAMSTAGE)
aip->AllocationMethod = PostMemDram;
@@ -412,7 +412,7 @@ AGESA_STATUS agesa_execute_state(AGESA_STRUCT_NAME func)
StdHeader = aip->NewStructPtr;
StdHeader->Func = func;
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
status = romstage_dispatch(StdHeader);
if (ENV_RAMSTAGE)
status = ramstage_dispatch(StdHeader);
diff --git a/src/soc/amd/common/pi/def_callouts.c b/src/soc/amd/common/pi/def_callouts.c
index 414de6f8ce..223abe3169 100644
--- a/src/soc/amd/common/pi/def_callouts.c
+++ b/src/soc/amd/common/pi/def_callouts.c
@@ -23,7 +23,7 @@ const BIOS_CALLOUT_STRUCT BiosCallouts[] = {
#else
const BIOS_CALLOUT_STRUCT BiosCallouts[] = {
/* Required callouts */
-#if ENV_ROMSTAGE
+#if ENV_RAMINIT
{ AGESA_HALT_THIS_AP, agesa_HaltThisAp },
#endif
{ AGESA_ALLOCATE_BUFFER, agesa_AllocateBuffer },
diff --git a/src/soc/amd/stoneyridge/BiosCallOuts.c b/src/soc/amd/stoneyridge/BiosCallOuts.c
index ba0f0ee950..b94f3a65b9 100644
--- a/src/soc/amd/stoneyridge/BiosCallOuts.c
+++ b/src/soc/amd/stoneyridge/BiosCallOuts.c
@@ -86,7 +86,7 @@ AGESA_STATUS agesa_ReadSpd(uint32_t Func, uintptr_t Data, void *ConfigPtr)
DEVTREE_CONST struct soc_amd_stoneyridge_config *conf;
AGESA_READ_SPD_PARAMS *info = ConfigPtr;
- if (!ENV_ROMSTAGE)
+ if (!ENV_RAMINIT)
return AGESA_UNSUPPORTED;
dev = pcidev_path_on_root(DCT_DEVFN);
diff --git a/src/soc/cavium/cn81xx/sdram.c b/src/soc/cavium/cn81xx/sdram.c
index 080adc093c..cdfa0f75fd 100644
--- a/src/soc/cavium/cn81xx/sdram.c
+++ b/src/soc/cavium/cn81xx/sdram.c
@@ -29,7 +29,7 @@ size_t sdram_size_mb(void)
#define BDK_RNM_CTL_STATUS 0
#define BDK_RNM_RANDOM 0x100000
-#if ENV_ROMSTAGE
+#if ENV_RAMINIT
/* Enable RNG for DRAM init */
static void rnm_init(void)
{
diff --git a/src/soc/mediatek/mt8186/emi.c b/src/soc/mediatek/mt8186/emi.c
index 6e2544185e..4f300da793 100644
--- a/src/soc/mediatek/mt8186/emi.c
+++ b/src/soc/mediatek/mt8186/emi.c
@@ -15,7 +15,7 @@ size_t sdram_size(void)
const struct mem_chip_info *mc;
size_t size = 0;
- if (ENV_ROMSTAGE) {
+ if (ENV_RAMINIT) {
size = mtk_dram_size();
printk(BIOS_INFO, "dram size (romstage): %#lx\n", size);
return size;
diff --git a/src/soc/sifive/fu540/clock.c b/src/soc/sifive/fu540/clock.c
index 977f938eb4..a8baddef9a 100644
--- a/src/soc/sifive/fu540/clock.c
+++ b/src/soc/sifive/fu540/clock.c
@@ -56,7 +56,7 @@ static struct prci_ctlr *prci = (void *)FU540_PRCI;
#define PRCI_DEVICESRESET_GEMGXL_RST_N(x) (((x) & 0x1) << 5)
/* Clock initialization should only be done in romstage. */
-#if ENV_ROMSTAGE
+#if ENV_RAMINIT
struct pll_settings {
unsigned int divr:6;
unsigned int divf:9;
@@ -247,7 +247,7 @@ void clock_init(void)
asm volatile ("fence");
}
-#endif /* ENV_ROMSTAGE */
+#endif /* ENV_RAMINIT */
/* Get the core clock's frequency, in KHz */
int clock_get_coreclk_khz(void)
diff --git a/src/southbridge/intel/bd82x6x/early_pch.c b/src/southbridge/intel/bd82x6x/early_pch.c
index 6ed3dce8b9..bbbc5e6f7a 100644
--- a/src/southbridge/intel/bd82x6x/early_pch.c
+++ b/src/southbridge/intel/bd82x6x/early_pch.c
@@ -310,6 +310,6 @@ void early_pch_init(void)
setup_pch_gpios(&mainboard_gpio_map);
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
enable_smbus();
}
diff --git a/src/southbridge/intel/i82801gx/early_init.c b/src/southbridge/intel/i82801gx/early_init.c
index 4647bf1c6a..3a0e0b1d77 100644
--- a/src/southbridge/intel/i82801gx/early_init.c
+++ b/src/southbridge/intel/i82801gx/early_init.c
@@ -57,7 +57,7 @@ void i82801gx_setup_bars(void)
#define TCO_BASE 0x60
-#if ENV_ROMSTAGE
+#if ENV_RAMINIT
void i82801gx_early_init(void)
{
enable_smbus();
diff --git a/src/southbridge/intel/i82801ix/early_init.c b/src/southbridge/intel/i82801ix/early_init.c
index f781098f33..b8bc9d83c9 100644
--- a/src/southbridge/intel/i82801ix/early_init.c
+++ b/src/southbridge/intel/i82801ix/early_init.c
@@ -47,7 +47,7 @@ void i82801ix_early_init(void)
{
const pci_devfn_t d31f0 = PCI_DEV(0, 0x1f, 0);
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
enable_smbus();
/* Set up RCBA. */
diff --git a/src/southbridge/intel/i82801jx/early_init.c b/src/southbridge/intel/i82801jx/early_init.c
index 327c8fc0a5..f7e880cf9e 100644
--- a/src/southbridge/intel/i82801jx/early_init.c
+++ b/src/southbridge/intel/i82801jx/early_init.c
@@ -69,7 +69,7 @@ void i82801jx_early_init(void)
{
const pci_devfn_t d31f0 = PCI_DEV(0, 0x1f, 0);
- if (ENV_ROMSTAGE)
+ if (ENV_RAMINIT)
enable_smbus();
printk(BIOS_DEBUG, "Setting up static southbridge registers...");
diff --git a/src/vendorcode/amd/agesa/common/agesa-entry-cfg.h b/src/vendorcode/amd/agesa/common/agesa-entry-cfg.h
index b1a346a78a..3302574349 100644
--- a/src/vendorcode/amd/agesa/common/agesa-entry-cfg.h
+++ b/src/vendorcode/amd/agesa/common/agesa-entry-cfg.h
@@ -2,7 +2,7 @@
#define AGESA_ENTRY_CFG_H
-#if ENV_ROMSTAGE
+#if ENV_RAMINIT
#define AGESA_ENTRY_INIT_RESET TRUE
#define AGESA_ENTRY_INIT_EARLY TRUE