aboutsummaryrefslogtreecommitdiff
path: root/platform/ext
diff options
context:
space:
mode:
authorSherry Zhang <sherry.zhang2@arm.com>2021-09-30 15:34:14 +0800
committerKen Liu <ken.liu@arm.com>2021-10-13 07:48:12 +0200
commit5846d2b08016e73a90cfe393d591760be6169de2 (patch)
treec239f5a77af47405fbac1e368d0e038a6ce7c38f /platform/ext
parentdeae45d03143b28bd21d182babffb785784bc760 (diff)
downloadtrusted-firmware-m-5846d2b08016e73a90cfe393d591760be6169de2.tar.gz
Build: Fix compile error in -DBL2=0
The defination `MCUBOOT_IMAGE_NUMBER` is passed to build library without checking the flag. It leads to passing `MCUBOOT_IMAGE_NUMBER` with empty defination to flash_layout.h. When `MCUBOOT_IMAGE_NUMBER` is not defined, it handles as single image. Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com> Change-Id: Icd08b29e42e8c42e3e6bea96059797767658faf0
Diffstat (limited to 'platform/ext')
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/mps2/an519/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/mps2/an521/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/mps2/fvp_sse300/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/mps3/an524/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/mps3/an547/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/musca_b1/sse_200/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/arm/musca_s1/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/nordic_nrf/common/nrf5340/partition/region_defs.h2
-rwxr-xr-x[-rw-r--r--]platform/ext/target/nordic_nrf/common/nrf9160/partition/region_defs.h2
-rwxr-xr-xplatform/ext/target/nxp/lpcxpresso55s69/partition/region_defs.h15
11 files changed, 17 insertions, 18 deletions
diff --git a/platform/ext/target/arm/mps2/an519/partition/region_defs.h b/platform/ext/target/arm/mps2/an519/partition/region_defs.h
index 9a3f1874fd..ca3911f6ed 100644..100755
--- a/platform/ext/target/arm/mps2/an519/partition/region_defs.h
+++ b/platform/ext/target/arm/mps2/an519/partition/region_defs.h
@@ -79,7 +79,7 @@
#define BL2_TRAILER_SIZE (0x10400)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/arm/mps2/an521/partition/region_defs.h b/platform/ext/target/arm/mps2/an521/partition/region_defs.h
index 0a1f849353..c49ddeb750 100644..100755
--- a/platform/ext/target/arm/mps2/an521/partition/region_defs.h
+++ b/platform/ext/target/arm/mps2/an521/partition/region_defs.h
@@ -79,7 +79,7 @@
#define BL2_TRAILER_SIZE (0x10400)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/arm/mps2/fvp_sse300/partition/region_defs.h b/platform/ext/target/arm/mps2/fvp_sse300/partition/region_defs.h
index da8f6716e0..334ef4fbe6 100644..100755
--- a/platform/ext/target/arm/mps2/fvp_sse300/partition/region_defs.h
+++ b/platform/ext/target/arm/mps2/fvp_sse300/partition/region_defs.h
@@ -81,7 +81,7 @@
#define BL2_TRAILER_SIZE (0xC00)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/arm/mps3/an524/partition/region_defs.h b/platform/ext/target/arm/mps3/an524/partition/region_defs.h
index ab1fc522ae..2cc9ea2907 100644..100755
--- a/platform/ext/target/arm/mps3/an524/partition/region_defs.h
+++ b/platform/ext/target/arm/mps3/an524/partition/region_defs.h
@@ -74,7 +74,7 @@
#define BL2_TRAILER_SIZE (0x800)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/arm/mps3/an547/partition/region_defs.h b/platform/ext/target/arm/mps3/an547/partition/region_defs.h
index adda5e13d7..90f75341de 100644..100755
--- a/platform/ext/target/arm/mps3/an547/partition/region_defs.h
+++ b/platform/ext/target/arm/mps3/an547/partition/region_defs.h
@@ -76,7 +76,7 @@
#define BL2_TRAILER_SIZE (0xC00)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/arm/musca_b1/sse_200/partition/region_defs.h b/platform/ext/target/arm/musca_b1/sse_200/partition/region_defs.h
index 7a7786fd32..e91dde2c46 100644..100755
--- a/platform/ext/target/arm/musca_b1/sse_200/partition/region_defs.h
+++ b/platform/ext/target/arm/musca_b1/sse_200/partition/region_defs.h
@@ -78,7 +78,7 @@
#define BL2_TRAILER_SIZE (0xC00)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/arm/musca_s1/partition/region_defs.h b/platform/ext/target/arm/musca_s1/partition/region_defs.h
index 4f7d246c43..547306a6ef 100644..100755
--- a/platform/ext/target/arm/musca_s1/partition/region_defs.h
+++ b/platform/ext/target/arm/musca_s1/partition/region_defs.h
@@ -79,7 +79,7 @@
#define BL2_TRAILER_SIZE (0xC00)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h b/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h
index a95a515e5e..26af9d07bd 100644..100755
--- a/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h
+++ b/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h
@@ -85,7 +85,7 @@
#define BL2_TRAILER_SIZE (0x800)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/nordic_nrf/common/nrf5340/partition/region_defs.h b/platform/ext/target/nordic_nrf/common/nrf5340/partition/region_defs.h
index 4c5ded6df1..3705334ded 100644..100755
--- a/platform/ext/target/nordic_nrf/common/nrf5340/partition/region_defs.h
+++ b/platform/ext/target/nordic_nrf/common/nrf5340/partition/region_defs.h
@@ -83,7 +83,7 @@
#define BL2_TRAILER_SIZE (0x0)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/nordic_nrf/common/nrf9160/partition/region_defs.h b/platform/ext/target/nordic_nrf/common/nrf9160/partition/region_defs.h
index 957a9bc3db..d0e183fec4 100644..100755
--- a/platform/ext/target/nordic_nrf/common/nrf9160/partition/region_defs.h
+++ b/platform/ext/target/nordic_nrf/common/nrf9160/partition/region_defs.h
@@ -83,7 +83,7 @@
#define BL2_TRAILER_SIZE (0x0)
#endif /* BL2 */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/partition/region_defs.h b/platform/ext/target/nxp/lpcxpresso55s69/partition/region_defs.h
index b0feb6a0f1..e0e9bd8458 100755
--- a/platform/ext/target/nxp/lpcxpresso55s69/partition/region_defs.h
+++ b/platform/ext/target/nxp/lpcxpresso55s69/partition/region_defs.h
@@ -73,7 +73,13 @@
#ifdef BL2
#define BL2_HEADER_SIZE (0x400) /* 1 KB */
#define BL2_TRAILER_SIZE (0x400) /* 1 KB */
-#if (MCUBOOT_IMAGE_NUMBER == 1) && \
+#else
+/* No header if no bootloader, but keep IMAGE_CODE_SIZE the same */
+#define BL2_HEADER_SIZE (0x0)
+#define BL2_TRAILER_SIZE (0x0)
+#endif /* BL2 */
+
+#if (!defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1)) && \
(NS_IMAGE_PRIMARY_PARTITION_OFFSET > S_IMAGE_PRIMARY_PARTITION_OFFSET)
/* If secure image and nonsecure image are concatenated, and nonsecure image
* locates at the higher memory range, then the secure image does not need
@@ -81,14 +87,7 @@
*/
#define IMAGE_S_CODE_SIZE \
(FLASH_S_PARTITION_SIZE - BL2_HEADER_SIZE)
-#endif
#else
-/* No header if no bootloader, but keep IMAGE_CODE_SIZE the same */
-#define BL2_HEADER_SIZE (0x0)
-#define BL2_TRAILER_SIZE (0x0)
-#endif /* BL2 */
-
-#ifndef IMAGE_S_CODE_SIZE
#define IMAGE_S_CODE_SIZE \
(FLASH_S_PARTITION_SIZE - BL2_HEADER_SIZE - BL2_TRAILER_SIZE)
#endif