diff options
author | Nikolai Artemiev <nartemiev@google.com> | 2023-05-03 11:05:07 +1000 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2023-05-09 07:43:23 +0000 |
commit | 00c9fac2a66ab2aafc6949166dfc733fd0b747ea (patch) | |
tree | 0093e9304ae7d4c657fed35cc47ca7a8ba313921 /spi25_statusreg.c | |
parent | fc6a09ba1fe76472a5b5959008cd699eeccd25d5 (diff) | |
download | flashrom-00c9fac2a66ab2aafc6949166dfc733fd0b747ea.tar.gz flashrom-00c9fac2a66ab2aafc6949166dfc733fd0b747ea.tar.bz2 flashrom-00c9fac2a66ab2aafc6949166dfc733fd0b747ea.zip |
flashrom: Use WP-based unlocking on opaque masters
Flashrom only tries to use WP-based unlocking if it detects that WP
operations are supported. However WP support was detected in a way that
ignored WP operations provided by opaque masters.
This stopped flashrom from automatically unlocking with some opaque
masters, particularly linux_mtd.
This commit also deletes part of a test that required the chip unlock
function to be called before read/write/erase operations because WP
unlocking is now used instead of chip unlocking.
BUG=b:280111380
BRANCH=none
TEST=Checked flashrom automatically unlocked flash on strongbad (MTD)
Change-Id: I1774ad64d82ae47cd085df6045e17e283855c01f
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/74930
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Diffstat (limited to 'spi25_statusreg.c')
-rw-r--r-- | spi25_statusreg.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/spi25_statusreg.c b/spi25_statusreg.c index 60e0b46b2..fa276f7d0 100644 --- a/spi25_statusreg.c +++ b/spi25_statusreg.c @@ -914,9 +914,6 @@ static int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash) return spi_disable_blockprotect_bp2_srwd(flash); } -/* special unit-test hook */ -blockprotect_func_t *g_test_unlock_injector; - blockprotect_func_t *lookup_blockprotect_func_ptr(const struct flashchip *const chip) { switch (chip->unlock) { @@ -948,7 +945,6 @@ blockprotect_func_t *lookup_blockprotect_func_ptr(const struct flashchip *const return lookup_82802ab_blockprotect_func_ptr(chip); case UNLOCK_SST_FWHUB: return unlock_sst_fwhub; /* sst_fwhub.c */ case UNPROTECT_28SF040: return unprotect_28sf040; /* sst28sf040.c */ - case TEST_UNLOCK_INJECTOR: return g_test_unlock_injector; /* default: non-total function, 0 indicates no unlock function set. * We explicitly do not want a default catch-all case in the switch * to ensure unhandled enum's are compiler warnings. |