arch/x86: Simplify <arch/early_variables.h>

This enables the use of .bss section for ENV_BOOTBLOCK
and ENV_VERSTAGE even with CAR_GLOBAL_MIGRATION=y.

In practice, boards with CAR_GLOBAL_MIGRATION=y currently
build with romcc-bootblock so they will not be using .bss.

Change-Id: Ie9dc14f3e528d3e4f48304f4d7de50df448a8af6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35016
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Kyösti Mälkki
2019-08-22 09:44:44 +03:00
parent 19e1d631e3
commit a165c07ed7
5 changed files with 23 additions and 45 deletions

View File

@@ -363,7 +363,7 @@ static int read_from_cbfs(const char *name, void *buf, size_t size)
int paging_enable_for_car(const char *pdpt_name, const char *pt_name)
{
if (!ENV_CACHE_AS_RAM)
if (!preram_symbols_available())
return -1;
if (read_from_cbfs(pdpt_name, _pdpt, REGION_SIZE(pdpt))) {
@@ -383,7 +383,7 @@ int paging_enable_for_car(const char *pdpt_name, const char *pt_name)
static void *get_pdpt_addr(void)
{
if (ENV_CACHE_AS_RAM)
if (preram_symbols_available())
return _pdpt;
return (void *)(uintptr_t)read_cr3();
}