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