124dba2b3SPaul BeesleyXilinx Versal 224dba2b3SPaul Beesley============= 324dba2b3SPaul Beesley 424dba2b3SPaul BeesleyTrusted Firmware-A implements the EL3 firmware layer for Xilinx Versal. 524dba2b3SPaul BeesleyThe platform only uses the runtime part of TF-A as Xilinx Versal already has a 624dba2b3SPaul BeesleyBootROM (BL1) and PMC FW (BL2). 724dba2b3SPaul Beesley 824dba2b3SPaul BeesleyBL31 is TF-A. 924dba2b3SPaul BeesleyBL32 is an optional Secure Payload. 1024dba2b3SPaul BeesleyBL33 is the non-secure world software (U-Boot, Linux etc). 1124dba2b3SPaul Beesley 1224dba2b3SPaul BeesleyTo build: 1324dba2b3SPaul Beesley```bash 1424dba2b3SPaul Beesleymake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal bl31 1524dba2b3SPaul Beesley``` 1624dba2b3SPaul Beesley 177b7c5350SPrasad KummariTo build bl32 TSP you have to rebuild bl31 too 187b7c5350SPrasad Kummari```bash 197b7c5350SPrasad Kummarimake CROSS_COMPILE=aarch64-none-elf- PLAT=versal SPD=tspd RESET_TO_BL31=1 bl31 bl32 207b7c5350SPrasad Kummari``` 217b7c5350SPrasad Kummari 220b25f404SVenkatesh Yadav AbbarapuTo build TF-A for JTAG DCC console 230b25f404SVenkatesh Yadav Abbarapu```bash 240b25f404SVenkatesh Yadav Abbarapumake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal bl31 VERSAL_CONSOLE=dcc 250b25f404SVenkatesh Yadav Abbarapu``` 260b25f404SVenkatesh Yadav Abbarapu 2796c031c7SPrasad KummariTo build TF-A with Errata management interface 2896c031c7SPrasad Kummari```bash 2996c031c7SPrasad Kummarimake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal bl31 ERRATA_ABI_SUPPORT=1 3096c031c7SPrasad Kummari``` 3196c031c7SPrasad Kummari 32302b4dfbSVenkatesh Yadav AbbarapuTo build TF-A with Straight-Line Speculation(SLS) 33302b4dfbSVenkatesh Yadav Abbarapu```bash 34302b4dfbSVenkatesh Yadav Abbarapumake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal bl31 HARDEN_SLS_ALL=1 35302b4dfbSVenkatesh Yadav Abbarapu``` 36302b4dfbSVenkatesh Yadav Abbarapu 3724dba2b3SPaul BeesleyXilinx Versal platform specific build options 3824dba2b3SPaul Beesley--------------------------------------------- 3924dba2b3SPaul Beesley 4024dba2b3SPaul Beesley* `VERSAL_ATF_MEM_BASE`: Specifies the base address of the bl31 binary. 4124dba2b3SPaul Beesley* `VERSAL_ATF_MEM_SIZE`: Specifies the size of the memory region of the bl31 binary. 4224dba2b3SPaul Beesley* `VERSAL_BL32_MEM_BASE`: Specifies the base address of the bl32 binary. 4324dba2b3SPaul Beesley* `VERSAL_BL32_MEM_SIZE`: Specifies the size of the memory region of the bl32 binary. 4424dba2b3SPaul Beesley 4524dba2b3SPaul Beesley* `VERSAL_CONSOLE`: Select the console driver. Options: 4624dba2b3SPaul Beesley - `pl011`, `pl011_0`: ARM pl011 UART 0 4724dba2b3SPaul Beesley - `pl011_1` : ARM pl011 UART 1 4824dba2b3SPaul Beesley 49ade92a64SJay Buddhabhatti* `CPU_PWRDWN_SGI`: Select the SGI for triggering CPU power down request to 50ade92a64SJay Buddhabhatti secondary cores on receiving power down callback from 51ade92a64SJay Buddhabhatti firmware. Options: 52ade92a64SJay Buddhabhatti 53ade92a64SJay Buddhabhatti - `0` : SGI 0 54ade92a64SJay Buddhabhatti - `1` : SGI 1 55ade92a64SJay Buddhabhatti - `2` : SGI 2 56ade92a64SJay Buddhabhatti - `3` : SGI 3 57ade92a64SJay Buddhabhatti - `4` : SGI 4 58ade92a64SJay Buddhabhatti - `5` : SGI 5 59ade92a64SJay Buddhabhatti - `6` : SGI 6 (Default) 60ade92a64SJay Buddhabhatti - `7` : SGI 7 61ade92a64SJay Buddhabhatti 6272b9f52dSPrasad KummariConfigurable Stack Size 6372b9f52dSPrasad Kummari----------------------- 6472b9f52dSPrasad Kummari 6572b9f52dSPrasad KummariThe stack size in TF-A for the Versal platform is configurable. 6672b9f52dSPrasad KummariThe custom package can define the desired stack size as per the requirement in 6772b9f52dSPrasad Kummarithe makefile as follows: 6872b9f52dSPrasad Kummari 6972b9f52dSPrasad Kummari.. code-block:: shell 7072b9f52dSPrasad Kummari 7172b9f52dSPrasad Kummari PLATFORM_STACK_SIZE := <value> 7272b9f52dSPrasad Kummari 7372b9f52dSPrasad Kummari $(eval $(call add_define,PLATFORM_STACK_SIZE)) 7472b9f52dSPrasad Kummari 7572b9f52dSPrasad KummariCUSTOM SIP Service Support 7672b9f52dSPrasad Kummari-------------------------- 7772b9f52dSPrasad Kummari 78*59230355SPrasad Kummari- Dedicated SMC FID ``SOC_SIP_SVC_CUSTOM(0x82002000)`` (32-bit) / 7972b9f52dSPrasad Kummari ``(0xC2002000)`` (64-bit) is used by a custom package for providing 8072b9f52dSPrasad Kummari CUSTOM SIP service. 8172b9f52dSPrasad Kummari 8272b9f52dSPrasad Kummari- By default, the platform provides a bare minimum definition for 8372b9f52dSPrasad Kummari ``custom_smc_handler`` in this service. 8472b9f52dSPrasad Kummari 8572b9f52dSPrasad Kummari- To use this service, the custom package should implement its own SMC handler 8672b9f52dSPrasad Kummari named ``custom_smc_handler``. Once the custom package is included in the 8772b9f52dSPrasad Kummari TF-A build, its definition of ``custom_smc_handler`` is enabled. 8872b9f52dSPrasad Kummari 8972b9f52dSPrasad KummariCustom Package Makefile Fragment Inclusion in TF-A Build 9072b9f52dSPrasad Kummari-------------------------------------------------------- 9172b9f52dSPrasad Kummari 9272b9f52dSPrasad Kummari- Custom package is not directly part of the TF-A source. 9372b9f52dSPrasad Kummari 9472b9f52dSPrasad Kummari- ``<CUSTOM_PKG_PATH>`` is the location where the user clones a 9572b9f52dSPrasad Kummari custom package locally. 9672b9f52dSPrasad Kummari 9772b9f52dSPrasad Kummari- The custom package must implement a makefile fragment named 9872b9f52dSPrasad Kummari ``custom_pkg.mk`` so it can be included in the TF-A build. 9972b9f52dSPrasad Kummari 10072b9f52dSPrasad Kummari- ``custom_pkg.mk`` should specify all the rules to include custom package 10172b9f52dSPrasad Kummari specific header files, dependent libraries, and source files that are 10272b9f52dSPrasad Kummari required to be part of the TF-A build. 10372b9f52dSPrasad Kummari 10472b9f52dSPrasad Kummari- When ``<CUSTOM_PKG_PATH>`` is specified in the TF-A build command, 10572b9f52dSPrasad Kummari ``custom_pkg.mk`` is included from ``<CUSTOM_PKG_PATH>``. 10672b9f52dSPrasad Kummari 10772b9f52dSPrasad Kummari- Example TF-A build command: 10872b9f52dSPrasad Kummari 10972b9f52dSPrasad Kummari.. code-block:: shell 11072b9f52dSPrasad Kummari 11172b9f52dSPrasad Kummari make CROSS_COMPILE=aarch64-none-elf- PLAT=versal RESET_TO_BL31=1 bl31 CUSTOM_PKG_PATH=<...> 11272b9f52dSPrasad Kummari 11331ce893eSVenkatesh Yadav Abbarapu# PLM->TF-A Parameter Passing 11431ce893eSVenkatesh Yadav Abbarapu------------------------------ 11531ce893eSVenkatesh Yadav AbbarapuThe PLM populates a data structure with image information for the TF-A. The TF-A 11631ce893eSVenkatesh Yadav Abbarapuuses that data to hand off to the loaded images. The address of the handoff 11731ce893eSVenkatesh Yadav Abbarapudata structure is passed in the ```PMC_GLOBAL_GLOB_GEN_STORAGE4``` register. 11831ce893eSVenkatesh Yadav AbbarapuThe register is free to be used by other software once the TF-A is bringing up 11931ce893eSVenkatesh Yadav Abbarapufurther firmware images. 120d8dc1cfaSPrasad Kummari 121d8dc1cfaSPrasad KummariReference DEN0028E SMC calling convention 122d8dc1cfaSPrasad Kummari------------------------------------------ 123d8dc1cfaSPrasad Kummari 124d8dc1cfaSPrasad KummariAllocated subranges of Function Identifier to SIP services 125d8dc1cfaSPrasad Kummari---------------------------------------------------------- 126d8dc1cfaSPrasad Kummari 127d8dc1cfaSPrasad Kummari+-----------------------+-------------------------------------------------------+ 128d8dc1cfaSPrasad Kummari| SMC Function | Identifier Service type | 129d8dc1cfaSPrasad Kummari+-----------------------+-------------------------------------------------------+ 130d8dc1cfaSPrasad Kummari| 0xC2000000-0xC200FFFF | Fast SMC64 SiP Service Calls as per SMCCC Section 6.1 | 131d8dc1cfaSPrasad Kummari+-----------------------+-------------------------------------------------------+ 132d8dc1cfaSPrasad Kummari 133d8dc1cfaSPrasad KummariIPI SMC call ranges 134d8dc1cfaSPrasad Kummari------------------- 135d8dc1cfaSPrasad Kummari 136d8dc1cfaSPrasad Kummari+---------------------------+-----------------------------------------------------------+ 137d8dc1cfaSPrasad Kummari| SMC Function Identifier | Service type | 138d8dc1cfaSPrasad Kummari+---------------------------+-----------------------------------------------------------+ 139d8dc1cfaSPrasad Kummari| 0xc2001000-0xc2001FFF | Fast SMC64 SiP Service call range used for AMD-Xilinx IPI | 140d8dc1cfaSPrasad Kummari+---------------------------+-----------------------------------------------------------+ 141d8dc1cfaSPrasad Kummari 142e1890297SJay BuddhabhattiPM SMC call ranges for SiP SVC version 0.1 143e1890297SJay Buddhabhatti-------------------------------------------------------- 144d8dc1cfaSPrasad Kummari 145d8dc1cfaSPrasad Kummari+---------------------------+---------------------------------------------------------------------------+ 146d8dc1cfaSPrasad Kummari| SMC Function Identifier | Service type | 147d8dc1cfaSPrasad Kummari+---------------------------+---------------------------------------------------------------------------+ 148d8dc1cfaSPrasad Kummari| 0xc2000000-0xc2000FFF | Fast SMC64 SiP Service call range used for AMD-Xilinx Platform Management | 149d8dc1cfaSPrasad Kummari+---------------------------+---------------------------------------------------------------------------+ 150d8dc1cfaSPrasad Kummari 151e1890297SJay BuddhabhattiPM SMC call ranges for SiP SVC version 0.2 152e1890297SJay Buddhabhatti-------------------------------------------------------- 153e1890297SJay Buddhabhatti 154e1890297SJay Buddhabhatti+---------------------------+---------------------------------------------------------------------------+ 155e1890297SJay Buddhabhatti| SMC Function Identifier | Service type | 156e1890297SJay Buddhabhatti+---------------------------+---------------------------------------------------------------------------+ 157e1890297SJay Buddhabhatti| 0xc2000FFF | Fast SMC64 SiP Service call used for pass-through of AMD-Xilinx Platform | 158e1890297SJay Buddhabhatti| | Management APIs to firmware | 159e1890297SJay Buddhabhatti+---------------------------+---------------------------------------------------------------------------+ 160e1890297SJay Buddhabhatti| 0xc2000A00-0xc2000AFF | Fast SMC64 SiP Service call range used for AMD-Xilinx Platform Management | 161e1890297SJay Buddhabhatti| | specific TF-A APIs | 162e1890297SJay Buddhabhatti+---------------------------+---------------------------------------------------------------------------+ 163e1890297SJay Buddhabhatti 164d8dc1cfaSPrasad KummariSMC function IDs for SiP Service queries 165d8dc1cfaSPrasad Kummari---------------------------------------- 166d8dc1cfaSPrasad Kummari 167d8dc1cfaSPrasad Kummari+--------------+--------------+--------------+ 168d8dc1cfaSPrasad Kummari| Service | Call UID | Revision | 169d8dc1cfaSPrasad Kummari+--------------+--------------+--------------+ 170d8dc1cfaSPrasad Kummari| SiP Service | 0x8200_FF01 | 0x8200_FF03 | 171d8dc1cfaSPrasad Kummari+--------------+--------------+--------------+ 172d8dc1cfaSPrasad Kummari 173d8dc1cfaSPrasad KummariCall UID Query – Returns a unique identifier of the service provider. 174d8dc1cfaSPrasad Kummari 175d8dc1cfaSPrasad KummariRevision Query – Returns revision details of the service implementor. 176