Support shared Mbed TLS heap for SGM
authorJohn Tsichritzis <[email protected]>
Wed, 22 Aug 2018 11:55:41 +0000 (12:55 +0100)
committerJohn Tsichritzis <[email protected]>
Tue, 4 Sep 2018 09:33:08 +0000 (10:33 +0100)
Change-Id: Ibbfedb6601feff51dfb82c1d94850716c5a36d24
Signed-off-by: John Tsichritzis <[email protected]>
plat/arm/css/sgm/fdts/sgm_tb_fw_config.dts
plat/arm/css/sgm/sgm_mmap_config.c
plat/arm/css/sgm/sgm_plat_config.c

index 95025493bb89124d515a66f6ede7b51247a839ed..d4810184225d093c292f21f98562b8e3d4768789 100644 (file)
                compatible = "arm,tb_fw";
                hw_config_addr = <0x0 0x83000000>;
                hw_config_max_size = <0x01000000>;
+               /*
+                * 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 009ee640367207880bba0a5e946b6b7601b01700..8a4a8ab037d32fda3e6b1da2c6386f83dc66455b 100644 (file)
@@ -42,6 +42,9 @@ const mmap_region_t plat_arm_mmap[] = {
        ARM_MAP_TSP_SEC_MEM,
 #ifdef SPD_opteed
        ARM_OPTEE_PAGEABLE_LOAD_MEM,
+#endif
+#if TRUSTED_BOARD_BOOT && LOAD_IMAGE_V2 && !BL2_AT_EL3
+       ARM_MAP_BL1_RW,
 #endif
        {0}
 };
index 809edf68eeefc635de75e35f86b56b3cc249ffb9..97b16a8f824537a0372b89142c3837b1174325ae 100644 (file)
@@ -67,3 +67,13 @@ css_plat_config_t *get_plat_config(void)
        assert(css_plat_info != NULL);
        return css_plat_info;
 }
+
+#if TRUSTED_BOARD_BOOT && LOAD_IMAGE_V2
+int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
+{
+       assert(heap_addr != NULL);
+       assert(heap_size != NULL);
+
+       return arm_get_mbedtls_heap(heap_addr, heap_size);
+}
+#endif