[flashrom] Test report for multiple SPI flash chips on serprog with UNTESTED status

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Fri Apr 19 02:28:02 CEST 2013

On Wed, 03 Apr 2013 12:40:07 +0800
Chi Zhang <zhangchi866 at gmail.com> wrote:

> Applied patch: http://patchwork.coreboot.org/patch/3927/
> And now AT26DF161A is NOT working any more.
> http://paste.flashrom.org/view.php?id=1578

I have to admit that I don't understand the problem yet at all. It
should have worked IMHO.
If you have some time please retry with -VV again after applying the
following patch on top of the previous patch (3927). This should print
what we actually try to write to the status register to disable the
alleged write protection. Maybe I am misreading the datasheet, and if
so the debug output should make it easier to understand what's going on.

 spi25_statusreg.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/spi25_statusreg.c b/spi25_statusreg.c
index c089157..b514204 100644
--- a/spi25_statusreg.c
+++ b/spi25_statusreg.c
@@ -96,6 +96,7 @@ int spi_write_status_register(struct flashctx *flash, int status)
 	int feature_bits = flash->chip->feature_bits;
 	int ret = 1;
+	msg_cdbg2("Trying to write 0x%02x to the status register.\n", status);
 	if (!(feature_bits & (FEATURE_WRSR_WREN | FEATURE_WRSR_EWSR))) {
 		msg_cdbg("Missing status register write definition, assuming "
 			 "EWSR is needed\n");
@@ -165,6 +166,7 @@ static int spi_disable_blockprotect_generic(struct flashctx *flash, uint8_t bp_m
 	status = spi_read_status_register(flash);
 	if ((status & bp_mask) != 0) {
 		msg_cerr("Block protection could not be disabled!\n");
+		flash->chip->printlock(flash);
 		return 1;

Kind regards/Mit freundlichen Grüßen, Stefan Tauner

More information about the flashrom mailing list