[flashrom] [PATCH] Dediprog SF100 support

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Tue Jan 19 12:36:22 CET 2010


On 19.01.2010 11:48, Stefan Reinauer wrote:
> On 1/19/10 4:01 AM, Carl-Daniel Hailfinger wrote:
>   
>> Dediprog SF100 support.  
>>     
>
> MacPro:flashrom stepan$ ./flashrom -p dediprog
> flashrom v0.9.1-r869
> Calibrating delay loop... OK.
> Found chip "ST M25P32" (4096 KB, SPI) at physical address 0xffc00000.
> No operations were specified.
>   

Nice.


> Aside from the physical address making not much sense (for any
> non-direct programmer)
>   

Indeed. We can tackle this later.


> MacPro:flashrom stepan$ ./flashrom -p dediprog -r testimage.rom
> flashrom v0.9.1-r869
> Calibrating delay loop... OK.
> Found chip "ST M25P32" (4096 KB, SPI) at physical address 0xffc00000.
> Reading flash... ^C
>
> The reading does not seem to work yet, even after several minutes, the
> image is still zero bytes.
>   

Hm. To be honest, reading is something I could not find in the logs.
Then again, maybe some diagnostics in SPEW mode could help. Please run

flashrom -p dediprog -VV -r testimage.rom

with the following debug patch (you need to run "make distclean" before
compiling it)


Mark 4 byte RDID as supported by Dediprog.
Really abort if any unhandled command sizes are run.
Add some debugging at SPEW level.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: flashrom-dediprog_fixups_debug/spi.c
===================================================================
--- flashrom-dediprog_fixups_debug/spi.c	(Revision 870)
+++ flashrom-dediprog_fixups_debug/spi.c	(Arbeitskopie)
@@ -335,6 +335,9 @@
 #if BUSPIRATE_SPI_SUPPORT == 1
 	case SPI_CONTROLLER_BUSPIRATE:
 #endif
+#if DEDIPROG_SUPPORT == 1
+	case SPI_CONTROLLER_DEDIPROG:
+#endif
 		return probe_spi_rdid_generic(flash, 4);
 	default:
 		printf_debug("4b ID not supported on this SPI controller\n");
Index: flashrom-dediprog_fixups_debug/dediprog.c
===================================================================
--- flashrom-dediprog_fixups_debug/dediprog.c	(Revision 870)
+++ flashrom-dediprog_fixups_debug/dediprog.c	(Arbeitskopie)
@@ -145,6 +145,7 @@
 
 int dediprog_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len)
 {
+	msg_pspew("%s, start=0x%x, len=0x%x\n", __func__, start, len);
 	/* Maximum read length is 4 bytes for now. */
 	return spi_read_chunked(flash, buf, start, len, 4);
 }
@@ -154,14 +155,21 @@
 {
 	int ret;
 
+	msg_pspew("%s, writecnt=%i, readcnt=%i\n", __func__, writecnt, readcnt);
 	/* Paranoid, but I don't want to be blamed if anything explodes. */
-	if ((writecnt != 1) && (writecnt != 4))
+	if ((writecnt != 1) && (writecnt != 4)) {
 		msg_perr("Untested writecnt=%i, aborting.\n", writecnt);
-	if (readcnt > 4)
+		return 1;
+	}
+	if (readcnt > 4) {
 		msg_perr("Untested readcnt=%i, aborting.\n", readcnt);
-	if ((readcnt == 0) && (writecnt != 1))
+		return 1;
+	}
+	if ((readcnt == 0) && (writecnt != 1)) {
 		msg_perr("Untested writecnt=%i, readcnt=%i combination, "
 			 "aborting.\n", writecnt, readcnt);
+		return 1;
+	}
 	
 	ret = usb_control_msg(dediprog_handle, 0x42, 0x1, 0xff, readcnt ? 0x1 : 0x0, (char *)writearr, writecnt, DEFAULT_TIMEOUT);
 	if (ret != writecnt) {


-- 
Developer quote of the year:
"We are juggling too many chainsaws and flaming arrows and tigers."





More information about the flashrom mailing list