diff options
author | Nikolai Artemiev <nartemiev@google.com> | 2022-02-13 22:32:59 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-04-05 23:47:46 +0000 |
commit | 9b20174fda038ef633af2163c9b1570f4dbf9a37 (patch) | |
tree | eb3b03cd25dc3e158c6c6de34f66bb7a79b70c99 /dummyflasher.c | |
parent | a850fd0aa8054a1125a9231fa3317428f15900f4 (diff) | |
download | flashrom-9b20174fda038ef633af2163c9b1570f4dbf9a37.tar.gz flashrom-9b20174fda038ef633af2163c9b1570f4dbf9a37.tar.bz2 flashrom-9b20174fda038ef633af2163c9b1570f4dbf9a37.zip |
libflashrom,linux_mtd: add linux_mtd writeprotect support
This commit adds a generic framework to allow opaque programmers to
implement writeprotect operations and uses the framework to support
writeprotect operations on linux MTD device files.
The generic framework comprises three new functions in
`struct opaque_master` that are called from libflashrom:
- wp_write_cfg()
- wp_read_cfg()
- wp_get_ranges()
For linux_mtd, only the read/write functions are implemented. Linux's
MTD interface doesn't provide a way to get available ranges, so calling
get_wp_ranges() on the linux_mtd master will return
FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE.
BUG=b:182223106
BRANCH=none
TEST=WP ops on hana DUT (MT8173) with W25Q32DW flash
TEST=flashrom --wp-enable --wp-range <non-empty> succeeds
TEST=flashrom --wp-enable --wp-range <empty> fails as expected
TEST=flashrom --wp-disable --wp-range <empty> succeeds
TEST=flashrom --wp-disable --wp-range <non-empty> fails as expected
TEST=flashrom --wp-status succeeds
Change-Id: I5c86e28cdec44bec49ba1d36f8ab62241b9b01da
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/61897
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'dummyflasher.c')
0 files changed, 0 insertions, 0 deletions