[flashrom] [commit] r1435 - trunk

repository service svn at flashrom.org
Fri Sep 9 14:46:32 CEST 2011


Author: stefanct
Date: Fri Sep  9 14:46:32 2011
New Revision: 1435
URL: http://flashrom.org/trac/flashrom/changeset/1435

Log:
Revamp the warning of failing to set BIOS write enable in enable_flash_ich

 - introduce a new variable 'wanted' that is used instead of 'new'
 - use 'new' for the actual value contained in BIOS_CNTL after we tried to write it
 - rephrase the warning which now also includes the old and new values besides the wanted one

Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>

Modified:
   trunk/chipset_enable.c

Modified: trunk/chipset_enable.c
==============================================================================
--- trunk/chipset_enable.c	Thu Sep  8 21:55:18 2011	(r1434)
+++ trunk/chipset_enable.c	Fri Sep  9 14:46:32 2011	(r1435)
@@ -256,7 +256,7 @@
 static int enable_flash_ich(struct pci_dev *dev, const char *name,
 			    int bios_cntl)
 {
-	uint8_t old, new;
+	uint8_t old, new, wanted;
 
 	/*
 	 * Note: the ICH0-ICH5 BIOS_CNTL register is actually 16 bit wide, but
@@ -280,15 +280,16 @@
 	if (old & (1 << 5))
 		msg_pinfo("WARNING: BIOS region SMM protection is enabled!\n");
 
-	new = old | 1;
-	if (new == old)
+	wanted = old | 1;
+	if (wanted == old)
 		return 0;
 
-	rpci_write_byte(dev, bios_cntl, new);
+	rpci_write_byte(dev, bios_cntl, wanted);
 
-	if (pci_read_byte(dev, bios_cntl) != new) {
-		msg_pinfo("Setting register 0x%x to 0x%x on %s failed "
-			  "(WARNING ONLY).\n", bios_cntl, new, name);
+	if ((new = pci_read_byte(dev, bios_cntl)) != wanted) {
+		msg_pinfo("WARNING: Setting 0x%x from 0x%x to 0x%x on %s "
+			  "failed. New value is 0x%x.\n",
+			  bios_cntl, old, wanted, name, new);
 		return -1;
 	}
 




More information about the flashrom mailing list