diff --git a/docs/optee-dispatcher.md b/docs/optee-dispatcher.md deleted file mode 100644 index c154f6b..0000000 --- a/docs/optee-dispatcher.md +++ /dev/null @@ -1,13 +0,0 @@ -OP-TEE Dispatcher -================= - -[OP-TEE OS] is a Trusted OS running as Secure EL1. - -To build and execute [OP-TEE OS] follow the instructions at -[ARM Trusted Firmware with OP-TEE] [OP-TEE OS] - -- - - - - - - - - - - - - - - - - - - - - - - - - - - -_Copyright (c) 2014, ARM Limited and Contributors. All rights reserved._ - -[OP-TEE OS]: http://github.com/OP-TEE/optee_os/tree/master/documentation/arm_trusted_firmware.md diff --git a/docs/plat/nvidia-tegra.md b/docs/plat/nvidia-tegra.md index 242e8db..e4f9a05 100644 --- a/docs/plat/nvidia-tegra.md +++ b/docs/plat/nvidia-tegra.md @@ -15,7 +15,16 @@ * plat/nvidia/tegra/common - Common code for all Tegra SoCs * plat/nvidia/tegra/soc/txxx - Chip specific code +Trusted OS dispatcher +===================== +Tegra supports multiple Trusted OS', Trusted Little Kernel (TLK) being one of +them. In order to include the 'tlkd' dispatcher in the image, pass 'SPD=tlkd' +on the command line while preparing a bl31 image. This allows other Trusted OS +vendors to use the upstream code and include their dispatchers in the image +without changing any makefiles. + Preparing the BL31 image to run on Tegra SoCs =================================================== CROSS_COMPILE=/bin/aarch64-none-elf- make PLAT=tegra \ -TARGET_SOC= all +TARGET_SOC= BL32= \ +SPD= all diff --git a/docs/spd/optee-dispatcher.md b/docs/spd/optee-dispatcher.md new file mode 100644 index 0000000..c154f6b --- /dev/null +++ b/docs/spd/optee-dispatcher.md @@ -0,0 +1,13 @@ +OP-TEE Dispatcher +================= + +[OP-TEE OS] is a Trusted OS running as Secure EL1. + +To build and execute [OP-TEE OS] follow the instructions at +[ARM Trusted Firmware with OP-TEE] [OP-TEE OS] + +- - - - - - - - - - - - - - - - - - - - - - - - - - + +_Copyright (c) 2014, ARM Limited and Contributors. All rights reserved._ + +[OP-TEE OS]: http://github.com/OP-TEE/optee_os/tree/master/documentation/arm_trusted_firmware.md diff --git a/docs/spd/tlk-dispatcher.md b/docs/spd/tlk-dispatcher.md new file mode 100644 index 0000000..890b35e --- /dev/null +++ b/docs/spd/tlk-dispatcher.md @@ -0,0 +1,60 @@ +Trusted Little Kernel (TLK) Dispatcher +======================================= +TLK dispatcher adds support for NVIDIA's Trusted Little Kernel (TLK) to work +with the Trusted Firmware. TLK-D can be compiled by including it in the +platform's makefile. TLK is primarily meant to work with Tegra SoCs, so until +Trusted Firmware starts supporting Tegra, the dispatcher code can only be +compiled for other platforms. + +In order to compile TLK-D, we need a BL32 image to be present. Since, TLKD +just needs to compile, any BL32 image would do. To use TLK as the BL32, please +refer to the "Build TLK" section. + +Once a BL32 is ready, TLKD can be included in the image using the following +command: + +CROSS_COMPILE=/bin/aarch64-none-elf- make NEED_BL1=0 +NEED_BL2=0 BL32= PLAT= SPD=tlkd all +_ +Trusted Little Kernel (TLK) +=========================== +TLK is a Trusted OS running as Secure EL1. It is a Free Open Source Software +(FOSS) release of the NVIDIA® Trusted Little Kernel (TLK) technology, which +extends technology made available with the development of the Little Kernel (LK). +You can download the LK modular embedded preemptive kernel for use on ARM, +x86, and AVR32 systems from https://github.com/travisg/lk + +NVIDIA implemented its Trusted Little Kernel (TLK) technology, designed as a +free and open-source trusted execution environment (OTE). + +TLK features include: + +• Small, pre-emptive kernel +• Supports multi-threading, IPCs, and thread scheduling +• Added TrustZone features +• Added Secure Storage +• Under MIT/FreeBSD license + +NVIDIA extensions to Little Kernel (LK) include: + +• User mode +• Address-space separation for TAs +• TLK Client Application (CA) library +• TLK TA library +• Crypto library (encrypt/decrypt, key handling) via OpenSSL +• Linux kernel driver +• Cortex A9/A15 support +• Power Management +• TrustZone memory carve-out (reconfigurable) +• Page table management +• Debugging support over UART (USB planned) + +TLK is hosted by NVIDIA on http://nv-tegra.nvidia.com under the +3rdparty/ote_partner/tlk.git repository. Detailed information about +TLK and OTE can be found in the Tegra_BSP_for_Android_TLK_FOSS_Reference.pdf +manual located under the "documentation" directory_. + +Build TLK +========= +To build and execute TLK, follow the instructions from "Building a TLK Device" +section from Tegra_BSP_for_Android_TLK_FOSS_Reference.pdf manual. diff --git a/docs/tlk-dispatcher.md b/docs/tlk-dispatcher.md deleted file mode 100644 index a2212b5..0000000 --- a/docs/tlk-dispatcher.md +++ /dev/null @@ -1,59 +0,0 @@ -Trusted Little Kernel (TLK) Dispatcher -======================================= -TLK dispatcher adds support for NVIDIA's Trusted Little Kernel (TLK) to work -with the Trusted Firmware. TLK-D can be compiled by including it in the -platform's makefile. TLK is primarily meant to work with Tegra SoCs, so until -Trusted Firmware starts supporting Tegra, the dispatcher code can only be -compiled for other platforms. - -In order to compile TLK-D, we need a BL32 image to be present. Since, TLKD -just needs to compile, any BL32 image would do. To use TLK as the BL32, please -refer to the "Build TLK" section. - -Once a BL32 is ready, TLKD can be compiled using the following command: - -CROSS_COMPILE=/bin/aarch64-none-elf- make NEED_BL1=0 -NEED_BL2=0 BL32= PLAT= all -_ -Trusted Little Kernel (TLK) -=========================== -TLK is a Trusted OS running as Secure EL1. It is a Free Open Source Software -(FOSS) release of the NVIDIA® Trusted Little Kernel (TLK) technology, which -extends technology made available with the development of the Little Kernel (LK). -You can download the LK modular embedded preemptive kernel for use on ARM, -x86, and AVR32 systems from https://github.com/travisg/lk - -NVIDIA implemented its Trusted Little Kernel (TLK) technology, designed as a -free and open-source trusted execution environment (OTE). - -TLK features include: - -• Small, pre-emptive kernel -• Supports multi-threading, IPCs, and thread scheduling -• Added TrustZone features -• Added Secure Storage -• Under MIT/FreeBSD license - -NVIDIA extensions to Little Kernel (LK) include: - -• User mode -• Address-space separation for TAs -• TLK Client Application (CA) library -• TLK TA library -• Crypto library (encrypt/decrypt, key handling) via OpenSSL -• Linux kernel driver -• Cortex A9/A15 support -• Power Management -• TrustZone memory carve-out (reconfigurable) -• Page table management -• Debugging support over UART (USB planned) - -TLK is hosted by NVIDIA on http://nv-tegra.nvidia.com under the -3rdparty/ote_partner/tlk.git repository. Detailed information about -TLK and OTE can be found in the Tegra_BSP_for_Android_TLK_FOSS_Reference.pdf -manual located under the "documentation" directory_. - -Build TLK -========= -To build and execute TLK, follow the instructions from "Building a TLK Device" -section from Tegra_BSP_for_Android_TLK_FOSS_Reference.pdf manual. diff --git a/plat/nvidia/tegra/common/tegra_bl31_setup.c b/plat/nvidia/tegra/common/tegra_bl31_setup.c index 628dc2a..7592903 100644 --- a/plat/nvidia/tegra/common/tegra_bl31_setup.c +++ b/plat/nvidia/tegra/common/tegra_bl31_setup.c @@ -82,7 +82,7 @@ #define BL31_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__) #endif -static entry_point_info_t bl33_image_ep_info; +static entry_point_info_t bl33_image_ep_info, bl32_image_ep_info; static plat_params_from_bl2_t plat_bl31_params_from_bl2 = { (uint64_t)TZDRAM_SIZE, (uintptr_t)NULL }; @@ -102,6 +102,9 @@ if (type == NON_SECURE) return &bl33_image_ep_info; + if (type == SECURE) + return &bl32_image_ep_info; + return NULL; } @@ -134,10 +137,11 @@ plat_crash_console_init(); /* - * Copy BL3-3 entry point information. + * Copy BL3-3, BL3-2 entry point information. * They are stored in Secure RAM, in BL2's address space. */ bl33_image_ep_info = *from_bl2->bl33_ep_info; + bl32_image_ep_info = *from_bl2->bl32_ep_info; /* * Parse platform specific parameters - TZDRAM aperture size and diff --git a/plat/nvidia/tegra/include/platform_def.h b/plat/nvidia/tegra/include/platform_def.h index 6be777e..d4b0ce2 100644 --- a/plat/nvidia/tegra/include/platform_def.h +++ b/plat/nvidia/tegra/include/platform_def.h @@ -69,8 +69,11 @@ /******************************************************************************* * BL31 specific defines. ******************************************************************************/ +#define BL31_SIZE 0x20000 #define BL31_BASE TZDRAM_BASE -#define BL31_LIMIT (TZDRAM_BASE + 0x11FFF) +#define BL31_LIMIT (TZDRAM_BASE + BL31_SIZE - 1) +#define BL32_BASE (TZDRAM_BASE + BL31_SIZE) +#define BL32_LIMIT TZDRAM_END /******************************************************************************* * Platform specific page table and MMU setup constants