summaryrefslogtreecommitdiff
path: root/board/hammer
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-08-16 15:29:48 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-03 08:50:35 -0700
commit6e853562c94698916c7f582df064a154b154f3d6 (patch)
tree03c73850fb25dc7179e3d9fd64982a50316b34e6 /board/hammer
parent5cd66ffe1698b94cb83bb05732af01e95f2f2510 (diff)
downloadchrome-ec-6e853562c94698916c7f582df064a154b154f3d6.tar.gz
usb_update: add extra command "UPDATE_EXTRA_CMD_CONSOLE_READ_*"
Similar to corressponding host commands, we can read uart console buffer by following ways: A. Read from the beginning of buffer to the end of buffer: # 1. set snapshot before reading UPDATE_EXTRA_CMD_CONSOLE_READ_INIT while (true) { # 2. read 64 bytes back UPDATE_EXTRA_CMD_CONSOLE_READ_NEXT CONSOLE_READ_NEXT # 3. if (2) returns an empty string, break, otherwise, continue. } B. Mimic `dmesg -w` (keep reading new messages) while (true) { # 1. set snapshot before reading UPDATE_EXTRA_CMD_CONSOLE_READ_INIT while (true) { # 2. read 64 bytes back UPDATE_EXTRA_CMD_CONSOLE_READ_NEXT CONSOLE_READ_RECENT # 3. if (2) returns an empty string, break, otherwise, continue. } } Add argument `-l` to usb_updater2, which will perform (B). Note that the update interface will be occupied while `usb_updater2 -l` is still running, so you can't use other updater command at the same time. BRANCH=none BUG=b:112877237 TEST=test on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I8d2010f84602ca6b84034a0cabe42ae7441614e0 Reviewed-on: https://chromium-review.googlesource.com/1177293 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'board/hammer')
-rw-r--r--board/hammer/board.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h
index 9e48463a98..d797e198cd 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -282,6 +282,8 @@
#define CONFIG_USB_PAIRING
+#define CONFIG_USB_CONSOLE_READ
+
#ifdef BOARD_WAND
/* Battery and charger options. */
#define CONFIG_CHARGER