mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
writeprotect: add get_wp_range() for decoding ranges
BUG=b:195381327,b:153800563 BRANCH=none TEST=flashrom --wp-{status,range} at end of patch series Change-Id: I5a1dfcf384166b1bac319d286306747e1dcaa000 Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/59183 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
9fc100f549
commit
2c3a2d66a9
@ -150,9 +150,17 @@ static enum flashrom_wp_result write_wp_bits(struct flashctx *flash, struct wp_b
|
||||
return FLASHROM_WP_OK;
|
||||
}
|
||||
|
||||
/** Get the range selected by a WP configuration. */
|
||||
static enum flashrom_wp_result get_wp_range(struct wp_range *range, struct flashctx *flash, const struct wp_bits *bits)
|
||||
{
|
||||
flash->chip->decode_range(&range->start, &range->len, bits, flashrom_flash_getsize(flash));
|
||||
|
||||
return FLASHROM_WP_OK;
|
||||
}
|
||||
|
||||
static bool chip_supported(struct flashctx *flash)
|
||||
{
|
||||
return false;
|
||||
return (flash->chip != NULL) && (flash->chip->decode_range != NULL);
|
||||
}
|
||||
|
||||
enum flashrom_wp_result wp_read_cfg(struct flashrom_wp_cfg *cfg, struct flashctx *flash)
|
||||
@ -166,11 +174,11 @@ enum flashrom_wp_result wp_read_cfg(struct flashrom_wp_cfg *cfg, struct flashctx
|
||||
if (ret == FLASHROM_WP_OK)
|
||||
ret = read_wp_bits(&bits, flash);
|
||||
|
||||
/* TODO: implement get_wp_range() and get_wp_mode() and call them */
|
||||
/*
|
||||
if (ret == FLASHROM_WP_OK)
|
||||
ret = get_wp_range(&cfg->range, flash, &bits);
|
||||
|
||||
/* TODO: implement and get_wp_mode() and call it */
|
||||
/*
|
||||
if (ret == FLASHROM_WP_OK)
|
||||
ret = get_wp_mode(&cfg->mode, &bits);
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user