summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-06 17:20:31 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-22 20:54:57 +0100
commit2d8520b275d47e0670e7f9e166e0f63c32855548 (patch)
tree71b69480daeb5e800b3863448cd0776dba265b7c /src/mainboard
parent97e1b11f416aa23787e71b6133702b82daf1552e (diff)
CBMEM: Replace cbmem_initialize() with cbmem_recovery()
The replacement function confirms CBMEM TOC is wiped clean on power cycles and resets. It also introduces compatibility interface to ease up transition to DYNAMIC_CBMEM. Change-Id: Ic5445c5bff4aff22a43821f3064f2df458b9f250 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4668 Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/romstage.c2
-rw-r--r--src/mainboard/emulation/qemu-q35/romstage.c2
-rw-r--r--src/mainboard/getac/p470/romstage.c2
-rw-r--r--src/mainboard/google/butterfly/romstage.c2
-rw-r--r--src/mainboard/google/link/romstage.c2
-rw-r--r--src/mainboard/google/parrot/romstage.c2
-rw-r--r--src/mainboard/google/stout/romstage.c2
-rw-r--r--src/mainboard/ibase/mb899/romstage.c2
-rw-r--r--src/mainboard/intel/cougar_canyon2/romstage.c2
-rw-r--r--src/mainboard/intel/d945gclf/romstage.c2
-rw-r--r--src/mainboard/intel/emeraldlake2/romstage.c2
-rw-r--r--src/mainboard/kontron/986lcd-m/romstage.c2
-rw-r--r--src/mainboard/kontron/ktqm77/romstage.c2
-rw-r--r--src/mainboard/lenovo/t60/romstage.c2
-rw-r--r--src/mainboard/lenovo/x201/romstage.c6
-rw-r--r--src/mainboard/lenovo/x60/romstage.c2
-rw-r--r--src/mainboard/roda/rk886ex/romstage.c2
-rw-r--r--src/mainboard/roda/rk9/romstage.c2
-rw-r--r--src/mainboard/samsung/lumpy/romstage.c2
-rw-r--r--src/mainboard/samsung/stumpy/romstage.c2
-rw-r--r--src/mainboard/via/epia-m850/romstage.c2
21 files changed, 25 insertions, 21 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/romstage.c b/src/mainboard/emulation/qemu-i440fx/romstage.c
index db8891ee21..0613d82b51 100644
--- a/src/mainboard/emulation/qemu-i440fx/romstage.c
+++ b/src/mainboard/emulation/qemu-i440fx/romstage.c
@@ -48,7 +48,7 @@ void main(unsigned long bist)
//print_pci_devices();
//dump_pci_devices();
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(0);
timestamp_init(rdtsc());
timestamp_add_now(TS_START_ROMSTAGE);
diff --git a/src/mainboard/emulation/qemu-q35/romstage.c b/src/mainboard/emulation/qemu-q35/romstage.c
index fae5095af0..190c775def 100644
--- a/src/mainboard/emulation/qemu-q35/romstage.c
+++ b/src/mainboard/emulation/qemu-q35/romstage.c
@@ -50,7 +50,7 @@ void main(unsigned long bist)
//print_pci_devices();
//dump_pci_devices();
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(0);
timestamp_init(rdtsc());
timestamp_add_now(TS_START_ROMSTAGE);
diff --git a/src/mainboard/getac/p470/romstage.c b/src/mainboard/getac/p470/romstage.c
index 87af8cadcb..a081a8a8a2 100644
--- a/src/mainboard/getac/p470/romstage.c
+++ b/src/mainboard/getac/p470/romstage.c
@@ -357,7 +357,7 @@ void main(unsigned long bist)
#endif
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/google/butterfly/romstage.c b/src/mainboard/google/butterfly/romstage.c
index b7ec01107d..d32f3f0a1a 100644
--- a/src/mainboard/google/butterfly/romstage.c
+++ b/src/mainboard/google/butterfly/romstage.c
@@ -244,7 +244,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/google/link/romstage.c b/src/mainboard/google/link/romstage.c
index 1e4b42c393..66d206757e 100644
--- a/src/mainboard/google/link/romstage.c
+++ b/src/mainboard/google/link/romstage.c
@@ -288,7 +288,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/google/parrot/romstage.c b/src/mainboard/google/parrot/romstage.c
index b6bacaedfe..361c19beba 100644
--- a/src/mainboard/google/parrot/romstage.c
+++ b/src/mainboard/google/parrot/romstage.c
@@ -244,7 +244,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/google/stout/romstage.c b/src/mainboard/google/stout/romstage.c
index a775e69cdf..0ea53e7ac8 100644
--- a/src/mainboard/google/stout/romstage.c
+++ b/src/mainboard/google/stout/romstage.c
@@ -296,7 +296,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/ibase/mb899/romstage.c b/src/mainboard/ibase/mb899/romstage.c
index 222c376b4d..0b9d408570 100644
--- a/src/mainboard/ibase/mb899/romstage.c
+++ b/src/mainboard/ibase/mb899/romstage.c
@@ -311,7 +311,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/intel/cougar_canyon2/romstage.c b/src/mainboard/intel/cougar_canyon2/romstage.c
index 42b19e4129..afd7e25655 100644
--- a/src/mainboard/intel/cougar_canyon2/romstage.c
+++ b/src/mainboard/intel/cougar_canyon2/romstage.c
@@ -322,7 +322,7 @@ void romstage_main_continue(EFI_STATUS status, VOID *HobListPtr) {
quick_ram_check();
post_code(0x4e);
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(0);
if(cbmem_was_initted) {
reset_system();
diff --git a/src/mainboard/intel/d945gclf/romstage.c b/src/mainboard/intel/d945gclf/romstage.c
index 166743f552..69d4232edd 100644
--- a/src/mainboard/intel/d945gclf/romstage.c
+++ b/src/mainboard/intel/d945gclf/romstage.c
@@ -269,7 +269,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/intel/emeraldlake2/romstage.c b/src/mainboard/intel/emeraldlake2/romstage.c
index 3534700236..9308e9617a 100644
--- a/src/mainboard/intel/emeraldlake2/romstage.c
+++ b/src/mainboard/intel/emeraldlake2/romstage.c
@@ -296,7 +296,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/kontron/986lcd-m/romstage.c b/src/mainboard/kontron/986lcd-m/romstage.c
index 1875a10ad4..549facd333 100644
--- a/src/mainboard/kontron/986lcd-m/romstage.c
+++ b/src/mainboard/kontron/986lcd-m/romstage.c
@@ -410,7 +410,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/kontron/ktqm77/romstage.c b/src/mainboard/kontron/ktqm77/romstage.c
index 15c10b29ba..b5959b1bec 100644
--- a/src/mainboard/kontron/ktqm77/romstage.c
+++ b/src/mainboard/kontron/ktqm77/romstage.c
@@ -295,7 +295,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/lenovo/t60/romstage.c b/src/mainboard/lenovo/t60/romstage.c
index 1b7e693d80..dae917c925 100644
--- a/src/mainboard/lenovo/t60/romstage.c
+++ b/src/mainboard/lenovo/t60/romstage.c
@@ -321,7 +321,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/lenovo/x201/romstage.c b/src/mainboard/lenovo/x201/romstage.c
index 18645acb05..7935e5618e 100644
--- a/src/mainboard/lenovo/x201/romstage.c
+++ b/src/mainboard/lenovo/x201/romstage.c
@@ -331,7 +331,11 @@ void main(unsigned long bist)
outl(reg32 & ~(7 << 10), DEFAULT_PMBASE + 0x04);
}
- cbmem_initted = !cbmem_initialize();
+ /* FIXME: If not in s3resume, raminit() calls cbmem_recovery(0),
+ * clears all of CBMEM region and puts in MRC training results.
+ * Tell here we are doing resume to avoid wiping CBMEM region
+ * again. */
+ cbmem_initted = !cbmem_recovery(1);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c
index 26a7b9b6fa..1198fb2007 100644
--- a/src/mainboard/lenovo/x60/romstage.c
+++ b/src/mainboard/lenovo/x60/romstage.c
@@ -323,7 +323,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/roda/rk886ex/romstage.c b/src/mainboard/roda/rk886ex/romstage.c
index e08c1c025f..ad323f5501 100644
--- a/src/mainboard/roda/rk886ex/romstage.c
+++ b/src/mainboard/roda/rk886ex/romstage.c
@@ -346,7 +346,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/roda/rk9/romstage.c b/src/mainboard/roda/rk9/romstage.c
index e71e9c4851..90392b9eb5 100644
--- a/src/mainboard/roda/rk9/romstage.c
+++ b/src/mainboard/roda/rk9/romstage.c
@@ -184,7 +184,7 @@ void main(unsigned long bist)
init_iommu();
- cbmem_initted = !cbmem_initialize();
+ cbmem_initted = !cbmem_recovery(0);
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
* this is not a resume. In that case we just create the cbmem toc.
diff --git a/src/mainboard/samsung/lumpy/romstage.c b/src/mainboard/samsung/lumpy/romstage.c
index 1f4fd02574..993345958d 100644
--- a/src/mainboard/samsung/lumpy/romstage.c
+++ b/src/mainboard/samsung/lumpy/romstage.c
@@ -317,7 +317,7 @@ void main(unsigned long bist)
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/samsung/stumpy/romstage.c b/src/mainboard/samsung/stumpy/romstage.c
index 7630c05549..e5b55b5059 100644
--- a/src/mainboard/samsung/stumpy/romstage.c
+++ b/src/mainboard/samsung/stumpy/romstage.c
@@ -324,7 +324,7 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
- cbmem_was_initted = !cbmem_initialize();
+ cbmem_was_initted = !cbmem_recovery(boot_mode==2);
if (boot_mode!=2)
save_mrc_data(&pei_data);
diff --git a/src/mainboard/via/epia-m850/romstage.c b/src/mainboard/via/epia-m850/romstage.c
index 39f4253d38..262bee7aa8 100644
--- a/src/mainboard/via/epia-m850/romstage.c
+++ b/src/mainboard/via/epia-m850/romstage.c
@@ -95,7 +95,7 @@ void main(unsigned long bist)
/* We got RAM working, now we can write the timestamps to RAM */
#if CONFIG_EARLY_CBMEM_INIT
- cbmem_initialize();
+ cbmem_recovery(0);
#endif
timestamp_add_now(TS_END_ROMSTAGE);
/* FIXME: See if this is needed or take this out please */