summaryrefslogtreecommitdiff
path: root/include/task.h
diff options
context:
space:
mode:
authorBrian J. Nemec <bnemec@google.com>2022-02-07 09:24:37 -0800
committerCommit Bot <commit-bot@chromium.org>2022-02-15 21:31:20 +0000
commit3027a7553e51785be1395af10b9545aa1a32ff99 (patch)
tree8eeddf54e82ccc19d3fb4ec6bec2ca5b17f2656d /include/task.h
parent0f6242e8bd99e0b1fe4d2f15e95bf48eb7daa516 (diff)
downloadchrome-ec-3027a7553e51785be1395af10b9545aa1a32ff99.tar.gz
stm32: Add the DFU Boot Manager
Added the DFU Boot Manager to control the switch between the DFU and main application region. The DFU Bootmanager performs self checks when the application boots. If any of the following conditions are true it will jump into DFU: * The system backup registers contain a 'Jump to DFU' request. * The start of the RW region is erased indicating the prior firmware update has failed. * An optional check can be enabled to record the number of consecutive unexpected reboots which will be useful for developer test images to avoid locked systems. Testing requires enabling multiple configuration settings set in the follower CL which enables it on Servo_v4. dfu-util version 0.9 lacks the 'leave' parameter required to automatically jump out, systems using this would need to be power cycled to leave DFU. BRANCH=servo BUG=b:217955677 TEST=Enabled the DFU configuration on a Servo_v4. Verified that the runtime identifier is correctly recognized by dfu-util and pydfu.py implementations of the DFU host protocol. Verified firmware updates via the DFU protocol function correctly. TEST=sudo dfu-util -a 0 -s 0x08000000:leave -e -D ec.bin Verified that dfu-util can program the application region. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: Ie535efc91318244574949542c03efa0b5973cbe5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3443960 Tested-by: Brian Nemec <bnemec@google.com> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Brian Nemec <bnemec@google.com>
Diffstat (limited to 'include/task.h')
-rw-r--r--include/task.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/task.h b/include/task.h
index a99c2af79e..d2a19e7a52 100644
--- a/include/task.h
+++ b/include/task.h
@@ -463,7 +463,9 @@ struct irq_def {
/* Include ec.irqlist here for compilation dependency */
#define ENABLE_IRQ(x)
+#if !defined(CONFIG_DFU_BOOTMANAGER_MAIN)
#include "ec.irqlist"
+#endif /* !defined(CONFIG_DFU_BOOTMANAGER_MAIN) */
#endif /* CONFIG_COMMON_RUNTIME */
#endif /* !CONFIG_ZEPHYR */