[coreboot-gerrit] New patch to review for coreboot: b4244f6 nehalem: Move cbmem_recovery call to raminit.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sat Jun 7 16:41:41 CEST 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5954

-gerrit

commit b4244f639b3c4a13bfd57738d7910d109721c4d0
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Sat Jun 7 16:27:27 2014 +0200

    nehalem: Move cbmem_recovery call to raminit.
    
    Currently cbmem_recovery is done in raminit only on non-S3-resume path
    do it on both paths to reduce confusion.
    
    Change-Id: I16161ad449b9802a855fcf834aa721f4f65c0bb4
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/mainboard/lenovo/x201/romstage.c        | 10 ----------
 src/mainboard/packardbell/ms2290/romstage.c | 10 ----------
 src/northbridge/intel/nehalem/raminit.c     | 14 ++++++++++++++
 3 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/mainboard/lenovo/x201/romstage.c b/src/mainboard/lenovo/x201/romstage.c
index 1237a5c..232b3d8 100644
--- a/src/mainboard/lenovo/x201/romstage.c
+++ b/src/mainboard/lenovo/x201/romstage.c
@@ -323,16 +323,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 6a18dd6..d3744a5 100644
--- a/src/mainboard/packardbell/ms2290/romstage.c
+++ b/src/mainboard/packardbell/ms2290/romstage.c
@@ -300,16 +300,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 978ffbf..8f88841 100644
--- a/src/northbridge/intel/nehalem/raminit.c
+++ b/src/northbridge/intel/nehalem/raminit.c
@@ -4977,6 +4977,20 @@ void raminit(const int s3resume, const u8 *spd_addrmap)
 	dump_timings(&info);
 	if (!s3resume)
 		save_timings(&info);
+	if (s3resume) {
+		if (cbmem_recovery(1)) {
+			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
 }
 



More information about the coreboot-gerrit mailing list