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/66334cbb_43abe22f PS55, Line 82: layout[layout_idx].layout_list[block_num].start_addr = start_addr; : layout[layout_idx].layout_list[block_num].end_addr = end_addr; : layout[layout_idx].layout_list[block_num].selected = false; : layout[layout_idx].layout_list[block_num].block_num = block_num; : if (layout_idx > 0) { : layout[layout_idx].layout_list[block_num].first_sub_block_index = sub_block_index; : while (layout[layout_idx-1].layout_list[sub_block_index].start_addr >= start_addr && : layout[layout_idx-1].layout_list[sub_block_index].end_addr <= end_addr && : sub_block_index < layout[layout_idx-1].block_count) { : sub_block_index++; : } : layout[layout_idx].layout_list[block_num].last_sub_block_index = sub_block_index - 1; : } ``` static void init_eraseblock(struct erase_layout *layout, size_t idx, size_t block_num, [..]) { struct eraseblock_data *edata = &layout[idx].layout_list[block_num];
edata->start_addr = start_addr; edata->end_addr = end_addr; edata->selected = false; edata->block_num = block_num;
if (!idx) return;
edata->first_sub_block_index = sub_block_index;
do { struct eraseblock_data *subedata = &layout[idx - 1].layout_list[sub_block_index]; const sub_block_count = layout[idx - 1].block_count; bool sub_block_inc = subedata->start_addr >= start_addr && subedata->end_addr <= end_addr && sub_block_index < sub_block_count;
sub_block_index++; } while (sub_block_inc);
edata->last_sub_block_index = sub_block_index - 1; } ```
something like this.