1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-06 08:07:07 +02:00

flashrom.c:Add function to get a flattened view of the chip erase blocks

Add a function to flatten out the addresses of the flash chip as per the
different erase functions. This function will return a list of layouts
which is dynamically allocated. So after use all the layouts as well as
the list itself should be freed. The free_erase_layout function does
that.

Change-Id: Iafe78de00daa55f7114bd4ce09465dd88074ece4
Signed-off-by: Aarya Chaumal <aarya.chaumal@gmail.com>
This commit is contained in:
Aarya Chaumal
2022-07-15 16:51:27 +05:30
committed by Simon Buhrow
parent dcdf301010
commit 22c621aed2
2 changed files with 95 additions and 0 deletions

View File

@ -359,6 +359,21 @@ struct flashrom_flashctx {
struct flashrom_progress *progress_state;
};
struct eraseblock_data {
chipoff_t start_addr;
chipoff_t end_addr;
bool selected;
size_t block_num;
size_t first_sub_block_index;
size_t last_sub_block_index;
};
struct erase_layout {
struct eraseblock_data* layout_list;
size_t block_count;
erasefunc_t* erasefn;
};
/* Timing used in probe routines. ZERO is -2 to differentiate between an unset
* field and zero delay.
*