Build: Allow crypto accelerators to override config

This patch allows the crypto accelerator, if selected,
to override some default config via a dedicated config
file.

Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: I7f2c7b96e0cc6da0104067455af58e81ad9be423
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68cf30a..fb6e840 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,14 @@
     include(platform/ext/target/${TFM_PLATFORM}/config.cmake)
 endif()
 
+# If CRYPTO_HW_ACCELERATOR is enabled by the platform, then load the
+# corresponding config if it exists
+if (CRYPTO_HW_ACCELERATOR)
+    if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/platform/ext/accelerators/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake)
+        include(platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake)
+    endif()
+endif()
+
 # Optionally load extra config, overriding platform options, overriding profile,
 # build type config, defaults and command line.
 if (TFM_EXTRA_CONFIG_PATH)