summaryrefslogtreecommitdiff
path: root/util/flash_ec
diff options
context:
space:
mode:
authorCHLin <CHLIN56@nuvoton.com>2018-03-07 14:33:43 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-04-18 02:07:59 -0700
commitdcaf8edc47c1703a760eff4d9ea12f68f8af492c (patch)
tree45cd1ce7771fb3f3305da88d097cf7ae51e6174e /util/flash_ec
parentb21f335c40568060cbd0b671d138f0ff69a47a05 (diff)
downloadchrome-ec-dcaf8edc47c1703a760eff4d9ea12f68f8af492c.tar.gz
util: uartupdatetool (UUT): Add tool to flash firmware by UART
When the FLPRG# strap pin is set to active low, and npcx7 chip is reset, it will enter uut mode. This CL adds the host tool to communicate with npcx chip in uut mode to flash ec firmware via UART port. BRANCH=none BUG=none TEST=No build errors for make buildall. TEST= ------------------------------------------------------------------------ 1. Connect the servo connector (J24) on npcx7 EVB to servo board v2 via flex cable. 2. Manually turn the switch SW1.6 to "ON" on npcx7 EVB. 3. Reset ec by issuing Power-Up or VCC1_RST reset. 4. Manually turn the switch SW1.6 to "OFF" on npcx7 EVB. 5. Move npcx7_evb from array BOARDS_NPCX_7M7X_JTAG to BOARDS_NPCX_UUT in flash_ec. 6. "./util/flash_ec --board=npcx7_evb." Change-Id: I2c588418e809e59f97ef4c3ad7ad13a3fef42f11 Signed-off-by: Dror Goldstein <dror.goldstein@nuvoton.com> Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/952037 Commit-Ready: CH Lin <chlin56@nuvoton.com> Tested-by: Alexandru M Stan <amstan@chromium.org> Tested-by: CH Lin <chlin56@nuvoton.com> Tested-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'util/flash_ec')
-rwxr-xr-xutil/flash_ec22
1 files changed, 11 insertions, 11 deletions
diff --git a/util/flash_ec b/util/flash_ec
index b0fbad8832..a91709ee7f 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -918,7 +918,7 @@ function flash_npcx_jtag() {
function flash_npcx_uut() {
TOOL_PATH="${EC_DIR}/build/${BOARD}/util:$PATH"
- NPCX_UUT=$(PATH="${TOOL_PATH}" which Uartupdatetool)
+ NPCX_UUT=$(PATH="${TOOL_PATH}" which uartupdatetool)
EC_UART="$(servo_ec_uart)"
BUILD_PATH="${EC_DIR}/build/${BOARD}"
@@ -944,9 +944,9 @@ function flash_npcx_uut() {
info "${MCU} UART pty : ${EC_UART}"
claim_pty ${EC_UART}
- # Remove the prefix "/dev/" because Uartupdatetool will add it.
+ # Remove the prefix "/dev/" because uartupdatetool will add it.
EC_UART=${EC_UART#/dev/}
- MON_PARAMS="-port ${EC_UART} -baudrate 115200"
+ MON_PARAMS="--port ${EC_UART} --baudrate 115200"
# Read the RO image size
EC_IMG_SIZE=$(printf "%08X" $(stat -c "%s" ${IMG_RO}))
@@ -959,13 +959,13 @@ function flash_npcx_uut() {
info "Start to flash RO image.."
# Start to program EC RO image
# Load monitor header binary to address 0x200C3000
- ${NPCX_UUT} ${MON_PARAMS} -opr wr -addr ${MON_HDR_ADDR} -file ${T}
+ ${NPCX_UUT} ${MON_PARAMS} --opr wr --addr ${MON_HDR_ADDR} --file ${T}
# Load monitor binary to address 0x200C3020
- ${NPCX_UUT} ${MON_PARAMS} -opr wr -addr ${MON_ADDR} -file ${MON}
+ ${NPCX_UUT} ${MON_PARAMS} --opr wr --addr ${MON_ADDR} --file ${MON}
# Load RO image to Code RAM range.
- ${NPCX_UUT} ${MON_PARAMS} -opr wr -addr ${EC_IMG_ADDR} -file ${IMG_RO}
+ ${NPCX_UUT} ${MON_PARAMS} --opr wr --addr ${EC_IMG_ADDR} --file ${IMG_RO}
# Execute the monitor to program RO image on SPI flash
- ${NPCX_UUT} ${MON_PARAMS} -opr call -addr ${MON_ADDR}
+ ${NPCX_UUT} ${MON_PARAMS} --opr call --addr ${MON_ADDR}
# Read the RW image size
EC_IMG_SIZE=$(printf "%08X" $(stat -c "%s" ${IMG_RW}))
@@ -978,13 +978,13 @@ function flash_npcx_uut() {
info "Start to flash RW image.."
# Start to program EC RW image
# Load monitor header binary to address 0x200C3000
- ${NPCX_UUT} ${MON_PARAMS} -opr wr -addr ${MON_HDR_ADDR} -file ${T}
+ ${NPCX_UUT} ${MON_PARAMS} --opr wr --addr ${MON_HDR_ADDR} --file ${T}
# Load monitor binary to address 0x200C3020
- ${NPCX_UUT} ${MON_PARAMS} -opr wr -addr ${MON_ADDR} -file ${MON}
+ ${NPCX_UUT} ${MON_PARAMS} --opr wr --addr ${MON_ADDR} --file ${MON}
# Load RW image to Code RAM range.
- ${NPCX_UUT} ${MON_PARAMS} -opr wr -addr ${EC_IMG_ADDR} -file ${IMG_RW}
+ ${NPCX_UUT} ${MON_PARAMS} --opr wr --addr ${EC_IMG_ADDR} --file ${IMG_RW}
# Execute the monitor to program RW image on SPI flash
- ${NPCX_UUT} ${MON_PARAMS} -opr call -addr ${MON_ADDR}
+ ${NPCX_UUT} ${MON_PARAMS} --opr call --addr ${MON_ADDR}
# Reconnect the EC-3PO interpreter to the UART.
dut_control ${MCU}_ec3po_interp_connect:on || \