[coreboot-gerrit] Change in coreboot[master]: nb/intel/common: Write MRC cache at exit of BS_DEV_INIT

Nico Huber (Code Review) gerrit at coreboot.org
Fri Sep 1 23:32:16 CEST 2017


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/21326


Change subject: nb/intel/common: Write MRC cache at exit of BS_DEV_INIT
......................................................................

nb/intel/common: Write MRC cache at exit of BS_DEV_INIT

We set the SPI lockdown in BS_POST_DEVICE (dev_finalize()) on many plat-
forms now. The SPI controller is initialized at start of BS_DEV_INIT
(dev_initialize()).

The SPI lockdown usually shouldn't be a problem but the SPI driver imple-
mentation lacks full support for the locked interface. Also, some options
exist to lock all flash regions read-only until the next reboot.

Change-Id: Ifda826ae2bb28adcce8dda8e2bb16dc38fe0fe9e
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M src/northbridge/intel/common/mrc_cache.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/21326/1

diff --git a/src/northbridge/intel/common/mrc_cache.c b/src/northbridge/intel/common/mrc_cache.c
index 2fc8d96..f692282 100644
--- a/src/northbridge/intel/common/mrc_cache.c
+++ b/src/northbridge/intel/common/mrc_cache.c
@@ -19,6 +19,7 @@
 #include <console/console.h>
 #include <cbfs.h>
 #include <fmap.h>
+#include <arch/acpi.h>
 #include <ip_checksum.h>
 #include <device/device.h>
 #include <cbmem.h>
@@ -162,6 +163,9 @@
 	int ret;
 	struct spi_flash flash;
 
+	if (acpi_is_wakeup_s3())
+		return;
+
 	if (!current) {
 		printk(BIOS_ERR, "No MRC cache in cbmem. Can't update flash.\n");
 		return;
@@ -231,7 +235,8 @@
 		printk(BIOS_DEBUG, "Successfully wrote MRC cache\n");
 }
 
-BOOT_STATE_INIT_ENTRY(BS_WRITE_TABLES, BS_ON_ENTRY, update_mrc_cache, NULL);
+/* Do it before chipset is locked during BS_POST_DEVICE. */
+BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, update_mrc_cache, NULL);
 
 struct mrc_data_container *find_current_mrc_cache(void)
 {

-- 
To view, visit https://review.coreboot.org/21326
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifda826ae2bb28adcce8dda8e2bb16dc38fe0fe9e
Gerrit-Change-Number: 21326
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170901/98547b7e/attachment.html>


More information about the coreboot-gerrit mailing list