[flashrom] [PATCH] Move implicit erase out of chip drivers, clean up

Uwe Hermann uwe at hermann-uwe.de
Wed Jul 28 02:23:58 CEST 2010


On Sat, Jul 17, 2010 at 12:18:49AM +0200, Carl-Daniel Hailfinger wrote:
> New version, updated to apply against current svn.
> 
> flashrom had an implicit erase-on-write for most flash chip and
                                                             ^
                                                             s

> Compile tested and proofread, but that's it. The patch may cause
> flashrom to eat your dog or it may cause your dog to eat burned flash chips.
> Please test on real hardware. Thanks!
> 
> I have a cleanup patch for the write functions which will apply on top
> of this, but I wanted to keep this patch readable and self-contained.
> 
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
 
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>

Tested on ASUS A8NE-FM with "SST SST49LF004A/B" (512 KB, FWH) and on a
Dr. Kaiser PCI card with a "Macronix MX29F001B" (128 KB, Parallel).

Tested all operations including erase/write multiple times for good measure.


> Index: flashrom-no_implicit_erase_inside_write/flashchips.c
> ===================================================================
> --- flashrom-no_implicit_erase_inside_write/flashchips.c	(Revision 1083)
> +++ flashrom-no_implicit_erase_inside_write/flashchips.c	(Arbeitskopie)
> @@ -453,7 +453,7 @@
>  		.model_id	= AT_25DF321,
>  		.total_size	= 4096,
>  		.page_size	= 256,
> -		.tested		= TEST_OK_PRW,
> +		.tested		= TEST_OK_PR,
>  		.probe		= probe_spi_rdid,
>  		.probe_timing	= TIMING_ZERO,
>  		.block_erasers	=

Didn't check whether any new chips were added since this patch which
would also need their W bit removed. Feel free to merge that into the
patch and re-use my ack.


> Index: flashrom-no_implicit_erase_inside_write/82802ab.c
> ===================================================================
> --- flashrom-no_implicit_erase_inside_write/82802ab.c	(Revision 1083)
> +++ flashrom-no_implicit_erase_inside_write/82802ab.c	(Arbeitskopie)
> @@ -144,23 +144,6 @@
>  	return 0;
>  }
>  
> -int erase_82802ab(struct flashchip *flash)
> -{
> -	int i;
> -	unsigned int total_size = flash->total_size * 1024;
> -
> -	msg_cspew("total_size is %d; flash->page_size is %d\n",
> -	       total_size, flash->page_size);
> -	for (i = 0; i < total_size; i += flash->page_size)
> -		if (erase_block_82802ab(flash, i, flash->page_size)) {
> -			msg_cerr("ERASE FAILED!\n");
> -			return -1;
> -		}
> -	msg_cinfo("DONE ERASE\n");
> -
> -	return 0;
> -}

No longer needed? Not used currently anywhere, it seems.


Uwe.
-- 
http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org




More information about the flashrom mailing list