aboutsummaryrefslogtreecommitdiffstats
path: root/plat
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-07-03 14:36:46 +0100
committerGitHub <noreply@github.com>2018-07-03 14:36:46 +0100
commit73b1a02fba21abdde0e5a2bb780d38f85ff37c85 (patch)
treed1c0a076c9f73315858e9551bbd7afef4ea5939d /plat
parent6c5e196be37b4afe3403f349d5da1747e12460ac (diff)
parent30fb0d67c32dba4792da9c751d3a359f9b32baa7 (diff)
downloadplatform_external_arm-trusted-firmware-73b1a02fba21abdde0e5a2bb780d38f85ff37c85.tar.gz
platform_external_arm-trusted-firmware-73b1a02fba21abdde0e5a2bb780d38f85ff37c85.tar.bz2
platform_external_arm-trusted-firmware-73b1a02fba21abdde0e5a2bb780d38f85ff37c85.zip
Merge pull request #1447 from Amit-Radur/bl32_v1
allwinner: Add BL32 (corresponds to Trusted OS) support
Diffstat (limited to 'plat')
-rw-r--r--plat/allwinner/common/include/platform_def.h6
-rw-r--r--plat/allwinner/common/sunxi_bl31_setup.c17
2 files changed, 21 insertions, 2 deletions
diff --git a/plat/allwinner/common/include/platform_def.h b/plat/allwinner/common/include/platform_def.h
index ca7db2f24..2752aa4d3 100644
--- a/plat/allwinner/common/include/platform_def.h
+++ b/plat/allwinner/common/include/platform_def.h
@@ -42,4 +42,10 @@
#define PLATFORM_MMAP_REGIONS 4
#define PLATFORM_STACK_SIZE (0x1000 / PLATFORM_CORE_COUNT)
+#ifndef SPD_none
+#ifndef BL32_BASE
+#define BL32_BASE SUNXI_DRAM_BASE
+#endif
+#endif
+
#endif /* __PLATFORM_DEF_H__ */
diff --git a/plat/allwinner/common/sunxi_bl31_setup.c b/plat/allwinner/common/sunxi_bl31_setup.c
index d1f1aa153..f5f91e318 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;
}