Add semihosting block store
To support test, a block store that uses semihosting file IO
facilities available on virtual platforms and real platforms
with a debugger is added. This uses a file residing in the
host file system for storage. Uses the semihosting component
from tf-a. tf-a is fetched as an external component and the
semihosting code is treated as a platform driver. The platform
definition file defines whether semihosting is avaiable for the
selected platform.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I38f9a13e49676572306158963c14f7b62b30dd1a
diff --git a/platform/drivers/tf-a/lib/semihosting/driver.cmake b/platform/drivers/tf-a/lib/semihosting/driver.cmake
new file mode 100644
index 0000000..3a33628
--- /dev/null
+++ b/platform/drivers/tf-a/lib/semihosting/driver.cmake
@@ -0,0 +1,20 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+if (NOT DEFINED TGT)
+ message(FATAL_ERROR "mandatory parameter TGT is not defined.")
+endif()
+
+#-------------------------------------------------------------------------------
+# Depends on the tf-a external component
+#-------------------------------------------------------------------------------
+set(_SEMIHOSTING_LIB_DIR "${TFA_SOURCE_DIR}/lib/semihosting")
+
+target_sources(${TGT} PRIVATE
+ "${_SEMIHOSTING_LIB_DIR}/semihosting.c"
+ "${_SEMIHOSTING_LIB_DIR}/aarch64/semihosting_call.S"
+)
+