Crypto: Add support for NV seed entropy

Add support for NV seed entropy based on MbedTLS in Crypto service.
Seed read and write operations use ITS services. Currently, only
support in IPC model since library model doesn't allow one partition
call another one during partition init process.
Port a reference implementation on AN521.

Change-Id: I4b5dd5ed667509a94a03efd97b80dd7420d9621e
Signed-off-by: Summer Qin <summer.qin@arm.com>
diff --git a/secure_fw/partitions/crypto/crypto_init.c b/secure_fw/partitions/crypto/crypto_init.c
index 9b93ea8..d60e897 100644
--- a/secure_fw/partitions/crypto/crypto_init.c
+++ b/secure_fw/partitions/crypto/crypto_init.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -17,6 +17,10 @@
  */
 #include "mbedtls/memory_buffer_alloc.h"
 
+#ifdef PLATFORM_DUMMY_NV_SEED
+#include "tfm_plat_crypto_dummy_nv_seed.h"
+#endif
+
 #ifndef TFM_PSA_API
 #include "tfm_secure_api.h"
 #endif
@@ -281,6 +285,12 @@
     LOG_INFFMT("\033[1;34m[Crypto] MBEDTLS_TEST_NULL_ENTROPY is not suitable for production!\033[0m\r\n");
 #endif
 
+#ifdef PLATFORM_DUMMY_NV_SEED
+    if (tfm_plat_crypto_create_entropy_seed() != TFM_CRYPTO_NV_SEED_SUCCESS) {
+        return PSA_ERROR_GENERIC_ERROR;
+    }
+#endif
+
     /* Initialise the Mbed Crypto memory allocator to use static
      * memory allocation from the provided buffer instead of using
      * the heap