diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-02-10 15:23:46 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-12 02:10:19 +0000 |
commit | 6776d3250648aab3c685c0a4de372094aba7d742 (patch) | |
tree | 55b2625b61aba14937b92bea5018a3ce4612dba8 /util | |
parent | 544eb013c83fbd2fcb3ea485cb6e271ece931083 (diff) | |
download | chrome-ec-6776d3250648aab3c685c0a4de372094aba7d742.tar.gz |
flash_ec: look for npcx_monitor.bin relative to EC image
Given a local EC build, npcx_monitor.bin can be found at a well known
location relative to ec.bin (chip/npcx/spiflashfw). So, add that to the
search path. flash_ec was failing to find npcx_monitor.bin when only
using the --image flag for a local build:
util/flash_ec --image build/${BOARD}/ec.bin
as it was looking for npcx_monitor.bin in the same directory as ec.bin.
The layout in /build/${BOARD}/firmware/... has ec.bin and
npcx_monitor.bin in the same directory, but a local build in the EC tree
uses build/${BOARD}/chip/npcx/spiflashfw/npcx_monitor.bin.
Also, adding the ${BOARD} environment variable as the default board type
when --board is not specified. This matches the behavior of the
makefiles. In this case, we can invoke flash_ec without arguments.
BRANCH=none
BUG=b:132350402
TEST=used flash_ec to update the EC on brya
Change-Id: I669f52cc4fe480ae23914d9fcbe67aadd18ed6c3
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2689597
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-x | util/flash_ec | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/flash_ec b/util/flash_ec index b2ac32720c..34d2ac0544 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -275,7 +275,7 @@ function dut_control_get_or_die { die "command exited $? (non-zero): dut-control --value_only $*" } -BOARD=${FLAGS_board} +: ${BOARD:=${FLAGS_board}} in_array() { local n=$# @@ -1406,6 +1406,7 @@ function flash_npcx_uut() { # the same path as the EC binary. local MON="" for dir in \ + "$(dirname "$IMG")/chip/npcx/spiflashfw" \ "$(dirname "$IMG")" \ "${EC_DIR}/build/${BOARD}/chip/npcx/spiflashfw" \ "$(dirname "$LOCAL_BUILD")" \ |