flashrom.c: Write whole layout regions at once

We used to write per erase block, right after erasing in case
we had to. To ease integration of a new erase-block selection,
the write step is postponed now, after all blocks in a region
that need erasing are erased.

This also moves the decision whether to call erase_block() on
a given block to a higher level and prepares for the new erase-
block selection algorithm.

Change-Id: I325c4873f9bde8183e9f43239929075ac31b80cc
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72550
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
1 file changed