aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNikolai Artemiev <nartemiev@google.com>2022-11-29 17:30:09 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2022-12-16 00:04:09 +0000
commit7902b2b51152980067ed456e31e7b0b8862a4dc7 (patch)
tree4b07a550413b87839bebbf90e93cd8c80b62ec69 /include
parente712c39507cdb98e0d958e9bfe14867f046569a9 (diff)
downloadflashrom-7902b2b51152980067ed456e31e7b0b8862a4dc7.tar.gz
flashrom-7902b2b51152980067ed456e31e7b0b8862a4dc7.tar.bz2
flashrom-7902b2b51152980067ed456e31e7b0b8862a4dc7.zip
programmer: Add get_region to spi/opaque masters
Add a get_region function to spi and opaque masters so that they can expose access permissions for multiple regions within the flash. A get_region() implementation is added for the ichspi driver in a following patch. Finally, another patch uses get_region() to make read_flash() and write_flash() skip inaccessable regions, making read, write, and erase operations work on Intel platforms with active an CSME coprocessor. This logic will be integrated with layout in the future, but for now this moves ichspi support forward without making refactoring too hard later on. BUG=b:260440773 BRANCH=none TEST=ninja test Change-Id: I8c43f6b705f36ef18842a04ba6241d3a0b36b232 Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/70126 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'include')
-rw-r--r--include/programmer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/programmer.h b/include/programmer.h
index aaa14071..67e7b4a9 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -313,6 +313,7 @@ struct spi_master {
int (*shutdown)(void *data);
bool (*probe_opcode)(const struct flashctx *flash, uint8_t opcode);
void (*delay) (const struct flashctx *flash, unsigned int usecs);
+ void (*get_region)(const struct flashctx *flash, unsigned int addr, struct flash_region *region);
void *data;
};
@@ -416,6 +417,7 @@ struct opaque_master {
enum flashrom_wp_result (*wp_write_cfg)(struct flashctx *, const struct flashrom_wp_cfg *);
enum flashrom_wp_result (*wp_read_cfg)(struct flashrom_wp_cfg *, struct flashctx *);
enum flashrom_wp_result (*wp_get_ranges)(struct flashrom_wp_ranges **, struct flashctx *);
+ void (*get_region)(const struct flashctx *flash, unsigned int addr, struct flash_region *region);
int (*shutdown)(void *data);
void *data;
};