mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
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 <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
parent
600576b43d
commit
1b0e9fc8ea
1
flash.h
1
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_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_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_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. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -766,6 +766,10 @@ int need_erase(const uint8_t *have, const uint8_t *want, unsigned int len, enum
|
|||||||
case write_gran_1056bytes:
|
case write_gran_1056bytes:
|
||||||
result = need_erase_gran_bytes(have, want, len, 1056);
|
result = need_erase_gran_bytes(have, want, len, 1056);
|
||||||
break;
|
break;
|
||||||
|
case write_gran_1byte_implicit_erase:
|
||||||
|
/* Do not erase, handle content changes from anything->0xff by writing 0xff. */
|
||||||
|
result = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
msg_cerr("%s: Unsupported granularity! Please report a bug at "
|
msg_cerr("%s: Unsupported granularity! Please report a bug at "
|
||||||
"flashrom@flashrom.org\n", __func__);
|
"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) {
|
switch (gran) {
|
||||||
case write_gran_1bit:
|
case write_gran_1bit:
|
||||||
case write_gran_1byte:
|
case write_gran_1byte:
|
||||||
|
case write_gran_1byte_implicit_erase:
|
||||||
stride = 1;
|
stride = 1;
|
||||||
break;
|
break;
|
||||||
case write_gran_256bytes:
|
case write_gran_256bytes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user