summaryrefslogtreecommitdiff
path: root/board/twinkie/sniffer.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-12-20 09:51:37 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-08 23:55:58 +0000
commitccb46f6d8e9c141f22c9d9cfe25dfcd1d433e8a4 (patch)
tree6f401a44d436fc7058049075d7b72253f79da27d /board/twinkie/sniffer.c
parent49bfe43b905c1ca80d42b18dbed43d0a6270a012 (diff)
downloadchrome-ec-ccb46f6d8e9c141f22c9d9cfe25dfcd1d433e8a4.tar.gz
twinkie: build a combined firmware
Build a Twinkie firmware image with the regular Twinkie sniffer firmware in the RO partition and a firmware behaving as a USB PD sink in the RW partition. The user can call the "twinkie sink" command to switch the USB PD sink firmware in the RW partition (and call "reboot" if he changes his mind and wants the sniffer back). Restore the ability of building different tasklists which was broken where the tests build was simplified. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=make buildall ./board/twinkie/build_rw_variant Try "twinkie sink" command on a Twinkie with the combined firmware. Change-Id: Ie489ce97a774ae7a22ac639c49a3d6e412e62de8 Reviewed-on: https://chromium-review.googlesource.com/237221 Reviewed-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/twinkie/sniffer.c')
-rw-r--r--board/twinkie/sniffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/twinkie/sniffer.c b/board/twinkie/sniffer.c
index e1f2d5c8c2..f08bd8b68b 100644
--- a/board/twinkie/sniffer.c
+++ b/board/twinkie/sniffer.c
@@ -338,6 +338,13 @@ void recording_enable(uint8_t mask)
/* TODO implement */
}
+static void sniffer_sysjump(void)
+{
+ /* Stop DMA before jumping to avoid memory corruption */
+ recording_enable(0);
+}
+DECLARE_HOOK(HOOK_SYSJUMP, sniffer_sysjump, HOOK_PRIO_DEFAULT);
+
static int command_sniffer(int argc, char **argv)
{
ccprintf("Seq number:%d Overflows: %d\n", seq, oflow);