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>
This commit is contained in:
parent
b70dcbc172
commit
30fb0d67c3
|
@ -27,3 +27,13 @@ To build:
|
||||||
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=sun50i_a64 DEBUG=1 bl31
|
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=sun50i_a64 DEBUG=1 bl31
|
||||||
|
|
||||||
.. _U-Boot documentation: http://git.denx.de/?p=u-boot.git;f=board/sunxi/README.sunxi64;hb=HEAD
|
.. _U-Boot documentation: http://git.denx.de/?p=u-boot.git;f=board/sunxi/README.sunxi64;hb=HEAD
|
||||||
|
|
||||||
|
Trusted OS dispatcher
|
||||||
|
=====================
|
||||||
|
|
||||||
|
One can boot Trusted OS(OP-TEE OS, bl32 image) along side bl31 image on Allwinner A64.
|
||||||
|
|
||||||
|
In order to include the 'opteed' dispatcher in the image, pass 'SPD=opteed' on the command line
|
||||||
|
while compiling the bl31 image and make sure the loader (SPL) loads the Trusted OS binary to
|
||||||
|
the beginning of DRAM (0x40000000).
|
||||||
|
|
||||||
|
|
|
@ -42,4 +42,10 @@
|
||||||
#define PLATFORM_MMAP_REGIONS 4
|
#define PLATFORM_MMAP_REGIONS 4
|
||||||
#define PLATFORM_STACK_SIZE (0x1000 / PLATFORM_CORE_COUNT)
|
#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__ */
|
#endif /* __PLATFORM_DEF_H__ */
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include "sunxi_private.h"
|
#include "sunxi_private.h"
|
||||||
|
|
||||||
|
static entry_point_info_t bl32_image_ep_info;
|
||||||
static entry_point_info_t bl33_image_ep_info;
|
static entry_point_info_t bl33_image_ep_info;
|
||||||
|
|
||||||
static console_16550_t console;
|
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,
|
console_16550_register(SUNXI_UART0_BASE, SUNXI_UART0_CLK_IN_HZ,
|
||||||
SUNXI_UART0_BAUDRATE, &console);
|
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 */
|
/* Populate entry point information for BL33 */
|
||||||
SET_PARAM_HEAD(&bl33_image_ep_info, PARAM_EP, VERSION_1, 0);
|
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)
|
entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
|
||||||
{
|
{
|
||||||
assert(sec_state_is_valid(type) != 0);
|
assert(sec_state_is_valid(type) != 0);
|
||||||
assert(type == NON_SECURE);
|
|
||||||
|
|
||||||
|
if (type == NON_SECURE)
|
||||||
return &bl33_image_ep_info;
|
return &bl33_image_ep_info;
|
||||||
|
|
||||||
|
if ((type == SECURE) && bl32_image_ep_info.pc)
|
||||||
|
return &bl32_image_ep_info;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue