Attention is currently required from: Nico Huber, Angel Pons, Sergii Dmytruk. Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58480 )
Change subject: flashchips,writeprotect_ranges: add range decoding function ......................................................................
Patch Set 30:
(1 comment)
File flash.h:
https://review.coreboot.org/c/flashrom/+/58480/comment/83cbc782_b5807fce PS23, Line 203: const struct flashrom_wp_chip_config *cfg, uint32_t chip_len
It seems this is exactly the input we need for the `w25` implementation. […]
Having the chip's length is quite convenient for w25 chips since their ranges generalize very nicely with the length, but I don't think it's overspecialized and some other chip families have similar patterns.
We could go with a full `struct flashchip` input, but I'm hesitant to let the functions know too much in case they start accumulating special cases based on random chip details.
We should keep the inputs to the functions data-only, since they should just define config bits -> protection range mappings in a convenient way. If the function takes a flashctx, we can't construct a bidirectional mapping between config bit values and protection ranges.