layout: Verify that regions to be written are granularity aligned
This will be important with the new erase/write strategy when we don't
write per erase block anymore.
Change-Id: Ie3c74ff4313c9d72ac92d3226804e0407088c17d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72546
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/include/flash.h b/include/flash.h
index 38e583a..db19566 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -93,6 +93,8 @@
write_gran_1byte_implicit_erase, /* EEPROMs and other chips with implicit erase and 1-byte writes. */
};
+size_t gran_to_bytes(enum write_granularity);
+
/*
* How many different contiguous runs of erase blocks with one size each do
* we have for a given erase function?