zephyr: restore device tree overlay
0e3fa72df4849eb42c99efb34b8617046c2e33cb removed device tree overlay
that is required to flash mcuboot to correct partition and CMake
variable that pointed to it. Restore it.
Do not restore adding "boards/${BOARD}.overlay" to the list since Zephyr
detects this file automatically now - see https://docs.zephyrproject.org/latest/application/index.html#devicetree-overlays
Signed-off-by: Sergey Koziakov <dya.eshshmai@gmail.com>
diff --git a/boot/zephyr/CMakeLists.txt b/boot/zephyr/CMakeLists.txt
index 1c334c1..f559844 100644
--- a/boot/zephyr/CMakeLists.txt
+++ b/boot/zephyr/CMakeLists.txt
@@ -6,6 +6,19 @@
cmake_minimum_required(VERSION 3.13.1)
+# Add a common dts overlay necessary to ensure mcuboot is linked into,
+# and fits inside, the boot partition. (If the user specified a
+# DTC_OVERLAY_FILE on the CMake command line, we need to append onto
+# the list).
+if(DTC_OVERLAY_FILE)
+ set(DTC_OVERLAY_FILE
+ "${DTC_OVERLAY_FILE} ${CMAKE_CURRENT_LIST_DIR}/dts.overlay"
+ CACHE STRING "" FORCE
+ )
+else()
+ set(DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/dts.overlay)
+endif()
+
# Enable Zephyr runner options which request mass erase if so
# configured.
#