enable serial recovery functionality on the zephyr mcuboot

This patch introduced serial bootloader functionality ported
from mynewt targets tree.

For achieving this following changes were applied:
- Modified boot_serial module for using, zephyr-os modules
  (crc driver, mbedtls-base64 library) and the zephyr serial adapter module
  introduced recently.
- Added service of boot serial recovery mode to main.
- Adapted the input parser to using static buffers.

Default serial-boot-pin configuration was added for nrf52_pca10040
and nrf52840_pca10056 boards.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/Kconfig b/Kconfig
index bcf196b..871e1e5 100644
--- a/Kconfig
+++ b/Kconfig
@@ -18,6 +18,7 @@
 	select REBOOT
 	select UART_INTERRUPT_DRIVEN
 	select SERIAL
+	select NEWLIB_LIBC
 	help
 	  Enable serial recovery feature in mcuboot.
 
@@ -31,7 +32,7 @@
 config BOOT_SERIAL_DETECT_PORT
 	string
 	prompt "GPIO Port to trigger serial recovery mode"
-	default CONFIG_GPIO_NRF5_P0_DEV_NAME
+	default GPIO_0 if SOC_FAMILY_NRF5
 	depends on MCUBOOT_SERIAL
 	help
 	  Serial recovery detect port
@@ -39,7 +40,8 @@
 config BOOT_SERIAL_DETECT_PIN
 	int
 	prompt "Pin to trigger serial recovery mode"
-	default 0
+	default 11 if BOARD_NRF52840_PCA10056
+	default 13 if BOARD_NRF52_PCA10040
 	depends on MCUBOOT_SERIAL
 	help
 	  Serial recovery detect pin