1c97857dbSAmit NagalAMD Versal Gen 2 2c97857dbSAmit Nagal================ 3c97857dbSAmit Nagal 4c97857dbSAmit NagalTrusted Firmware-A implements the EL3 firmware layer for AMD Versal Gen 2. 5c97857dbSAmit NagalThe platform only uses the runtime part of TF-A as AMD Versal Gen 2 already 6c97857dbSAmit Nagalhas a BootROM (BL1) and PMC FW (BL2). 7c97857dbSAmit Nagal 8c97857dbSAmit NagalBL31 is TF-A. 9c97857dbSAmit NagalBL32 is an optional Secure Payload. 10c97857dbSAmit NagalBL33 is the non-secure world software (U-Boot, Linux etc). 11c97857dbSAmit Nagal 12c97857dbSAmit NagalTo build: 13c97857dbSAmit Nagal```bash 14c97857dbSAmit Nagalmake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal2 bl31 15c97857dbSAmit Nagal``` 16c97857dbSAmit Nagal 17c97857dbSAmit NagalTo build TF-A for JTAG DCC console: 18c97857dbSAmit Nagal```bash 19c97857dbSAmit Nagalmake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal2 CONSOLE=dcc bl31 20c97857dbSAmit Nagal``` 21c97857dbSAmit Nagal 22c97857dbSAmit NagalTo build TF-A with Errata management interface 23c97857dbSAmit Nagal```bash 24c97857dbSAmit Nagalmake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal2 bl31 ERRATA_ABI_SUPPORT=1 25c97857dbSAmit Nagal``` 26c97857dbSAmit Nagal 27c97857dbSAmit NagalTo build TF-A with IPI CRC check: 28c97857dbSAmit Nagal```bash 29c97857dbSAmit Nagalmake RESET_TO_BL31=1 CROSS_COMPILE=aarch64-none-elf- PLAT=versal2 bl31 IPI_CRC_CHECK=1 30c97857dbSAmit Nagal``` 31c97857dbSAmit Nagal 32c97857dbSAmit NagalAMD Versal Gen 2 platform specific build options 33c97857dbSAmit Nagal------------------------------------------------- 34c97857dbSAmit Nagal 35c97857dbSAmit Nagal* `MEM_BASE`: Specifies the base address of the bl31 binary. 36c97857dbSAmit Nagal* `MEM_SIZE`: Specifies the size of the memory region of the bl31 binary. 37c97857dbSAmit Nagal* `BL32_MEM_BASE`: Specifies the base address of the bl32 binary. 38c97857dbSAmit Nagal* `BL32_MEM_SIZE`: Specifies the size of the memory region of the bl32 binary. 39c97857dbSAmit Nagal 40c97857dbSAmit Nagal* `CONSOLE`: Select the console driver. Options: 41c97857dbSAmit Nagal - `pl011`, `pl011_0`: ARM pl011 UART 0 (default) 42c97857dbSAmit Nagal - `pl011_1` : ARM pl011 UART 1 43c97857dbSAmit Nagal - `dcc` : JTAG Debug Communication Channel(DCC) 44c97857dbSAmit Nagal 45*4efae6abSPrasad KummariConfigurable Stack Size 46*4efae6abSPrasad Kummari----------------------- 47*4efae6abSPrasad Kummari 48*4efae6abSPrasad KummariThe stack size in TF-A for the Versal platform is configurable. 49*4efae6abSPrasad KummariThe custom package can define the desired stack size as per the requirement in 50*4efae6abSPrasad Kummarithe makefile as follows: 51*4efae6abSPrasad Kummari 52*4efae6abSPrasad Kummari.. code-block:: shell 53*4efae6abSPrasad Kummari 54*4efae6abSPrasad Kummari PLATFORM_STACK_SIZE := <value> 55*4efae6abSPrasad Kummari 56*4efae6abSPrasad Kummari $(eval $(call add_define,PLATFORM_STACK_SIZE)) 57*4efae6abSPrasad Kummari 58*4efae6abSPrasad KummariCUSTOM SIP Service Support 59*4efae6abSPrasad Kummari-------------------------- 60*4efae6abSPrasad Kummari 61*4efae6abSPrasad Kummari- Dedicated SMC FID ``SOC_SIP_SVC_CUSTOM(0x82002000)`` (32-bit) / 62*4efae6abSPrasad Kummari ``(0xC2002000)`` (64-bit) is used by a custom package for providing 63*4efae6abSPrasad Kummari CUSTOM SIP service. 64*4efae6abSPrasad Kummari 65*4efae6abSPrasad Kummari- By default, the platform provides a bare minimum definition for 66*4efae6abSPrasad Kummari ``custom_smc_handler`` in this service. 67*4efae6abSPrasad Kummari 68*4efae6abSPrasad Kummari- To use this service, the custom package should implement its own SMC handler 69*4efae6abSPrasad Kummari named ``custom_smc_handler``. Once the custom package is included in the 70*4efae6abSPrasad Kummari TF-A build, its definition of ``custom_smc_handler`` is enabled. 71*4efae6abSPrasad Kummari 72*4efae6abSPrasad KummariCustom Package Makefile Fragment Inclusion in TF-A Build 73*4efae6abSPrasad Kummari-------------------------------------------------------- 74*4efae6abSPrasad Kummari 75*4efae6abSPrasad Kummari- Custom package is not directly part of the TF-A source. 76*4efae6abSPrasad Kummari 77*4efae6abSPrasad Kummari- ``<CUSTOM_PKG_PATH>`` is the location where the user clones a 78*4efae6abSPrasad Kummari custom package locally. 79*4efae6abSPrasad Kummari 80*4efae6abSPrasad Kummari- The custom package must implement a makefile fragment named 81*4efae6abSPrasad Kummari ``custom_pkg.mk`` so it can be included in the TF-A build. 82*4efae6abSPrasad Kummari 83*4efae6abSPrasad Kummari- ``custom_pkg.mk`` should specify all the rules to include custom package 84*4efae6abSPrasad Kummari specific header files, dependent libraries, and source files that are 85*4efae6abSPrasad Kummari required to be part of the TF-A build. 86*4efae6abSPrasad Kummari 87*4efae6abSPrasad Kummari- When ``<CUSTOM_PKG_PATH>`` is specified in the TF-A build command, 88*4efae6abSPrasad Kummari ``custom_pkg.mk`` is included from ``<CUSTOM_PKG_PATH>``. 89*4efae6abSPrasad Kummari 90*4efae6abSPrasad Kummari- Example TF-A build command: 91*4efae6abSPrasad Kummari 92*4efae6abSPrasad Kummari.. code-block:: shell 93*4efae6abSPrasad Kummari 94*4efae6abSPrasad Kummari make CROSS_COMPILE=aarch64-none-elf- PLAT=versal2 RESET_TO_BL31=1 bl31 CUSTOM_PKG_PATH=<...> 95c97857dbSAmit Nagal 96c97857dbSAmit NagalReference DEN0028E SMC calling convention 97c97857dbSAmit Nagal------------------------------------------ 98c97857dbSAmit Nagal 99c97857dbSAmit NagalAllocated subranges of Function Identifier to SIP services 100c97857dbSAmit Nagal------------------------------------------------------------ 101c97857dbSAmit Nagal 102c97857dbSAmit Nagal+-----------------------+-------------------------------------------------------+ 103c97857dbSAmit Nagal| SMC Function | Identifier Service type | 104c97857dbSAmit Nagal+-----------------------+-------------------------------------------------------+ 105c97857dbSAmit Nagal| 0xC2000000-0xC200FFFF | Fast SMC64 SiP Service Calls as per SMCCC Section 6.1 | 106c97857dbSAmit Nagal+-----------------------+-------------------------------------------------------+ 107c97857dbSAmit Nagal 108c97857dbSAmit NagalIPI SMC call ranges 109c97857dbSAmit Nagal------------------- 110c97857dbSAmit Nagal 111c97857dbSAmit Nagal+---------------------------+-----------------------------------------------------------+ 112c97857dbSAmit Nagal| SMC Function Identifier | Service type | 113c97857dbSAmit Nagal+---------------------------+-----------------------------------------------------------+ 114c97857dbSAmit Nagal| 0xc2001000-0xc2001FFF | Fast SMC64 SiP Service call range used for AMD-Xilinx IPI | 115c97857dbSAmit Nagal+---------------------------+-----------------------------------------------------------+ 116c97857dbSAmit Nagal 117c97857dbSAmit NagalPM SMC call ranges 118c97857dbSAmit Nagal------------------ 119c97857dbSAmit Nagal 120c97857dbSAmit Nagal+---------------------------+---------------------------------------------------------------------------+ 121c97857dbSAmit Nagal| SMC Function Identifier | Service type | 122c97857dbSAmit Nagal+---------------------------+---------------------------------------------------------------------------+ 123c97857dbSAmit Nagal| 0xc2000000-0xc2000FFF | Fast SMC64 SiP Service call range used for AMD-Xilinx Platform Management | 124c97857dbSAmit Nagal+---------------------------+---------------------------------------------------------------------------+ 125c97857dbSAmit Nagal 126c97857dbSAmit NagalSMC function IDs for SiP Service queries 127c97857dbSAmit Nagal---------------------------------------- 128c97857dbSAmit Nagal 129c97857dbSAmit Nagal+--------------+--------------+--------------+ 130c97857dbSAmit Nagal| Service | Call UID | Revision | 131c97857dbSAmit Nagal+--------------+--------------+--------------+ 132c97857dbSAmit Nagal| SiP Service | 0x8200_FF01 | 0x8200_FF03 | 133c97857dbSAmit Nagal+--------------+--------------+--------------+ 134c97857dbSAmit Nagal 135c97857dbSAmit NagalCall UID Query – Returns a unique identifier of the service provider. 136c97857dbSAmit Nagal 137c97857dbSAmit NagalRevision Query – Returns revision details of the service implementor. 138