summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--flash.h1
-rw-r--r--flashrom.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index cb53ad1..c2de2d0 100644
--- a/flash.h
+++ b/flash.h
@@ -87,6 +87,7 @@ enum write_granularity {
write_gran_528bytes, /* If less than 528 bytes are written, the unwritten bytes are undefined. */
write_gran_1024bytes, /* If less than 1024 bytes are written, the unwritten bytes are undefined. */
write_gran_1056bytes, /* If less than 1056 bytes are written, the unwritten bytes are undefined. */
+ write_gran_1byte_implicit_erase, /* EEPROMs and other chips with implicit erase and 1-byte writes. */
};
/*
diff --git a/flashrom.c b/flashrom.c
index 8e5d363..408c555 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -766,6 +766,10 @@ int need_erase(const uint8_t *have, const uint8_t *want, unsigned int len, enum
case write_gran_1056bytes:
result = need_erase_gran_bytes(have, want, len, 1056);
break;
+ case write_gran_1byte_implicit_erase:
+ /* Do not erase, handle content changes from anything->0xff by writing 0xff. */
+ result = 0;
+ break;
default:
msg_cerr("%s: Unsupported granularity! Please report a bug at "
"flashrom@flashrom.org\n", __func__);
@@ -807,6 +811,7 @@ static unsigned int get_next_write(const uint8_t *have, const uint8_t *want, uns
switch (gran) {
case write_gran_1bit:
case write_gran_1byte:
+ case write_gran_1byte_implicit_erase:
stride = 1;
break;
case write_gran_256bytes:
OpenPOWER on IntegriCloud