diff options
author | John Tsichritzis <john.tsichritzis@arm.com> | 2018-06-07 16:31:34 +0100 |
---|---|---|
committer | John Tsichritzis <john.tsichritzis@arm.com> | 2018-09-04 10:32:06 +0100 |
commit | 6d01a463348b04af2afa3c00579ebc6ecd12eaf1 (patch) | |
tree | 01f023aa03e4631d8ad6a30beaea6757e8c64bb6 /include/drivers/auth/mbedtls/mbedtls_config.h | |
parent | 708531cf0541295f50d81b0bfa3441e757a00348 (diff) | |
download | trusted-firmware-a-6d01a463348b04af2afa3c00579ebc6ecd12eaf1.tar.gz |
Prepare Mbed TLS drivers for shared heap
The Mbed TLS drivers, in order to work, need a heap for internal usage.
This heap, instead of being directly referenced by the drivers, now it
is being accessed indirectly through a pointer. Also, the heap, instead
of being part of the drivers, now it is being received through the
plat_get_mbedtls_heap() function. This function requests a heap from the
current BL image which utilises the Mbed TLS drivers.
Those changes create the opportunity for the Mbed TLS heap to be shared
among different images, thus saving memory. A default heap
implementation is provided but it can be overridden by a platform
specific, optimised implemenetation.
Change-Id: I286a1f10097a9cdcbcd312201eea576c18d157fa
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
Diffstat (limited to 'include/drivers/auth/mbedtls/mbedtls_config.h')
-rw-r--r-- | include/drivers/auth/mbedtls/mbedtls_config.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/drivers/auth/mbedtls/mbedtls_config.h b/include/drivers/auth/mbedtls/mbedtls_config.h index f8f260808b..59aeea9929 100644 --- a/include/drivers/auth/mbedtls/mbedtls_config.h +++ b/include/drivers/auth/mbedtls/mbedtls_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -95,4 +95,16 @@ #include "mbedtls/check_config.h" #endif +/* + * Determine Mbed TLS heap size + * 13312 = 13*1024 + * 7168 = 7*1024 + */ +#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA) \ + || (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA_AND_ECDSA) +#define TF_MBEDTLS_HEAP_SIZE U(13312) +#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA) +#define TF_MBEDTLS_HEAP_SIZE U(7168) +#endif + #endif /* __MBEDTLS_CONFIG_H__ */ |