Boot: Verify address when using loading to RAM
Add macros to define the range of RAM that should be used for executing
images. Validate that images will be loaded inside this region before
copying them.
Change-Id: I75bb9ee5f8369856b2dc4870752ed3c6a0e5c716
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/bl2/ext/mcuboot/include/target.h b/bl2/ext/mcuboot/include/target.h
index 728541c..256f725 100644
--- a/bl2/ext/mcuboot/include/target.h
+++ b/bl2/ext/mcuboot/include/target.h
@@ -21,6 +21,18 @@
#error "FLASH_AREA_IMAGE_SECTOR_SIZE must be defined by the target"
#endif
+#ifdef MCUBOOT_RAM_LOADING
+#ifndef IMAGE_EXECUTABLE_RAM_START
+#error "If MCUBOOT_RAM_LOADING is set then IMAGE_EXECUTABLE_RAM_START must be \
+defined by the target"
+#endif
+
+#ifndef IMAGE_EXECUTABLE_RAM_SIZE
+#error "If MCUBOOT_RAM_LOADING is set then IMAGE_EXECUTABLE_RAM_SIZE must be \
+defined by the target"
+#endif
+#endif /* MCUBOOT_RAM_LOADING */
+
#ifndef FLASH_AREA_0_OFFSET
#error "FLASH_AREA_0_OFFSET must be defined by the target"
#endif