Attention is currently required from: Simon Buhrow, Nico Huber, Thomas Heijligen, Paul Menzel, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/65879 )
Change subject: flashrom.c:Add function to get a flattened view of the chip erase blocks ......................................................................
Patch Set 55:
(1 comment)
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/65879/comment/a77259ce_7a9f939e PS55, Line 58: chipoff_t addr = 0; : : for (int i = 0; addr < chip->total_size * 1024; i++) { : const struct eraseblock *block = &chip->block_erasers[eraser_idx].eraseblocks[i]; : block_count += block->count; : addr += block->size * block->count; : } ``` static size_t calculate_block_count(const struct flashchip *chip, size_t eraser_idx) { size_t block_count = 0;
chipoff_t addr = 0; for (size_t i = 0; addr < chip->total_size * 1024; i++) { const struct eraseblock *block = &chip->block_erasers[eraser_idx].eraseblocks[i]; block_count += block->count; addr += block->size * block->count; }
return block_count; } ```