Boot: Extend flash layout for multiple images
This patch introduces the BOOT_IMAGE_NUMBER macro and current_image
variable to support multiple updatable images and the associated
extended flash layout.
The FLASH_AREA_IMAGE_* object-like macros are replaced with
function-like ones and therefore some functions have been updated,
because the labels of a switch statement and the initialization
values of objects with static storage duration have to be constant
expressions.
Change-Id: Ib7b26ec3c94233e52db4f97825ddb6a3e55bb1d3
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/docs/PORTING.md b/docs/PORTING.md
index 2a63d50..ad2b885 100644
--- a/docs/PORTING.md
+++ b/docs/PORTING.md
@@ -86,9 +86,19 @@
`fa_id` is can be one of the following options:
```c
-#define FLASH_AREA_IMAGE_PRIMARY 1
-#define FLASH_AREA_IMAGE_SECONDARY 2
-#define FLASH_AREA_IMAGE_SCRATCH 3
+/* Independent from multiple image boot */
+#define FLASH_AREA_BOOTLOADER 0
+#define FLASH_AREA_IMAGE_SCRATCH 3
+```
+```c
+/* Flash area IDs of the first image in case of multiple images */
+#define FLASH_AREA_IMAGE_PRIMARY 1
+#define FLASH_AREA_IMAGE_SECONDARY 2
+```
+```c
+/* Flash area IDs of the second image in case of multiple images */
+#define FLASH_AREA_IMAGE_PRIMARY 5
+#define FLASH_AREA_IMAGE_SECONDARY 6
```
The functions that must be defined for working with the `flash_area`s are: