Replace flash partitioning terminology

This change replaces the slot 0/1 terminology with primary/secondary
slot and replaces FLASH_AREA_IMAGE_0/1 with
FLASH_AREA_IMAGE_PRIMARY/SECONDARY. This naming convention may be more
understandable, fits better to MCUs with multiple images and it is an
architecture agnostic alternative as well.

Change-Id: I655a585f6ae023852c671ee6635399efe25209c9
Signed-off-by: David Vincze <david.vincze@arm.com>
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/samples/mcuboot_config/mcuboot_config.template.h b/samples/mcuboot_config/mcuboot_config.template.h
index 3dee47e..d29f4f6 100644
--- a/samples/mcuboot_config/mcuboot_config.template.h
+++ b/samples/mcuboot_config/mcuboot_config.template.h
@@ -45,7 +45,7 @@
 /* #define MCUBOOT_OVERWRITE_ONLY */
 
 #ifdef MCUBOOT_OVERWRITE_ONLY
-/* Uncomment to only erase and overwrite those slot 0 sectors needed
+/* Uncomment to only erase and overwrite those primary slot sectors needed
  * to install the new image, rather than the entire image slot. */
 /* #define MCUBOOT_OVERWRITE_ONLY_FAST */
 #endif
@@ -64,11 +64,11 @@
 /* #define MCUBOOT_USE_TINYCRYPT */
 
 /*
- * Always check the signature of the image in slot 0 before booting,
+ * Always check the signature of the image in the primary slot before booting,
  * even if no upgrade was performed. This is recommended if the boot
  * time penalty is acceptable.
  */
-#define MCUBOOT_VALIDATE_SLOT0
+#define MCUBOOT_VALIDATE_PRIMARY_SLOT
 
 /*
  * Flash abstraction
diff --git a/samples/zephyr/Makefile b/samples/zephyr/Makefile
index 938468e..62291e3 100644
--- a/samples/zephyr/Makefile
+++ b/samples/zephyr/Makefile
@@ -39,11 +39,11 @@
 # time, you should see a message about the bootloader not being able
 # to find a bootable image.
 #
-# "make flash_hello1" will then flash the first application into
-# "slot0".  This should boot into this app, print a small message, and
+# "make flash_hello1" will then flash the first application into the
+# "primary slot".  This should boot into this app, print a small message, and
 # give the zephyr console.
 #
-# "make flash_hello2" will flash hello2 into the second slot.  The
+# "make flash_hello2" will flash hello2 into the "secondary slot".  The
 # reset should upgrade and run the new image.  Resetting again should
 # then revert back to the first app, since we did not mark this image
 # as good.
@@ -140,7 +140,7 @@
 # This is the same signing command as above, except that it adds the
 # "--pad" argument.  This will also add the trailer that indicates
 # this image is intended to be an upgrade.  It should be flashed into
-# slot1 instead of slot0.
+# the secondary slot instead of the primary slot.
 hello2: check
 	(mkdir -p $(BUILD_DIR_HELLO2) && \
 		cd $(BUILD_DIR_HELLO2) && \
@@ -244,7 +244,7 @@
 		SIGNING_KEY=../../root-rsa-2048.pem \
 		hello2
 
-# Test that when configured to not validate slot0, we still boot, but
+# Test that when configured to not validate the primary slot, we still boot, but
 # don't upgrade.
 # flash_boot: tries to boot and resets
 # flash_hello1: hello1 runs
@@ -252,7 +252,7 @@
 # reset: hello1 runs
 test-no-bootcheck: clean
 	$(MAKE) \
-		BOOTLOADER_OVERLAY_CONFIG=$(PWD)/overlay-skip-slot0-validate.conf \
+		BOOTLOADER_OVERLAY_CONFIG=$(PWD)/overlay-skip-primary-slot-validate.conf \
 		SIGNING_KEY=../../root-ec-p256.pem \
 		all
 
diff --git a/samples/zephyr/overlay-skip-primary-slot-validate.conf b/samples/zephyr/overlay-skip-primary-slot-validate.conf
new file mode 100644
index 0000000..e94518e
--- /dev/null
+++ b/samples/zephyr/overlay-skip-primary-slot-validate.conf
@@ -0,0 +1,3 @@
+# Kconfig overlay for building without validating primary slot.
+
+# CONFIG_BOOT_VALIDATE_SLOT0 is not set
diff --git a/samples/zephyr/overlay-skip-slot0-validate.conf b/samples/zephyr/overlay-skip-slot0-validate.conf
deleted file mode 100644
index dd3b2c2..0000000
--- a/samples/zephyr/overlay-skip-slot0-validate.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# Kconfig overlay for building without validating slot 0.
-
-# CONFIG_BOOT_VALIDATE_SLOT0 is not set