]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(arm): carveout DRAM1 area for Event Log
authorManish V Badarkhe <Manish.Badarkhe@arm.com>
Mon, 12 Dec 2022 10:14:25 +0000 (10:14 +0000)
committerManish V Badarkhe <Manish.Badarkhe@arm.com>
Wed, 8 Mar 2023 19:51:17 +0000 (19:51 +0000)
Reserved 4KB area for Event Log in DRAM1. This area is used by BL2
to copy Event Log from internal SRAM to this carved out DRAM region
in the subsequent patch.

Change-Id: I7b405775c66d249e31edf7688d95770e6c05c175
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
include/plat/arm/common/arm_def.h
plat/arm/board/fvp/fvp_common.c
plat/arm/board/fvp/include/platform_def.h

index 38793cd735342424ccf03e4a05f1e69d2a8f7aea..45614557716b35dd346442756bd67889af18f66d 100644 (file)
@@ -82,6 +82,7 @@
  *   - L1 GPT DRAM: Reserved for L1 GPT if RME is enabled
  *   - REALM DRAM: Reserved for Realm world if RME is enabled
  *   - TF-A <-> RMM SHARED: Area shared for communication between TF-A and RMM
+ *   - Event Log: Area for Event Log if MEASURED_BOOT feature is enabled
  *   - AP TZC DRAM: The remaining TZC secured DRAM reserved for AP use
  *
  *              RME enabled(64MB)                RME not enabled(16MB)
  *              |                  |             |                 |
  *              |  AP TZC (~28MB)  |             |  AP TZC (~14MB) |
  *              --------------------             -------------------
+ *              |     Event Log    |             |     Event Log   |
+ *              |      (4KB)       |             |      (4KB)      |
+ *              --------------------             -------------------
+ *              |   REALM (RMM)    |             |                 |
+ *              |   (32MB - 4KB)   |             |  EL3 TZC (2MB)  |
+ *              --------------------             -------------------
  *              |                  |             |                 |
- *              |   REALM (RMM)    |             |  EL3 TZC (2MB)  |
- *              |   (32MB - 4KB)   |             -------------------
- *              --------------------             |                 |
- *              |                  |             |    SCP TZC      |
- *              |   TF-A <-> RMM   |  0xFFFF_FFFF-------------------
- *              |   SHARED (4KB)   |
+ *              |   TF-A <-> RMM   |             |    SCP TZC      |
+ *              |   SHARED (4KB)   |  0xFFFF_FFFF-------------------
  *              --------------------
  *              |                  |
  *              |  EL3 TZC (3MB)   |
  */
 #define ARM_EL3_TZC_DRAM1_SIZE         UL(0x00300000) /* 3MB */
 #define ARM_L1_GPT_SIZE                        UL(0x00100000) /* 1MB */
-
 /* 32MB - ARM_EL3_RMM_SHARED_SIZE */
 #define ARM_REALM_SIZE                 (UL(0x02000000) -               \
                                                ARM_EL3_RMM_SHARED_SIZE)
 #define ARM_SCP_TZC_DRAM1_SIZE         PLAT_ARM_SCP_TZC_DRAM1_SIZE
 #define ARM_SCP_TZC_DRAM1_END          (ARM_SCP_TZC_DRAM1_BASE +       \
                                        ARM_SCP_TZC_DRAM1_SIZE - 1U)
+
+# if (defined(SPD_tspd) || defined(SPD_opteed) || defined(SPD_spmd)) && \
+MEASURED_BOOT
+#define ARM_EVENT_LOG_DRAM1_SIZE       UL(0x00001000)  /* 4KB */
+
+#if ENABLE_RME
+#define ARM_EVENT_LOG_DRAM1_BASE       (ARM_REALM_BASE -               \
+                                        ARM_EVENT_LOG_DRAM1_SIZE)
+#else
+#define ARM_EVENT_LOG_DRAM1_BASE       (ARM_EL3_TZC_DRAM1_BASE -       \
+                                        ARM_EVENT_LOG_DRAM1_SIZE)
+#endif /* ENABLE_RME */
+#define ARM_EVENT_LOG_DRAM1_END                (ARM_EVENT_LOG_DRAM1_BASE +     \
+                                        ARM_EVENT_LOG_DRAM1_SIZE -     \
+                                        1U)
+#else
+#define ARM_EVENT_LOG_DRAM1_SIZE       UL(0)
+#endif /* (SPD_tspd || SPD_opteed || SPD_spmd) && MEASURED_BOOT */
+
 #if ENABLE_RME
 #define ARM_L1_GPT_ADDR_BASE           (ARM_DRAM1_BASE +               \
                                        ARM_DRAM1_SIZE -                \
                                        ARM_EL3_TZC_DRAM1_SIZE +        \
                                        ARM_EL3_RMM_SHARED_SIZE +       \
                                        ARM_REALM_SIZE +                \
-                                       ARM_L1_GPT_SIZE))
+                                       ARM_L1_GPT_SIZE +               \
+                                       ARM_EVENT_LOG_DRAM1_SIZE))
+
 #define ARM_AP_TZC_DRAM1_END           (ARM_AP_TZC_DRAM1_BASE +        \
                                        ARM_AP_TZC_DRAM1_SIZE - 1U)
 
                                        PLAT_ARM_TRUSTED_DRAM_SIZE,     \
                                        MT_MEMORY | MT_RW | MT_SECURE)
 
+# if (defined(SPD_tspd) || defined(SPD_opteed) || defined(SPD_spmd)) && \
+MEASURED_BOOT
+#define ARM_MAP_EVENT_LOG_DRAM1                                                \
+                               MAP_REGION_FLAT(                        \
+                                       ARM_EVENT_LOG_DRAM1_BASE,       \
+                                       ARM_EVENT_LOG_DRAM1_SIZE,       \
+                                       MT_MEMORY | MT_RW | MT_SECURE)
+#endif /* (SPD_tspd || SPD_opteed || SPD_spmd) && MEASURED_BOOT */
+
 #if ENABLE_RME
 /*
  * We add the EL3_RMM_SHARED size to RMM mapping to map the region as a block.
index c7bf93e602f7f214095d39731204c9aa4e74b6d3..24230656eb9f9bcd33dec4236b829ae5cd6868f5 100644 (file)
@@ -111,6 +111,15 @@ const mmap_region_t plat_arm_mmap[] = {
         * Required to load HW_CONFIG, SPMC and SPs to trusted DRAM.
         */
        ARM_MAP_TRUSTED_DRAM,
+
+       /*
+        * Required to load Event Log in TZC secured memory
+        */
+#if MEASURED_BOOT && (defined(SPD_tspd) || defined(SPD_opteed) || \
+defined(SPD_spmd))
+       ARM_MAP_EVENT_LOG_DRAM1,
+#endif /* MEASURED_BOOT && (SPD_tspd || SPD_opteed || SPD_spmd) */
+
 #if ENABLE_RME
        ARM_MAP_RMM_DRAM,
        ARM_MAP_GPT_L1_DRAM,
index 52146a3b63ec66b3406d8e65f70b92b4dc7604f7..039f8e2995c1840ad9517894b6e608c865e68013 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2023, Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
 # define MAX_XLAT_TABLES               5
 #else
 # define PLAT_ARM_MMAP_ENTRIES         12
-# define MAX_XLAT_TABLES               6
+# if (defined(SPD_tspd) || defined(SPD_opteed) || defined(SPD_spmd)) && \
+defined(IMAGE_BL2) && MEASURED_BOOT
+#  define MAX_XLAT_TABLES              7
+# else
+#  define MAX_XLAT_TABLES              6
+# endif /* (SPD_tspd || SPD_opteed || SPD_spmd) && IMAGE_BL2 && MEASURED_BOOT */
 #endif
 
 /*