]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(fconf): fix FCONF_ARM_IO_UUID_NUMBER value
authorRob Hughes <robert.hughes@arm.com>
Fri, 20 Jan 2023 10:43:41 +0000 (10:43 +0000)
committerJoanna Farley <joanna.farley@arm.com>
Tue, 4 Apr 2023 09:36:48 +0000 (11:36 +0200)
The FCONF_ARM_IO_UUID_NUMBER macro is hardcoded to the number of entries
in the `load_info` array, but this number did not match the actual
length of the array in the case that TRUSTED_BOARD_BOOT is defined, but
SPD_spmd is not defined.

This patch fixes the hardcoded length by replacing it with a more
flexible calculation which sums up the various contributing groups of
entries.

Signed-off-by: Rob Hughes <robert.hughes@arm.com>
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Change-Id: I557bca7dd32c3be084bbba11d84dfa2818cb6790

plat/arm/common/fconf/arm_fconf_io.c

index 6c323312cdb0f9f6394e2d8acbc4758f9076b007..dfaaaae074b8f62d93b429647f14bab079c11eb0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2022, ARM Limited. All rights reserved.
+ * Copyright (c) 2019-2023, ARM Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -277,11 +277,22 @@ struct plat_io_policy policies[MAX_NUMBER_IDS] = {
 
 #ifdef IMAGE_BL2
 
+#define FCONF_ARM_IO_UUID_NUM_BASE     U(10)
+
 #if TRUSTED_BOARD_BOOT
-#define FCONF_ARM_IO_UUID_NUMBER       U(24)
+#define FCONF_ARM_IO_UUID_NUM_TBB      U(12)
 #else
-#define FCONF_ARM_IO_UUID_NUMBER       U(10)
-#endif
+#define FCONF_ARM_IO_UUID_NUM_TBB      U(0)
+#endif /* TRUSTED_BOARD_BOOT */
+
+#if TRUSTED_BOARD_BOOT && defined(SPD_spmd)
+#define FCONF_ARM_IO_UUID_NUM_SPD      U(2)
+#else
+#define FCONF_ARM_IO_UUID_NUM_SPD      U(0)
+#endif /* TRUSTED_BOARD_BOOT && defined(SPD_spmd) */
+
+#define FCONF_ARM_IO_UUID_NUMBER       FCONF_ARM_IO_UUID_NUM_BASE + \
+                                       FCONF_ARM_IO_UUID_NUM_TBB + FCONF_ARM_IO_UUID_NUM_SPD
 
 static io_uuid_spec_t fconf_arm_uuids[FCONF_ARM_IO_UUID_NUMBER];
 static OBJECT_POOL_ARRAY(fconf_arm_uuids_pool, fconf_arm_uuids);