boot: zephyr: add nrf52840 QSPI NOR overlays

Add configuration and DTS overlays to run MCUboot + smp_svr on the
nrf52840dk using the secondary slot in the external QSPI NOR flash.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
diff --git a/boot/zephyr/boards/nrf52840dk_qspi_nor.conf b/boot/zephyr/boards/nrf52840dk_qspi_nor.conf
new file mode 100644
index 0000000..3205eaf
--- /dev/null
+++ b/boot/zephyr/boards/nrf52840dk_qspi_nor.conf
@@ -0,0 +1,3 @@
+CONFIG_NORDIC_QSPI_NOR=y
+CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
+CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
diff --git a/boot/zephyr/boards/nrf52840dk_qspi_nor_secondary.overlay b/boot/zephyr/boards/nrf52840dk_qspi_nor_secondary.overlay
new file mode 100644
index 0000000..7c9a87c
--- /dev/null
+++ b/boot/zephyr/boards/nrf52840dk_qspi_nor_secondary.overlay
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020 Nordic Semiconductor ASA
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/delete-node/ &boot_partition;
+/delete-node/ &slot0_partition;
+/delete-node/ &slot1_partition;
+/delete-node/ &scratch_partition;
+
+&flash0 {
+	partitions {
+		boot_partition: partition@0 {
+			label = "mcuboot";
+			reg = <0x000000000 0x00010000>;
+		};
+		slot0_partition: partition@10000 {
+			label = "image-0";
+			reg = <0x000010000 0x0000e8000>;
+		};
+	};
+};
+
+&mx25r64 {
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		slot1_partition: partition@0 {
+			label = "image-1";
+			reg = <0x000000000 0x0000e8000>;
+		};
+	};
+};
diff --git a/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf b/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf
new file mode 100644
index 0000000..9f984be
--- /dev/null
+++ b/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf
@@ -0,0 +1,2 @@
+CONFIG_MULTITHREADING=y
+CONFIG_BOOT_MAX_IMG_SECTORS=256
diff --git a/boot/zephyr/sample.yaml b/boot/zephyr/sample.yaml
index 048a588..a685159 100644
--- a/boot/zephyr/sample.yaml
+++ b/boot/zephyr/sample.yaml
@@ -23,3 +23,8 @@
       DTC_OVERLAY_FILE=./boards/nrf52840_single_slot.overlay
     platform_allow:  nrf52840dk_nrf52840
     tags: bootloader_mcuboot
+  sample.bootloader.mcuboot.qspi_nor_slot:
+    extra_args: DTC_OVERLAY_FILE=./boards/nrf52840dk_qspi_nor_secondary.overlay
+      OVERLAY_CONFIG="./boards/nrf52840dk_qspi_nor.conf;./boards/nrf52840dk_qspi_secondary_boot.conf"
+    platform_allow: nrf52840dk_nrf52840
+    tags: bootloader_mcuboot