summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2019-08-14 17:57:08 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-15 23:23:14 +0000
commit127d89622a133e6b29e0f07b899cb7987b07c31c (patch)
treed6f063ab3889670825208210c82848000f46ee46
parentc0ec57469c658ba82fce583ecfd0af189cc6cdd8 (diff)
downloadchrome-ec-127d89622a133e6b29e0f07b899cb7987b07c31c.tar.gz
util: make flash_ec tolerant with dummy npcx_uut chip
flash_ec fails when npcx_uut chip in a bad status doesn't respond at all, especially upon ec_flash_size query. This patch subpress the exit on ec_flash_size query failure, because that information is not mandatory in flashing EC. BUG=none BRANCH=none TEST=manualy tested on kohaku. 1. programmed kohaku EC with a wrong binary. 2. checked kohaku EC in a bad status, and was not able to respond. 3. ran flash_ec and checked flash_ec finished EC FW program. e.g. flash_ec --board kohaku --image ${IMG} 4. read EC firmware back. e.g. flash_ec --board kohaku --read ${TMP_IMG} Change-Id: Ic853dd9f827217621cd598c799c68fbbf970078a Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753009 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rwxr-xr-xutil/flash_ec6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/flash_ec b/util/flash_ec
index aea6e25d72..0f2d09792d 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -1234,8 +1234,10 @@ function flash_npcx_uut() {
# The start address to restore monitor firmware binary
local MON_ADDR="0x200C3020"
local BASE_ADDR="0x64000000" # The base flash memory address
- local FLASH_SIZE=$(( $(dut_control_get ec_flash_size)*1024 ))
- # EC Flash memory size
+ local FLASH_SIZE # EC Flash memory size
+
+ FLASH_SIZE=$(dut_control_get ec_flash_size) \
+ && FLASH_SIZE=$(( ${FLASH_SIZE}*1024 )) || true
if [ ! -x "$NPCX_UUT" ]; then
die "no NPCX UART Update Tool found."