xref: /arm-trusted-firmware/docs/plat/marvell/armada/build.rst (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700SchasingluluTF-A Build Instructions for Marvell Platforms
2*91f16700Schasinglulu=============================================
3*91f16700Schasinglulu
4*91f16700SchasingluluThis section describes how to compile the Trusted Firmware-A (TF-A) project for Marvell's platforms.
5*91f16700Schasinglulu
6*91f16700SchasingluluBuild Instructions
7*91f16700Schasinglulu------------------
8*91f16700Schasinglulu(1) Set the cross compiler
9*91f16700Schasinglulu
10*91f16700Schasinglulu    .. code:: shell
11*91f16700Schasinglulu
12*91f16700Schasinglulu        > export CROSS_COMPILE=/path/to/toolchain/aarch64-linux-gnu-
13*91f16700Schasinglulu
14*91f16700Schasinglulu(2) Set path for FIP images:
15*91f16700Schasinglulu
16*91f16700SchasingluluSet U-Boot image path (relatively to TF-A root or absolute path)
17*91f16700Schasinglulu
18*91f16700Schasinglulu    .. code:: shell
19*91f16700Schasinglulu
20*91f16700Schasinglulu        > export BL33=path/to/u-boot.bin
21*91f16700Schasinglulu
22*91f16700SchasingluluFor example: if U-Boot project (and its images) is located at ``~/project/u-boot``,
23*91f16700SchasingluluBL33 should be ``~/project/u-boot/u-boot.bin``
24*91f16700Schasinglulu
25*91f16700Schasinglulu    .. note::
26*91f16700Schasinglulu
27*91f16700Schasinglulu       *u-boot.bin* should be used and not *u-boot-spl.bin*
28*91f16700Schasinglulu
29*91f16700SchasingluluSet MSS/SCP image path (mandatory only for A7K/A8K/CN913x when MSS_SUPPORT=1)
30*91f16700Schasinglulu
31*91f16700Schasinglulu    .. code:: shell
32*91f16700Schasinglulu
33*91f16700Schasinglulu        > export SCP_BL2=path/to/mrvl_scp_bl2*.img
34*91f16700Schasinglulu
35*91f16700Schasinglulu(3) Armada-37x0 build requires WTP tools installation.
36*91f16700Schasinglulu
37*91f16700SchasingluluSee below in the section "Tools and external components installation".
38*91f16700SchasingluluInstall ARM 32-bit cross compiler, which is required for building WTMI image for CM3
39*91f16700Schasinglulu
40*91f16700Schasinglulu    .. code:: shell
41*91f16700Schasinglulu
42*91f16700Schasinglulu        > sudo apt-get install gcc-arm-linux-gnueabi
43*91f16700Schasinglulu
44*91f16700Schasinglulu(4) Clean previous build residuals (if any)
45*91f16700Schasinglulu
46*91f16700Schasinglulu    .. code:: shell
47*91f16700Schasinglulu
48*91f16700Schasinglulu        > make distclean
49*91f16700Schasinglulu
50*91f16700Schasinglulu(5) Build TF-A
51*91f16700Schasinglulu
52*91f16700SchasingluluThere are several build options:
53*91f16700Schasinglulu
54*91f16700Schasinglulu- PLAT
55*91f16700Schasinglulu
56*91f16700Schasinglulu        Supported Marvell platforms are:
57*91f16700Schasinglulu
58*91f16700Schasinglulu            - a3700        - A3720 DB, EspressoBin and Turris MOX
59*91f16700Schasinglulu            - a70x0
60*91f16700Schasinglulu            - a70x0_amc    - AMC board
61*91f16700Schasinglulu            - a70x0_mochabin - Globalscale MOCHAbin
62*91f16700Schasinglulu            - a80x0
63*91f16700Schasinglulu            - a80x0_mcbin  - MacchiatoBin
64*91f16700Schasinglulu            - a80x0_puzzle - IEI Puzzle-M801
65*91f16700Schasinglulu            - t9130        - CN913x
66*91f16700Schasinglulu            - t9130_cex7_eval - CN913x CEx7 Evaluation Board
67*91f16700Schasinglulu
68*91f16700Schasinglulu- DEBUG
69*91f16700Schasinglulu
70*91f16700Schasinglulu        Default is without debug information (=0). in order to enable it use ``DEBUG=1``.
71*91f16700Schasinglulu        Can be enabled also when building UART recovery images, there is no issue with it.
72*91f16700Schasinglulu
73*91f16700Schasinglulu        Production TF-A images should be built without this debug option!
74*91f16700Schasinglulu
75*91f16700Schasinglulu- LOG_LEVEL
76*91f16700Schasinglulu
77*91f16700Schasinglulu        Defines the level of logging which will be purged to the default output port.
78*91f16700Schasinglulu
79*91f16700Schasinglulu            -  0 - LOG_LEVEL_NONE
80*91f16700Schasinglulu            - 10 - LOG_LEVEL_ERROR
81*91f16700Schasinglulu            - 20 - LOG_LEVEL_NOTICE (default for DEBUG=0)
82*91f16700Schasinglulu            - 30 - LOG_LEVEL_WARNING
83*91f16700Schasinglulu            - 40 - LOG_LEVEL_INFO (default for DEBUG=1)
84*91f16700Schasinglulu            - 50 - LOG_LEVEL_VERBOSE
85*91f16700Schasinglulu
86*91f16700Schasinglulu- USE_COHERENT_MEM
87*91f16700Schasinglulu
88*91f16700Schasinglulu        This flag determines whether to include the coherent memory region in the
89*91f16700Schasinglulu        BL memory map or not. Enabled by default.
90*91f16700Schasinglulu
91*91f16700Schasinglulu- LLC_ENABLE
92*91f16700Schasinglulu
93*91f16700Schasinglulu        Flag defining the LLC (L3) cache state. The cache is enabled by default (``LLC_ENABLE=1``).
94*91f16700Schasinglulu
95*91f16700Schasinglulu- LLC_SRAM
96*91f16700Schasinglulu
97*91f16700Schasinglulu        Flag enabling the LLC (L3) cache SRAM support. The LLC SRAM is activated and used
98*91f16700Schasinglulu        by Trusted OS (OP-TEE OS, BL32). The TF-A only prepares CCU address translation windows
99*91f16700Schasinglulu        for SRAM address range at BL31 execution stage with window target set to DRAM-0.
100*91f16700Schasinglulu        When Trusted OS activates LLC SRAM, the CCU window target is changed to SRAM.
101*91f16700Schasinglulu        There is no reason to enable this feature if OP-TEE OS built with CFG_WITH_PAGER=n.
102*91f16700Schasinglulu        Only set LLC_SRAM=1 if OP-TEE OS is built with CFG_WITH_PAGER=y.
103*91f16700Schasinglulu
104*91f16700Schasinglulu- MARVELL_SECURE_BOOT
105*91f16700Schasinglulu
106*91f16700Schasinglulu        Build trusted(=1)/non trusted(=0) image, default is non trusted.
107*91f16700Schasinglulu        This parameter is used only for ``mrvl_flash`` and ``mrvl_uart`` targets.
108*91f16700Schasinglulu
109*91f16700Schasinglulu- MV_DDR_PATH
110*91f16700Schasinglulu
111*91f16700Schasinglulu        This parameter is required for ``mrvl_flash`` and ``mrvl_uart`` targets.
112*91f16700Schasinglulu        For A7K/A8K/CN913x it is used for BLE build and for Armada37x0 it used
113*91f16700Schasinglulu        for ddr_tool build.
114*91f16700Schasinglulu
115*91f16700Schasinglulu        Specify path to the full checkout of Marvell mv-ddr-marvell git
116*91f16700Schasinglulu        repository. Checkout must contain also .git subdirectory because
117*91f16700Schasinglulu        mv-ddr build process calls git commands.
118*91f16700Schasinglulu
119*91f16700Schasinglulu        Do not remove any parts of git checkout becuase build process and other
120*91f16700Schasinglulu        applications need them for correct building and version determination.
121*91f16700Schasinglulu
122*91f16700Schasinglulu
123*91f16700SchasingluluCN913x specific build options:
124*91f16700Schasinglulu
125*91f16700Schasinglulu- CP_NUM
126*91f16700Schasinglulu
127*91f16700Schasinglulu        Total amount of CPs (South Bridge) connected to AP. When the parameter is omitted,
128*91f16700Schasinglulu        the build uses the default number of CPs, which is a number of embedded CPs inside the
129*91f16700Schasinglulu        package: 1 or 2 depending on the SoC used. The parameter is valid for OcteonTX2 CN913x SoC
130*91f16700Schasinglulu        family (PLAT=t9130), which can have external CPs connected to the MCI ports. Valid
131*91f16700Schasinglulu        values with CP_NUM are in a range of 1 to 3.
132*91f16700Schasinglulu
133*91f16700Schasinglulu
134*91f16700SchasingluluA7K/A8K/CN913x specific build options:
135*91f16700Schasinglulu
136*91f16700Schasinglulu- BLE_PATH
137*91f16700Schasinglulu
138*91f16700Schasinglulu        Points to BLE (Binary ROM extension) sources folder.
139*91f16700Schasinglulu        The parameter is optional, its default value is ``plat/marvell/armada/a8k/common/ble``
140*91f16700Schasinglulu        which uses TF-A in-tree BLE implementation.
141*91f16700Schasinglulu
142*91f16700Schasinglulu- MSS_SUPPORT
143*91f16700Schasinglulu
144*91f16700Schasinglulu        When ``MSS_SUPPORT=1``, then TF-A includes support for Management SubSystem (MSS).
145*91f16700Schasinglulu        When enabled it is required to specify path to the MSS firmware image via ``SCP_BL2``
146*91f16700Schasinglulu        option.
147*91f16700Schasinglulu
148*91f16700Schasinglulu        This option is by default enabled.
149*91f16700Schasinglulu
150*91f16700Schasinglulu- SCP_BL2
151*91f16700Schasinglulu
152*91f16700Schasinglulu        Specify path to the MSS fimware image binary which will run on Cortex-M3 coprocessor.
153*91f16700Schasinglulu        It is available in Marvell binaries-marvell git repository. Required when ``MSS_SUPPORT=1``.
154*91f16700Schasinglulu
155*91f16700SchasingluluGlobalscale MOCHAbin specific build options:
156*91f16700Schasinglulu
157*91f16700Schasinglulu- DDR_TOPOLOGY
158*91f16700Schasinglulu
159*91f16700Schasinglulu        The DDR topology map index/name, default is 0.
160*91f16700Schasinglulu
161*91f16700Schasinglulu        Supported Options:
162*91f16700Schasinglulu            -    0 - DDR4 1CS 2GB
163*91f16700Schasinglulu            -    1 - DDR4 1CS 4GB
164*91f16700Schasinglulu            -    2 - DDR4 2CS 8GB
165*91f16700Schasinglulu
166*91f16700SchasingluluArmada37x0 specific build options:
167*91f16700Schasinglulu
168*91f16700Schasinglulu- HANDLE_EA_EL3_FIRST_NS
169*91f16700Schasinglulu
170*91f16700Schasinglulu        When ``HANDLE_EA_EL3_FIRST_NS=1``, External Aborts and SError Interrupts, resulting from errors
171*91f16700Schasinglulu        in NS world, will be always trapped in TF-A. TF-A in this case enables dirty hack / workaround for
172*91f16700Schasinglulu        a bug found in U-Boot and Linux kernel PCIe controller driver pci-aardvark.c, traps and then masks
173*91f16700Schasinglulu        SError interrupt caused by AXI SLVERR on external access (syndrome 0xbf000002).
174*91f16700Schasinglulu
175*91f16700Schasinglulu        Otherwise when ``HANDLE_EA_EL3_FIRST_NS=0``, these exceptions will be trapped in the current
176*91f16700Schasinglulu        exception level (or in EL1 if the current exception level is EL0). So exceptions caused by
177*91f16700Schasinglulu        U-Boot will be trapped in U-Boot, exceptions caused by Linux kernel (or user applications)
178*91f16700Schasinglulu        will be trapped in Linux kernel.
179*91f16700Schasinglulu
180*91f16700Schasinglulu        Mentioned bug in pci-aardvark.c driver is fixed in U-Boot version v2021.07 and Linux kernel
181*91f16700Schasinglulu        version v5.13 (workarounded since Linux kernel version 5.9) and also backported in Linux
182*91f16700Schasinglulu        kernel stable releases since versions v5.12.13, v5.10.46, v5.4.128, v4.19.198, v4.14.240.
183*91f16700Schasinglulu
184*91f16700Schasinglulu        If target system has already patched version of U-Boot and Linux kernel then it is strongly
185*91f16700Schasinglulu        recommended to not enable this workaround as it disallows propagating of all External Aborts
186*91f16700Schasinglulu        to running Linux kernel and makes correctable errors as fatal aborts.
187*91f16700Schasinglulu
188*91f16700Schasinglulu        This option is now disabled by default. In past this option has different name "HANDLE_EA_EL3_FIRST" and
189*91f16700Schasinglulu        was enabled by default in TF-A versions v2.2, v2.3, v2.4 and v2.5.
190*91f16700Schasinglulu
191*91f16700Schasinglulu- CM3_SYSTEM_RESET
192*91f16700Schasinglulu
193*91f16700Schasinglulu        When ``CM3_SYSTEM_RESET=1``, the Cortex-M3 secure coprocessor will be used for system reset.
194*91f16700Schasinglulu
195*91f16700Schasinglulu        TF-A will send command 0x0009 with a magic value via the rWTM mailbox interface to the
196*91f16700Schasinglulu        Cortex-M3 secure coprocessor.
197*91f16700Schasinglulu        The firmware running in the coprocessor must either implement this functionality or
198*91f16700Schasinglulu        ignore the 0x0009 command (which is true for the firmware from A3700-utils-marvell
199*91f16700Schasinglulu        repository). If this option is enabled but the firmware does not support this command,
200*91f16700Schasinglulu        an error message will be printed prior trying to reboot via the usual way.
201*91f16700Schasinglulu
202*91f16700Schasinglulu        This option is needed on Turris MOX as a workaround to a HW bug which causes reset to
203*91f16700Schasinglulu        sometime hang the board.
204*91f16700Schasinglulu
205*91f16700Schasinglulu- A3720_DB_PM_WAKEUP_SRC
206*91f16700Schasinglulu
207*91f16700Schasinglulu        For Armada 3720 Development Board only, when ``A3720_DB_PM_WAKEUP_SRC=1``,
208*91f16700Schasinglulu        TF-A will setup PM wake up src configuration. This option is disabled by default.
209*91f16700Schasinglulu
210*91f16700Schasinglulu
211*91f16700SchasingluluArmada37x0 specific build options for ``mrvl_flash`` and ``mrvl_uart`` targets:
212*91f16700Schasinglulu
213*91f16700Schasinglulu- DDR_TOPOLOGY
214*91f16700Schasinglulu
215*91f16700Schasinglulu        The DDR topology map index/name, default is 0.
216*91f16700Schasinglulu
217*91f16700Schasinglulu        Supported Options:
218*91f16700Schasinglulu            -    0 - DDR3 1CS 512MB (DB-88F3720-DDR3-Modular, EspressoBin V3-V5)
219*91f16700Schasinglulu            -    1 - DDR4 1CS 512MB (DB-88F3720-DDR4-Modular)
220*91f16700Schasinglulu            -    2 - DDR3 2CS   1GB (EspressoBin V3-V5)
221*91f16700Schasinglulu            -    3 - DDR4 2CS   4GB (DB-88F3720-DDR4-Modular)
222*91f16700Schasinglulu            -    4 - DDR3 1CS   1GB (DB-88F3720-DDR3-Modular, EspressoBin V3-V5)
223*91f16700Schasinglulu            -    5 - DDR4 1CS   1GB (EspressoBin V7, EspressoBin-Ultra)
224*91f16700Schasinglulu            -    6 - DDR4 2CS   2GB (EspressoBin V7)
225*91f16700Schasinglulu            -    7 - DDR3 2CS   2GB (EspressoBin V3-V5)
226*91f16700Schasinglulu            - CUST - CUSTOMER BOARD (Customer board settings)
227*91f16700Schasinglulu
228*91f16700Schasinglulu- CLOCKSPRESET
229*91f16700Schasinglulu
230*91f16700Schasinglulu        The clock tree configuration preset including CPU and DDR frequency,
231*91f16700Schasinglulu        default is CPU_800_DDR_800.
232*91f16700Schasinglulu
233*91f16700Schasinglulu            - CPU_600_DDR_600  - CPU at 600 MHz, DDR at 600 MHz
234*91f16700Schasinglulu            - CPU_800_DDR_800  - CPU at 800 MHz, DDR at 800 MHz
235*91f16700Schasinglulu            - CPU_1000_DDR_800 - CPU at 1000 MHz, DDR at 800 MHz
236*91f16700Schasinglulu            - CPU_1200_DDR_750 - CPU at 1200 MHz, DDR at 750 MHz
237*91f16700Schasinglulu
238*91f16700Schasinglulu        Look at Armada37x0 chip package marking on board to identify correct CPU frequency.
239*91f16700Schasinglulu        The last line on package marking (next line after the 88F37x0 line) should contain:
240*91f16700Schasinglulu
241*91f16700Schasinglulu            - C080 or I080 - chip with  800 MHz CPU - use ``CLOCKSPRESET=CPU_800_DDR_800``
242*91f16700Schasinglulu            - C100 or I100 - chip with 1000 MHz CPU - use ``CLOCKSPRESET=CPU_1000_DDR_800``
243*91f16700Schasinglulu            - C120         - chip with 1200 MHz CPU - use ``CLOCKSPRESET=CPU_1200_DDR_750``
244*91f16700Schasinglulu
245*91f16700Schasinglulu- BOOTDEV
246*91f16700Schasinglulu
247*91f16700Schasinglulu        The flash boot device, default is ``SPINOR``.
248*91f16700Schasinglulu
249*91f16700Schasinglulu        Currently, Armada37x0 only supports ``SPINOR``, ``SPINAND``, ``EMMCNORM`` and ``SATA``:
250*91f16700Schasinglulu
251*91f16700Schasinglulu            - SPINOR - SPI NOR flash boot
252*91f16700Schasinglulu            - SPINAND - SPI NAND flash boot
253*91f16700Schasinglulu            - EMMCNORM - eMMC Download Mode
254*91f16700Schasinglulu
255*91f16700Schasinglulu                Download boot loader or program code from eMMC flash into CM3 or CA53
256*91f16700Schasinglulu                Requires full initialization and command sequence
257*91f16700Schasinglulu
258*91f16700Schasinglulu            - SATA - SATA device boot
259*91f16700Schasinglulu
260*91f16700Schasinglulu                Image needs to be stored at disk LBA 0 or at disk partition with
261*91f16700Schasinglulu                MBR type 0x4d (ASCII 'M' as in Marvell) or at disk partition with
262*91f16700Schasinglulu                GPT partition type GUID ``6828311A-BA55-42A4-BCDE-A89BB5EDECAE``.
263*91f16700Schasinglulu
264*91f16700Schasinglulu- PARTNUM
265*91f16700Schasinglulu
266*91f16700Schasinglulu        The boot partition number, default is 0.
267*91f16700Schasinglulu
268*91f16700Schasinglulu        To boot from eMMC, the value should be aligned with the parameter in
269*91f16700Schasinglulu        U-Boot with name of ``CONFIG_SYS_MMC_ENV_PART``, whose value by default is
270*91f16700Schasinglulu        1. For details about CONFIG_SYS_MMC_ENV_PART, please refer to the U-Boot
271*91f16700Schasinglulu        build instructions.
272*91f16700Schasinglulu
273*91f16700Schasinglulu- WTMI_IMG
274*91f16700Schasinglulu
275*91f16700Schasinglulu        The path of the binary can point to an image which
276*91f16700Schasinglulu        does nothing, an image which supports EFUSE or a customized CM3 firmware
277*91f16700Schasinglulu        binary. The default image is ``fuse.bin`` that built from sources in WTP
278*91f16700Schasinglulu        folder, which is the next option. If the default image is OK, then this
279*91f16700Schasinglulu        option should be skipped.
280*91f16700Schasinglulu
281*91f16700Schasinglulu        Please note that this is not a full WTMI image, just a main loop without
282*91f16700Schasinglulu        hardware initialization code. Final WTMI image is built from this WTMI_IMG
283*91f16700Schasinglulu        binary and sys-init code from the WTP directory which sets DDR and CPU
284*91f16700Schasinglulu        clocks according to DDR_TOPOLOGY and CLOCKSPRESET options.
285*91f16700Schasinglulu
286*91f16700Schasinglulu        CZ.NIC as part of Turris project released free and open source WTMI
287*91f16700Schasinglulu        application firmware ``wtmi_app.bin`` for all Armada 3720 devices.
288*91f16700Schasinglulu        This firmware includes additional features like access to Hardware
289*91f16700Schasinglulu        Random Number Generator of Armada 3720 SoC which original Marvell's
290*91f16700Schasinglulu        ``fuse.bin`` image does not have.
291*91f16700Schasinglulu
292*91f16700Schasinglulu        CZ.NIC's Armada 3720 Secure Firmware is available at website:
293*91f16700Schasinglulu
294*91f16700Schasinglulu            https://gitlab.nic.cz/turris/mox-boot-builder/
295*91f16700Schasinglulu
296*91f16700Schasinglulu- WTP
297*91f16700Schasinglulu
298*91f16700Schasinglulu        Specify path to the full checkout of Marvell A3700-utils-marvell git
299*91f16700Schasinglulu        repository. Checkout must contain also .git subdirectory because WTP
300*91f16700Schasinglulu        build process calls git commands.
301*91f16700Schasinglulu
302*91f16700Schasinglulu        WTP build process uses also Marvell mv-ddr-marvell git repository
303*91f16700Schasinglulu        specified in MV_DDR_PATH option.
304*91f16700Schasinglulu
305*91f16700Schasinglulu        Do not remove any parts of git checkout becuase build process and other
306*91f16700Schasinglulu        applications need them for correct building and version determination.
307*91f16700Schasinglulu
308*91f16700Schasinglulu- CRYPTOPP_PATH
309*91f16700Schasinglulu
310*91f16700Schasinglulu        Use this parameter to point to Crypto++ source code
311*91f16700Schasinglulu        directory. If this option is specified then Crypto++ source code in
312*91f16700Schasinglulu        CRYPTOPP_PATH directory will be automatically compiled. Crypto++ library
313*91f16700Schasinglulu        is required for building WTP image tool. Either CRYPTOPP_PATH or
314*91f16700Schasinglulu        CRYPTOPP_LIBDIR with CRYPTOPP_INCDIR needs to be specified for Armada37x0.
315*91f16700Schasinglulu
316*91f16700Schasinglulu- CRYPTOPP_LIBDIR
317*91f16700Schasinglulu
318*91f16700Schasinglulu        Use this parameter to point to the directory with
319*91f16700Schasinglulu        compiled Crypto++ library. By default it points to the CRYPTOPP_PATH.
320*91f16700Schasinglulu
321*91f16700Schasinglulu        On Debian systems it is possible to install system-wide Crypto++ library
322*91f16700Schasinglulu        via command ``apt install libcrypto++-dev`` and specify CRYPTOPP_LIBDIR
323*91f16700Schasinglulu        to ``/usr/lib/``.
324*91f16700Schasinglulu
325*91f16700Schasinglulu- CRYPTOPP_INCDIR
326*91f16700Schasinglulu
327*91f16700Schasinglulu        Use this parameter to point to the directory with
328*91f16700Schasinglulu        header files of Crypto++ library. By default it points to the CRYPTOPP_PATH.
329*91f16700Schasinglulu
330*91f16700Schasinglulu        On Debian systems it is possible to install system-wide Crypto++ library
331*91f16700Schasinglulu        via command ``apt install libcrypto++-dev`` and specify CRYPTOPP_INCDIR
332*91f16700Schasinglulu        to ``/usr/include/crypto++/``.
333*91f16700Schasinglulu
334*91f16700Schasinglulu
335*91f16700SchasingluluFor example, in order to build the image in debug mode with log level up to 'notice' level run
336*91f16700Schasinglulu
337*91f16700Schasinglulu.. code:: shell
338*91f16700Schasinglulu
339*91f16700Schasinglulu    > make DEBUG=1 USE_COHERENT_MEM=0 LOG_LEVEL=20 PLAT=<MARVELL_PLATFORM> mrvl_flash
340*91f16700Schasinglulu
341*91f16700SchasingluluAnd if we want to build a Armada37x0 image in debug mode with log level up to 'notice' level,
342*91f16700Schasingluluthe image has the preset CPU at 1000 MHz, preset DDR3 at 800 MHz, the DDR topology of DDR4 2CS,
343*91f16700Schasingluluthe image boot from SPI NOR flash partition 0, and the image is non trusted in WTP, the command
344*91f16700Schasinglululine is as following
345*91f16700Schasinglulu
346*91f16700Schasinglulu.. code:: shell
347*91f16700Schasinglulu
348*91f16700Schasinglulu    > make DEBUG=1 USE_COHERENT_MEM=0 LOG_LEVEL=20 CLOCKSPRESET=CPU_1000_DDR_800 \
349*91f16700Schasinglulu        MARVELL_SECURE_BOOT=0 DDR_TOPOLOGY=3 BOOTDEV=SPINOR PARTNUM=0 PLAT=a3700 \
350*91f16700Schasinglulu        MV_DDR_PATH=/path/to/mv-ddr-marvell/ WTP=/path/to/A3700-utils-marvell/ \
351*91f16700Schasinglulu        CRYPTOPP_PATH=/path/to/cryptopp/ BL33=/path/to/u-boot.bin \
352*91f16700Schasinglulu        all fip mrvl_bootimage mrvl_flash mrvl_uart
353*91f16700Schasinglulu
354*91f16700SchasingluluTo build just TF-A without WTMI image (useful for A3720 Turris MOX board), run following command:
355*91f16700Schasinglulu
356*91f16700Schasinglulu.. code:: shell
357*91f16700Schasinglulu
358*91f16700Schasinglulu    > make USE_COHERENT_MEM=0 PLAT=a3700 CM3_SYSTEM_RESET=1 BL33=/path/to/u-boot.bin \
359*91f16700Schasinglulu        CROSS_COMPILE=aarch64-linux-gnu- mrvl_bootimage
360*91f16700Schasinglulu
361*91f16700SchasingluluHere is full example how to build production release of Marvell firmware image (concatenated
362*91f16700Schasinglulubinary of Marvell's A3720 sys-init, CZ.NIC's Armada 3720 Secure Firmware, TF-A and U-Boot) for
363*91f16700SchasingluluEspressoBin board (PLAT=a3700) with 1GHz CPU (CLOCKSPRESET=CPU_1000_DDR_800) and
364*91f16700Schasinglulu1GB DDR4 RAM (DDR_TOPOLOGY=5):
365*91f16700Schasinglulu
366*91f16700Schasinglulu.. code:: shell
367*91f16700Schasinglulu
368*91f16700Schasinglulu    > git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
369*91f16700Schasinglulu    > git clone https://source.denx.de/u-boot/u-boot.git
370*91f16700Schasinglulu    > git clone https://github.com/weidai11/cryptopp.git
371*91f16700Schasinglulu    > git clone https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
372*91f16700Schasinglulu    > git clone https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
373*91f16700Schasinglulu    > git clone https://gitlab.nic.cz/turris/mox-boot-builder.git
374*91f16700Schasinglulu    > make -C u-boot CROSS_COMPILE=aarch64-linux-gnu- mvebu_espressobin-88f3720_defconfig u-boot.bin
375*91f16700Schasinglulu    > make -C mox-boot-builder CROSS_CM3=arm-linux-gnueabi- wtmi_app.bin
376*91f16700Schasinglulu    > make -C trusted-firmware-a CROSS_COMPILE=aarch64-linux-gnu- CROSS_CM3=arm-linux-gnueabi- \
377*91f16700Schasinglulu        USE_COHERENT_MEM=0 PLAT=a3700 CLOCKSPRESET=CPU_1000_DDR_800 DDR_TOPOLOGY=5 \
378*91f16700Schasinglulu        MV_DDR_PATH=$PWD/mv-ddr-marvell/ WTP=$PWD/A3700-utils-marvell/ \
379*91f16700Schasinglulu        CRYPTOPP_PATH=$PWD/cryptopp/ BL33=$PWD/u-boot/u-boot.bin \
380*91f16700Schasinglulu        WTMI_IMG=$PWD/mox-boot-builder/wtmi_app.bin FIP_ALIGN=0x100 mrvl_flash
381*91f16700Schasinglulu
382*91f16700SchasingluluProduced Marvell firmware flash image: ``trusted-firmware-a/build/a3700/release/flash-image.bin``
383*91f16700Schasinglulu
384*91f16700SchasingluluSpecial Build Flags
385*91f16700Schasinglulu--------------------
386*91f16700Schasinglulu
387*91f16700Schasinglulu- PLAT_RECOVERY_IMAGE_ENABLE
388*91f16700Schasinglulu    When set this option to enable secondary recovery function when build atf.
389*91f16700Schasinglulu    In order to build UART recovery image this operation should be disabled for
390*91f16700Schasinglulu    A7K/A8K/CN913x because of hardware limitation (boot from secondary image
391*91f16700Schasinglulu    can interrupt UART recovery process). This MACRO definition is set in
392*91f16700Schasinglulu    ``plat/marvell/armada/a8k/common/include/platform_def.h`` file.
393*91f16700Schasinglulu
394*91f16700Schasinglulu- DDR32
395*91f16700Schasinglulu    In order to work in 32bit DDR, instead of the default 64bit ECC DDR,
396*91f16700Schasinglulu    this flag should be set to 1.
397*91f16700Schasinglulu
398*91f16700SchasingluluFor more information about build options, please refer to the
399*91f16700Schasinglulu:ref:`Build Options` document.
400*91f16700Schasinglulu
401*91f16700Schasinglulu
402*91f16700SchasingluluBuild output
403*91f16700Schasinglulu------------
404*91f16700SchasingluluMarvell's TF-A compilation generates 8 files:
405*91f16700Schasinglulu
406*91f16700Schasinglulu    - ble.bin		- BLe image (not available for Armada37x0)
407*91f16700Schasinglulu    - bl1.bin		- BL1 image
408*91f16700Schasinglulu    - bl2.bin		- BL2 image
409*91f16700Schasinglulu    - bl31.bin		- BL31 image
410*91f16700Schasinglulu    - fip.bin		- FIP image (contains BL2, BL31 & BL33 (U-Boot) images)
411*91f16700Schasinglulu    - boot-image.bin	- TF-A image (contains BL1 and FIP images)
412*91f16700Schasinglulu    - flash-image.bin	- Flashable Marvell firmware image. For Armada37x0 it
413*91f16700Schasinglulu      contains TIM, WTMI and boot-image.bin images. For other platforms it contains
414*91f16700Schasinglulu      BLe and boot-image.bin images. Should be placed on the boot flash/device.
415*91f16700Schasinglulu    - uart-images.tgz.bin - GZIPed TAR archive which contains Armada37x0 images
416*91f16700Schasinglulu      for booting via UART. Could be loaded via Marvell's WtpDownload tool from
417*91f16700Schasinglulu      A3700-utils-marvell repository.
418*91f16700Schasinglulu
419*91f16700SchasingluluAdditional make target ``mrvl_bootimage`` produce ``boot-image.bin`` file. Target
420*91f16700Schasinglulu``mrvl_flash`` produce final ``flash-image.bin`` file and target ``mrvl_uart``
421*91f16700Schasingluluproduce ``uart-images.tgz.bin`` file.
422*91f16700Schasinglulu
423*91f16700Schasinglulu
424*91f16700SchasingluluTools and external components installation
425*91f16700Schasinglulu------------------------------------------
426*91f16700Schasinglulu
427*91f16700SchasingluluArmada37x0 Builds require installation of additional components
428*91f16700Schasinglulu~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429*91f16700Schasinglulu
430*91f16700Schasinglulu(1) ARM cross compiler capable of building images for the service CPU (CM3).
431*91f16700Schasinglulu    This component is usually included in the Linux host packages.
432*91f16700Schasinglulu    On Debian/Ubuntu hosts the default GNU ARM tool chain can be installed
433*91f16700Schasinglulu    using the following command
434*91f16700Schasinglulu
435*91f16700Schasinglulu    .. code:: shell
436*91f16700Schasinglulu
437*91f16700Schasinglulu        > sudo apt-get install gcc-arm-linux-gnueabi
438*91f16700Schasinglulu
439*91f16700Schasinglulu    Only if required, the default tool chain prefix ``arm-linux-gnueabi-`` can be
440*91f16700Schasinglulu    overwritten using the environment variable ``CROSS_CM3``.
441*91f16700Schasinglulu    Example for BASH shell
442*91f16700Schasinglulu
443*91f16700Schasinglulu    .. code:: shell
444*91f16700Schasinglulu
445*91f16700Schasinglulu        > export CROSS_CM3=/opt/arm-cross/bin/arm-linux-gnueabi
446*91f16700Schasinglulu
447*91f16700Schasinglulu(2) DDR initialization library sources (mv_ddr) available at the following repository
448*91f16700Schasinglulu    (use the "master" branch):
449*91f16700Schasinglulu
450*91f16700Schasinglulu    https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
451*91f16700Schasinglulu
452*91f16700Schasinglulu(3) Armada3700 tools available at the following repository
453*91f16700Schasinglulu    (use the "master" branch):
454*91f16700Schasinglulu
455*91f16700Schasinglulu    https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
456*91f16700Schasinglulu
457*91f16700Schasinglulu(4) Crypto++ library available at the following repository:
458*91f16700Schasinglulu
459*91f16700Schasinglulu    https://github.com/weidai11/cryptopp.git
460*91f16700Schasinglulu
461*91f16700Schasinglulu(5) Optional CZ.NIC's Armada 3720 Secure Firmware:
462*91f16700Schasinglulu
463*91f16700Schasinglulu    https://gitlab.nic.cz/turris/mox-boot-builder.git
464*91f16700Schasinglulu
465*91f16700SchasingluluArmada70x0, Armada80x0 and CN913x Builds require installation of additional components
466*91f16700Schasinglulu~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
467*91f16700Schasinglulu
468*91f16700Schasinglulu(1) DDR initialization library sources (mv_ddr) available at the following repository
469*91f16700Schasinglulu    (use the "master" branch):
470*91f16700Schasinglulu
471*91f16700Schasinglulu    https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
472*91f16700Schasinglulu
473*91f16700Schasinglulu(2) MSS Management SubSystem Firmware available at the following repository
474*91f16700Schasinglulu    (use the "binaries-marvell-armada-SDK10.0.1.0" branch):
475*91f16700Schasinglulu
476*91f16700Schasinglulu    https://github.com/MarvellEmbeddedProcessors/binaries-marvell.git
477