summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/lenovo/x201/romstage.c10
-rw-r--r--src/mainboard/packardbell/ms2290/romstage.c10
-rw-r--r--src/northbridge/intel/nehalem/raminit.c17
3 files changed, 16 insertions, 21 deletions
diff --git a/src/mainboard/lenovo/x201/romstage.c b/src/mainboard/lenovo/x201/romstage.c
index 2f4efc8baf..f129794d62 100644
--- a/src/mainboard/lenovo/x201/romstage.c
+++ b/src/mainboard/lenovo/x201/romstage.c
@@ -324,16 +324,6 @@ void main(unsigned long bist)
if (s3resume) {
void *resume_backup_memory;
- /* For non-S3-resume, CBMEM is inited in raminit code. */
- if (cbmem_recovery(1)) {
- printk(BIOS_ERR, "Failed S3 resume.\n");
- ram_check(0x100000, 0x200000);
-
- /* Failed S3 resume, reset to come up cleanly */
- outb(0xe, 0xcf9);
- hlt();
- }
-
resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);
/* copy 1MB - 64K to high tables ram_base to prevent memory corruption
diff --git a/src/mainboard/packardbell/ms2290/romstage.c b/src/mainboard/packardbell/ms2290/romstage.c
index 79afae301e..2ca520d267 100644
--- a/src/mainboard/packardbell/ms2290/romstage.c
+++ b/src/mainboard/packardbell/ms2290/romstage.c
@@ -306,16 +306,6 @@ void main(unsigned long bist)
if (s3resume) {
void *resume_backup_memory;
- /* For non-S3-resume, CBMEM is inited in raminit code. */
- if (cbmem_recovery(1)) {
- printk(BIOS_ERR, "Failed S3 resume.\n");
- ram_check(0x100000, 0x200000);
-
- /* Failed S3 resume, reset to come up cleanly */
- outb(0xe, 0xcf9);
- hlt();
- }
-
resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);
/* copy 1MB - 64K to high tables ram_base to prevent memory corruption
diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c
index 6673b5a846..b1356c21b2 100644
--- a/src/northbridge/intel/nehalem/raminit.c
+++ b/src/northbridge/intel/nehalem/raminit.c
@@ -1715,7 +1715,6 @@ static void save_timings(struct raminfo *info)
printk (BIOS_SPEW, "[6e8] = %x\n", train.reg_6e8);
/* Save the MRC S3 restore data to cbmem */
- cbmem_recovery(0);
mrcdata = cbmem_add
(CBMEM_ID_MRCDATA, output_len + sizeof(struct mrc_data_container));
@@ -3869,6 +3868,7 @@ void raminit(const int s3resume, const u8 *spd_addrmap)
struct raminfo info;
u8 x2ca8;
u16 deven;
+ int cbmem_wasnot_inited;
x2ca8 = read_mchbar8(0x2ca8);
deven = pcie_read_config16(NORTHBRIDGE, D0F0_DEVEN);
@@ -4973,7 +4973,22 @@ void raminit(const int s3resume, const u8 *spd_addrmap)
#if REAL
udelay(1000);
dump_timings(&info);
+ cbmem_wasnot_inited = cbmem_recovery(s3resume);
+
if (!s3resume)
save_timings(&info);
+ if (s3resume && cbmem_wasnot_inited) {
+ u32 reg32;
+ printk(BIOS_ERR, "Failed S3 resume.\n");
+ ram_check(0x100000, 0x200000);
+
+ /* Clear SLP_TYPE. */
+ reg32 = inl(DEFAULT_PMBASE + 0x04);
+ outl(reg32 & ~(7 << 10), DEFAULT_PMBASE + 0x04);
+
+ /* Failed S3 resume, reset to come up cleanly */
+ outb(0xe, 0xcf9);
+ hlt();
+ }
#endif
}