xref: /arm-trusted-firmware/docs/plat/marvell/armada/uart-booting.rst (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700SchasingluluTF-A UART Booting Instructions for Marvell Platforms
2*91f16700Schasinglulu====================================================
3*91f16700Schasinglulu
4*91f16700SchasingluluThis section describes how to temporary boot the Trusted Firmware-A (TF-A) project over UART
5*91f16700Schasingluluwithout flashing it to non-volatile storage for Marvell's platforms.
6*91f16700Schasinglulu
7*91f16700SchasingluluSee :ref:`TF-A Build Instructions for Marvell Platforms` how to build ``mrvl_uart`` and
8*91f16700Schasinglulu``mrvl_flash`` targets used in this section.
9*91f16700Schasinglulu
10*91f16700SchasingluluArmada37x0 UART image downloading
11*91f16700Schasinglulu---------------------------------
12*91f16700Schasinglulu
13*91f16700SchasingluluThere are two options how to download UART image into any Armada37x0 board.
14*91f16700Schasinglulu
15*91f16700SchasingluluMarvell Wtpdownloader
16*91f16700Schasinglulu~~~~~~~~~~~~~~~~~~~~~
17*91f16700Schasinglulu
18*91f16700SchasingluluMarvell Wtpdownloader works only with UART images stored in separate files and supports only upload
19*91f16700Schasingluluspeed with 115200 bauds. Target ``mrvl_uart`` produces GZIPed TAR archive ``uart-images.tgz.bin``
20*91f16700Schasingluluwith either three files ``TIM_ATF.bin``, ``wtmi_h.bin`` and ``boot-image_h.bin`` for non-secure
21*91f16700Schasingluluboot or with four files ``TIM_ATF_TRUSTED.bin``, ``TIMN_ATF_TRUSTED.bin``, ``wtmi_h.bin`` and
22*91f16700Schasinglulu``boot-image_h.bin`` when secure boot is enabled.
23*91f16700Schasinglulu
24*91f16700SchasingluluCompilation:
25*91f16700Schasinglulu
26*91f16700Schasinglulu.. code:: shell
27*91f16700Schasinglulu
28*91f16700Schasinglulu    > git clone https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
29*91f16700Schasinglulu    > make -C A3700-utils-marvell/wtptp/src/Wtpdownloader_Linux -f makefile.mk
30*91f16700Schasinglulu
31*91f16700SchasingluluIt produces executable binary ``A3700-utils-marvell/wtptp/src/Wtpdownloader_Linux/WtpDownload_linux``
32*91f16700Schasinglulu
33*91f16700SchasingluluTo download images from ``uart-images.tgz.bin`` archive unpack it and for non-secure boot variant run:
34*91f16700Schasinglulu
35*91f16700Schasinglulu.. code:: shell
36*91f16700Schasinglulu
37*91f16700Schasinglulu    > stty -F /dev/ttyUSB<port#> clocal
38*91f16700Schasinglulu    > WtpDownload_linux -P UART -C <port#> -E -B TIM_ATF.bin -I wtmi_h.bin -I boot-image_h.bin
39*91f16700Schasinglulu
40*91f16700SchasingluluAfter that immediately start terminal on ``/dev/ttyUSB<port#>`` to see boot output.
41*91f16700Schasinglulu
42*91f16700SchasingluluCZ.NIC mox-imager
43*91f16700Schasinglulu~~~~~~~~~~~~~~~~~
44*91f16700Schasinglulu
45*91f16700SchasingluluCZ.NIC mox-imager supports all Armada37x0 boards (not only Turris MOX as name suggests). It works
46*91f16700Schasingluluwith either with separate files from ``uart-images.tgz.bin`` archive (like Marvell Wtpdownloader)
47*91f16700Schasingluluproduced by ``mrvl_uart`` target or also with ``flash-image.bin`` file produced by ``mrvl_flash``
48*91f16700Schasinglulutarget, which is the exactly same file as used for flashing. So when using CZ.NIC mox-imager there
49*91f16700Schasingluluis no need to build separate files for UART flashing like in case with Marvell Wtpdownloader.
50*91f16700Schasinglulu
51*91f16700SchasingluluCZ.NIC mox-imager moreover supports higher upload speeds up to the 6000000 bauds (which seems to
52*91f16700Schasinglulube limit of Armada37x0 SoC) which is much higher and faster than Marvell Wtpdownloader.
53*91f16700Schasinglulu
54*91f16700SchasingluluCompilation:
55*91f16700Schasinglulu
56*91f16700Schasinglulu.. code:: shell
57*91f16700Schasinglulu
58*91f16700Schasinglulu    > git clone https://gitlab.nic.cz/turris/mox-imager.git
59*91f16700Schasinglulu    > make -C mox-imager
60*91f16700Schasinglulu
61*91f16700SchasingluluIt produces executable binary ``mox-imager/mox-imager``
62*91f16700Schasinglulu
63*91f16700SchasingluluTo download single file image built by ``mrvl_flash`` target at the highest speed, run:
64*91f16700Schasinglulu
65*91f16700Schasinglulu.. code:: shell
66*91f16700Schasinglulu
67*91f16700Schasinglulu    > mox-imager -D /dev/ttyUSB<port#> -E -b 6000000 -t flash-image.bin
68*91f16700Schasinglulu
69*91f16700SchasingluluTo download images from ``uart-images.tgz.bin`` archive built by ``mrvl_uart`` target for
70*91f16700Schasinglulunon-secure boot variant (like Wtpdownloader) but at the highest speed, first unpack
71*91f16700Schasinglulu``uart-images.tgz.bin`` archive and then run:
72*91f16700Schasinglulu
73*91f16700Schasinglulu.. code:: shell
74*91f16700Schasinglulu
75*91f16700Schasinglulu    > mox-imager -D /dev/ttyUSB<port#> -E -b 6000000 -t TIM_ATF.bin wtmi_h.bin boot-image_h.bin
76*91f16700Schasinglulu
77*91f16700SchasingluluCZ.NIC mox-imager after successful download will start its own mini terminal (option ``-t``) to
78*91f16700Schasinglulunot loose any boot output. It also prints boot output which is sent either by image files or by
79*91f16700Schasinglulubootrom during transferring of image files. This mini terminal can be quit by CTRL-\\ + C keypress.
80*91f16700Schasinglulu
81*91f16700Schasinglulu
82*91f16700SchasingluluA7K/A8K/CN913x UART image downloading
83*91f16700Schasinglulu-------------------------------------
84*91f16700Schasinglulu
85*91f16700SchasingluluA7K/A8K/CN913x uses same image ``flash-image.bin`` for both flashing and booting over UART.
86*91f16700SchasingluluFor downloading image over UART it is possible to use mvebu64boot tool.
87*91f16700Schasinglulu
88*91f16700SchasingluluCompilation:
89*91f16700Schasinglulu
90*91f16700Schasinglulu.. code:: shell
91*91f16700Schasinglulu
92*91f16700Schasinglulu    > git clone https://github.com/pali/mvebu64boot.git
93*91f16700Schasinglulu    > make -C mvebu64boot
94*91f16700Schasinglulu
95*91f16700SchasingluluIt produces executable binary ``mvebu64boot/mvebu64boot``
96*91f16700Schasinglulu
97*91f16700SchasingluluTo download ``flash-image.bin`` image run:
98*91f16700Schasinglulu
99*91f16700Schasinglulu.. code:: shell
100*91f16700Schasinglulu
101*91f16700Schasinglulu    > mvebu64boot -t -b flash-image.bin /dev/ttyUSB0
102*91f16700Schasinglulu
103*91f16700SchasingluluAfter successful download it will start own mini terminal (option ``-t``) like CZ.NIC mox-imager.
104