xref: /rk3399_ARM-atf/docs/plat/nvidia-tegra.rst (revision a474d3d700bcf4ff2c19694521e41c960b6cc091)
16f625747SDouglas RaillardTegra SoCs - Overview
26f625747SDouglas Raillard=====================
36f625747SDouglas Raillard
4*a474d3d7SVarun Wadekar-  .. rubric:: T186
5*a474d3d7SVarun Wadekar      :name: t186
6*a474d3d7SVarun Wadekar
7*a474d3d7SVarun WadekarThe NVIDIA® Parker (T186) series system-on-chip (SoC) delivers a heterogeneous
8*a474d3d7SVarun Wadekarmulti-processing (HMP) solution designed to optimize performance and
9*a474d3d7SVarun Wadekarefficiency.
10*a474d3d7SVarun Wadekar
11*a474d3d7SVarun WadekarT186 has Dual NVIDIA Denver 2 ARM® CPU cores, plus Quad ARM Cortex®-A57 cores,
12*a474d3d7SVarun Wadekarin a coherent multiprocessor configuration. The Denver 2 and Cortex-A57 cores
13*a474d3d7SVarun Wadekarsupport ARMv8, executing both 64-bit Aarch64 code, and 32-bit Aarch32 code
14*a474d3d7SVarun Wadekarincluding legacy ARMv7 applications. The Denver 2 processors each have 128 KB
15*a474d3d7SVarun WadekarInstruction and 64 KB Data Level 1 caches; and have a 2MB shared Level 2
16*a474d3d7SVarun Wadekarunified cache. The Cortex-A57 processors each have 48 KB Instruction and 32 KB
17*a474d3d7SVarun WadekarData Level 1 caches; and also have a 2 MB shared Level 2 unified cache. A
18*a474d3d7SVarun Wadekarhigh speed coherency fabric connects these two processor complexes and allows
19*a474d3d7SVarun Wadekarheterogeneous multi-processing with all six cores if required.
20*a474d3d7SVarun 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
69*a474d3d7SVarun WadekarTegra supports multiple Trusted OS'.
70*a474d3d7SVarun Wadekar
71*a474d3d7SVarun Wadekar- Trusted Little Kernel (TLK): In order to include the 'tlkd' dispatcher in
72*a474d3d7SVarun Wadekar  the image, pass 'SPD=tlkd' on the command line while preparing a bl31 image.
73*a474d3d7SVarun Wadekar- Trusty: In order to include the 'trusty' dispatcher in the image, pass
74*a474d3d7SVarun Wadekar  'SPD=trusty' on the command line while preparing a bl31 image.
75*a474d3d7SVarun Wadekar
76*a474d3d7SVarun WadekarThis allows other Trusted OS vendors to use the upstream code and include
77*a474d3d7SVarun Wadekartheir dispatchers in the image without changing any makefiles.
78*a474d3d7SVarun Wadekar
79*a474d3d7SVarun WadekarThese are the supported Trusted OS' by Tegra platforms.
80*a474d3d7SVarun Wadekar
81*a474d3d7SVarun WadekarTegra132: TLK
82*a474d3d7SVarun WadekarTegra210: TLK and Trusty
83*a474d3d7SVarun WadekarTegra186: Trusty
846f625747SDouglas Raillard
856f625747SDouglas RaillardPreparing the BL31 image to run on Tegra SoCs
866f625747SDouglas Raillard=============================================
876f625747SDouglas Raillard
886f625747SDouglas Raillard.. code:: shell
896f625747SDouglas Raillard
906f625747SDouglas Raillard    CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- make PLAT=tegra \
91*a474d3d7SVarun Wadekar    TARGET_SOC=<target-soc e.g. t186|t210|t132> SPD=<dispatcher e.g. trusty|tlkd>
92*a474d3d7SVarun Wadekar    bl31
936f625747SDouglas Raillard
946f625747SDouglas RaillardPlatforms wanting to use different TZDRAM\_BASE, can add ``TZDRAM_BASE=<value>``
956f625747SDouglas Raillardto the build command line.
966f625747SDouglas Raillard
976f625747SDouglas RaillardThe Tegra platform code expects a pointer to the following platform specific
986f625747SDouglas Raillardstructure via 'x1' register from the BL2 layer which is used by the
996f625747SDouglas Raillardbl31\_early\_platform\_setup() handler to extract the TZDRAM carveout base and
1006f625747SDouglas Raillardsize for loading the Trusted OS and the UART port ID to be used. The Tegra
1016f625747SDouglas Raillardmemory controller driver programs this base/size in order to restrict NS
1026f625747SDouglas Raillardaccesses.
1036f625747SDouglas Raillard
1046f625747SDouglas Raillardtypedef struct plat\_params\_from\_bl2 {
1056f625747SDouglas Raillard/\* TZ memory size */
1066f625747SDouglas Raillarduint64\_t tzdram\_size;
1076f625747SDouglas Raillard/* TZ memory base */
1086f625747SDouglas Raillarduint64\_t tzdram\_base;
1096f625747SDouglas Raillard/* UART port ID \*/
1106f625747SDouglas Raillardint uart\_id;
111b495791bSHarvey Hsieh/* L2 ECC parity protection disable flag \*/
112b495791bSHarvey Hsiehint l2\_ecc\_parity\_prot\_dis;
113087cf68aSVarun Wadekar/* SHMEM base address for storing the boot logs \*/
114087cf68aSVarun Wadekaruint64\_t boot\_profiler\_shmem\_base;
1156f625747SDouglas Raillard} plat\_params\_from\_bl2\_t;
1166f625747SDouglas Raillard
1176f625747SDouglas RaillardPower Management
1186f625747SDouglas Raillard================
1196f625747SDouglas Raillard
1206f625747SDouglas RaillardThe PSCI implementation expects each platform to expose the 'power state'
1216f625747SDouglas Raillardparameter to be used during the 'SYSTEM SUSPEND' call. The state-id field
1226f625747SDouglas Raillardis implementation defined on Tegra SoCs and is preferably defined by
1236f625747SDouglas Raillardtegra\_def.h.
1246f625747SDouglas Raillard
1256f625747SDouglas RaillardTegra configs
1266f625747SDouglas Raillard=============
1276f625747SDouglas Raillard
1286f625747SDouglas Raillard-  'tegra\_enable\_l2\_ecc\_parity\_prot': This flag enables the L2 ECC and Parity
1294def07d5SDan Handley   Protection bit, for Arm Cortex-A57 CPUs, during CPU boot. This flag will
1306f625747SDouglas Raillard   be enabled by Tegrs SoCs during 'Cluster power up' or 'System Suspend' exit.
131