feat(st): use and override default MBedTLS config
Each time MbedTLS is updated, the default config may be updated. As
STM32MP platforms have their own config file, this needs to be aligned.
To avoid this alignment, directly include the default config and
override some values for ST platforms, mainly heap size.
MBEDTLS_MPI_WINDOW_SIZE is also kept to avoid behavior change.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I6a9c3141451ab7b11906a7139549d31cfff0581a
diff --git a/plat/st/common/include/stm32mp_mbedtls_config.h b/plat/st/common/include/stm32mp_mbedtls_config.h
new file mode 100644
index 0000000..d6a4cc3
--- /dev/null
+++ b/plat/st/common/include/stm32mp_mbedtls_config.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2025, STMicroelectronics - All Rights Reserved
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <default_mbedtls_config.h>
+
+/* MPI / BIGNUM options */
+#undef MBEDTLS_MPI_WINDOW_SIZE
+#define MBEDTLS_MPI_WINDOW_SIZE 2
+
+/*
+ * Mbed TLS heap size is small as we only use the asn1
+ * parsing functions
+ * digest, signature and crypto algorithm are done by
+ * other library.
+ */
+#undef TF_MBEDTLS_HEAP_SIZE
+#define TF_MBEDTLS_HEAP_SIZE U(5120)