From 1b0e9fc8ea313cdffc4d38548cb0c8577481a467 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Mon, 16 Jun 2014 22:36:17 +0000 Subject: EEPROM support: handle implicit erase Add support for EEPROMs with 1 byte granularity and implicit erase on write. flashrom will not try to erase before write on these chips. Explicitly requested erase with -E is done by writing 0xff. Corresponding to flashrom svn r1822. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Tauner --- flashrom.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'flashrom.c') 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: -- cgit v1.1