Enable serial only when required for Mynewt

For Mynewt when no logging (default option) or serial boot was selected,
avoid initializing all serial supporting system. This enables to save
flash space when only basic bootloader functionality is used.

Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/boot/mynewt/src/main.c b/boot/mynewt/src/main.c
index 1f2bb5e..ebafca3 100755
--- a/boot/mynewt/src/main.c
+++ b/boot/mynewt/src/main.c
@@ -38,6 +38,7 @@
 #include <console/console.h>
 #include "bootutil/image.h"
 #include "bootutil/bootutil.h"
+#include "bootutil/bootutil_log.h"
 
 #define BOOT_AREA_DESC_MAX    (256)
 #define AREA_DESC_MAX         (BOOT_AREA_DESC_MAX)
@@ -67,10 +68,14 @@
 
     hal_bsp_init();
 
+#if defined(MCUBOOT_SERIAL) || defined(MCUBOOT_HAVE_LOGGING)
     /* initialize uart without os */
     os_dev_initialize_all(OS_DEV_INIT_PRIMARY);
     sysinit();
     console_blocking_mode();
+#else
+    flash_map_init();
+#endif
 
 #ifdef MCUBOOT_SERIAL
     /*