Platform: Remove unused heap
- Set mbedtls_print to tfm_sp_log_printf which does not need heap.
- After that in case of no debug information, heap is not needed.
Remove heap in link scripts.
- In case of with debug information, heap is used by GNU c lib
functions like assert, vprintf and so on. Reserve 0x200 bytes
heap for that.
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: I6874d9a9b4aff5fcc80ad7a14f225cb431dcb363
diff --git a/secure_fw/partitions/crypto/crypto_init.c b/secure_fw/partitions/crypto/crypto_init.c
index 077fceb..ab02882 100644
--- a/secure_fw/partitions/crypto/crypto_init.c
+++ b/secure_fw/partitions/crypto/crypto_init.c
@@ -18,6 +18,8 @@
*/
#include "mbedtls/memory_buffer_alloc.h"
+#include "mbedtls/platform.h"
+
#ifdef CRYPTO_NV_SEED
#include "tfm_plat_crypto_nv_seed.h"
#endif /* CRYPTO_NV_SEED */
@@ -343,6 +345,11 @@
mbedtls_memory_buffer_alloc_init(mbedtls_mem_buf,
TFM_CRYPTO_ENGINE_BUF_SIZE);
+ /* mbedtls_printf is used to print messages including error information. */
+#if (TFM_PARTITION_LOG_LEVEL >= TFM_PARTITION_LOG_LEVEL_ERROR)
+ mbedtls_platform_set_printf(tfm_sp_log_printf);
+#endif
+
/* Initialise the crypto accelerator if one is enabled */
#ifdef CRYPTO_HW_ACCELERATOR
LOG_INFFMT("[INF][Crypto] Initialising HW accelerator... ");