Hi,
I've looked at many patches now and feel pretty dazed.
While it's not ready yet (most probably because it didn't get a review), I'm in clear favor of Alexander's approach:
https://www.flashrom.org/pipermail/flashrom/2014-October/012967.html
It does what I'd expect of layout support, takes the erase blocks into account, and leaves the whole code in a better shape (gets rid of the ugly flow in doit()).
The separate functions for erase / read / verify reminded me of lib- flashrom, and that I actually wanted to rewrite doit() years ago to use the libflashrom functions. Which brings me to the following pro- posal:
1st take the modified walk_eraseregions() from Alexander's patch, 2nd rewrite the libflashrom patch to use it, 3rd rewrite doit() using libflashrom.
So far this would suffice my use case. However, it would overrun major features of Stefan's layout patch series: The new layout format and the `-i <image>[:<file>]` support. Well, the former seems orthogonal to the other changes, and the latter would require more work for a similar feature in libflashrom anyway.
So my main concern is that if I don't push forward libflashrom now, we will maintain two code paths until libflashrom is used internally by flashrom.
Any comments?
Best regards, Nico