summaryrefslogtreecommitdiff
path: root/Makefile
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 /Makefile
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 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e0aff80f67..43712434a3 100644
--- a/Makefile
+++ b/Makefile
@@ -212,7 +212,8 @@ _mock_cfg := $(foreach t,$(_mock_lst) ,HAS_MOCK_$(t))
CPPFLAGS += $(foreach t,$(_mock_cfg),-D$(t)=$(EMPTY))
$(foreach c,$(_mock_cfg),$(eval $(c)=y))
-ifneq "$(CONFIG_COMMON_RUNTIME)" "y"
+ifneq ($(CONFIG_COMMON_RUNTIME),y)
+ifneq ($(CONFIG_DFU_BOOTMANAGER_MAIN),ro)
_irq_list:=$(shell $(CPP) $(CPPFLAGS) -P -Ichip/$(CHIP) -I$(BASEDIR) \
-I$(BDIR) -D"ENABLE_IRQ(x)=EN_IRQ x" \
-imacros chip/$(CHIP)/registers.h \
@@ -220,6 +221,7 @@ ifneq "$(CONFIG_COMMON_RUNTIME)" "y"
CPPFLAGS+=$(foreach irq,$(_irq_list),\
-D"irq_$(irq)_handler_optional=irq_$(irq)_handler")
endif
+endif
# Compute RW firmware size and offset
_rw_off_str:=$(shell echo "CONFIG_RW_MEM_OFF" | $(CPP) $(CPPFLAGS) -P \