This patch set enables us to figure out if transactions will succeed without executing them, which allows for a refactoring of probe_spi_rdid_generic() which in consequence makes it possible to add probe_spi_rdid_edi().
The infrastructure code as a whole, but especially the ichspi code is heavily modified. Please be aware of that if you test it on mainboards.
Antonio: please rebase your Spansion patch on this one and extend it to add actually two chips by using the full 32 bit model IDs (0x20184d00, 0x20184d01) and .probe = probe_spi_rdid_edi.
Stefan Tauner (5): Refactor ichspi and prepare it for check_trans(). Prepare wbsio_spi.c for check_trans(). Introduce check_trans(). Generify probe_spi_rdid_generic() and add probe_spi_rdid_edi(). Let the dummy programmer emulate SPI payload limitations.
bitbang_spi.c | 1 + buspirate_spi.c | 14 ++- dediprog.c | 24 ++-- dummyflasher.c | 16 ++- flash.h | 1 + flashchips.c | 24 ++-- flashchips.h | 2 +- ft2232_spi.c | 14 ++- ichspi.c | 356 +++++++++++++++++++++++++++++++------------------------ it85spi.c | 1 + it87spi.c | 31 +++-- linux_spi.c | 31 +++-- programmer.h | 11 ++ sb600spi.c | 51 ++++---- serprog.c | 32 +++-- spi.c | 9 +- spi25.c | 97 +++++++-------- wbsio_spi.c | 146 ++++++++++++++--------- 18 files changed, 527 insertions(+), 334 deletions(-)
This is the output of the dummy programmer to show the new behavior:
flashrom v0.9.6.1-r1611 on Linux 3.2.0-31-generic (x86_64) flashrom is free software, get the source code at http://www.flashrom.org
flashrom was built with libpci 3.1.8, GCC 4.6.3, little endian Command line (3 args): ./flashrom -p dummy:bus=SPI,spi_prog=wbsio,emulate=M25P10.RES -V Calibrating delay loop... OS timer resolution is 1 usecs, 1456M loops per second, 10 myus = 10 us, 100 myus = 127 us, 1000 myus = 1023 us, 10000 myus = 10024 us, 4 myus = 10 us, OK. Initializing dummy programmer Requested buses are: SPI Enabling support for SPI flash. Emulating ST M25P10.RES SPI flash chip (RES, page write) Using SPI payload limitations of the wbsio programmer. Filling fake flash chip with 0xff, size 131072 The following protocols are supported: SPI. Probing for AMIC A25L05PT, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L05PU, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L10PT, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L10PU, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L20PT, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L20PU, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L40PT, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L40PU, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L80P, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L16PT, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L16PU, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L512, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L010, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L020, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L040, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L080, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L016, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25L032, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for AMIC A25LQ032, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF021, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF041A, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF081, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF081A, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF161, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF321, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF321A, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DF641(A), 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25DQ161, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25F512B, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25FS010, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT25FS040, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT26DF041, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT26DF081A, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT26DF161, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT26DF161A, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT26F004, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45CS1282, 16896 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB011D, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB021D, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB041D, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB081D, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB161D, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB321C, 4224 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB321D, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel AT45DB642D, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for EMST F25L008A, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B05, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B05T, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B10, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B10T, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B20, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B20T, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B40T, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B80T, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B16T, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B32T, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25B64T, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F05, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F10, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F20, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25F64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25Q40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25Q80(A), 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25Q16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25Q32(A/B), 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25Q64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25Q128, 16384 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25QH16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon EN25QH32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q20, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25Q128, 16384 kB: 3 byte RDID not supported on this SPI controller. Probing for GigaDevice GD25LQ32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L512, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L1005, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L2005, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L4005, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L8005, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L1605, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L1635D, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L1635E, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L3205, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L3235D, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L6405, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix MX25L12805, 16384 kB: 3 byte RDID not supported on this SPI controller. Probing for Numonyx M25PE10, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Numonyx M25PE20, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Numonyx M25PE40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Numonyx M25PE80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Numonyx M25PE16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Numonyx N25Q064, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC Pm25LV010, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC Pm25LV016B, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC Pm25LV020, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC Pm25LV040, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC Pm25LV080B, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC Pm25LV512, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for Sanyo LF25FW203A, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Spansion S25FL004A, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Spansion S25FL008A, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Spansion S25FL016A, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Spansion S25FL032A, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Spansion S25FL064A, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25LF040A, 512 kB: probe_spi_res2: id1 0x10, id2 0x10 Probing for SST SST25LF080A, 1024 kB: probe_spi_res2: id1 0x10, id2 0x10 Probing for SST SST25VF010, 128 kB: probe_spi_rems: id1 0xff, id2 0xff Probing for SST SST25VF016B, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25VF032B, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25VF064C, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25VF040, 512 kB: probe_spi_rems: id1 0xff, id2 0xff Probing for SST SST25VF040B, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25VF040B.REMS, 512 kB: probe_spi_rems: id1 0xff, id2 0xff Probing for SST SST25VF080B, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25WF512, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25WF010, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25WF020, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for SST SST25WF040, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P05-A, 64 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P05, 64 kB: probe_spi_res1: id 0x10 Chip status register is 00 Found ST flash chip "M25P05" (64 kB, SPI) on dummy. Probing for ST M25P10-A, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P10, 128 kB: probe_spi_res1: id 0x10 Chip status register is 00 Found ST flash chip "M25P10" (128 kB, SPI) on dummy. Probing for ST M25P20, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P40-old, 512 kB: probe_spi_res1: id 0x10 Probing for ST M25P80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25P128, 16384 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25PX16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25PX32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for ST M25PX64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25Q80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25Q16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25Q32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25Q64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25Q128, 16384 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X10, 128 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X20, 256 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X40, 512 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X80, 1024 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X16, 2048 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X32, 4096 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond W25X64, 8192 kB: 3 byte RDID not supported on this SPI controller. Probing for Unknown SFDP-capable chip, 0 kB: No SFDP signature found. Probing for AMIC unknown AMIC SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Atmel unknown Atmel SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Eon unknown Eon SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Macronix unknown Macronix SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for PMC unknown PMC SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for SST unknown SST SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for ST unknown ST SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Sanyo unknown Sanyo SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Winbond unknown Winbond (ex Nexcom) SPI chip, 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Generic unknown SPI chip (RDID), 0 kB: 3 byte RDID not supported on this SPI controller. Probing for Generic unknown SPI chip (REMS), 0 kB: probe_spi_rems: id1 0xff, id2 0xff Multiple flash chips were detected: "M25P05", "M25P10" Please specify which chip to use with the -c <chipname> option.