Mandate the presence of mcuboot_config/mcuboot_config.h

Mynewt uses this file to convert MYNEWT_VAL(xxx) to MCUBOOT_xxx config
options. Zephyr currently adds config options via the compiler command
line, but it should use this instead.

As prep work for that conversion, add an empty mcuboot_config.h to the
Zephyr port, and include this file unconditionally wherever it's
needed. This takes care of the simulator as well, since that puts
boot/zephyr/include on its C file include path.

This turned up a couple of files (bootutil_priv.h and caps.c) that
were using the MCUBOOT_xxx config values without including the
file. Add the includes there, as they'll be needed later.

To make this official, add it to the requirements in the porting guide
and provide a template file porters can use while getting started.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>

fixup! Mandate the presence of mcuboot_config/mcuboot_config.h
diff --git a/samples/mcuboot_config/mcuboot_config.template.h b/samples/mcuboot_config/mcuboot_config.template.h
new file mode 100644
index 0000000..e5f208c
--- /dev/null
+++ b/samples/mcuboot_config/mcuboot_config.template.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018 Open Source Foundries Limited
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#ifndef __MCUBOOT_CONFIG_H__
+#define __MCUBOOT_CONFIG_H__
+
+/*
+ * Template configuration file for MCUboot.
+ *
+ * When porting MCUboot to a new target, copy it somewhere that your
+ * include path can find it as mcuboot_config/mcuboot_config.h, and
+ * make adjustments to suit your platform.
+ *
+ * For examples, see:
+ *
+ * boot/zephyr/include/mcuboot_config/mcuboot_config.h
+ * boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h
+ */
+
+/*
+ * Signature types
+ *
+ * You must choose exactly one signature type.
+ */
+
+/* Uncomment for RSA signature support */
+/* #define MCUBOOT_SIGN_RSA */
+
+/* Uncomment for ECDSA signatures using curve P-256. */
+/* #define MCUBOOT_SIGN_EC256 */
+
+
+/*
+ * Upgrade mode
+ *
+ * The default is to support A/B image swapping with rollback.  A
+ * simpler code path, which only supports overwriting the
+ * existing image with the update image, is also available.
+ */
+
+/* Uncomment to enable the overwrite-only code path. */
+/* #define MCUBOOT_OVERWRITE_ONLY */
+
+#ifdef MCUBOOT_OVERWRITE_ONLY
+/* Uncomment to only erase and overwrite those slot 0 sectors needed
+ * to install the new image, rather than the entire image slot. */
+/* #define MCUBOOT_OVERWRITE_ONLY_FAST */
+#endif
+
+/*
+ * Cryptographic settings
+ *
+ * You must choose between mbedTLS and Tinycrypt as source of
+ * cryptographic primitives. Other cryptographic settings are also
+ * available.
+ */
+
+/* Uncomment to use ARM's mbedTLS cryptographic primitives */
+/* #define MCUBOOT_USE_MBED_TLS */
+/* Uncomment to use Tinycrypt's. */
+/* #define MCUBOOT_USE_TINYCRYPT */
+
+/*
+ * Always check the signature of the image in slot 0 before booting,
+ * even if no upgrade was performed. This is recommended if the boot
+ * time penalty is acceptable.
+ */
+#define MCUBOOT_VALIDATE_SLOT0
+
+/*
+ * Flash abstraction
+ */
+
+/* Uncomment if your flash map API supports flash_area_get_sectors().
+ * See the flash APIs for more details. */
+/* #define MCUBOOT_USE_FLASH_AREA_GET_SECTORS */
+
+#endif /* __MCUBOOT_CONFIG_H__ */