diff options
author | Tom Hughes <tomhughes@chromium.org> | 2019-05-30 11:29:11 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-31 17:21:48 -0700 |
commit | 1a457a125b832b411d4653ecbdc5e1f03f45ae47 (patch) | |
tree | 0f3ae48d40b8d01832ba925a36612e31ecb5d5f9 /util | |
parent | 06b2bd507f7b64267d4e73885c354c917a9dfa5b (diff) | |
download | chrome-ec-1a457a125b832b411d4653ecbdc5e1f03f45ae47.tar.gz |
util: update hardware write protect check for flash_fp_mcu
This method of checking seems more robust across devices. The old way
did not work on hatch.
BRANCH=none
BUG=b:124405913
TEST=make buildall -j
TEST=flash_fp_mcu /opt/google/biod/fw/nocturne_fp_v2.2.110-b936c0a3c.bin
TEST=flash_fp_mcu /opt/google/biod/fw/hatch_fp_v2.0.1359-6f54be08d.bin
Change-Id: I513f8bc5dafcdec7a95ac38657a342b3af509ccc
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1637584
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/flash_fp_mcu_common.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/flash_fp_mcu_common.sh b/util/flash_fp_mcu_common.sh index 5ef9029f92..ef70bc61e1 100644 --- a/util/flash_fp_mcu_common.sh +++ b/util/flash_fp_mcu_common.sh @@ -25,8 +25,10 @@ echo "$(readlink -f "$0")" readonly CROS_EC_SPI_MODALIAS_STR="of:NcrfpTCgoogle,cros-ec-spi" check_hardware_write_protect_disabled() { - if ectool gpioget EC_WP_L | grep -q '= 0'; then - echo "Please make sure WP is deasserted." + local hardware_write_protect_state="$(crossystem wpsw_cur)" + if [[ "${hardware_write_protect_state}" != "0" ]]; then + echo "Please make sure hardware write protect is disabled." + echo "See https://www.chromium.org/chromium-os/firmware-porting-guide/firmware-ec-write-protection" exit 1 fi } |