Juno: Use shared mbedtls heap between bl1 and bl2
authorLouis Mayencourt <louis.mayencourt@arm.com>
Wed, 31 Jul 2019 14:03:44 +0000 (15:03 +0100)
committerLouis Mayencourt <louis.mayencourt@arm.com>
Tue, 13 Aug 2019 10:51:22 +0000 (11:51 +0100)
Change-Id: Ia1ecad58ebf9de3f3a44b17ad1de57424b431125
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
plat/arm/board/juno/fdts/juno_tb_fw_config.dts
plat/arm/board/juno/juno_common.c
plat/arm/board/juno/juno_security.c

index b16f5ccc44519aa195e7586a14d80943f82393b4..a8ab6c5f9f716ed60a1733c97511fc0405999049 100644 (file)
        compatible = "arm,tb_fw";
        /* Disable authentication for development */
        disable_auth = <0x0>;
+       /*
+        * The following two entries are placeholders for Mbed TLS
+        * heap information. The default values don't matter since
+        * they will be overwritten by BL1.
+        * In case of having shared Mbed TLS heap between BL1 and BL2,
+        * BL1 will populate these two properties with the respective
+        * info about the shared heap. This info will be available for
+        * BL2 in order to locate and re-use the heap.
+        */
+       mbedtls_heap_addr = <0x0 0x0>;
+       mbedtls_heap_size = <0x0>;
 };
index 118c19ab709b22bc76a86317c556bfc042f0921d..be9f32bd1021c0d3ea8fa62d933b7a605f022283 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -46,6 +46,9 @@ const mmap_region_t plat_arm_mmap[] = {
 #ifdef SPD_opteed
        ARM_MAP_OPTEE_CORE_MEM,
        ARM_OPTEE_PAGEABLE_LOAD_MEM,
+#endif
+#if TRUSTED_BOARD_BOOT && !BL2_AT_EL3
+       ARM_MAP_BL1_RW,
 #endif
        {0}
 };
index 6566b15c87bdedf59b4516fb4969504ae0811e76..32823e01c5d573445bed701a03eb65d21c36e2b6 100644 (file)
@@ -3,6 +3,7 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
+#include <assert.h>
 
 #include <common/debug.h>
 #include <drivers/arm/nic_400.h>
@@ -149,6 +150,9 @@ void plat_arm_security_setup(void)
 #if TRUSTED_BOARD_BOOT
 int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
 {
-       return get_mbedtls_heap_helper(heap_addr, heap_size);
+       assert(heap_addr != NULL);
+       assert(heap_size != NULL);
+
+       return arm_get_mbedtls_heap(heap_addr, heap_size);
 }
 #endif