summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/include/arch/early_variables.h1
-rw-r--r--src/arch/arm64/include/arch/early_variables.h1
-rw-r--r--src/arch/riscv/include/arch/early_variables.h5
-rw-r--r--src/arch/x86/Kconfig15
-rw-r--r--src/arch/x86/boot/cbmem.c4
5 files changed, 19 insertions, 7 deletions
diff --git a/src/arch/arm/include/arch/early_variables.h b/src/arch/arm/include/arch/early_variables.h
index cb0872e8f0..97bc0cd38e 100644
--- a/src/arch/arm/include/arch/early_variables.h
+++ b/src/arch/arm/include/arch/early_variables.h
@@ -27,6 +27,5 @@ static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
#define car_sync_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
-static inline void car_migrate_variables(void) { }
#endif
diff --git a/src/arch/arm64/include/arch/early_variables.h b/src/arch/arm64/include/arch/early_variables.h
index cb0872e8f0..97bc0cd38e 100644
--- a/src/arch/arm64/include/arch/early_variables.h
+++ b/src/arch/arm64/include/arch/early_variables.h
@@ -27,6 +27,5 @@ static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
#define car_sync_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
-static inline void car_migrate_variables(void) { }
#endif
diff --git a/src/arch/riscv/include/arch/early_variables.h b/src/arch/riscv/include/arch/early_variables.h
index f9516a4c19..97bc0cd38e 100644
--- a/src/arch/riscv/include/arch/early_variables.h
+++ b/src/arch/riscv/include/arch/early_variables.h
@@ -20,10 +20,6 @@
#ifndef ARCH_EARLY_VARIABLES_H
#define ARCH_EARLY_VARIABLES_H
-#if defined(CONFIG_CAR_MIGRATION) && CONFIG_CAR_MIGRATION
- #error "This is RISCV, silly... we don't have CAR here."
-#endif
-
#define CAR_GLOBAL
#define CAR_MIGRATE(migrate_fn_)
@@ -31,6 +27,5 @@ static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
#define car_sync_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
-static inline void car_migrate_variables(void) { }
#endif
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index edbc67acb2..dfb91fad8e 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -51,6 +51,21 @@ config ROMCC
bool
default n
+config BROKEN_CAR_MIGRATE
+ def_bool n
+ help
+ Many boards use CAR_GLOBAL but have no EARLY_CBMEM_INIT and
+ manage CAR migration on S3 resume path only. Couple boards use
+ CAR_GLOBAL and never do CAR migration.
+
+config LATE_CBMEM_INIT
+ def_bool n
+ select BROKEN_CAR_MIGRATE
+ help
+ Enable this in chipset's Kconfig if northbridge does not implement
+ early get_top_of_ram() call for romstage. CBMEM tables will be
+ allocated late in ramstage, after PCI devices resources are known.
+
config PC80_SYSTEM
bool
default y if ARCH_X86
diff --git a/src/arch/x86/boot/cbmem.c b/src/arch/x86/boot/cbmem.c
index af42edd841..80588c385d 100644
--- a/src/arch/x86/boot/cbmem.c
+++ b/src/arch/x86/boot/cbmem.c
@@ -21,6 +21,7 @@
#include <arch/acpi.h>
/* FIXME: Remove after CBMEM_INIT_HOOKS. */
+#include <arch/early_variables.h>
#include <cpu/x86/gdt.h>
#include <console/cbmem_console.h>
#include <timestamp.h>
@@ -76,6 +77,9 @@ void *cbmem_top(void)
void cbmem_run_init_hooks(void)
{
+ /* Migrate car.global_data. */
+ car_migrate_variables();
+
#if !defined(__PRE_RAM__)
/* Relocate CBMEM console. */
cbmemc_reinit();