Nick: zlatistiv E-mail: zlatistiv@gmail.com Board: 25Q64JVSIQ Contents: pi@raspberrypi:~/flashrom/builddir $ ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c "W25Q64JV-.Q" --wp-enable --wp-range 0x007ff000,0x00001000 -o wp_enable.log flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom is free software, get the source code at https://flashrom.org Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Enabled hardware protection Activated protection range: start=0x007ff000 length=0x00001000 (upper 1/2048) pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c "W25Q64JV-.Q" --wp-status flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom is free software, get the source code at https://flashrom.org Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Protection range: start=0x007ff000 length=0x00001000 (upper 1/2048) Protection mode: hardware pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ cat wp_enable.log flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom was built with GCC 10.2.1 20210110, little endian Command line (9 args): ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c W25Q64JV-.Q --wp-enable --wp-range 0x007ff000,0x00001000 -o wp_enable.log Initializing linux_spi programmer Using default 2000kHz clock. Use 'spispeed' parameter to override. Using device /dev/spidev0.0 Using 2000kHz clock get_max_kernel_buf_size: Using value from /sys/module/spidev/parameters/bufsiz as max buffer size. linux_spi_init: max_kernel_buf_size: 4096 The following protocols are supported: SPI. Probing for Winbond W25Q64JV-.Q, 8192 kB: compare_id: id1 0xef, id2 0x4017 Added layout entry 00000000 - 007fffff named complete flash Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Chip status register is 0x00. 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). write_wp_bits: wp_verify reg:1 value:0x44 write_wp_bits: wp_verify reg:2 value:0x2 write_wp_bits: wp_verify reg:3 value:0x60 write_wp_bits: wp_verify reg:1 value:0xc4 write_wp_bits: wp_verify reg:2 value:0x2 write_wp_bits: wp_verify reg:3 value:0x60 Enabled hardware protection Activated protection range: start=0x007ff000 length=0x00001000 (upper 1/2048) pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ # From here on WP pin is pulled to ground, preventing flashrom from modifying the status registers pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c "W25Q64JV-.Q" --wp-disable flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom is free software, get the source code at https://flashrom.org Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Failed to apply new WP settings: unexpected WP configuration read back from chip Note: hardware status register protection is enabled. The chip's WP# pin must be set to an inactive voltage level to be able to change the WP settings. pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c "W25Q64JV-.Q" --wp-range 0x0,0x0 flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom is free software, get the source code at https://flashrom.org Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Failed to apply new WP settings: unexpected WP configuration read back from chip Note: hardware status register protection is enabled. The chip's WP# pin must be set to an inactive voltage level to be able to change the WP settings. pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ cat layout 0x0:0x7fefff head 0x7ff000:0x7fffff tail pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ # Writing to the upper 1/2048 part of the flash will fail, verified after read pi@raspberrypi:~/flashrom/builddir $ ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c "W25Q64JV-.Q" -w zero.bin -l layout --image tail flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom is free software, get the source code at https://flashrom.org Using region: "tail". Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Failed to unlock flash status reg with wp support. Block protection could not be disabled! Reading old flash chip contents... done. Updating flash chip contents... FAILED at 0x007ff000! Expected=0xff, Found=0x38, failed byte count from 0x007ff000-0x007fffff: 0xfec ERASE FAILED! Erase/write done from 7ff000 to 7fffff Write Failed!Uh oh. Erase/write failed. Checking if anything has changed. Reading current flash chip contents... done. Good, writing to the flash chip apparently didn't do anything. Please check the connections (especially those to write protection pins) between the programmer and the flash chip. If you think the error is caused by flashrom please report this to the mailing list at flashrom@flashrom.org or on chat (see https://flashrom.org/contact.html for details), thanks! pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ pi@raspberrypi:~/flashrom/builddir $ # Writing to the first 2047/2048 of the flash works as expected, verified after read pi@raspberrypi:~/flashrom/builddir $ ./flashrom -p linux_spi:dev=/dev/spidev0.0 -c "W25Q64JV-.Q" -w zero.bin -l layout --image head flashrom v1.6.0-devel (git:v1.5.0-51-ge7ac0f1d) on Linux 6.1.21-v8+ (aarch64) flashrom is free software, get the source code at https://flashrom.org Using region: "head". Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Winbond flash chip "W25Q64JV-.Q" (8192 kB, SPI) on linux_spi. Failed to unlock flash status reg with wp support. Block protection could not be disabled! Reading old flash chip contents... done. Updating flash chip contents... Erase/write done from 0 to 7fefff Verifying flash... VERIFIED. pi@raspberrypi:~/flashrom/builddir $