On 1/21/10 10:26 AM, Carl-Daniel Hailfinger wrote:
Add write support. Speed up reads by a factor of 64 by switching block size from 4 to 256. Add support for 4 byte RDID.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Stefan Reinauer stepan@coresystems.de
MacPro:flashrom stepan$ time ./flashrom -pdediprog -r testread.rom flashrom v0.9.1-r878 Calibrating delay loop... OK. Found chip "ST M25P32" (4096 KB, SPI) at physical address 0xffc00000. === This flash part has status UNTESTED for operations: ERASE Please email a report to flashrom@flashrom.org if any of the above operations work correctly for you with this flash part. Please include the flashrom output with the additional -V option for all operations you tested (-V, -rV, -wV, -EV), and mention which mainboard or programmer you tested. Thanks for your help! === Reading flash... Command Receive SPI failed, ret=-34, expected 256! done.
real 0m31.602s user 0m0.924s sys 0m0.794s
dd if=/dev/urandom of=testwrite.rom bs=1024 count=$((1024*4)) time ./flashrom -pdediprog -w testwrite.rom flashrom v0.9.1-r878 Calibrating delay loop... OK. Found chip "ST M25P32" (4096 KB, SPI) at physical address 0xffc00000. === This flash part has status UNTESTED for operations: ERASE Please email a report to flashrom@flashrom.org if any of the above operations work correctly for you with this flash part. Please include the flashrom output with the additional -V option for all operations you tested (-V, -rV, -wV, -EV), and mention which mainboard or programmer you tested. Thanks for your help! === Flash image seems to be a legacy BIOS. Disabling checks. Writing flash chip... Erasing flash before programming... Erasing flash chip... Command Receive SPI failed, ret=-34, expected 256! ERASE FAILED at 0x00000000! Expected=0xff, Read=0x00, failed byte count from 0x00000000-0x0000ffff: 0x16ea ERASE FAILED! ERASE FAILED at 0x00000000! Expected=0xff, Read=0x00, ^C
real 1m17.836s user 0m1.948s sys 0m2.206s
time ./flashrom -pdediprog -w testwrite.rom -VV flashrom v0.9.1-r878 dediprog_init Found USB device (0483:dada). Found a SF100 V:3.1.8 Setting SPI voltage to 3.500 V Calibrating delay loop... 761M loops per second, 100 myus = 200 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 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. [...] Flash image seems to be a legacy BIOS. Disabling checks. Writing flash chip... dediprog_spi_send_command, writecnt=1, readcnt=2 Erasing flash before programming... Erasing flash chip... Looking at blockwise erase function 0... trying... 0x000000-0x00ffff, dediprog_spi_send_command, writecnt=1, readcnt=0 dediprog_spi_send_command, writecnt=4, readcnt=0 dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_read, start=0x0, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 Command Receive SPI failed, ret=-34, expected 256! ERASE FAILED at 0x00000000! Expected=0xff, Read=0x00,dediprog_spi_read, start=0x100, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x200, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x300, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x400, len=0x100 [...] dediprog_spi_read, start=0xff00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 failed byte count from 0x00000000-0x0000ffff: 0x16ea ERASE FAILED!
Looking at blockwise erase function 1... trying... 0x000000-0x3fffff, dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_send_command, writecnt=1, readcnt=0 dediprog_spi_send_command, writecnt=1, readcnt=0 dediprog_spi_send_command, writecnt=1, readcnt=2 dediprog_spi_read, start=0x0, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 ERASE FAILED at 0x00000000! Expected=0xff, Read=0x00,dediprog_spi_read, start=0x100, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x200, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x300, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x400, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x500, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x600, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x700, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x800, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x900, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0xa00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0xb00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0xc00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0xd00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0xe00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0xf00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x1000, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x1100, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x1200, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x1300, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x1400, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x1500, len=0x100 [...] dediprog_spi_read, start=0x3ff900, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x3ffa00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x3ffb00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x3ffc00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x3ffd00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x3ffe00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 dediprog_spi_read, start=0x3fff00, len=0x100 dediprog_spi_send_command, writecnt=4, readcnt=256 failed byte count from 0x00000000-0x003fffff: 0x58000 ERASE FAILED!
Looking at blockwise erase function 2... not defined. Looking for another erase function. Looking at blockwise erase function 3... not defined. Looking for another erase function. Looking at blockwise erase function 4... not defined. Looking for another erase function. FAILED! ERASE FAILED! FAILED! Your flash chip is in an unknown state. Get help on IRC at irc.freenode.net (channel #flashrom) or mail flashrom@flashrom.org! ------------------------------------------------------------------------------- DO NOT REBOOT OR POWEROFF! dediprog_shutdown Setting SPI voltage to 0.000 V
real 1m58.392s user 0m2.733s sys 0m4.135s