David Hendricks has posted comments on this change. ( https://review.coreboot.org/23203 )
Change subject: Add support to get layout from fmap (e.g. coreboot rom) ......................................................................
Patch Set 16:
(3 comments)
https://review.coreboot.org/#/c/23203/17/cli_classic.c File cli_classic.c:
https://review.coreboot.org/#/c/23203/17/cli_classic.c@57 PS17, Line 57: --fmap <fmapfile> read ROM layout from binary containing <fmapfile>"
needs to be updated.
Nice catch - done.
https://review.coreboot.org/#/c/23203/18/libflashrom.c File libflashrom.c:
https://review.coreboot.org/#/c/23203/18/libflashrom.c@462 PS18, Line 462: for (offset = 0; : offse This does two things: - Makes the stride fall within the length passed into the function. - Makes the stride align with block boundaries on the chip.
We could also try setting the stride based on rom_offset and len, e.g. 'stride = log2(len) / 2' in the loop initialization, but that requires adding -lm to link options or implementing our own log2().
https://review.coreboot.org/#/c/23203/18/libflashrom.c@479 PS18, Line 479: break; Updated to use rom_offset + len instead of chip_size to enforce the boundaries passed into the function.