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