cros_ec: Attempt to disable EC soft WP prior to flashing
If hardware write-protection is disabled but EC soft WP has not been
disabled via "flashrom -p ec --wp-disable", the EC may still reject
erase/write commands. This is the case for CrOS ECs which use external
flash memory and do not need to be rebooted for WP changes to take
effect.
This patch attempts to disable EC soft WP prior to flashing and
restores it afterward if needed.
BUG=chromium:653652
BRANCH=r55
TEST=Tested on Reef (EC uses external SPI flash) and Veyron_mighty
(EC uses internal flash). On Reef, EC can now be fully re-flashed
once hardware WP is disabled. On Veyron_mighty, EC still needs to
be rebooted so this patch had no real effect and attempting to flash
still failed.
Change-Id: Ia75b0fc89d45dd4001cfaf0cf52bc319c2596710
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/396551
2 files changed