FlashROM读SPI Flash出现问题



  • 如题,Flash是Winbond W25Q128,flashrom识别成功但读写操作时提示"ioctl: Message too long" 。
    接线方法是按照树莓派的接法,CS接到了CS1上面,试过修改dts文件把:

    spi-max-frequency = <40000000>;
    

    改成

    spi-max-frequency = <20000000>;
    

    依然报错。

    同时也尝试过在文件底下加上一个软SPI(spi-gpio)但flashrom直接无法识别了,可能是我写的不对:

    	spi {
    		compatible = "spi-gpio";
            	#address-cells = <0x1>;
            	ranges;
    
    		gpio-sck = <&gpio0 15 0>;
    		gpio-miso = <&gpio0 16 0>;
    		gpio-mosi = <&gpio0 17 0>;
    		cs-gpios = <&gpio0 14 0>;
    		num-chipselects = <1>;
    		status = "ok";
          
              spidev@2{
                             compatible = "spidev";
                             reg = <0>;
                             #address-cells = <1>;
                             #size-cells = <0>;
                             spi-max-frequency = <2000000>;
                   };
    	}; 
    

    详细flashrom信息如下:

    root@Widora:/tmp# flashrom -p linux_spi:dev=/dev/spidev32766.1 -r test.bin -VV
    flashrom v1.0 on Linux 3.18.29 (mips)
    flashrom is free software, get the source code at https://flashrom.org
    
    flashrom was built with libpci 3.3.1, GCC 4.8.3, little endian
    Command line (5 args): flashrom -p linux_spi:dev=/dev/spidev32766.1 -r test.bin -VV
    Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
    Initializing linux_spi programmer
    Using device /dev/spidev32766.1
    The following protocols are supported: SPI.
    Probing for AMIC A25L05PT, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L05PU, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L10PT, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L10PU, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L20PT, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L20PU, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L40PT, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L40PU, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L80P, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L16PT, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L16PU, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L512, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L010, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L020, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L080, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L016, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25L032, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25LQ16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25LQ032/A25LQ32A, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for AMIC A25LQ64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF021, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF041A, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF081, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF081A, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF161, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF321, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF321A, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DF641(A), 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DL081, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DL161, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25DQ161, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25F512, 64 kB: probe_spi_at25f: id1 0x00, id2 0x00
    Probing for Atmel AT25F512A, 64 kB: probe_spi_at25f: id1 0x00, id2 0x00
    Probing for Atmel AT25F512B, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25F1024(A), 128 kB: probe_spi_at25f: id1 0x00, id2 0x00
    Probing for Atmel AT25F2048, 256 kB: probe_spi_at25f: id1 0x00, id2 0x00
    Probing for Atmel AT25F4096, 512 kB: probe_spi_at25f: id1 0x00, id2 0x00
    Probing for Atmel AT25FS010, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT25FS040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT26DF041, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT26DF081A, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT26DF161, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT26DF161A, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT26F004, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45CS1282, 16896 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB011D, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB021D, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB041D, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB081D, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB161D, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB321C, 4224 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB321D, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB321E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel AT45DB642D, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for ESMT F25L008A, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for ESMT F25L32PA, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B05, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B05T, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P05, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B10T, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B20T, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B40T, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B80T, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B16T, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B32T, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25B64T, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25P64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F05, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25F64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25Q40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25Q80(A), 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25Q16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25Q32(A/B), 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25Q64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25Q128, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25QH16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25QH32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25QH64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25QH128, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon EN25S64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for ESI ES25P40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for ESI ES25P80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for ESI ES25P16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25LQ40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25LQ80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25LQ16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25LQ32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25LQ64(B), 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25LQ128, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q512, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q20(B), 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q40(B), 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q80(B), 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q16(B), 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q32(B), 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q64(B), 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q128B, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25Q128C, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25T80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25VQ21B, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25VQ40C, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25VQ41B, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25VQ80C, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for GigaDevice GD25VQ16C, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Intel 25F160S33B8, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Intel 25F160S33T8, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Intel 25F320S33B8, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Intel 25F320S33T8, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Intel 25F640S33B8, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Intel 25F640S33T8, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX23L1654, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX23L3254, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX23L6454, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX23L12854, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L512(E)/MX25V512(C), 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L1005(C)/MX25L1006E, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L2005(C)/MX25L2006E, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L4005(A/C)/MX25L4006E, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L8005/MX25L8006E/MX25L8008E/MX25V8005, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L1605, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L1605A/MX25L1606E/MX25L1608E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L1605D/MX25L1608D/MX25L1673E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L1635D, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L1635E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L3205(A), 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L3205D/MX25L3208D, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L3206E/MX25L3208E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L3273E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L3235D, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L6405, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L6405D, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L6406E/MX25L6408E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L6436E/MX25L6445E/MX25L6465E/MX25L6473E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L12805D, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L12835F/MX25L12845E/MX25L12865E, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25U1635E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25U3235E/F, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25U6435E/F, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25U12835F, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix MX25L6495F, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P05-A, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P05, 64 kB: Ignoring RES in favour of RDID.
    Probing for Micron/Numonyx/ST M25P10-A, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P10, 128 kB: Ignoring RES in favour of RDID.
    Probing for Micron/Numonyx/ST M25P20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P20-old, 256 kB: Ignoring RES in favour of RDID.
    Probing for Micron/Numonyx/ST M25P40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P40-old, 512 kB: Ignoring RES in favour of RDID.
    Probing for Micron/Numonyx/ST M25P80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25P128, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PE10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PE20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PE40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PE80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PE16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PX80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PX16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PX32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M25PX64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M45PE10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M45PE20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M45PE40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M45PE80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST M45PE16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q016, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q032..1E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q032..3E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q064..1E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q064..3E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q128..1E, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Micron/Numonyx/ST N25Q128..3E, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Nantronics N25S10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Nantronics N25S20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Nantronics N25S40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Nantronics N25S80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Nantronics N25S16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LD256C, 32 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LD512(C), 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LD010(C), 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LD020(C), 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LD040(C), 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LQ020, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LQ040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LQ080, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LQ016, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LQ032C, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LV512(A), 64 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for PMC Pm25LV010, 128 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for PMC Pm25LV010A, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LV020, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LV040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LV080B, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC Pm25LV016B, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Sanyo LE25FW106, 128 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for Sanyo LE25FW406A, 512 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for Sanyo LE25FU406B, 512 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for Sanyo LE25FU406C/LE25U40CMC, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Sanyo LE25FW203A, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Sanyo LE25FW403A, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Sanyo LE25FW418A, 512 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for Sanyo LE25FW806, 1024 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for Sanyo LE25FW808, 1024 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for Spansion S25FL004A, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL008A, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL016A, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL032A/P, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL064A/P, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL204K, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL208K, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL116K/S25FL216K, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL132K, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL164K, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL127S-64kB, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL127S-256kB, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL128P......0, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL128P......1, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL128S......0, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL128S......1, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL129P......0, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Spansion S25FL129P......1, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25LF020A, 256 kB: probe_spi_rems: id1 0xef, id2 0x17
    Probing for SST SST25LF040A, 512 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for SST SST25LF080(A), 1024 kB: probe_spi_res2: id1 0x17, id2 0x17
    Probing for SST SST25VF512(A), 64 kB: probe_spi_rems: id1 0xef, id2 0x17
    Probing for SST SST25VF010(A), 128 kB: probe_spi_rems: id1 0xef, id2 0x17
    Probing for SST SST25VF020, 256 kB: probe_spi_rems: id1 0xef, id2 0x17
    Probing for SST SST25VF020B, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25VF040, 512 kB: probe_spi_rems: id1 0xef, id2 0x17
    Probing for SST SST25VF040B, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25VF040B.REMS, 512 kB: probe_spi_rems: id1 0xef, id2 0x17
    Probing for SST SST25WF020A, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF040B, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF080B, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25VF080B, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25VF016B, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25VF032B, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25VF064C, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF512, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF010, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF020, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST SST25WF080, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q40.V, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q80.V, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q16.V, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q32.V, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q64.V, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q128.V, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Found Winbond flash chip "W25Q128.V" (16384 kB, SPI) on linux_spi.
    Chip status register is 0x00.
    Probing for Winbond W25Q20.W, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q40.W, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q80.W, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q16.W, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q32.W, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q64.W, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25Q128.W, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond W25X64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Unknown SFDP-capable chip, 0 kB: SFDP revision = 1.0
    SFDP number of parameter headers is 1 (NPH = 0).
    
    SFDP parameter table header 0/0:
      ID 0x00, version 1.0
      Length 36 B, Parameter Table Pointer 0x000080
    Parsing JEDEC flash parameter table... 
      3-Byte only addressing.
      Status register is non-volatile and the standard does not allow vendors to tell us whether EWSR/WREN is needed for status register writes - assuming EWSR.
      Write chunk size is at least 64 B.
      Flash chip size is 16384 kB.
      Block eraser 0: 4096 x 4096 B with opcode 0x20
      Tried to add a duplicate block eraser: 4096 x 4096 B with opcode 0x20.
      Block eraser 1: 512 x 32768 B with opcode 0x52
      Block eraser 2: 256 x 65536 B with opcode 0xd8
    done.
    Probing for AMIC unknown AMIC SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Atmel unknown Atmel SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Eon unknown Eon SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Macronix unknown Macronix SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for PMC unknown PMC SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for SST unknown SST SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for ST unknown ST SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Sanyo unknown Sanyo SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Winbond unknown Winbond (ex Nexcom) SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Generic unknown SPI chip (RDID), 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
    Probing for Generic unknown SPI chip (REMS), 0 kB: probe_spi_rems: id1 0xef, id2 0x17
    Found Winbond flash chip "W25Q128.V" (16384 kB, SPI).
    This chip may contain one-time programmable memory. flashrom cannot read
    and may never be able to write it, hence it may not be able to completely
    clone the contents of this chip (see man page for details).
    Block protection is disabled.
    Reading flash... linux_spi_send_command: ioctl: Message too long
    Read operation failed!
    FAILED.
    


  • @mango 不好意思前几天不在深圳没看到您的跟帖

    情况是这样的,如果是mainline的openwrt,直接改dts的:

    		gpio-sck = <&gpio0 15 0>;
    		gpio-miso = <&gpio0 16 0>;
    		gpio-mosi = <&gpio0 17 0>;
    		cs-gpios = <&gpio0 14 0>;
    

    里面最后一位的0写错了,改成1即可,即<&gpio0 xx 0>改成<&gpio0 xx 1>

    如果是MTK的OpenWrt,比如@mango 他们给的那个openwrt,则可能需要手动用reg工具改一下寄存器。
    具体说明教程参见此帖:https://community.onion.io/topic/1266/how-to-switch-agpio-gpio-18-19-omega2-fw-vs-lede-build,
    没记错的话命令应该是reg w 0x1000003C 0xFE01FF

    此外还需要注意:

    1. spi-max-frequency建议改大一点,如果只是用flashrom的话可以直接设置成20000000(加个0,翻10倍)速度快很多
    2. 建议使用谷歌ChromiumOS的flashrom,不然写入/擦写速度很慢。稍后我会做一个openwrt feed,到时候贴上来。

    同时感谢@mango 大佬以及某些不方便透露姓名的大佬们的帮助!以前大一大二瞎折腾C# Java啥的没怎么折腾嵌入式,所以不够熟练……😂


  • administrators

    @huming2207 建议把搞定的也贴到这里 :)



  • ……打错几个字修改了一下,再补充一点,可能需要修改spidev的buffer size,否则flashrom可能认得出flash芯片,但无法进行读写操作。我设置到最大值65535 bytes,测了几十回没问题。


  • administrators

    @huming2207 听说模拟的SPI比ch341那种烧写器都快?😅



  • @mango 是的

    谷歌ChromiumOS fork版的FlashROM效果会更好,因为他能对比镜像和flash里面的内容,然后自动跳过一些不需要写入的block。

    我略改了下那个谷歌版FlashROM,加了一两个原版FlashROM的linux_spi
    buffer相关的patch,写入16MB最差情况5分1秒,最好情况1分半。

    等会儿我忙完了就做个openwrt feed贴上来



  • 实际多次写入不同的、带OpenWrt的镜像大概两分多钟,还算理想。
    还有如果配合ft232系列,有空重新折腾一下flashrom那个ft232适配代码应该速度会更快。


  • administrators

    @huming2207 我用ch341烧整个大固件,记得至少10分钟,看那进度条我都以为死机了。。。。。。。



  • 好的flashrom的feed来了,在源码根目录的feeds.conf.default最后一行加上:

    src-git flashrom https://github.com/huming2207/openwrt-flashrom-chromium.git
    

    即可



  • @mango 我倒是奇怪为毛淘宝上一堆用stm32做烧录器,然后代码写得跟我一样屎😂,客服态度非常差,驱动还不签名,英文版Win10用他们的上位机app一堆bug,读写大文件似乎还放到UI线程做,然后UI卡死。而且关键是很多做这个开发的人都是在Linux环境下干活儿,他们也不写个Linux的上位机app。

    而且好像淘宝上搞FT232/2232/4232的都是用来做JTAG debugger,没有像那些烧录器一样带个芯片座子……如果有谁做个烧录器外形的FT232板子,顺便再引出JTAG的那种标准接口,魔改一个FlashROM,用Electron或者Qt或者GTK什么的做个好看好用点的GUI,80块以内价格,我会买。

    @mango 大佬如果感兴趣的话做一个?😂


  • administrators

    @huming2207 赶快把这个工程师神器搞出来



  • @mango 我平时不在国内,打板子不太方便(而且画板子画的一般吧,之前玩脱了两次浪费几十块钱),你们如果能做是最好的哈哈哈

    我过后试试把FlashROM的所有stdout输出信息魔改一下搞成带JSON格式的,然后GUI用WPF或者Electron做个跨平台的app,难度应该不大。


  • administrators

    @huming2207 肉身在墙外着实令人羡慕!
    软件多找lintel,硬件我来,哈哈



  • @mango 哈哈还不算肉身翻墙,只是上个学