aboutsummaryrefslogtreecommitdiff
path: root/plat/allwinner/common/sunxi_bl31_setup.c
diff options
context:
space:
mode:
authorAmit Singh Tomar <amittomer25@gmail.com>2018-06-20 00:44:50 +0530
committerAndre Przywara <andre.przywara@arm.com>2018-06-28 23:47:30 +0100
commitdab901f83a9fd65aba53551301912375cf97a6d6 (patch)
treee55231c76514dc9958a1a3669864db69cb800e41 /plat/allwinner/common/sunxi_bl31_setup.c
parentd5a0491c811d7e7558c0f7b14c805d804721c854 (diff)
downloadtrusted-firmware-a-dab901f83a9fd65aba53551301912375cf97a6d6.tar.gz
allwinner: Add BL32 (corresponds to Trusted OS) support
This patch is an attempt to run Trusted OS (OP-TEE OS being one of them) along side BL31 image. ATF supports multiple SPD's that can take dispatcher name (opteed for OP-TEE OS) as an input using the 'SPD=<dispatcher name>' option during bl31 build. Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
Diffstat (limited to 'plat/allwinner/common/sunxi_bl31_setup.c')
-rw-r--r--plat/allwinner/common/sunxi_bl31_setup.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/plat/allwinner/common/sunxi_bl31_setup.c b/plat/allwinner/common/sunxi_bl31_setup.c
index d1f1aa1530..f5f91e3186 100644
--- a/plat/allwinner/common/sunxi_bl31_setup.c
+++ b/plat/allwinner/common/sunxi_bl31_setup.c
@@ -18,6 +18,7 @@
#include "sunxi_private.h"
+static entry_point_info_t bl32_image_ep_info;
static entry_point_info_t bl33_image_ep_info;
static console_16550_t console;
@@ -34,6 +35,13 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
console_16550_register(SUNXI_UART0_BASE, SUNXI_UART0_CLK_IN_HZ,
SUNXI_UART0_BAUDRATE, &console);
+#ifdef BL32_BASE
+ /* Populate entry point information for BL32 */
+ SET_PARAM_HEAD(&bl32_image_ep_info, PARAM_EP, VERSION_1, 0);
+ SET_SECURITY_STATE(bl32_image_ep_info.h.attr, SECURE);
+ bl32_image_ep_info.pc = BL32_BASE;
+#endif
+
/* Populate entry point information for BL33 */
SET_PARAM_HEAD(&bl33_image_ep_info, PARAM_EP, VERSION_1, 0);
/*
@@ -72,7 +80,12 @@ void bl31_platform_setup(void)
entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
{
assert(sec_state_is_valid(type) != 0);
- assert(type == NON_SECURE);
- return &bl33_image_ep_info;
+ if (type == NON_SECURE)
+ return &bl33_image_ep_info;
+
+ if ((type == SECURE) && bl32_image_ep_info.pc)
+ return &bl32_image_ep_info;
+
+ return NULL;
}