aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2018-11-26 10:13:51 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-11-27 10:51:20 +0100
commit7d34d304a5115a167102aa165c6a41124b00205d (patch)
tree685e2e15323da617f07cda8f8db2eb73a26cf91e
parent13d99f95ae68104f4e97a58f6887c75863b4f502 (diff)
downloadtf-a-tests-7d34d304a5115a167102aa165c6a41124b00205d.tar.gz
Move BL1 SMC FIDs macros out of platform layer
BL1 SMC function IDs are not platform-specific so move them to a new generic header file, called bl1.h. Change-Id: I621483f7737f8101e9f370343e1a45a731c31c3b Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
-rw-r--r--fwu/ns_bl1u/ns_bl1u_main.c1
-rw-r--r--fwu/ns_bl1u/ns_bl1u_tests.c9
-rw-r--r--fwu/ns_bl2u/ns_bl2u_main.c1
-rw-r--r--include/runtime_services/bl1.h39
-rw-r--r--plat/arm/board/fvp/include/platform_def.h16
-rw-r--r--plat/arm/board/juno/include/platform_def.h15
6 files changed, 43 insertions, 38 deletions
diff --git a/fwu/ns_bl1u/ns_bl1u_main.c b/fwu/ns_bl1u/ns_bl1u_main.c
index 46c226367..4a15e8606 100644
--- a/fwu/ns_bl1u/ns_bl1u_main.c
+++ b/fwu/ns_bl1u/ns_bl1u_main.c
@@ -6,6 +6,7 @@
#include <arch_helpers.h>
#include <assert.h>
+#include <bl1.h>
#include <debug.h>
#include <errno.h>
#include <image_loader.h>
diff --git a/fwu/ns_bl1u/ns_bl1u_tests.c b/fwu/ns_bl1u/ns_bl1u_tests.c
index 082439a90..16ae2591a 100644
--- a/fwu/ns_bl1u/ns_bl1u_tests.c
+++ b/fwu/ns_bl1u/ns_bl1u_tests.c
@@ -9,6 +9,7 @@
* BL1.
******************************************************************************/
+#include <bl1.h>
#include <debug.h>
#include <errno.h>
#include <io_fip.h>
@@ -18,12 +19,6 @@
#include <tftf.h>
#include <tftf_lib.h>
-/* Expected number of SMC calls supported in BL1 */
-#define BL1_NUM_SMC_CALLS 11
-
-/* Expected version of BL1 SMC implementation */
-#define BL1_SMC_VER_VALUE 1
-
typedef struct {
/* Description to print before sending the SMC */
const char *description;
@@ -49,7 +44,7 @@ static const ns_bl1u_test_t tests[] = {
{
.description = "BL1_SMC_VERSION",
.args = { BL1_SMC_VERSION, 0, 0, 0, 0 },
- .expect = BL1_SMC_VER_VALUE,
+ .expect = BL1_VERSION,
},
{
diff --git a/fwu/ns_bl2u/ns_bl2u_main.c b/fwu/ns_bl2u/ns_bl2u_main.c
index 815859de1..babcf93e0 100644
--- a/fwu/ns_bl2u/ns_bl2u_main.c
+++ b/fwu/ns_bl2u/ns_bl2u_main.c
@@ -5,6 +5,7 @@
*/
#include <arch_helpers.h>
+#include <bl1.h>
#include <debug.h>
#include <firmware_image_package.h>
#include <fwu_nvm.h>
diff --git a/include/runtime_services/bl1.h b/include/runtime_services/bl1.h
new file mode 100644
index 000000000..16746308b
--- /dev/null
+++ b/include/runtime_services/bl1.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef BL1_H
+#define BL1_H
+
+#define BL1_SMC_CALL_COUNT 0x0
+#define BL1_SMC_UID 0x1
+/* SMC #0x2 reserved. */
+#define BL1_SMC_VERSION 0x3
+
+/* SMC function ID used to request BL1 to execute BL31. */
+#define BL1_SMC_RUN_IMAGE 0x4
+
+/* SMC function IDs for Firmware Update operations. */
+#define FWU_SMC_IMAGE_COPY 0x10
+#define FWU_SMC_IMAGE_AUTH 0x11
+#define FWU_SMC_IMAGE_EXECUTE 0x12
+#define FWU_SMC_IMAGE_RESUME 0x13
+#define FWU_SMC_SEC_IMAGE_DONE 0x14
+#define FWU_SMC_UPDATE_DONE 0x15
+#define FWU_SMC_IMAGE_RESET 0x16
+
+/*
+ * Number of SMC calls supported in BL1.
+ *
+ * Note that when Trusted Board Boot is disabled in BL1, this drops down to 4,
+ * as the 7 FWU SMCs are not implemented. We test BL1's SMC interface only in
+ * the context of FWU tests, where TBB is enabled.
+ */
+#define BL1_NUM_SMC_CALLS 11
+
+/* Version reported by the BL1_SMC_VERSION SMC. */
+#define BL1_VERSION 0x1
+
+#endif /* BL1_H */
diff --git a/plat/arm/board/fvp/include/platform_def.h b/plat/arm/board/fvp/include/platform_def.h
index f09b6b52d..2ef467bcd 100644
--- a/plat/arm/board/fvp/include/platform_def.h
+++ b/plat/arm/board/fvp/include/platform_def.h
@@ -65,22 +65,6 @@
#define NSRAM_SIZE (0x00010000)
/*******************************************************************************
- * Corresponds to the function ID of the BL1 SMC handler for FWU process.
- ******************************************************************************/
-#define BL1_SMC_CALL_COUNT 0x0
-#define BL1_SMC_UID 0x1
-/* SMC #0x2 reserved */
-#define BL1_SMC_VERSION 0x3
-#define FWU_SMC_IMAGE_COPY 0x10
-#define FWU_SMC_IMAGE_AUTH 0x11
-#define FWU_SMC_IMAGE_EXECUTE 0x12
-#define FWU_SMC_IMAGE_RESUME 0x13
-#define FWU_SMC_SEC_IMAGE_DONE 0x14
-#define FWU_SMC_UPDATE_DONE 0x15
-#define FWU_SMC_IMAGE_RESET 0x16
-
-
-/*******************************************************************************
* NS_BL1U specific defines.
* NS_BL1U RW data is relocated from NS-ROM to NS-RAM at runtime so we
* need 2 sets of addresses.
diff --git a/plat/arm/board/juno/include/platform_def.h b/plat/arm/board/juno/include/platform_def.h
index 37b419fc9..66d722466 100644
--- a/plat/arm/board/juno/include/platform_def.h
+++ b/plat/arm/board/juno/include/platform_def.h
@@ -76,21 +76,6 @@
#define NSRAM_SIZE (0x00008000)
/*******************************************************************************
- * Corresponds to the function ID of the BL1 SMC handler for FWU process.
- ******************************************************************************/
-#define BL1_SMC_CALL_COUNT 0x0
-#define BL1_SMC_UID 0x1
-/* SMC #0x2 reserved */
-#define BL1_SMC_VERSION 0x3
-#define FWU_SMC_IMAGE_COPY 0x10
-#define FWU_SMC_IMAGE_AUTH 0x11
-#define FWU_SMC_IMAGE_EXECUTE 0x12
-#define FWU_SMC_IMAGE_RESUME 0x13
-#define FWU_SMC_SEC_IMAGE_DONE 0x14
-#define FWU_SMC_UPDATE_DONE 0x15
-#define FWU_SMC_IMAGE_RESET 0x16
-
-/*******************************************************************************
* NS_BL1U specific defines.
* NS_BL1U RW data is relocated from NS-ROM to NS-RAM at runtime so we
* need 2 sets of addresses.