[flashrom] [commit] r1362 - trunk

repository service svn at flashrom.org
Fri Jul 1 02:39:24 CEST 2011


Author: stefanct
Date: Fri Jul  1 02:39:23 2011
New Revision: 1362
URL: http://flashrom.org/trac/flashrom/changeset/1362

Log:
ichspi.c: preserve reserved bits in address registers

Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Modified:
   trunk/ichspi.c

Modified: trunk/ichspi.c
==============================================================================
--- trunk/ichspi.c	Fri Jul  1 02:39:16 2011	(r1361)
+++ trunk/ichspi.c	Fri Jul  1 02:39:23 2011	(r1362)
@@ -659,10 +659,11 @@
 		return 1;
 	}
 
-	/* Programm Offset in Flash into FADDR */
-	REGWRITE32(ICH7_REG_SPIA, (offset & 0x00FFFFFF));	/* SPI addresses are 24 BIT only */
+	/* Program offset in flash into SPIA while preserving reserved bits. */
+	temp32 = REGREAD32(ICH7_REG_SPIA) & ~0x00FFFFFF;
+	REGWRITE32(ICH7_REG_SPIA, (offset & 0x00FFFFFF) | temp32);
 
-	/* Program data into FDATA0 to N */
+	/* Program data into SPID0 to N */
 	if (write_cmd && (datalength != 0)) {
 		temp32 = 0;
 		for (a = 0; a < datalength; a++) {
@@ -803,8 +804,10 @@
 		return 1;
 	}
 
-	/* Programm Offset in Flash into FADDR */
-	REGWRITE32(ICH9_REG_FADDR, (offset & 0x00FFFFFF));	/* SPI addresses are 24 BIT only */
+	/* Program offset in flash into FADDR while preserve the reserved bits
+	 * and clearing the 25. address bit which is only useable in hwseq. */
+	temp32 = REGREAD32(ICH9_REG_FADDR) & ~0x01FFFFFF;
+	REGWRITE32(ICH9_REG_FADDR, (offset & 0x00FFFFFF) | temp32);
 
 	/* Program data into FDATA0 to N */
 	if (write_cmd && (datalength != 0)) {




More information about the flashrom mailing list