Boot: add original files from MCUBoot and Zephyr project
Aligned with MCUBoot version 1.0.0
MCUBoot files:
-- bl2/ext/mcuboot
Aligned with Zephyr version 1.10.0
Zephyr files:
-- bl2/ext/mcuboot/include/util.h
-- platform/ext/target/common/flash.h
Change-Id: I314c3efa2bd2c13a4a2eaefeb5da43e53e988638
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
diff --git a/bl2/ext/mcuboot/include/target.h b/bl2/ext/mcuboot/include/target.h
new file mode 100644
index 0000000..9ccc032
--- /dev/null
+++ b/bl2/ext/mcuboot/include/target.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017, Linaro Ltd
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#ifndef H_TARGETS_TARGET_
+#define H_TARGETS_TARGET_
+
+#if defined(MCUBOOT_TARGET_CONFIG)
+/*
+ * Target-specific definitions are permitted in legacy cases that
+ * don't provide the information via DTS, etc.
+ */
+#include MCUBOOT_TARGET_CONFIG
+#else
+/*
+ * Otherwise, the Zephyr SoC header and the DTS provide most
+ * everything we need.
+ */
+#include <soc.h>
+
+#define FLASH_ALIGN FLASH_WRITE_BLOCK_SIZE
+
+/*
+ * TODO: remove soc_family_kinetis.h once its flash driver supports
+ * FLASH_PAGE_LAYOUT.
+ */
+#if defined(CONFIG_SOC_FAMILY_KINETIS)
+#include "soc_family_kinetis.h"
+#endif
+#endif /* !defined(MCUBOOT_TARGET_CONFIG) */
+
+/*
+ * Sanity check the target support.
+ */
+#if !defined(FLASH_DRIVER_NAME) || \
+ !defined(FLASH_ALIGN) || \
+ !defined(FLASH_AREA_IMAGE_0_OFFSET) || \
+ !defined(FLASH_AREA_IMAGE_0_SIZE) || \
+ !defined(FLASH_AREA_IMAGE_1_OFFSET) || \
+ !defined(FLASH_AREA_IMAGE_1_SIZE) || \
+ !defined(FLASH_AREA_IMAGE_SCRATCH_OFFSET) || \
+ !defined(FLASH_AREA_IMAGE_SCRATCH_SIZE)
+#error "Target support is incomplete; cannot build mcuboot."
+#endif
+
+#endif