xref: /arm-trusted-firmware/docs/plat/arm/arm_fpga/index.rst (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700SchasingluluArm FPGA Platform
2*91f16700Schasinglulu=================
3*91f16700Schasinglulu
4*91f16700SchasingluluThis platform supports FPGA images used internally in Arm Ltd., for
5*91f16700Schasinglulutesting and bringup of new cores. With that focus, peripheral support is
6*91f16700Schasingluluminimal: there is no mass storage or display output, for instance. Also
7*91f16700Schasingluluthis port ignores any power management features of the platform.
8*91f16700SchasingluluSome interconnect setup is done internally by the platform, so the TF-A code
9*91f16700Schasinglulujust needs to setup UART and GIC.
10*91f16700Schasinglulu
11*91f16700SchasingluluThe FPGA platform requires to pass on a DTB for the non-secure payload
12*91f16700Schasinglulu(mostly Linux), so we let TF-A use information from the DTB for dynamic
13*91f16700Schasingluluconfiguration: the UART and GIC base addresses are read from there.
14*91f16700Schasinglulu
15*91f16700SchasingluluAs a result this port is a fairly generic BL31-only port, which can serve
16*91f16700Schasingluluas a template for a minimal new (and possibly DT-based) platform port.
17*91f16700Schasinglulu
18*91f16700SchasingluluThe aim of this port is to support as many FPGA images as possible with
19*91f16700Schasinglulua single build. Image specific data must be described in the DTB or should
20*91f16700Schasinglulube auto-detected at runtime.
21*91f16700Schasinglulu
22*91f16700SchasingluluAs the number and topology layout of the CPU cores differs significantly
23*91f16700Schasingluluacross the various images, this is detected at runtime by BL31.
24*91f16700SchasingluluThe /cpus node in the DT will be added and filled accordingly, as long as
25*91f16700Schasingluluit does not exist already.
26*91f16700Schasinglulu
27*91f16700SchasingluluPlatform-specific build options
28*91f16700Schasinglulu-------------------------------
29*91f16700Schasinglulu
30*91f16700Schasinglulu-  ``SUPPORT_UNKNOWN_MPID`` : Boolean option to allow unknown MPIDR registers.
31*91f16700Schasinglulu   Normally TF-A panics if it encounters a MPID value not matched to its
32*91f16700Schasinglulu   internal list, but for new or experimental cores this creates a lot of
33*91f16700Schasinglulu   churn. With this option, the code will fall back to some basic CPU support
34*91f16700Schasinglulu   code (only architectural system registers, and no errata).
35*91f16700Schasinglulu   Default value of this flag is 1.
36*91f16700Schasinglulu
37*91f16700Schasinglulu-  ``PRELOADED_BL33_BASE`` : Physical address of the BL33 non-secure payload.
38*91f16700Schasinglulu   It must have been loaded into DRAM already, typically this is done by
39*91f16700Schasinglulu   the script that also loads BL31 and the DTB.
40*91f16700Schasinglulu   It defaults to 0x80080000, which is the traditional load address for an
41*91f16700Schasinglulu   arm64 Linux kernel.
42*91f16700Schasinglulu
43*91f16700Schasinglulu-  ``FPGA_PRELOADED_DTB_BASE`` : Physical address of the flattened device
44*91f16700Schasinglulu   tree blob (DTB). This DT will be used by TF-A for dynamic configuration,
45*91f16700Schasinglulu   so it must describe at least the UART and a GICv3 interrupt controller.
46*91f16700Schasinglulu   The DT gets amended by the code, to potentially add a command line and
47*91f16700Schasinglulu   fill the CPU topology nodes. It will also be passed on to BL33, by
48*91f16700Schasinglulu   putting its address into the x0 register before jumping to the entry
49*91f16700Schasinglulu   point (following the Linux kernel boot protocol).
50*91f16700Schasinglulu   It defaults to 0x80070000, which is 64KB before the BL33 load address.
51*91f16700Schasinglulu
52*91f16700Schasinglulu-  ``FPGA_PRELOADED_CMD_LINE`` : Physical address of the command line to
53*91f16700Schasinglulu   put into the devicetree blob. Due to the lack of a proper bootloader,
54*91f16700Schasinglulu   a command line can be put somewhere into memory, so that BL31 will
55*91f16700Schasinglulu   detect it and copy it into the DTB passed on to BL33.
56*91f16700Schasinglulu   To avoid random garbage, there needs to be a "CMD:" signature before the
57*91f16700Schasinglulu   actual command line.
58*91f16700Schasinglulu   Defaults to 0x1000, which is normally in the "ROM" space of the typical
59*91f16700Schasinglulu   FPGA image (which can be written by the FPGA payload uploader, but is
60*91f16700Schasinglulu   read-only to the CPU). The FPGA payload tool should be given a text file
61*91f16700Schasinglulu   containing the desired command line, prefixed by the "CMD:" signature.
62*91f16700Schasinglulu
63*91f16700SchasingluluBuilding the TF-A image
64*91f16700Schasinglulu-----------------------
65*91f16700Schasinglulu
66*91f16700Schasinglulu   .. code:: shell
67*91f16700Schasinglulu
68*91f16700Schasinglulu       make PLAT=arm_fgpa DEBUG=1
69*91f16700Schasinglulu
70*91f16700Schasinglulu   This will use the default load addresses as described above. When those
71*91f16700Schasinglulu   addresses need to differ for a certain setup, they can be passed on the
72*91f16700Schasinglulu   make command line:
73*91f16700Schasinglulu
74*91f16700Schasinglulu   .. code:: shell
75*91f16700Schasinglulu
76*91f16700Schasinglulu       make PLAT=arm_fgpa DEBUG=1 PRELOADED_BL33_BASE=0x80200000 FPGA_PRELOADED_DTB_BASE=0x80180000 bl31
77*91f16700Schasinglulu
78*91f16700SchasingluluRunning the TF-A image
79*91f16700Schasinglulu----------------------
80*91f16700Schasinglulu
81*91f16700SchasingluluAfter building TF-A, the actual TF-A code will be located in ``bl31.bin`` in
82*91f16700Schasingluluthe build directory.
83*91f16700SchasingluluAdditionally there is a ``bl31.axf`` ELF file, which contains BL31, as well
84*91f16700Schasingluluas some simple ROM trampoline code (required by the Arm FPGA boot flow) and
85*91f16700Schasinglulua generic DTB to support most of the FPGA images. This can be simply handed
86*91f16700Schasingluluover to the FPGA payload uploader, which will take care of loading the
87*91f16700Schasinglulucomponents at their respective load addresses. In addition to this file
88*91f16700Schasingluluyou need at least a BL33 payload (typically a Linux kernel image), optionally
89*91f16700Schasinglulua Linux initrd image file and possibly a command line:
90*91f16700Schasinglulu
91*91f16700Schasinglulu   .. code:: shell
92*91f16700Schasinglulu
93*91f16700Schasinglulu       fpga-run ... -m bl31.axf -l auto -m Image -l 0x80080000 -m initrd.gz -l 0x84000000 -m cmdline.txt -l 0x1000
94*91f16700Schasinglulu
95*91f16700Schasinglulu--------------
96*91f16700Schasinglulu
97*91f16700Schasinglulu*Copyright (c) 2020, Arm Limited. All rights reserved.*
98