16f625747SDouglas RaillardTegra SoCs - Overview 26f625747SDouglas Raillard===================== 36f625747SDouglas Raillard 4a474d3d7SVarun Wadekar- .. rubric:: T186 5a474d3d7SVarun Wadekar :name: t186 6a474d3d7SVarun Wadekar 7a474d3d7SVarun WadekarThe NVIDIA® Parker (T186) series system-on-chip (SoC) delivers a heterogeneous 8a474d3d7SVarun Wadekarmulti-processing (HMP) solution designed to optimize performance and 9a474d3d7SVarun Wadekarefficiency. 10a474d3d7SVarun Wadekar 11a474d3d7SVarun WadekarT186 has Dual NVIDIA Denver 2 ARM® CPU cores, plus Quad ARM Cortex®-A57 cores, 12a474d3d7SVarun Wadekarin a coherent multiprocessor configuration. The Denver 2 and Cortex-A57 cores 13a474d3d7SVarun Wadekarsupport ARMv8, executing both 64-bit Aarch64 code, and 32-bit Aarch32 code 14a474d3d7SVarun Wadekarincluding legacy ARMv7 applications. The Denver 2 processors each have 128 KB 15a474d3d7SVarun WadekarInstruction and 64 KB Data Level 1 caches; and have a 2MB shared Level 2 16a474d3d7SVarun Wadekarunified cache. The Cortex-A57 processors each have 48 KB Instruction and 32 KB 17a474d3d7SVarun WadekarData Level 1 caches; and also have a 2 MB shared Level 2 unified cache. A 18a474d3d7SVarun Wadekarhigh speed coherency fabric connects these two processor complexes and allows 19a474d3d7SVarun Wadekarheterogeneous multi-processing with all six cores if required. 20a474d3d7SVarun Wadekar 216f625747SDouglas Raillard- .. rubric:: T210 226f625747SDouglas Raillard :name: t210 236f625747SDouglas Raillard 244def07d5SDan HandleyT210 has Quad Arm® Cortex®-A57 cores in a switched configuration with a 254def07d5SDan Handleycompanion set of quad Arm Cortex-A53 cores. The Cortex-A57 and A53 cores 264def07d5SDan Handleysupport Armv8-A, executing both 64-bit Aarch64 code, and 32-bit Aarch32 code 274def07d5SDan Handleyincluding legacy Armv7-A applications. The Cortex-A57 processors each have 286f625747SDouglas Raillard48 KB Instruction and 32 KB Data Level 1 caches; and have a 2 MB shared 296f625747SDouglas RaillardLevel 2 unified cache. The Cortex-A53 processors each have 32 KB Instruction 306f625747SDouglas Raillardand 32 KB Data Level 1 caches; and have a 512 KB shared Level 2 unified cache. 316f625747SDouglas Raillard 326f625747SDouglas Raillard- .. rubric:: T132 336f625747SDouglas Raillard :name: t132 346f625747SDouglas Raillard 356f625747SDouglas RaillardDenver is NVIDIA's own custom-designed, 64-bit, dual-core CPU which is 364def07d5SDan Handleyfully Armv8-A architecture compatible. Each of the two Denver cores 376f625747SDouglas Raillardimplements a 7-way superscalar microarchitecture (up to 7 concurrent 386f625747SDouglas Raillardmicro-ops can be executed per clock), and includes a 128KB 4-way L1 396f625747SDouglas Raillardinstruction cache, a 64KB 4-way L1 data cache, and a 2MB 16-way L2 406f625747SDouglas Raillardcache, which services both cores. 416f625747SDouglas Raillard 426f625747SDouglas RaillardDenver implements an innovative process called Dynamic Code Optimization, 436f625747SDouglas Raillardwhich optimizes frequently used software routines at runtime into dense, 446f625747SDouglas Raillardhighly tuned microcode-equivalent routines. These are stored in a 456f625747SDouglas Raillarddedicated, 128MB main-memory-based optimization cache. After being read 466f625747SDouglas Raillardinto the instruction cache, the optimized micro-ops are executed, 476f625747SDouglas Raillardre-fetched and executed from the instruction cache as long as needed and 486f625747SDouglas Raillardcapacity allows. 496f625747SDouglas Raillard 506f625747SDouglas RaillardEffectively, this reduces the need to re-optimize the software routines. 516f625747SDouglas RaillardInstead of using hardware to extract the instruction-level parallelism 526f625747SDouglas Raillard(ILP) inherent in the code, Denver extracts the ILP once via software 536f625747SDouglas Raillardtechniques, and then executes those routines repeatedly, thus amortizing 546f625747SDouglas Raillardthe cost of ILP extraction over the many execution instances. 556f625747SDouglas Raillard 566f625747SDouglas RaillardDenver also features new low latency power-state transitions, in addition 576f625747SDouglas Raillardto extensive power-gating and dynamic voltage and clock scaling based on 586f625747SDouglas Raillardworkloads. 596f625747SDouglas Raillard 606f625747SDouglas RaillardDirectory structure 616f625747SDouglas Raillard=================== 626f625747SDouglas Raillard 636f625747SDouglas Raillard- plat/nvidia/tegra/common - Common code for all Tegra SoCs 646f625747SDouglas Raillard- plat/nvidia/tegra/soc/txxx - Chip specific code 656f625747SDouglas Raillard 666f625747SDouglas RaillardTrusted OS dispatcher 676f625747SDouglas Raillard===================== 686f625747SDouglas Raillard 69a474d3d7SVarun WadekarTegra supports multiple Trusted OS'. 70a474d3d7SVarun Wadekar 71a474d3d7SVarun Wadekar- Trusted Little Kernel (TLK): In order to include the 'tlkd' dispatcher in 72a474d3d7SVarun Wadekar the image, pass 'SPD=tlkd' on the command line while preparing a bl31 image. 73a474d3d7SVarun Wadekar- Trusty: In order to include the 'trusty' dispatcher in the image, pass 74a474d3d7SVarun Wadekar 'SPD=trusty' on the command line while preparing a bl31 image. 75a474d3d7SVarun Wadekar 76a474d3d7SVarun WadekarThis allows other Trusted OS vendors to use the upstream code and include 77a474d3d7SVarun Wadekartheir dispatchers in the image without changing any makefiles. 78a474d3d7SVarun Wadekar 79a474d3d7SVarun WadekarThese are the supported Trusted OS' by Tegra platforms. 80a474d3d7SVarun Wadekar 81a474d3d7SVarun WadekarTegra132: TLK 82a474d3d7SVarun WadekarTegra210: TLK and Trusty 83a474d3d7SVarun WadekarTegra186: Trusty 846f625747SDouglas Raillard 85*c2ad38ceSVarun WadekarScatter files 86*c2ad38ceSVarun Wadekar============= 87*c2ad38ceSVarun Wadekar 88*c2ad38ceSVarun WadekarTegra platforms currently support scatter files and ld.S scripts. The scatter 89*c2ad38ceSVarun Wadekarfiles help support ARMLINK linker to generate BL31 binaries. For now, there 90*c2ad38ceSVarun Wadekarexists a common scatter file, plat/nvidia/tegra/scat/bl31.scat, for all Tegra 91*c2ad38ceSVarun WadekarSoCs. The `LINKER` build variable needs to point to the ARMLINK binary for 92*c2ad38ceSVarun Wadekarthe scatter file to be used. Tegra platforms have verified BL31 image generation 93*c2ad38ceSVarun Wadekarwith ARMCLANG (compilation) and ARMLINK (linking) for the Tegra186 platforms. 94*c2ad38ceSVarun Wadekar 956f625747SDouglas RaillardPreparing the BL31 image to run on Tegra SoCs 966f625747SDouglas Raillard============================================= 976f625747SDouglas Raillard 986f625747SDouglas Raillard.. code:: shell 996f625747SDouglas Raillard 1006f625747SDouglas Raillard CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- make PLAT=tegra \ 101a474d3d7SVarun Wadekar TARGET_SOC=<target-soc e.g. t186|t210|t132> SPD=<dispatcher e.g. trusty|tlkd> 102a474d3d7SVarun Wadekar bl31 1036f625747SDouglas Raillard 1046f625747SDouglas RaillardPlatforms wanting to use different TZDRAM\_BASE, can add ``TZDRAM_BASE=<value>`` 1056f625747SDouglas Raillardto the build command line. 1066f625747SDouglas Raillard 1076f625747SDouglas RaillardThe Tegra platform code expects a pointer to the following platform specific 1086f625747SDouglas Raillardstructure via 'x1' register from the BL2 layer which is used by the 1096f625747SDouglas Raillardbl31\_early\_platform\_setup() handler to extract the TZDRAM carveout base and 1106f625747SDouglas Raillardsize for loading the Trusted OS and the UART port ID to be used. The Tegra 1116f625747SDouglas Raillardmemory controller driver programs this base/size in order to restrict NS 1126f625747SDouglas Raillardaccesses. 1136f625747SDouglas Raillard 1146f625747SDouglas Raillardtypedef struct plat\_params\_from\_bl2 { 1156f625747SDouglas Raillard/\* TZ memory size */ 1166f625747SDouglas Raillarduint64\_t tzdram\_size; 1176f625747SDouglas Raillard/* TZ memory base */ 1186f625747SDouglas Raillarduint64\_t tzdram\_base; 1196f625747SDouglas Raillard/* UART port ID \*/ 1206f625747SDouglas Raillardint uart\_id; 121b495791bSHarvey Hsieh/* L2 ECC parity protection disable flag \*/ 122b495791bSHarvey Hsiehint l2\_ecc\_parity\_prot\_dis; 123087cf68aSVarun Wadekar/* SHMEM base address for storing the boot logs \*/ 124087cf68aSVarun Wadekaruint64\_t boot\_profiler\_shmem\_base; 1256f625747SDouglas Raillard} plat\_params\_from\_bl2\_t; 1266f625747SDouglas Raillard 1276f625747SDouglas RaillardPower Management 1286f625747SDouglas Raillard================ 1296f625747SDouglas Raillard 1306f625747SDouglas RaillardThe PSCI implementation expects each platform to expose the 'power state' 1316f625747SDouglas Raillardparameter to be used during the 'SYSTEM SUSPEND' call. The state-id field 1326f625747SDouglas Raillardis implementation defined on Tegra SoCs and is preferably defined by 1336f625747SDouglas Raillardtegra\_def.h. 1346f625747SDouglas Raillard 1356f625747SDouglas RaillardTegra configs 1366f625747SDouglas Raillard============= 1376f625747SDouglas Raillard 1386f625747SDouglas Raillard- 'tegra\_enable\_l2\_ecc\_parity\_prot': This flag enables the L2 ECC and Parity 1394def07d5SDan Handley Protection bit, for Arm Cortex-A57 CPUs, during CPU boot. This flag will 1406f625747SDouglas Raillard be enabled by Tegrs SoCs during 'Cluster power up' or 'System Suspend' exit. 141