arch/x86 cbmem: Drop tests for LATE_CBMEM_INIT
Remove all cases in code where we tested for EARLY_CBMEM_INIT or LATE_CBMEM_INIT being set. This also removes all references to LATE_CBMEM_INIT in comments. Change-Id: I4e47fb5c8a947d268f4840cfb9c0d3596fb9ab39 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/26827 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Patrick Georgi
parent
8616442150
commit
513a1a81f7
@@ -43,9 +43,7 @@ bootblock-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
|
||||
bootblock-y += libgcc.c
|
||||
bootblock-$(CONFIG_GENERIC_UDELAY) += timer.c
|
||||
|
||||
ifeq ($(CONFIG_EARLY_CBMEM_INIT),y)
|
||||
bootblock-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
|
||||
endif
|
||||
|
||||
bootblock-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
|
||||
bootblock-y += delay.c
|
||||
@@ -97,10 +95,8 @@ ramstage-y += romstage_stack.c
|
||||
romstage-y += stack.c
|
||||
ramstage-y += rtc.c
|
||||
|
||||
ifeq ($(CONFIG_EARLY_CBMEM_INIT),y)
|
||||
romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
|
||||
romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
|
||||
endif
|
||||
|
||||
romstage-y += compute_ip_checksum.c
|
||||
ifeq ($(CONFIG_COMPILER_GCC),y)
|
||||
|
@@ -17,9 +17,6 @@
|
||||
#include <bootstate.h>
|
||||
#include <rules.h>
|
||||
#include <symbols.h>
|
||||
#if IS_ENABLED(CONFIG_ARCH_X86) && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)
|
||||
#include <arch/acpi.h>
|
||||
#endif
|
||||
|
||||
void cbmem_run_init_hooks(int is_recovery)
|
||||
{
|
||||
@@ -40,16 +37,3 @@ void cbmem_run_init_hooks(int is_recovery)
|
||||
void __weak cbmem_fail_resume(void)
|
||||
{
|
||||
}
|
||||
|
||||
#if ENV_RAMSTAGE && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)
|
||||
static void init_cbmem_post_device(void *unused)
|
||||
{
|
||||
if (acpi_is_wakeup())
|
||||
cbmem_initialize();
|
||||
else
|
||||
cbmem_initialize_empty();
|
||||
}
|
||||
|
||||
BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY,
|
||||
init_cbmem_post_device, NULL);
|
||||
#endif
|
||||
|
@@ -63,17 +63,13 @@ static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
|
||||
#else
|
||||
|
||||
/*
|
||||
* When running from RAM, a lot of console output is generated before CBMEM is
|
||||
* When running from RAM, some console output is generated before CBMEM is
|
||||
* reinitialized. This static buffer is used to store that output temporarily,
|
||||
* to be concatenated with the CBMEM console buffer contents accumulated
|
||||
* during the ROM stage, once CBMEM becomes available at RAM stage.
|
||||
*/
|
||||
|
||||
#if IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)
|
||||
#define STATIC_CONSOLE_SIZE 1024
|
||||
#else
|
||||
#define STATIC_CONSOLE_SIZE CONFIG_CONSOLE_CBMEM_BUFFER_SIZE
|
||||
#endif
|
||||
static u8 static_console[STATIC_CONSOLE_SIZE];
|
||||
#endif
|
||||
|
||||
|
@@ -458,12 +458,10 @@ void main(void)
|
||||
post_code(POST_CONSOLE_READY);
|
||||
|
||||
/*
|
||||
* CBMEM needs to be recovered in the EARLY_CBMEM_INIT case because
|
||||
* timestamps, APCI, etc rely on the cbmem infrastructure being
|
||||
* around. Explicitly recover it.
|
||||
* CBMEM needs to be recovered because timestamps, APCI, etc rely on
|
||||
* the cbmem infrastructure being around. Explicitly recover it.
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
|
||||
cbmem_initialize();
|
||||
cbmem_initialize();
|
||||
|
||||
/* Record current time, try to locate timestamps in CBMEM. */
|
||||
timestamp_init(timestamp_get());
|
||||
|
@@ -64,7 +64,7 @@ static inline const struct imd_entry *cbmem_to_imd(const struct cbmem_entry *e)
|
||||
}
|
||||
|
||||
/* These are the different situations to handle:
|
||||
* CONFIG_EARLY_CBMEM_INIT:
|
||||
*
|
||||
* In ramstage cbmem_initialize() attempts a recovery of the
|
||||
* cbmem region set up by romstage. It uses cbmem_top() as the
|
||||
* starting point of recovery.
|
||||
@@ -116,11 +116,8 @@ void __weak cbmem_top_init(void)
|
||||
static void cbmem_top_init_once(void)
|
||||
{
|
||||
/* Call one-time hook on expected cbmem init during boot. This sequence
|
||||
assumes first init call is in romstage for early cbmem init and
|
||||
ramstage for late cbmem init. */
|
||||
if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && !ENV_ROMSTAGE)
|
||||
return;
|
||||
if (IS_ENABLED(CONFIG_LATE_CBMEM_INIT) && !ENV_RAMSTAGE)
|
||||
assumes first init call is in romstage. */
|
||||
if (!ENV_ROMSTAGE)
|
||||
return;
|
||||
|
||||
cbmem_top_init();
|
||||
|
@@ -136,8 +136,7 @@ void run_ramstage(void)
|
||||
* firmware path on resume.
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_ARCH_X86) &&
|
||||
!IS_ENABLED(CONFIG_NO_STAGE_CACHE) &&
|
||||
IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
|
||||
!IS_ENABLED(CONFIG_NO_STAGE_CACHE))
|
||||
run_ramstage_from_resume(&ramstage);
|
||||
|
||||
if (prog_locate(&ramstage))
|
||||
|
@@ -218,10 +218,10 @@ void timestamp_init(uint64_t base)
|
||||
return;
|
||||
}
|
||||
|
||||
/* In the EARLY_CBMEM_INIT case timestamps could have already been
|
||||
* recovered. In those circumstances honor the cache which sits in BSS
|
||||
/* Timestamps could have already been recovered.
|
||||
* In those circumstances honor the cache which sits in BSS
|
||||
* as it has already been initialized. */
|
||||
if (ENV_RAMSTAGE && IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) &&
|
||||
if (ENV_RAMSTAGE &&
|
||||
ts_cache->cache_state != TIMESTAMP_CACHE_UNINITIALIZED)
|
||||
return;
|
||||
|
||||
@@ -271,10 +271,10 @@ static void timestamp_sync_cache_to_cbmem(int is_recovery)
|
||||
|
||||
/*
|
||||
* There's no need to worry about the base_time fields being out of
|
||||
* sync because only the following configurations are used/supported:
|
||||
* sync because only the following configuration is used/supported:
|
||||
*
|
||||
* 1. Timestamps get initialized before ramstage, which implies
|
||||
* CONFIG_EARLY_CBMEM_INIT and CBMEM initialization in romstage.
|
||||
* Timestamps get initialized before ramstage, which implies
|
||||
* CBMEM initialization in romstage.
|
||||
* This requires the board to define a TIMESTAMP() region in its
|
||||
* memlayout.ld (default on x86). The base_time from timestamp_init()
|
||||
* (usually called from bootblock.c on most non-x86 boards) persists
|
||||
@@ -283,18 +283,12 @@ static void timestamp_sync_cache_to_cbmem(int is_recovery)
|
||||
* sync, which will adjust the timestamps in there to the correct
|
||||
* base_time (from CBMEM) with the timestamp_add_table_entry() below.
|
||||
*
|
||||
* 2. Timestamps only get initialized in ramstage *and*
|
||||
* CONFIG_LATE_CBMEM_INIT is set. main() will call timestamp_init()
|
||||
* very early (before any timestamps get logged) to set a base_time
|
||||
* in the BSS cache, which will later get synced over to CBMEM.
|
||||
*
|
||||
* If you try to initialize timestamps before ramstage but don't define
|
||||
* a TIMESTAMP region, all operations will fail (safely), and coreboot
|
||||
* will behave as if timestamps only get initialized in ramstage.
|
||||
*
|
||||
* If CONFIG_EARLY_CBMEM_INIT is set but timestamps only get
|
||||
* initialized in ramstage, the base_time from timestamp_init() will
|
||||
* get ignored and all timestamps will be 0-based.
|
||||
* If timestamps only get initialized in ramstage, the base_time from
|
||||
* timestamp_init() will get ignored and all timestamps will be 0-based.
|
||||
*/
|
||||
for (i = 0; i < ts_cache_table->num_entries; i++) {
|
||||
struct timestamp_entry *tse = &ts_cache_table->entries[i];
|
||||
|
Reference in New Issue
Block a user