Patchwork Dediprog SF100 support

login
register
about
Submitter Carl-Daniel Hailfinger
Date 2010-01-19 11:36:22
Message ID <4B559936.6080409@gmx.net>
Download mbox | patch
Permalink /patch/815/
State Superseded
Headers show

Comments

Carl-Daniel Hailfinger - 2010-01-19 11:36:22
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@gmx.net>
Stefan Reinauer - 2010-01-19 11:43:42
On 1/19/10 12:36 PM, Carl-Daniel Hailfinger wrote:
> Hm. To be honest, reading is something I could not find in the logs.
>   
I can provide a reading only log if that helps?

> 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@gmx.net>
>   

/flashrom -p dediprog -VV -r testimage.rom
flashrom v0.9.1-r869
dediprog_init
Found USB device (0483:dada).
Found a SF100   V:3.1.8
Setting SPI voltage to 3.500 V
Calibrating delay loop... 515M loops per second, 100 myus = 135 us. OK.
Probing for AMD Am29F010A/B, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMD Am29F002(N)BB, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for AMD Am29F002(N)BT, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for AMD Am29F016D, 2048 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMD Am29F040B, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMD Am29F080B, 1024 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMD Am29LV040B, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMD Am29LV081B, 1024 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for ASD AE49F2008, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Atmel AT25DF021, 256 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25DF041A, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25DF081, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25DF161, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25DF321, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25DF321A, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25DF641, 8192 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25F512B, 64 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25FS010, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT25FS040, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT26DF041, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT26DF081A, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT26DF161, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT26DF161A, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT26F004, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT29C512, 64 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Atmel AT29C010A, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Atmel AT29C020, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Atmel AT29C040A, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Atmel AT45CS1282, 16896 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB011D, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB021D, 256 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB041D, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB081D, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB161D, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB321C, 4224 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB321D, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT45DB642D, 8192 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Atmel AT49BV512, 64 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Atmel AT49F002(N), 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Atmel AT49F002(N)T, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for AMIC A25L40PT, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=4
RDID returned 0x20 0x20 0x16 0x10. probe_spi_rdid_generic: id1 0x20, id2
0x2016
Probing for AMIC A25L40PU, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=4
RDID returned 0x20 0x20 0x16 0x10. probe_spi_rdid_generic: id1 0x20, id2
0x2016
Probing for AMIC A29002B, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMIC A29002T, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMIC A29040B, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for AMIC A49LF040A, 512 KB: skipped. Host bus type SPI and chip
bus type LPC are incompatible.
Probing for EMST F49B002UA, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Eon EN25B05, 64 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B05T, 64 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B10, 128 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B10T, 128 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B20, 256 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B20T, 256 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B40, 512 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B40T, 512 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B80, 1024 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B80T, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B16, 2048 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B16T, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B32, 4096 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B32T, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B64, 8192 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25B64T, 8192 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25D16, 2048 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F05, 64 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F10, 128 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F20, 256 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F40, 512 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F80, 1024 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F16, 2048 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Eon EN25F32, 4096 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for EON EN29F002(A)(N)B, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for EON EN29F002(A)(N)T, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Fujitsu MBM29F004BC, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Fujitsu MBM29F004TC, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Fujitsu MBM29F400BC, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Fujitsu MBM29F400TC, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Intel 28F001BX-B, 128 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Intel 28F001BX-T, 128 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Intel 82802AB, 512 KB: skipped. Host bus type SPI and chip
bus type FWH are incompatible.
Probing for Intel 82802AC, 1024 KB: skipped. Host bus type SPI and chip
bus type FWH are incompatible.
Probing for Macronix MX25L512, 64 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L1005, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L2005, 256 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L4005, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L8005, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L1605, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L1635D, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L3205, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L3235D, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L6405, 8192 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX25L12805, 16384 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix MX29F001B, 128 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Macronix MX29F001T, 128 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Macronix MX29F002B, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Macronix MX29F002T, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Macronix MX29LV040, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Numonyx M25PE10, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Numonyx M25PE20, 256 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Numonyx M25PE40, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Numonyx M25PE80, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Numonyx M25PE16, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm25LV010, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm25LV016B, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm25LV020, 256 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm25LV040, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm25LV080B, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm25LV512, 64 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC Pm29F002T, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for PMC Pm29F002B, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for PMC Pm39LV010, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for PMC Pm49FL002, 256 KB: skipped. Host bus type SPI and chip
bus type LPC,FWH are incompatible.
Probing for PMC Pm49FL004, 512 KB: skipped. Host bus type SPI and chip
bus type LPC,FWH are incompatible.
Probing for Sanyo LF25FW203A, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Sharp LHF00L04, 1024 KB: skipped. Host bus type SPI and chip
bus type FWH are incompatible.
Probing for Spansion S25FL008A, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Spansion S25FL016A, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for SST SST25VF016B, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for SST SST25VF032B, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for SST SST25VF040.REMS, 512 KB: dediprog_spi_send_command,
writecnt=4, readcnt=2
REMS returned 00 00. probe_spi_rems: id1 0x0, id2 0x0
Probing for SST SST25VF040B, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for SST SST25VF040B.REMS, 512 KB: dediprog_spi_send_command,
writecnt=4, readcnt=2
REMS returned 00 00. probe_spi_rems: id1 0x0, id2 0x0
Probing for SST SST25VF080B, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for SST SST28SF040A, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST29EE010, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST29LE010, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST29EE020A, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST29LE020, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39SF010A, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39SF020A, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39SF040, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39VF512, 64 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39VF010, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39VF020, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39VF040, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST39VF080, 1024 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for SST SST49LF002A/B, 256 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for SST SST49LF003A/B, 384 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for SST SST49LF004A/B, 512 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for SST SST49LF004C, 512 KB: skipped. Host bus type SPI and chip
bus type FWH are incompatible.
Probing for SST SST49LF008A, 1024 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for SST SST49LF008C, 1024 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for SST SST49LF016C, 2048 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for SST SST49LF020, 256 KB: skipped. Host bus type SPI and chip
bus type LPC are incompatible.
Probing for SST SST49LF020A, 256 KB: skipped. Host bus type SPI and chip
bus type LPC are incompatible.
Probing for SST SST49LF040, 512 KB: skipped. Host bus type SPI and chip
bus type LPC are incompatible.
Probing for SST SST49LF040B, 512 KB: skipped. Host bus type SPI and chip
bus type LPC are incompatible.
Probing for SST SST49LF080A, 1024 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for SST SST49LF160C, 2048 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for ST M25P05-A, 64 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P05.RES, 64 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. Probing for ST M25P10-A, 128 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P10.RES, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. Probing for ST M25P20, 256 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P40, 512 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P40-old, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. Probing for ST M25P80, 1024 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P16, 2048 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P32, 4096 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
dediprog_spi_send_command, writecnt=1, readcnt=2
Chip status register is 00
Chip status register: Status Register Write Disable (SRWD) is not set
Chip status register: Bit 6 is not set
Chip status register: Bit 5 / Block Protect 3 (BP3) is not set
Chip status register: Bit 4 / Block Protect 2 (BP2) is not set
Chip status register: Bit 3 / Block Protect 1 (BP1) is not set
Chip status register: Bit 2 / Block Protect 0 (BP0) is not set
Chip status register: Write Enable Latch (WEL) is not set
Chip status register: Write In Progress (WIP/BUSY) is not set
Found chip "ST M25P32" (4096 KB, SPI) at physical address 0xffc00000.
Probing for ST M25P64, 8192 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M25P128, 16384 KB: dediprog_spi_send_command, writecnt=1,
readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST M29F002B, 256 KB: skipped. Host bus type SPI and chip bus
type Parallel are incompatible.
Probing for ST M29F002T/NT, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for ST M29F040B, 512 KB: skipped. Host bus type SPI and chip bus
type Parallel are incompatible.
Probing for ST M29F400BT, 512 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for ST M29W010B, 128 KB: skipped. Host bus type SPI and chip bus
type Parallel are incompatible.
Probing for ST M29W040B, 512 KB: skipped. Host bus type SPI and chip bus
type Parallel are incompatible.
Probing for ST M50FLW040A, 512 KB: skipped. Host bus type SPI and chip
bus type LPC,FWH are incompatible.
Probing for ST M50FLW040B, 512 KB: skipped. Host bus type SPI and chip
bus type LPC,FWH are incompatible.
Probing for ST M50FLW080A, 1024 KB: skipped. Host bus type SPI and chip
bus type LPC,FWH are incompatible.
Probing for ST M50FLW080B, 1024 KB: skipped. Host bus type SPI and chip
bus type LPC,FWH are incompatible.
Probing for ST M50FW002, 256 KB: skipped. Host bus type SPI and chip bus
type FWH are incompatible.
Probing for ST M50FW016, 2048 KB: skipped. Host bus type SPI and chip
bus type FWH are incompatible.
Probing for ST M50FW040, 512 KB: skipped. Host bus type SPI and chip bus
type FWH are incompatible.
Probing for ST M50FW080, 1024 KB: skipped. Host bus type SPI and chip
bus type FWH are incompatible.
Probing for ST M50LPW116, 2048 KB: skipped. Host bus type SPI and chip
bus type LPC are incompatible.
Probing for SyncMOS S29C31004T, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for SyncMOS S29C51001T, 128 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for SyncMOS S29C51002T, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for SyncMOS S29C51004T, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for TI TMS29F002RB, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for TI TMS29F002RT, 256 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Winbond W25x10, 128 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W25x20, 256 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W25x40, 512 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W25x80, 1024 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W25x16, 2048 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W25x32, 4096 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W25x64, 8192 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Winbond W29C011, 128 KB: skipped. Host bus type SPI and chip
bus type Parallel are incompatible.
Probing for Winbond W29C020C, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Winbond W29C040P, 512 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Winbond W29EE011, 128 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Winbond W39V040A, 512 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for Winbond W39V040B, 512 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for Winbond W39V040C, 512 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for Winbond W39V040FA, 512 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for Winbond W39V080A, 1024 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for Winbond W49F002U, 256 KB: skipped. Host bus type SPI and
chip bus type Parallel are incompatible.
Probing for Winbond W49V002A, 256 KB: skipped. Host bus type SPI and
chip bus type LPC are incompatible.
Probing for Winbond W49V002FA, 256 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for Winbond W39V080FA, 1024 KB: skipped. Host bus type SPI and
chip bus type FWH are incompatible.
Probing for Winbond W39V080FA (dual mode), 512 KB: skipped. Host bus
type SPI and chip bus type FWH are incompatible.
Probing for Atmel unknown Atmel SPI chip, 0 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for EON unknown EON SPI chip, 0 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Macronix unknown Macronix SPI chip, 0 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for PMC unknown PMC SPI chip, 0 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for SST unknown SST SPI chip, 0 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for ST unknown ST SPI chip, 0 KB: dediprog_spi_send_command,
writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Sanyo unknown Sanyo SPI chip, 0 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Generic unknown SPI chip (RDID), 0 KB:
dediprog_spi_send_command, writecnt=1, readcnt=3
RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
Probing for Generic unknown SPI chip (REMS), 0 KB:
dediprog_spi_send_command, writecnt=4, readcnt=2
REMS returned 00 00. probe_spi_rems: id1 0x0, id2 0x0
Reading flash... dediprog_spi_read, start=0x0, len=0x400000
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
dediprog_spi_send_command, writecnt=4, readcnt=4
[...]
Carl-Daniel Hailfinger - 2010-01-19 12:08:42
On 19.01.2010 12:43, Stefan Reinauer wrote:
> On 1/19/10 12:36 PM, Carl-Daniel Hailfinger wrote:
>   
>> Hm. To be honest, reading is something I could not find in the logs.
>>   
>>     
> I can provide a reading only log if that helps?
>   

Unfortunately that won't help. Reading uses USB bulk transfers without
opcodes. This may sound strange, but the SF100 firmware seems to have a
builtin mode where it issues the SPI READ opcode (or the FAST_READ
opcode, no idea without a SPI sniffer log) if you send a special request
without any opcode. As long as I have no idea about how to use this for
partial reads, we can't use that mode.


>> 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@gmx.net>
>>     
>
> /flashrom -p dediprog -VV -r testimage.rom
> flashrom v0.9.1-r869
> dediprog_init
> Found USB device (0483:dada).
> Found a SF100   V:3.1.8
> Setting SPI voltage to 3.500 V
> [...]
> Probing for Atmel AT25DF021, 256 KB: dediprog_spi_send_command,
> writecnt=1, readcnt=3
> RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
> [...]
> Probing for AMIC A25L40PT, 512 KB: dediprog_spi_send_command,
> writecnt=1, readcnt=4
> RDID returned 0x20 0x20 0x16 0x10. probe_spi_rdid_generic: id1 0x20, id2
> 0x2016
> [...]
> Probing for ST M25P32, 4096 KB: dediprog_spi_send_command, writecnt=1,
> readcnt=3
> RDID returned 0x20 0x20 0x16. probe_spi_rdid_generic: id1 0x20, id2 0x2016
> dediprog_spi_send_command, writecnt=1, readcnt=2
> Chip status register is 00
> Chip status register: Status Register Write Disable (SRWD) is not set
> Chip status register: Bit 6 is not set
> Chip status register: Bit 5 / Block Protect 3 (BP3) is not set
> Chip status register: Bit 4 / Block Protect 2 (BP2) is not set
> Chip status register: Bit 3 / Block Protect 1 (BP1) is not set
> Chip status register: Bit 2 / Block Protect 0 (BP0) is not set
> Chip status register: Write Enable Latch (WEL) is not set
> Chip status register: Write In Progress (WIP/BUSY) is not set
> Found chip "ST M25P32" (4096 KB, SPI) at physical address 0xffc00000.
> [...]
> Reading flash... dediprog_spi_read, start=0x0, len=0x400000
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> dediprog_spi_send_command, writecnt=4, readcnt=4
> [...]
>   

Good news: My patch works as designed. Read seems to work as well. Ack
please?
Bad news: The dediprog is dog slow. And with dog slow, I mean unbearably
sloooooooow. Reading works, but for a 4 MByte chip it may take up to 35
minutes AFAICS, maybe more. The file specified by -r will only be filled
with contents after the read is complete.

I see a speedup by a factor of 4 on the horizon, but I will implement
that only after I get confirmation that read works correctly (would be
pointless otherwise).

Regards,
Carl-Daniel
Stefan Reinauer - 2010-01-19 12:14:45
On 1/19/10 1:08 PM, Carl-Daniel Hailfinger wrote:
> On 19.01.2010 12:43, Stefan Reinauer wrote:
>   
>> On 1/19/10 12:36 PM, Carl-Daniel Hailfinger wrote:
>>   
>>     
>>> Hm. To be honest, reading is something I could not find in the logs.
>>>   
>>>     
>>>       
>> I can provide a reading only log if that helps?
>>   
>>     
> Unfortunately that won't help. Reading uses USB bulk transfers without
> opcodes. This may sound strange, but the SF100 firmware seems to have a
> builtin mode where it issues the SPI READ opcode (or the FAST_READ
> opcode, no idea without a SPI sniffer log) if you send a special request
> without any opcode. As long as I have no idea about how to use this for
> partial reads, we can't use that mode.
>
>   
Well, then you need a log for a partial read?

Frankly, it would still be around 60-100 times faster to always read the
whole chip and just through away what you don't need ;-)

> Good news: My patch works as designed. Read seems to work as well. Ack
> please?
> Bad news: The dediprog is dog slow. 
Not with the windows software. It looks like only your driver is slow,
not the dediprog ;-) But hey, it's a start.
> sloooooooow. Reading works, but for a 4 MByte chip it may take up to 35
> minutes AFAICS, maybe more. The file specified by -r will only be filled
> with contents after the read is complete.
>   
Maybe it shouldn't be created before that, either, then?

> I see a speedup by a factor of 4 on the horizon, but I will implement
> that only after I get confirmation that read works correctly (would be
> pointless otherwise).
>   
Requiring 10 minutes to read the chip is still kind of pointless, so I
don't know if it's worth the effort if the driver can't be generally fixed.

Stefan
Carl-Daniel Hailfinger - 2010-01-19 13:36:21
On 19.01.2010 13:14, Stefan Reinauer wrote:
> On 1/19/10 1:08 PM, Carl-Daniel Hailfinger wrote:
>   
>> On 19.01.2010 12:43, Stefan Reinauer wrote:  
>>     
>>> On 1/19/10 12:36 PM, Carl-Daniel Hailfinger wrote:
>>>       
>>>> Hm. To be honest, reading is something I could not find in the logs.
>>>>
>>>>         
>>> I can provide a reading only log if that helps?
>>>
>>>       
>> Unfortunately that won't help. Reading uses USB bulk transfers without
>> opcodes. This may sound strange, but the SF100 firmware seems to have a
>> builtin mode where it issues the SPI READ opcode (or the FAST_READ
>> opcode, no idea without a SPI sniffer log) if you send a special request
>> without any opcode. As long as I have no idea about how to use this for
>> partial reads, we can't use that mode.
>>
>>     
> Well, then you need a log for a partial read?
>   

A log of a partial read of the last few sectors would be a good start,
but the big problem is that I don't know which opcode is sent to the
chip. So if you have a Bus Pirate or any other Sniffer, reducing the SPI
frequency to a point where the sniffer can keep up (at least for the
first sector or so) would at least reveal the opcode used by the
Dediprog. Then I could create an opcode filter which diverts reads to a
separate bulk read function.


> Frankly, it would still be around 60-100 times faster to always read the
> whole chip and just through away what you don't need ;-)
>   

Hm yes. Right now not knowing the opcode sent to the chip is the biggest
problem.


>> Good news: My patch works as designed. Read seems to work as well. Ack
>> please?
>> Bad news: The dediprog is dog slow. 
>>     
> Not with the windows software. It looks like only your driver is slow,
> not the dediprog ;-) But hey, it's a start.
>   

The windows driver uses one control URB, then does bulk reads until the
chip is completely read. With 512 bytes per bulk read, this means we
have 8192 bulk transactions. That's fast.
The flashrom driver uses control URBs for everything: One for sending
the opcode, one for reading the result in 4 byte chunks. That means we
send 2 million URBs down the wire and receive 2 million URBs. We
probably spend 250 ┬Ás per transaction on USB 2.0, maybe more.


>> sloooooooow. Reading works, but for a 4 MByte chip it may take up to 35
>> minutes AFAICS, maybe more. The file specified by -r will only be filled
>> with contents after the read is complete.
>>   
>>     
> Maybe it shouldn't be created before that, either, then?
>   

Not sure. Reading a chip for 35 minutes and then noticing that the file
can't be created isn't exactly nice either.


>> I see a speedup by a factor of 4 on the horizon, but I will implement
>> that only after I get confirmation that read works correctly (would be
>> pointless otherwise).
>>   
>>     
> Requiring 10 minutes to read the chip is still kind of pointless, so I
> don't know if it's worth the effort if the driver can't be generally fixed.
>   

Get me a log of the SPI side (the first 1024 bytes or so are sufficient)
with a matching log on the USB side and I can reach the same speeds as
the windows driver.

As interim measure, I can increase read chunk size to 16 (speedup factor
4) once we know if read works. Once we know read chunk size 16 works, I
can test bigger chunk sizes up to 64 (USB protocol limit). That would be
a factor of 16 faster than the current implementation. Maybe not
perfect, but it would definitely be usable.
I need those chunk size tests anyway to implement write support.


Regards,
Carl-Daniel
Stefan Reinauer - 2010-01-21 22:40:57
On 1/19/10 2:36 PM, Carl-Daniel Hailfinger wrote:

> Get me a log of the SPI side (the first 1024 bytes or so are sufficient)
> with a matching log on the USB side and I can reach the same speeds as
> the windows driver.
>   

I'm curious, what do you need the SPI side for?


Stefan
Carl-Daniel Hailfinger - 2010-01-22 02:16:35
On 21.01.2010 23:40, Stefan Reinauer wrote:
> On 1/19/10 2:36 PM, Carl-Daniel Hailfinger wrote:
>   
>> Get me a log of the SPI side (the first 1024 bytes or so are sufficient)
>> with a matching log on the USB side and I can reach the same speeds as
>> the windows driver.
>>     
>
> I'm curious, what do you need the SPI side for?
>   

The SF100 has a built-in read function which does _not_ accept any
opcode and is totally opaque. Since two different (incompatible) read
opcodes exist for most chips, I'd really like to know which one is used
by the Dediprog so I can create an opcode filter which redirects the
correct read opcode to the SF100 special read function.

Regards,
Carl-Daniel

Patch

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) {