diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2022-07-25 00:23:25 +0300 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-19 06:59:30 +0000 |
commit | 994de3ae946820dd6e03eb600e2e623e917845a4 (patch) | |
tree | b395e86c94c73bcc2c256b26e98d16725fc2d599 /include | |
parent | 125a328b4d8445f41c9fdde9e51c1b2bb40ad72e (diff) | |
download | flashrom-994de3ae946820dd6e03eb600e2e623e917845a4.tar.gz flashrom-994de3ae946820dd6e03eb600e2e623e917845a4.tar.bz2 flashrom-994de3ae946820dd6e03eb600e2e623e917845a4.zip |
writeprotect_ranges.c: add more range functions
Not all chips follow the same pattern. There are differences in how CMP
bit is treated or in block size used.
Change-Id: Ied7b27be2ee2426af8f473432e2b01a290de2365
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66212
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/chipdrivers.h | 3 | ||||
-rw-r--r-- | include/flash.h | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/chipdrivers.h b/include/chipdrivers.h index 3b07afe3..34e3af8d 100644 --- a/include/chipdrivers.h +++ b/include/chipdrivers.h @@ -216,5 +216,8 @@ int spi_block_erase_emulation(struct flashctx *flash, unsigned int addr, unsigne /* writeprotect_ranges.c */ void decode_range_spi25(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); +void decode_range_spi25_64k_block(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); +void decode_range_spi25_bit_cmp(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); +void decode_range_spi25_2x_block(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); #endif /* !__CHIPDRIVERS_H__ */ diff --git a/include/flash.h b/include/flash.h index 23222c72..b4b56fe0 100644 --- a/include/flash.h +++ b/include/flash.h @@ -224,8 +224,11 @@ struct reg_bit_info { struct wp_bits; enum decode_range_func { - NO_DECODE_RANGE_FUNC = 0, /* 0 indicates no range decode funciton is set. */ + NO_DECODE_RANGE_FUNC = 0, /* 0 indicates no range decode function is set. */ DECODE_RANGE_SPI25 = 1, + DECODE_RANGE_SPI25_64K_BLOCK = 2, + DECODE_RANGE_SPI25_BIT_CMP = 3, + DECODE_RANGE_SPI25_2X_BLOCK = 4, }; typedef void (decode_range_func_t)(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); |