zephyr: force mcuboot to fit in the boot partition
Add a DTC overlay file which uses the boot partition as the code
partition.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
diff --git a/Makefile b/Makefile
index 1e9ec42..533aff2 100644
--- a/Makefile
+++ b/Makefile
@@ -53,4 +53,7 @@
# Needed for mbedtls config-boot.h file.
CFLAGS += -I$(CURDIR)/boot/zephyr/include
+DTC_OVERLAY_FILE := $(CURDIR)/boot/zephyr/dts.overlay
+export DTC_OVERLAY_FILE
+
include ${ZEPHYR_BASE}/Makefile.inc
diff --git a/boot/zephyr/dts.overlay b/boot/zephyr/dts.overlay
new file mode 100644
index 0000000..74d3dfb
--- /dev/null
+++ b/boot/zephyr/dts.overlay
@@ -0,0 +1,5 @@
+/ {
+ chosen {
+ zephyr,code-partition = &boot_partition;
+ };
+};