124dba2b3SPaul BeesleyNVIDIA Tegra 224dba2b3SPaul Beesley============ 36f625747SDouglas Raillard 4fbd9eb58SVarun Wadekar- .. rubric:: T194 5fbd9eb58SVarun Wadekar :name: t194 6fbd9eb58SVarun Wadekar 7fbd9eb58SVarun WadekarT194 has eight NVIDIA Carmel CPU cores in a coherent multi-processor 8fbd9eb58SVarun Wadekarconfiguration. The Carmel cores support the ARM Architecture version 8.2, 9fbd9eb58SVarun Wadekarexecuting both 64-bit AArch64 code, and 32-bit AArch32 code. The Carmel 10fbd9eb58SVarun Wadekarprocessors are organized as four dual-core clusters, where each cluster has 11fbd9eb58SVarun Wadekara dedicated 2 MiB Level-2 unified cache. A high speed coherency fabric connects 12fbd9eb58SVarun Wadekarthese processor complexes and allows heterogeneous multi-processing with all 13fbd9eb58SVarun Wadekareight cores if required. 14fbd9eb58SVarun Wadekar 15a474d3d7SVarun Wadekar- .. rubric:: T186 16a474d3d7SVarun Wadekar :name: t186 17a474d3d7SVarun Wadekar 18a474d3d7SVarun WadekarThe NVIDIA® Parker (T186) series system-on-chip (SoC) delivers a heterogeneous 19a474d3d7SVarun Wadekarmulti-processing (HMP) solution designed to optimize performance and 20a474d3d7SVarun Wadekarefficiency. 21a474d3d7SVarun Wadekar 22a474d3d7SVarun WadekarT186 has Dual NVIDIA Denver2 ARM® CPU cores, plus Quad ARM Cortex®-A57 cores, 23a474d3d7SVarun Wadekarin a coherent multiprocessor configuration. The Denver 2 and Cortex-A57 cores 24a474d3d7SVarun Wadekarsupport ARMv8, executing both 64-bit Aarch64 code, and 32-bit Aarch32 code 25a474d3d7SVarun Wadekarincluding legacy ARMv7 applications. The Denver 2 processors each have 128 KB 26a474d3d7SVarun WadekarInstruction and 64 KB Data Level 1 caches; and have a 2MB shared Level 2 27a474d3d7SVarun Wadekarunified cache. The Cortex-A57 processors each have 48 KB Instruction and 32 KB 28a474d3d7SVarun WadekarData Level 1 caches; and also have a 2 MB shared Level 2 unified cache. A 29a474d3d7SVarun Wadekarhigh speed coherency fabric connects these two processor complexes and allows 30a474d3d7SVarun Wadekarheterogeneous multi-processing with all six cores if required. 31a474d3d7SVarun Wadekar 326f625747SDouglas RaillardDenver is NVIDIA's own custom-designed, 64-bit, dual-core CPU which is 334def07d5SDan Handleyfully Armv8-A architecture compatible. Each of the two Denver cores 346f625747SDouglas Raillardimplements a 7-way superscalar microarchitecture (up to 7 concurrent 356f625747SDouglas Raillardmicro-ops can be executed per clock), and includes a 128KB 4-way L1 366f625747SDouglas Raillardinstruction cache, a 64KB 4-way L1 data cache, and a 2MB 16-way L2 376f625747SDouglas Raillardcache, which services both cores. 386f625747SDouglas Raillard 396f625747SDouglas RaillardDenver implements an innovative process called Dynamic Code Optimization, 406f625747SDouglas Raillardwhich optimizes frequently used software routines at runtime into dense, 416f625747SDouglas Raillardhighly tuned microcode-equivalent routines. These are stored in a 426f625747SDouglas Raillarddedicated, 128MB main-memory-based optimization cache. After being read 436f625747SDouglas Raillardinto the instruction cache, the optimized micro-ops are executed, 446f625747SDouglas Raillardre-fetched and executed from the instruction cache as long as needed and 456f625747SDouglas Raillardcapacity allows. 466f625747SDouglas Raillard 476f625747SDouglas RaillardEffectively, this reduces the need to re-optimize the software routines. 486f625747SDouglas RaillardInstead of using hardware to extract the instruction-level parallelism 496f625747SDouglas Raillard(ILP) inherent in the code, Denver extracts the ILP once via software 506f625747SDouglas Raillardtechniques, and then executes those routines repeatedly, thus amortizing 516f625747SDouglas Raillardthe cost of ILP extraction over the many execution instances. 526f625747SDouglas Raillard 536f625747SDouglas RaillardDenver also features new low latency power-state transitions, in addition 546f625747SDouglas Raillardto extensive power-gating and dynamic voltage and clock scaling based on 556f625747SDouglas Raillardworkloads. 566f625747SDouglas Raillard 57d4ad3da0SVarun Wadekar- .. rubric:: T210 58d4ad3da0SVarun Wadekar :name: t210 59d4ad3da0SVarun Wadekar 60d4ad3da0SVarun WadekarT210 has Quad Arm® Cortex®-A57 cores in a switched configuration with a 61d4ad3da0SVarun Wadekarcompanion set of quad Arm Cortex-A53 cores. The Cortex-A57 and A53 cores 62d4ad3da0SVarun Wadekarsupport Armv8-A, executing both 64-bit Aarch64 code, and 32-bit Aarch32 code 63d4ad3da0SVarun Wadekarincluding legacy Armv7-A applications. The Cortex-A57 processors each have 64d4ad3da0SVarun Wadekar48 KB Instruction and 32 KB Data Level 1 caches; and have a 2 MB shared 65d4ad3da0SVarun WadekarLevel 2 unified cache. The Cortex-A53 processors each have 32 KB Instruction 66d4ad3da0SVarun Wadekarand 32 KB Data Level 1 caches; and have a 512 KB shared Level 2 unified cache. 67d4ad3da0SVarun Wadekar 686f625747SDouglas RaillardDirectory structure 6924dba2b3SPaul Beesley------------------- 706f625747SDouglas Raillard 716f625747SDouglas Raillard- plat/nvidia/tegra/common - Common code for all Tegra SoCs 726f625747SDouglas Raillard- plat/nvidia/tegra/soc/txxx - Chip specific code 736f625747SDouglas Raillard 746f625747SDouglas RaillardTrusted OS dispatcher 7524dba2b3SPaul Beesley--------------------- 766f625747SDouglas Raillard 77a474d3d7SVarun WadekarTegra supports multiple Trusted OS'. 78a474d3d7SVarun Wadekar 79a474d3d7SVarun Wadekar- Trusted Little Kernel (TLK): In order to include the 'tlkd' dispatcher in 80a474d3d7SVarun Wadekar the image, pass 'SPD=tlkd' on the command line while preparing a bl31 image. 81a474d3d7SVarun Wadekar- Trusty: In order to include the 'trusty' dispatcher in the image, pass 82a474d3d7SVarun Wadekar 'SPD=trusty' on the command line while preparing a bl31 image. 83a474d3d7SVarun Wadekar 84a474d3d7SVarun WadekarThis allows other Trusted OS vendors to use the upstream code and include 85a474d3d7SVarun Wadekartheir dispatchers in the image without changing any makefiles. 86a474d3d7SVarun Wadekar 87a474d3d7SVarun WadekarThese are the supported Trusted OS' by Tegra platforms. 88a474d3d7SVarun Wadekar 89fbd9eb58SVarun Wadekar- Tegra210: TLK and Trusty 90fbd9eb58SVarun Wadekar- Tegra186: Trusty 91fbd9eb58SVarun Wadekar- Tegra194: Trusty 926f625747SDouglas Raillard 93c2ad38ceSVarun WadekarScatter files 9424dba2b3SPaul Beesley------------- 95c2ad38ceSVarun Wadekar 96c2ad38ceSVarun WadekarTegra platforms currently support scatter files and ld.S scripts. The scatter 97c2ad38ceSVarun Wadekarfiles help support ARMLINK linker to generate BL31 binaries. For now, there 98c2ad38ceSVarun Wadekarexists a common scatter file, plat/nvidia/tegra/scat/bl31.scat, for all Tegra 99c2ad38ceSVarun WadekarSoCs. The `LINKER` build variable needs to point to the ARMLINK binary for 100c2ad38ceSVarun Wadekarthe scatter file to be used. Tegra platforms have verified BL31 image generation 101c2ad38ceSVarun Wadekarwith ARMCLANG (compilation) and ARMLINK (linking) for the Tegra186 platforms. 102c2ad38ceSVarun Wadekar 1036f625747SDouglas RaillardPreparing the BL31 image to run on Tegra SoCs 10424dba2b3SPaul Beesley--------------------------------------------- 1056f625747SDouglas Raillard 1066f625747SDouglas Raillard.. code:: shell 1076f625747SDouglas Raillard 1086f625747SDouglas Raillard CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- make PLAT=tegra \ 109d4ad3da0SVarun Wadekar TARGET_SOC=<target-soc e.g. t194|t186|t210> SPD=<dispatcher e.g. trusty|tlkd> 110a474d3d7SVarun Wadekar bl31 1116f625747SDouglas Raillard 112*fe7503bbSAaron KlingNote that all Tegra platforms only support compiling with GCC or ARMCLANG. Clang 113*fe7503bbSAaron Klingis not supported. Images will compile with clang, but will not boot. 114*fe7503bbSAaron Kling 1156f625747SDouglas RaillardPlatforms wanting to use different TZDRAM\_BASE, can add ``TZDRAM_BASE=<value>`` 1166f625747SDouglas Raillardto the build command line. 1176f625747SDouglas Raillard 1186f625747SDouglas RaillardThe Tegra platform code expects a pointer to the following platform specific 1196f625747SDouglas Raillardstructure via 'x1' register from the BL2 layer which is used by the 1206f625747SDouglas Raillardbl31\_early\_platform\_setup() handler to extract the TZDRAM carveout base and 1216f625747SDouglas Raillardsize for loading the Trusted OS and the UART port ID to be used. The Tegra 1226f625747SDouglas Raillardmemory controller driver programs this base/size in order to restrict NS 1236f625747SDouglas Raillardaccesses. 1246f625747SDouglas Raillard 1256f625747SDouglas Raillardtypedef struct plat\_params\_from\_bl2 { 1266f625747SDouglas Raillard/\* TZ memory size */ 1276f625747SDouglas Raillarduint64\_t tzdram\_size; 1286f625747SDouglas Raillard/* TZ memory base */ 1296f625747SDouglas Raillarduint64\_t tzdram\_base; 1306f625747SDouglas Raillard/* UART port ID \*/ 1316f625747SDouglas Raillardint uart\_id; 132b495791bSHarvey Hsieh/* L2 ECC parity protection disable flag \*/ 133b495791bSHarvey Hsiehint l2\_ecc\_parity\_prot\_dis; 134087cf68aSVarun Wadekar/* SHMEM base address for storing the boot logs \*/ 135087cf68aSVarun Wadekaruint64\_t boot\_profiler\_shmem\_base; 1366f625747SDouglas Raillard} plat\_params\_from\_bl2\_t; 1376f625747SDouglas Raillard 1386f625747SDouglas RaillardPower Management 13924dba2b3SPaul Beesley---------------- 1406f625747SDouglas Raillard 1416f625747SDouglas RaillardThe PSCI implementation expects each platform to expose the 'power state' 1426f625747SDouglas Raillardparameter to be used during the 'SYSTEM SUSPEND' call. The state-id field 1436f625747SDouglas Raillardis implementation defined on Tegra SoCs and is preferably defined by 1446f625747SDouglas Raillardtegra\_def.h. 1456f625747SDouglas Raillard 1466f625747SDouglas RaillardTegra configs 14724dba2b3SPaul Beesley------------- 1486f625747SDouglas Raillard 1496f625747SDouglas Raillard- 'tegra\_enable\_l2\_ecc\_parity\_prot': This flag enables the L2 ECC and Parity 1504def07d5SDan Handley Protection bit, for Arm Cortex-A57 CPUs, during CPU boot. This flag will 1516f625747SDouglas Raillard be enabled by Tegrs SoCs during 'Cluster power up' or 'System Suspend' exit. 152