[flashrom] [commit] r1054 - trunk

repository service svn at flashrom.org
Sun Jun 20 13:02:33 CEST 2010


Author: hailfinger
Date: Sun Jun 20 13:02:33 2010
New Revision: 1054
URL: http://flashrom.org/trac/coreboot/changeset/1054

Log:
The SPI opcode 0xd8 is not a chip erase opcode on any chip out there.
Besides that, the function as implemented just walks the chip and
ignores sector sizes.
Sector erase with SPI opcode 0xd8 is of course still supported.
Kill a declaration for a nonexisting function while we're at it.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Sean Nelson <audiohacked at gmail.com>

Modified:
   trunk/chipdrivers.h
   trunk/spi25.c

Modified: trunk/chipdrivers.h
==============================================================================
--- trunk/chipdrivers.h	Sun Jun 20 12:58:32 2010	(r1053)
+++ trunk/chipdrivers.h	Sun Jun 20 13:02:33 2010	(r1054)
@@ -35,8 +35,6 @@
 int spi_write_disable(void);
 int spi_chip_erase_60(struct flashchip *flash);
 int spi_chip_erase_c7(struct flashchip *flash);
-int spi_chip_erase_60_c7(struct flashchip *flash);
-int spi_chip_erase_d8(struct flashchip *flash);
 int spi_block_erase_20(struct flashchip *flash, unsigned int addr, unsigned int blocklen);
 int spi_block_erase_52(struct flashchip *flash, unsigned int addr, unsigned int blocklen);
 int spi_block_erase_d7(struct flashchip *flash, unsigned int addr, unsigned int blocklen);

Modified: trunk/spi25.c
==============================================================================
--- trunk/spi25.c	Sun Jun 20 12:58:32 2010	(r1053)
+++ trunk/spi25.c	Sun Jun 20 13:02:33 2010	(r1054)
@@ -646,29 +646,6 @@
 	return 0;
 }
 
-int spi_chip_erase_d8(struct flashchip *flash)
-{
-	int i, rc = 0;
-	int total_size = flash->total_size * 1024;
-	int erase_size = 64 * 1024;
-
-	spi_disable_blockprotect();
-
-	msg_cinfo("Erasing chip: \n");
-
-	for (i = 0; i < total_size / erase_size; i++) {
-		rc = spi_block_erase_d8(flash, i * erase_size, erase_size);
-		if (rc) {
-			msg_cerr("Error erasing block at 0x%x\n", i);
-			break;
-		}
-	}
-
-	msg_cinfo("\n");
-
-	return rc;
-}
-
 /* Sector size is usually 4k, though Macronix eliteflash has 64k */
 int spi_block_erase_20(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
 {




More information about the flashrom mailing list