1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

Add support for 128 bytes write granularity

Some chips such as the ENE KB9012 internal flash require a write
granularity of 128 bytes.

Corresponding to flashrom svn r1897.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Acked-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Paul Kocialkowski 2015-10-16 02:16:20 +00:00 committed by Stefan Tauner
parent 557eb4ff18
commit c8305e1dee
2 changed files with 7 additions and 0 deletions

View File

@ -85,6 +85,7 @@ enum write_granularity {
write_gran_1bit, /* Each bit can be cleared individually. */ write_gran_1bit, /* Each bit can be cleared individually. */
write_gran_1byte, /* A byte can be written once. Further writes to an already written byte cause write_gran_1byte, /* A byte can be written once. Further writes to an already written byte cause
* its contents to be either undefined or to stay unchanged. */ * its contents to be either undefined or to stay unchanged. */
write_gran_128bytes, /* If less than 128 bytes are written, the unwritten bytes are undefined. */
write_gran_264bytes, /* If less than 264 bytes are written, the unwritten bytes are undefined. */ write_gran_264bytes, /* If less than 264 bytes are written, the unwritten bytes are undefined. */
write_gran_512bytes, /* If less than 512 bytes are written, the unwritten bytes are undefined. */ write_gran_512bytes, /* If less than 512 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_528bytes, /* If less than 528 bytes are written, the unwritten bytes are undefined. */

View File

@ -781,6 +781,9 @@ int need_erase(const uint8_t *have, const uint8_t *want, unsigned int len, enum
break; break;
} }
break; break;
case write_gran_128bytes:
result = need_erase_gran_bytes(have, want, len, 128);
break;
case write_gran_256bytes: case write_gran_256bytes:
result = need_erase_gran_bytes(have, want, len, 256); result = need_erase_gran_bytes(have, want, len, 256);
break; break;
@ -847,6 +850,9 @@ static unsigned int get_next_write(const uint8_t *have, const uint8_t *want, uns
case write_gran_1byte_implicit_erase: case write_gran_1byte_implicit_erase:
stride = 1; stride = 1;
break; break;
case write_gran_128bytes:
stride = 128;
break;
case write_gran_256bytes: case write_gran_256bytes:
stride = 256; stride = 256;
break; break;