aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@foss.st.com>2021-06-03 10:48:57 +0200
committerYann Gautier <yann.gautier@foss.st.com>2021-06-03 10:48:57 +0200
commit3f916a412afcf340781ed0dec31d3b67d94fdca4 (patch)
tree8528a9c08f80311fe2e7a3785412e4f217d0087f
parente1db570a30661755c29ef03213c96f66a449c511 (diff)
downloadtrusted-firmware-a-3f916a412afcf340781ed0dec31d3b67d94fdca4.tar.gz
refactor(plat/st): remove io_dummy code for OP-TEE
The io_dummy code and function calls are only used in case BL32 is TF-A SP_min, and not OP-TEE. This code in bl2_io_storage can then be put under #ifndef AARCH32_SP_OPTEE. Signed-off-by: Yann Gautier <yann.gautier@foss.st.com> Change-Id: I52787a775160b335f97547203f653419621f5147
-rw-r--r--plat/st/common/bl2_io_storage.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plat/st/common/bl2_io_storage.c b/plat/st/common/bl2_io_storage.c
index 18ee35e2be..a25643b023 100644
--- a/plat/st/common/bl2_io_storage.c
+++ b/plat/st/common/bl2_io_storage.c
@@ -31,9 +31,11 @@
#include <plat/common/platform.h>
/* IO devices */
+#ifndef AARCH32_SP_OPTEE
static const io_dev_connector_t *dummy_dev_con;
static uintptr_t dummy_dev_handle;
static uintptr_t dummy_dev_spec;
+#endif
static uintptr_t image_dev_handle;
static uintptr_t storage_dev_handle;
@@ -162,7 +164,9 @@ static io_block_spec_t stm32image_block_spec = {
static const io_dev_connector_t *stm32image_dev_con __unused;
+#ifndef AARCH32_SP_OPTEE
static int open_dummy(const uintptr_t spec);
+#endif
static int open_image(const uintptr_t spec);
static int open_storage(const uintptr_t spec);
@@ -215,10 +219,12 @@ static const struct plat_io_policy policies[] = {
}
};
+#ifndef AARCH32_SP_OPTEE
static int open_dummy(const uintptr_t spec)
{
return io_dev_init(dummy_dev_handle, 0);
}
+#endif
static int open_image(const uintptr_t spec)
{
@@ -523,12 +529,14 @@ void stm32mp_io_setup(void)
boot_context->boot_partition_used_toboot);
}
+#ifndef AARCH32_SP_OPTEE
io_result = register_io_dev_dummy(&dummy_dev_con);
assert(io_result == 0);
io_result = io_dev_open(dummy_dev_con, dummy_dev_spec,
&dummy_dev_handle);
assert(io_result == 0);
+#endif
switch (boot_context->boot_interface_selected) {
#if STM32MP_SDMMC