[coreboot-gerrit] Patch set updated for coreboot: 3003dac Intel (sandy/ivy): Avoid calling cbmem_initialize() twice

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sat Jan 11 21:48:37 CET 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4666

-gerrit

commit 3003dac92009ead3c00f5eb60e2e09ea361301d3
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sat Jan 4 11:02:45 2014 +0200

    Intel (sandy/ivy): Avoid calling cbmem_initialize() twice
    
    Delay the copying of MRC cache data from CAR to CBMEM until after
    sdram_initialize() returns and cbmem_initialize() completes.
    Calling cbmem_initialize() twice would complicate the decision logic
    of when CBMEM area needs to be wiped clean.
    
    Change-Id: Ic59e94cb2436293efc47b52f7418f5dbf76c714a
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/mainboard/google/butterfly/romstage.c   | 2 ++
 src/mainboard/google/link/romstage.c        | 2 ++
 src/mainboard/google/parrot/romstage.c      | 2 ++
 src/mainboard/google/stout/romstage.c       | 2 ++
 src/mainboard/intel/emeraldlake2/romstage.c | 2 ++
 src/mainboard/kontron/ktqm77/romstage.c     | 2 ++
 src/mainboard/samsung/lumpy/romstage.c      | 2 ++
 src/mainboard/samsung/stumpy/romstage.c     | 2 ++
 src/northbridge/intel/sandybridge/raminit.c | 7 +------
 src/northbridge/intel/sandybridge/raminit.h | 1 +
 10 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/mainboard/google/butterfly/romstage.c b/src/mainboard/google/butterfly/romstage.c
index 67e509e..b7ec011 100644
--- a/src/mainboard/google/butterfly/romstage.c
+++ b/src/mainboard/google/butterfly/romstage.c
@@ -245,6 +245,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/google/link/romstage.c b/src/mainboard/google/link/romstage.c
index 27a22f7..6074f85 100644
--- a/src/mainboard/google/link/romstage.c
+++ b/src/mainboard/google/link/romstage.c
@@ -287,6 +287,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/google/parrot/romstage.c b/src/mainboard/google/parrot/romstage.c
index 2fe61d6..b6bacae 100644
--- a/src/mainboard/google/parrot/romstage.c
+++ b/src/mainboard/google/parrot/romstage.c
@@ -245,6 +245,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/google/stout/romstage.c b/src/mainboard/google/stout/romstage.c
index a0700af..a775e69 100644
--- a/src/mainboard/google/stout/romstage.c
+++ b/src/mainboard/google/stout/romstage.c
@@ -297,6 +297,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #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 f116668..3534700 100644
--- a/src/mainboard/intel/emeraldlake2/romstage.c
+++ b/src/mainboard/intel/emeraldlake2/romstage.c
@@ -297,6 +297,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #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 773079d..15c10b2 100644
--- a/src/mainboard/kontron/ktqm77/romstage.c
+++ b/src/mainboard/kontron/ktqm77/romstage.c
@@ -296,6 +296,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/samsung/lumpy/romstage.c b/src/mainboard/samsung/lumpy/romstage.c
index 6c87f88..fd3c19b 100644
--- a/src/mainboard/samsung/lumpy/romstage.c
+++ b/src/mainboard/samsung/lumpy/romstage.c
@@ -318,6 +318,8 @@ void main(unsigned long bist)
 	MCHBAR16(SSKPD) = 0xCAFE;
 
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/samsung/stumpy/romstage.c b/src/mainboard/samsung/stumpy/romstage.c
index ee715e7..7630c05 100644
--- a/src/mainboard/samsung/stumpy/romstage.c
+++ b/src/mainboard/samsung/stumpy/romstage.c
@@ -325,6 +325,8 @@ void main(unsigned long bist)
 
 	MCHBAR16(SSKPD) = 0xCAFE;
 	cbmem_was_initted = !cbmem_initialize();
+	if (boot_mode!=2)
+		save_mrc_data(&pei_data);
 
 #if CONFIG_HAVE_ACPI_RESUME
 	/* If there is no high memory area, we didn't boot before, so
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index 6dc7dbf..11e743b 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -54,7 +54,7 @@
 #define CMOS_OFFSET_MRC_SEED_CHK 160
 #endif
 
-static void save_mrc_data(struct pei_data *pei_data)
+void save_mrc_data(struct pei_data *pei_data)
 {
 	u16 c1, c2, checksum;
 
@@ -63,7 +63,6 @@ static void save_mrc_data(struct pei_data *pei_data)
 	int output_len = ALIGN(pei_data->mrc_output_len, 16);
 
 	/* Save the MRC S3 restore data to cbmem */
-	cbmem_initialize();
 	mrcdata = cbmem_add
 		(CBMEM_ID_MRCDATA,
 		 output_len + sizeof(struct mrc_data_container));
@@ -299,8 +298,4 @@ void sdram_initialize(struct pei_data *pei_data)
 
 	post_system_agent_init(pei_data);
 	report_memory_config();
-
-	/* S3 resume: don't save scrambler seed or MRC data */
-	if (pei_data->boot_mode != 2)
-		save_mrc_data(pei_data);
 }
diff --git a/src/northbridge/intel/sandybridge/raminit.h b/src/northbridge/intel/sandybridge/raminit.h
index 2e9b1f3..c3b1c2a 100644
--- a/src/northbridge/intel/sandybridge/raminit.h
+++ b/src/northbridge/intel/sandybridge/raminit.h
@@ -30,6 +30,7 @@ struct sys_info {
 } __attribute__ ((packed));
 
 void sdram_initialize(struct pei_data *pei_data);
+void save_mrc_data(struct pei_data *pei_data);
 int fixup_sandybridge_errata(void);
 
 #endif				/* RAMINIT_H */



More information about the coreboot-gerrit mailing list