zephyr: restructure the build process to use board config files
Move the board specific configurations into its own header file, which
can now be created per board, once it gets tested and validated by the
bootloader.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index 800fe51..026fc92 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -19,17 +19,15 @@
#include <flash.h>
#include <asm_inline.h>
-#include "bootutil/image.h"
-#include "bootutil/bootutil.h"
-
-#if defined(CONFIG_BOARD_FRDM_K64F)
-#define BOOT_FLASH "KSDK_FLASH"
-#elif defined(CONFIG_BOARD_96B_CARBON)
-#define BOOT_FLASH "STM32F4_FLASH"
+#if defined(MCUBOOT_TARGET_CONFIG)
+#include MCUBOOT_TARGET_CONFIG
#else
#error "Board is currently not supported by bootloader"
#endif
+#include "bootutil/image.h"
+#include "bootutil/bootutil.h"
+
struct device *boot_flash_device;
struct vector_table {
@@ -47,7 +45,7 @@
os_heap_init();
- boot_flash_device = device_get_binding(BOOT_FLASH);
+ boot_flash_device = device_get_binding(FLASH_DRIVER_NAME);
if (!boot_flash_device) {
printk("Flash device not found\n");
while (1)